/* DeonGame 公共样式（取自已批准原型第 3 轮 style.css） */
:root {
  --bg: #0b0d18; --panel: #151a2e; --panel-2: #1c2240; --line: #2a3158; --text: #e8eaf6; --muted: #8b92b8;
  --primary: #7c5cff; --primary-2: #3fa9ff; --gold: #ffc94a; --danger: #ff4d6d; --success: #22d39a; --neg: #ff6b81;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(124,92,255,.22), transparent 60%),
              radial-gradient(900px 500px at 100% 0%, rgba(63,169,255,.14), transparent 60%),
              var(--bg);
  background-attachment: fixed;
}
a { color: #8fb8ff; text-decoration: none; }
a:hover { color: #c3d8ff; text-decoration: underline; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; filter: grayscale(.6); }
::selection { background: rgba(124,92,255,.5); }

/* 顶栏 */
.topbar {
  height: 60px; background: rgba(10,12,24,.85); backdrop-filter: blur(8px); color: #fff; display: flex; align-items: center;
  padding: 0 24px; gap: 24px; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(124,92,255,.35);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.topbar .logo { font-weight: 800; font-size: 20px; letter-spacing: 2px; color: #fff; text-shadow: 0 0 12px rgba(124,92,255,.8); }
.topbar .logo span { color: var(--gold); text-shadow: 0 0 12px rgba(255,201,74,.7); }
.topbar .logo:hover { text-decoration: none; }
.topbar .spacer { flex: 1; }
.topbar .stat { display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; color: var(--muted); line-height: 1.3; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }
.topbar .stat b { font-size: 16px; color: var(--gold); font-variant-numeric: tabular-nums; }
.topbar .stat b.neg { color: var(--neg); }
.topbar .user { display: flex; align-items: center; gap: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#3a4370,#262c4d); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(143,184,255,.35); }
.avatar.ai { background: linear-gradient(135deg,#8a5cff,#5a32c8); box-shadow: 0 0 0 2px rgba(178,140,255,.5); }
.topbar .btn-ghost { color: #cfd5f0; border: 1px solid var(--line); background: transparent; padding: 5px 14px; border-radius: 8px; }
.topbar .btn-ghost:hover { border-color: var(--primary); color: #fff; }

/* 通用 */
.container { max-width: 1180px; margin: 0 auto; padding: 24px; }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.35); padding: 20px; }
.btn { border: 1px solid var(--line); border-radius: 8px; padding: 8px 18px; background: #232a4d; color: var(--text); font-weight: 600; transition: transform .08s, box-shadow .15s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(124,92,255,.45); }
.btn.danger { background: linear-gradient(135deg, #ff4d6d, #d9264a); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgba(255,77,109,.35); }
.btn.warn { background: linear-gradient(135deg, #ffd66b, #f5a623); border-color: transparent; color: #2a1a00; box-shadow: 0 4px 16px rgba(255,201,74,.35); }
.btn.success { background: linear-gradient(135deg, #2ee6a8, #12a874); border-color: transparent; color: #04261a; box-shadow: 0 4px 16px rgba(34,211,154,.35); }
.btn.lg { padding: 11px 28px; font-size: 16px; }
.btn.block { width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: rgba(255,255,255,.08); color: #c7cbe6; border: 1px solid rgba(255,255,255,.08); }
.tag.green { background: rgba(34,211,154,.14); color: #5ef0bd; border-color: rgba(34,211,154,.3); }
.tag.blue { background: rgba(63,169,255,.14); color: #7cc4ff; border-color: rgba(63,169,255,.3); }
.tag.orange { background: rgba(255,170,60,.14); color: #ffbf66; border-color: rgba(255,170,60,.3); }
.tag.red { background: rgba(255,77,109,.16); color: #ff8aa0; border-color: rgba(255,77,109,.35); }
.neg { color: var(--neg); }
.pos { color: var(--success); }

/* 表单 */
.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-card { width: 400px; box-shadow: 0 0 0 1px rgba(124,92,255,.25), 0 20px 60px rgba(0,0,0,.55), 0 0 60px rgba(124,92,255,.18); }
.auth-card h1 { font-size: 24px; margin: 0 0 4px; background: linear-gradient(90deg,#fff,#b9a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.field { margin: 16px 0; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: #aab0d4; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #0f1326; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,92,255,.25); }
.field input:disabled { color: var(--muted); }
.field input.err { border-color: var(--danger); background: rgba(255,77,109,.08); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .errmsg { font-size: 12px; color: var(--neg); margin-top: 4px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin: 12px 0; border: 1px solid transparent; }
.alert.error { background: rgba(255,77,109,.12); color: #ff9db0; border-color: rgba(255,77,109,.35); }
.alert.info { background: rgba(63,169,255,.1); color: #9fd2ff; border-color: rgba(63,169,255,.3); }
.alert.success { background: rgba(34,211,154,.1); color: #7ff0c6; border-color: rgba(34,211,154,.3); }
.alert.warn { background: rgba(255,170,60,.1); color: #ffc98a; border-color: rgba(255,170,60,.35); }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(3,4,12,.75); backdrop-filter: blur(3px); display: none; align-items: center; justify-content: center; z-index: 50; }
.mask.show { display: flex; }
.dialog { background: linear-gradient(180deg, #1f2647, #151a2e); color: var(--text); border: 1px solid rgba(124,92,255,.45); border-radius: 16px; width: 440px; max-width: 92vw; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(124,92,255,.25); }
.dialog h2 { margin: 0 0 12px; font-size: 20px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* 提示条 */
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); background: #232a4d; color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 60; font-size: 14px; display: none; border: 1px solid var(--primary); box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 20px rgba(124,92,255,.35); }
.toast.show { display: block; }
.toast.err { background: #3a1422; border-color: var(--danger); box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 20px rgba(255,77,109,.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3158; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 产品补充 */
.top-link, .back-link { color: #cfd5f0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.loading { text-align: center; padding: 40px 0; color: var(--muted); }

@media (max-width: 760px) {
  .topbar { padding: 0 10px; gap: 8px; height: auto; min-height: 60px; flex-wrap: wrap; }
  .topbar .logo { font-size: 16px; }
  .topbar .stat { padding: 2px 6px; }
  .topbar .user span[data-testid="topbar-username"] { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .container { padding: 12px; }
  .auth-card { width: 100%; }
}
