/* ============================================================
   KONAGI LAB — 浅色科技风样式
   ============================================================ */

:root {
  --bg: #f3f7fd;
  --bg-2: #e9f1fb;
  --ink: #0b1220;
  --ink-2: #24324a;
  --muted: #66788f;
  --line: rgba(15, 34, 64, 0.09);
  --line-2: rgba(15, 34, 64, 0.16);
  --brand: #2f6bff;
  --brand-2: #00c8ff;
  --violet: #7a5cff;
  --green: #10b981;
  --danger: #ef4444;
  --card: #ffffff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(23, 46, 90, 0.06);
  --shadow: 0 18px 48px -18px rgba(23, 46, 90, 0.28);
  --shadow-lg: 0 32px 80px -28px rgba(23, 46, 90, 0.38);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景：渐层 + 网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(1000px 620px at 12% -8%, rgba(47, 107, 255, 0.16), transparent 62%),
    radial-gradient(880px 560px at 92% 4%, rgba(0, 200, 255, 0.16), transparent 60%),
    radial-gradient(760px 620px at 50% 108%, rgba(122, 92, 255, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, #fbfdff 40%, var(--bg-2) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(47, 107, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(47, 107, 255, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.7;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.9em; background: rgba(47,107,255,.08); padding: 1px 6px; border-radius: 6px; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px clamp(16px, 5vw, 56px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px -6px rgba(47, 107, 255, 0.8);
  position: relative;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 6px;
  border: 2px solid rgba(255,255,255,.9); border-radius: 4px;
}
.logo-text { font-size: 15px; }
.logo-text em { font-style: normal; color: var(--brand); }

.nav-links { display: flex; gap: 4px; margin-left: 18px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px; font-size: 14px; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: rgba(47, 107, 255, 0.07); color: var(--brand); }
.nav-links a.on { color: var(--brand); background: rgba(47, 107, 255, 0.1); font-weight: 600; }
.nav-links a.nav-k399 { color: var(--violet); font-weight: 600; }

.nav-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.who-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  background: var(--btn-bg); color: var(--ink);
  transition: transform .18s ease, box-shadow .25s ease, background .2s, border-color .2s;
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #4f8cff 45%, var(--brand-2));
  box-shadow: 0 14px 30px -14px rgba(47, 107, 255, .95), inset 0 1px 0 rgba(255,255,255,.35);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .7s ease;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:hover { box-shadow: 0 18px 40px -14px rgba(47, 107, 255, 1); }

.btn-ghost { background: rgba(255,255,255,.7); border-color: var(--line-2); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; border-color: rgba(47,107,255,.4); color: var(--brand); }

.btn-line { border-color: var(--line-2); background: #fff; }
.btn-line:hover { border-color: var(--brand); color: var(--brand); }

.btn-tiny { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.arrow {
  width: 16px; height: 16px; display: inline-block; position: relative;
  transition: transform .2s ease;
}
.arrow::before {
  content: ""; position: absolute; left: 1px; top: 50%; width: 12px; height: 1.8px;
  background: currentColor; transform: translateY(-50%); border-radius: 2px;
}
.arrow::after {
  content: ""; position: absolute; right: 1px; top: 50%; width: 7px; height: 7px;
  border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor;
  transform: translateY(-50%) rotate(45deg); border-radius: 1px;
}
.btn:hover .arrow, .card:hover .arrow, a:hover > .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 104px) clamp(16px, 5vw, 56px) 24px; }
.hero-inner { max-width: 1060px; margin: 0 auto; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--brand); background: rgba(47, 107, 255, .08);
  border: 1px solid rgba(47, 107, 255, .18); letter-spacing: .02em;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }

.hero h1 {
  font-size: clamp(34px, 5.6vw, 64px);
  line-height: 1.12; letter-spacing: -0.025em; margin: 22px 0 0; font-weight: 800;
}
.grad {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 45%, var(--violet) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: flow 7s ease-in-out infinite;
}
@keyframes flow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.lede { max-width: 640px; margin: 20px 0 0; font-size: clamp(15px, 1.6vw, 17px); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; margin-top: 46px; border-radius: var(--radius); overflow: hidden;
  background: var(--line); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat { background: rgba(255,255,255,.86); padding: 20px 18px; text-align: left; }
.stat b { display: block; font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ---------- 通用区块 ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(46px, 6vw, 78px) clamp(16px, 5vw, 32px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 0; letter-spacing: -0.02em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line-2); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }

/* ---------- 卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 18px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.82));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .28s cubic-bezier(.2,.7,.3,1), box-shadow .28s, border-color .28s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .28s;
  background: radial-gradient(340px 220px at var(--mx, 50%) var(--my, 0%), rgba(47,107,255,.12), transparent 70%);
  pointer-events: none;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(47,107,255,.32); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card h3 { margin: 2px 0 0; font-size: 19px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.best { color: var(--muted); }
.go { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; }
.unit { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.chip-violet { color: #5b3df5; background: rgba(122, 92, 255, .12); }
.chip-blue { color: #1668e3; background: rgba(47, 107, 255, .12); }
.chip-green { color: #0b8a63; background: rgba(16, 185, 129, .13); }
.chip-dark { color: #fff; background: linear-gradient(135deg, #1d2b4a, #38507f); }

.card-k399 {
  background: linear-gradient(160deg, #0e1b34, #17294a 55%, #1b3d6b);
  border-color: rgba(255,255,255,.14); color: #eaf2ff;
}
.card-k399 h3, .card-k399 .go { color: #fff; }
.card-k399 p { color: rgba(234, 242, 255, .72); }
.card-k399 .card-foot { border-top-color: rgba(255,255,255,.14); }
.card-k399 .best { color: rgba(234,242,255,.6); font-family: var(--mono); }
.card-k399 .unit { color: rgba(234,242,255,.55); }
.card-k399::before { background: radial-gradient(360px 240px at var(--mx, 50%) var(--my, 0%), rgba(0, 200, 255, .28), transparent 70%); }

/* ---------- 排行榜 ---------- */
.board {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px;
  backdrop-filter: blur(8px);
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; }
.tab {
  padding: 9px 15px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 13.5px; font-family: inherit;
  font-weight: 600; transition: background .2s, color .2s;
}
.tab:hover { background: rgba(47,107,255,.07); color: var(--brand); }
.tab.is-on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

.board-panel { display: none; padding: 8px 10px 14px; }
.board-panel.is-on { display: block; animation: fade-in .32s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 12px; border-radius: 12px; border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover { background: rgba(47,107,255,.05); }
.rank-no {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--muted);
  background: rgba(15,34,64,.05);
}
.rank-row.top .rank-no { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 18px -10px rgba(47,107,255,.9); }
.rank-row:nth-child(1).top .rank-no { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 8px 18px -10px rgba(245,158,11,.9); }
.rank-row:nth-child(2).top .rank-no { background: linear-gradient(135deg, #94a3b8, #cbd5e1); }
.rank-row:nth-child(3).top .rank-no { background: linear-gradient(135deg, #d97706, #f59e0b); }
.rank-name { font-weight: 600; font-size: 14.5px; }
.rank-val b { font-family: var(--mono); font-size: 16px; }
.rank-val em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 3px; }
.empty { color: var(--muted); font-size: 14px; padding: 22px 12px; }

/* ---------- 三栏说明 ---------- */
.triple { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.mini {
  padding: 22px; border-radius: var(--radius); background: rgba(255,255,255,.7);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.mini-ico {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--brand);
  background: rgba(47,107,255,.1); margin-bottom: 10px;
}
.mini h4 { margin: 0 0 6px; font-size: 15.5px; }
.mini p { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---------- 页脚 ---------- */
.foot { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 26px clamp(16px, 5vw, 32px); }
.foot p { margin: 0; font-size: 13px; color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }

/* ---------- 认证页 ---------- */
.auth-wrap {
  max-width: 980px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(16px, 5vw, 32px) 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 28px; align-items: start;
}
.auth-card {
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 24px; padding: 30px; box-shadow: var(--shadow);
}
.auth-head h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.auth-head p { margin: 0 0 20px; color: var(--muted); font-size: 13.5px; }
.tabs-auth { border-radius: 12px; background: rgba(15,34,64,.04); padding: 4px; display: inline-flex; }
.tabs-auth .tab { padding: 8px 22px; }

.field { display: block; margin: 16px 0; }
.field span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 14.5px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(47,107,255,.13); }
.form-err { min-height: 20px; margin: 6px 0 10px; font-size: 13px; color: var(--danger); }
.auth-foot { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--brand); font-weight: 600; }
.auth-side {
  padding: 26px; border-radius: 24px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(233,241,251,.7));
  box-shadow: var(--shadow-sm);
}
.auth-side h3 { margin: 0 0 12px; font-size: 16px; }
.ticks { list-style: none; margin: 0 0 16px; padding: 0; }
.ticks li { position: relative; padding-left: 22px; margin-bottom: 10px; font-size: 13.5px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 11px; height: 6px;
  border-left: 2px solid var(--green); border-bottom: 2px solid var(--green);
  transform: rotate(-45deg); border-radius: 1px;
}

/* ---------- 个人面板 ---------- */
.page-head {
  max-width: 1180px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(16px, 5vw, 32px) 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.page-head h1 { margin: 14px 0 8px; font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -0.025em; }

.best-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.best-card {
  padding: 18px; border-radius: 16px; background: rgba(255,255,255,.86);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.best-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.best-card h3 { margin: 0 0 6px; font-size: 14.5px; color: var(--ink-2); font-weight: 600; }
.big-num { margin: 0; font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.big-num em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; font-family: var(--sans); }
.big-num.muted { color: var(--muted); }
.rank-pill { font-size: 11px; font-weight: 700; color: var(--brand); background: rgba(47,107,255,.1); padding: 3px 9px; border-radius: 999px; }

.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.mono { font-family: var(--mono); }
.data-table td em { font-style: normal; color: var(--muted); font-size: 11.5px; margin-left: 3px; }
.dim { color: var(--muted); font-size: 13px; }

/* ---------- 游戏页 ---------- */
.game-wrap {
  max-width: 980px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) clamp(16px, 5vw, 32px) 0;
}
.game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.game-head h1 { margin: 10px 0 6px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.02em; }
.game-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 560px; }

.game-panel {
  background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px);
}

.hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.hud-item { background: #fff; padding: 12px 16px; }
.hud-item span { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hud-item b { font-family: var(--mono); font-size: 20px; font-weight: 700; }

.stage {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #eef4ff, #e6f0ff 60%, #eaf6ff);
  border: 1px solid var(--line); min-height: 340px;
  display: grid; place-items: center; text-align: center; padding: 28px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .25s;
}
.stage.is-go { background: linear-gradient(160deg, #d8ffe9, #c9f7dd); }
.stage.is-wait { background: linear-gradient(160deg, #ffe0e0, #ffd0d0); }
.stage.is-idle { cursor: default; }

.stage-inner { max-width: 520px; }
.stage h2 { margin: 0 0 8px; font-size: clamp(20px, 2.4vw, 26px); }
.stage p { margin: 0; color: var(--ink-2); font-size: 14px; }
.stage .huge { font-family: var(--mono); font-size: clamp(44px, 9vw, 76px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: 6px 0; }
.stage .sub { font-size: 13px; color: var(--muted); }

.result-panel { margin-top: 18px; display: none; }
.result-panel.is-on { display: block; animation: fade-in .3s ease both; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.result-big { font-family: var(--mono); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.result-big em { font-style: normal; font-size: 13px; color: var(--muted); font-family: var(--sans); margin-left: 6px; }
.result-note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* 记忆矩阵 */
.matrix { display: grid; gap: 8px; margin: 0 auto; width: min(420px, 84vw); }
.cell {
  aspect-ratio: 1 / 1; border-radius: 12px; background: #fff;
  border: 1px solid var(--line-2); cursor: pointer;
  transition: background .15s, transform .12s, box-shadow .2s;
}
.cell:hover { border-color: rgba(47,107,255,.5); }
.cell.is-lit { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 22px -12px rgba(47,107,255,.95); }
.cell.is-pick { background: rgba(47,107,255,.18); border-color: var(--brand); }
.cell.is-bad { background: rgba(239,68,68,.18); border-color: var(--danger); }
.cell.is-ok { background: rgba(16,185,129,.2); border-color: var(--green); }

/* 瞄准 */
.aim-area { position: relative; height: min(420px, 58vh); width: 100%; border-radius: 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #f7fbff, #e8f1ff); border: 1px solid var(--line); cursor: crosshair; }
.target {
  position: absolute; width: 54px; height: 54px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #fff, #ff7b7b 60%, #f43f5e);
  box-shadow: 0 10px 24px -12px rgba(244,63,94,.9), inset 0 0 0 2px rgba(255,255,255,.6);
  transition: transform .08s ease;
}
.target:active { transform: translate(-50%, -50%) scale(.9); }

/* 2048 */
.board2048 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(440px, 82vw); margin: 0 auto;
  padding: 8px; background: rgba(15,34,64,.06); border-radius: 16px; }
.tile { aspect-ratio: 1/1; display: grid; place-items: center; border-radius: 10px; font-family: var(--mono);
  font-weight: 800; font-size: clamp(18px, 4vw, 26px); background: rgba(255,255,255,.7); color: #3b4a63;
  transition: background .15s, color .15s, transform .12s; }
.tile.n2 { background: #ffffff; }
.tile.n4 { background: #eef4ff; }
.tile.n8 { background: #dbe8ff; color: #1e3f8f; }
.tile.n16 { background: #c7dbff; color: #16357a; }
.tile.n32 { background: #a9c8ff; color: #102a63; }
.tile.n64 { background: #7fb0ff; color: #fff; }
.tile.n128 { background: #5b95ff; color: #fff; }
.tile.n256 { background: #3f7bff; color: #fff; }
.tile.n512 { background: #2f6bff; color: #fff; }
.tile.n1024 { background: #7a5cff; color: #fff; }
.tile.n2048 { background: linear-gradient(135deg, #7a5cff, #00c8ff); color: #fff; box-shadow: 0 12px 26px -14px rgba(122,92,255,.9); }
.tile.pop { animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.88); } to { transform: scale(1); } }

/* 智商测试 */
.quiz { display: grid; gap: 18px; }
.q-card { padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.q-index { font-family: var(--mono); font-size: 12px; color: var(--brand); font-weight: 700; }
.q-text { margin: 6px 0 14px; font-size: 15.5px; font-weight: 600; }
.q-opts { display: grid; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 14px; font-family: inherit;
  text-align: left; transition: border-color .18s, background .18s, transform .12s;
}
.opt:hover { border-color: rgba(47,107,255,.45); background: rgba(47,107,255,.04); }
.opt.is-pick { border-color: var(--brand); background: rgba(47,107,255,.09); box-shadow: 0 0 0 3px rgba(47,107,255,.1); }
.opt.is-right { border-color: var(--green); background: rgba(16,185,129,.1); }
.opt.is-wrong { border-color: var(--danger); background: rgba(239,68,68,.09); }
.opt b { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.explain { margin: 10px 0 0; font-size: 13px; color: var(--muted); display: none; }
.explain.is-on { display: block; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: rgba(11,18,32,.92); color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  z-index: 200; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); max-width: 90vw;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* reveal 动画 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease var(--d, 0ms), transform .6s cubic-bezier(.2,.7,.3,1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* 响应式 */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .nav-links a { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  .nav-user { margin-left: auto; }
}
@media (max-width: 520px) {
  .section-head { flex-direction: column; align-items: flex-start; }
  .hint { display: none; }
  .stat { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   排行榜（左侧分类 + 排名进度条）
   ============================================================ */
.board-split { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 8px; }

.board-nav { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.board-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-family: inherit; font-weight: 600;
  font-size: 13.5px; cursor: pointer; text-align: left;
  transition: background .2s, color .2s, border-color .2s;
}
.board-tab .bt-name { color: var(--ink-2); }
.board-tab.is-on .bt-name { color: var(--brand); }
.board-tab .bt-top {
  font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-tab .bt-top b {
  font-weight: 800; letter-spacing: .03em;
  background: linear-gradient(100deg, #f7c948, #e09b00 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.board-tab .bt-top i { font-style: normal; opacity: .55; }
.board-tab:hover { background: rgba(47, 107, 255, .07); color: var(--brand); }
.board-tab.is-on {
  background: #fff; color: var(--brand);
  border-color: rgba(47, 107, 255, .28); box-shadow: var(--shadow-sm);
}

.board-body { min-width: 0; padding: 4px 8px; }

.rank-row {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 12px 8px; border-radius: 10px; border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.rank-main { min-width: 0; }
.rank-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rank-name { display: inline-flex; align-items: center; min-width: 0; font-weight: 600; font-size: 14.5px; }
.rank-no { margin-top: 1px; }

.rank-bar {
  height: 4px; margin-top: 8px; border-radius: 999px;
  background: rgba(15, 34, 64, .07); overflow: hidden;
}
.rank-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 107, 255, .6), var(--brand));
  transition: width .55s cubic-bezier(.2, .7, .3, 1);
}
.top-1 .rank-bar i { background: linear-gradient(90deg, #f7c948, #f59e0b); }
.top-2 .rank-bar i { background: linear-gradient(90deg, #d5dde7, #97a5b6); }
.top-3 .rank-bar i { background: linear-gradient(90deg, #e2a878, #bf6f39); }

.top-1 .rank-no { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; }
.top-2 .rank-no { background: linear-gradient(135deg, #94a3b8, #cbd5e1); color: #fff; }
.top-3 .rank-no { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }

.crown { width: 15px; height: 15px; margin-left: 6px; flex: none; }
.crown.gold { fill: #f5b301; filter: drop-shadow(0 1px 1px rgba(170, 110, 0, .35)); }
.crown.silver { fill: #aeb9c6; filter: drop-shadow(0 1px 1px rgba(90, 100, 115, .3)); }
.crown.bronze { fill: #c47a3d; filter: drop-shadow(0 1px 1px rgba(120, 60, 20, .3)); }

/* 测试矩阵卡片里的双成绩 */
.card-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 6px; padding: 12px; border-radius: 12px;
  background: rgba(47, 107, 255, .045);
}
.card-stats span {
  display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-stats b { font-family: var(--mono); font-size: 17px; }
.card-stats b em { font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-left: 3px; }

@media (max-width: 760px) {
  .board-split { grid-template-columns: 1fr; }
  .board-nav { flex-direction: row; overflow-x: auto; padding: 4px; }
  .board-tab { white-space: nowrap; min-width: 132px; }
  .board-tab .bt-top { font-size: 10.5px; }
}

