/* ============================== base ============================== */
:root {
  --ink: #0b1220;
  --ink-2: #1f2937;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e6eaf0;
  --line-strong: #d3dae5;
  --bg: #ffffff;
  --soft: #f7f9fc;
  --soft-2: #f1f5f9;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-soft: #eef2ff;
  --green: #0e9f6e;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 12px 32px -12px rgba(16, 24, 40, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; }
::selection { background: #c7d2fe; color: #111827; }

.app { min-height: calc(100vh - 280px); }
.container { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.narrow { width: min(860px, calc(100% - 48px)); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ============================== buttons ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-quiet { color: var(--muted); padding: 0 10px; height: 36px; }
.btn-quiet:hover { color: var(--ink); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }

/* ============================== topbar ============================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 234, 240, 0.9);
}
.topbar-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  height: 66px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.2px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--ink); color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700;
}
.brand-name { font-size: 16px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 20px; }
.nav a {
  padding: 8px 12px; border-radius: 9px; color: var(--muted); font-size: 14.5px; font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover { color: var(--ink); background: var(--soft); }
.nav a.active { color: var(--ink); background: var(--soft-2); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-pill {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.user-email { font-size: 13px; color: var(--ink-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================== hero ============================== */
.hero { position: relative; overflow: hidden; padding: 76px 0 54px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 620px;
  background:
    radial-gradient(600px 300px at 20% 20%, rgba(79, 70, 229, 0.10), transparent 70%),
    radial-gradient(520px 280px at 78% 8%, rgba(14, 159, 110, 0.08), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 6px 12px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  margin: 20px 0 16px; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.12;
  letter-spacing: -1.6px; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { margin: 0; color: var(--muted); font-size: 17px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 38px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 26px; letter-spacing: -0.6px; }
.hero-stat span { font-size: 13px; color: var(--muted); }

.hero-card { position: relative; }
.paper-preview {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-md);
  padding: 22px 22px 18px; transform: rotate(-1.2deg);
}
.paper-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.paper-preview-title { font-weight: 700; font-size: 14px; }
.preview-q { font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }
.preview-code {
  margin-top: 12px; background: #0b1220; color: #dbe4f0; border-radius: 12px; padding: 14px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; overflow: hidden;
  white-space: pre;
}
.preview-code .c { color: #93c5fd; }
.preview-code .k { color: #fca5a5; }
.preview-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.preview-opt {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: var(--muted);
}
.preview-opt.good { border-color: #a7f3d0; background: var(--green-soft); color: #047857; font-weight: 600; }

/* ============================== sections ============================== */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.6px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-link { color: var(--accent-ink); font-size: 14px; font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.subject-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.subject-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.subject-card.ready:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.subject-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--soft-2);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono);
  font-weight: 700; font-size: 13px; color: var(--ink);
}
.subject-card h3 { margin: 2px 0 0; font-size: 17px; }
.subject-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.subject-card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.tag-accent { color: var(--accent-ink); background: var(--accent-soft); border-color: #dfe5ff; }
.tag-soon { color: var(--muted-2); background: var(--soft); }

.feature { display: flex; gap: 14px; padding: 20px; background: var(--soft); border-radius: 16px; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 10px; background: #fff; border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none;
}
.feature h4 { margin: 0 0 4px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 8px; }
.stat-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; }
.stat-card b { display: block; font-size: 26px; letter-spacing: -0.6px; line-height: 1.2; }
.stat-card span { font-size: 13px; color: var(--muted); }
.stat-card.accent { background: linear-gradient(180deg, #f8f9ff, #fff); border-color: #e0e6ff; }

.dash-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid #e0e6ff; background: linear-gradient(120deg, #f8f9ff, #eef2ff 60%, #f7fffb);
  border-radius: 20px; padding: 24px 26px; margin-top: 8px;
}
.dash-banner h3 { margin: 0 0 6px; font-size: 19px; }
.dash-banner p { margin: 0; color: var(--muted); font-size: 14px; }
.dash-actions { display: flex; gap: 10px; flex: none; }

/* ============================== practice ============================== */
.page-head { padding: 46px 0 10px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.9px; }
.page-head p { margin: 0; color: var(--muted); }
.panel {
  border: 1px solid var(--line); border-radius: 20px; background: #fff; padding: 28px;
  box-shadow: var(--shadow-sm);
}
.form-row { margin-bottom: 26px; }
.form-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.form-label b { font-size: 15px; }
.form-label span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-2); border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; cursor: pointer; transition: all 0.15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:disabled { opacity: 0.45; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--soft-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.mix-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mix-pill { border-radius: 12px; padding: 10px 14px; font-size: 13px; flex: 1; min-width: 130px; }
.mix-easy { background: var(--green-soft); color: #047857; }
.mix-medium { background: var(--amber-soft); color: var(--amber); }
.mix-hard { background: var(--red-soft); color: var(--red); }
.practice-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.bank-hint { font-size: 13px; color: var(--muted); }
.bank-hint b { color: var(--ink); }

/* ============================== quiz ============================== */
.quiz-top {
  position: sticky; top: 66px; z-index: 30; background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 12px 0;
}
.quiz-top-inner { display: flex; align-items: center; gap: 18px; }
.quiz-progress { flex: 1; }
.quiz-progress-bar { height: 6px; background: var(--soft-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.quiz-progress-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.25s ease; }
.quiz-progress-text { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.quiz-timer { font-family: var(--mono); font-size: 14px; color: var(--ink-2); background: var(--soft); border-radius: 10px; padding: 7px 12px; }
.quiz-body { padding: 30px 0 60px; }
.question-card { border: 1px solid var(--line); border-radius: 20px; background: #fff; padding: 30px; box-shadow: var(--shadow-sm); }
.q-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.badge { font-size: 12px; border-radius: 999px; padding: 4px 10px; font-weight: 600; border: 1px solid transparent; }
.badge-chapter { color: var(--muted); background: var(--soft); border-color: var(--line); }
.badge-type { color: var(--ink-2); background: #fff; border-color: var(--line-strong); }
.badge-easy { color: #047857; background: var(--green-soft); }
.badge-medium { color: var(--amber); background: var(--amber-soft); }
.badge-hard { color: var(--red); background: var(--red-soft); }
.q-stem { font-size: 17px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.q-code {
  margin: 18px 0 4px; background: #0b1220; color: #dbe4f0; border-radius: 14px; padding: 18px 20px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7; overflow-x: auto; white-space: pre;
  border: 1px solid #1e293b;
}
.q-code::-webkit-scrollbar { height: 8px; }
.q-code::-webkit-scrollbar-thumb { background: #334155; border-radius: 8px; }

.options { display: grid; gap: 10px; margin-top: 22px; }
.opt {
  display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 14px 16px;
  cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.opt:hover { border-color: var(--ink); }
.opt .letter {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: var(--muted); flex: none; margin-top: 1px;
}
.opt.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
.opt.sel .letter { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.correct { border-color: #34d399; background: var(--green-soft); }
.opt.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.opt.wrong { border-color: #fca5a5; background: var(--red-soft); }
.opt.wrong .letter { background: var(--red); border-color: var(--red); color: #fff; }
.opt[disabled] { cursor: default; }

.fill-wrap { margin-top: 22px; }
.fill-input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px 16px;
  font-family: var(--mono); font-size: 16px; background: #fff; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fill-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,70,229,0.10); }
.fill-hint { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.quiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.qnav { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.qnav button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.qnav button.done { background: var(--accent-soft); border-color: #dfe5ff; color: var(--accent-ink); }
.qnav button.cur { border-color: var(--ink); color: var(--ink); }

/* ============================== result ============================== */
.result-hero {
  display: flex; align-items: center; gap: 32px; border: 1px solid var(--line);
  border-radius: 22px; padding: 30px; background: linear-gradient(120deg, #fbfcff, #fff 55%, #f7fffb);
}
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--soft-2); stroke-width: 10; }
.ring-value { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.6s ease; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-size: 30px; letter-spacing: -1px; line-height: 1; }
.ring-text span { font-size: 12px; color: var(--muted); margin-top: 6px; }
.result-summary h2 { margin: 0 0 6px; font-size: 22px; }
.result-summary p { margin: 0; color: var(--muted); }
.result-metrics { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.result-metrics b { display: block; font-size: 20px; }
.result-metrics span { font-size: 12.5px; color: var(--muted); }
.result-actions { margin-left: auto; display: flex; flex-direction: column; gap: 10px; flex: none; }

.review-list { display: grid; gap: 16px; margin-top: 22px; }
.review-card { border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 22px 24px; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.review-no { font-weight: 800; font-size: 15px; margin-right: 2px; }
.verdict { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.verdict.ok { color: #047857; background: var(--green-soft); }
.verdict.no { color: var(--red); background: var(--red-soft); }
.review-stem { font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.review-code { margin: 12px 0 2px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.answer-row { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; }
.answer-row .k { color: var(--muted); margin-right: 6px; }
.answer-row .v { font-family: var(--mono); font-weight: 700; }
.answer-row .v.ok { color: #047857; }
.answer-row .v.no { color: var(--red); }
.analysis {
  margin-top: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap;
}
.analysis b { color: var(--ink); }

/* ============================== stats ============================== */
.chart-card { border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; background: #fff; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.chart-head b { font-size: 15px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: #c7d2fe; border-radius: 6px 6px 2px 2px; min-height: 3px; transition: height 0.4s ease; }
.bar-fill.has { background: var(--accent); }
.bar-label { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-family: var(--mono); }
.recent-list { display: grid; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 13.5px; background: #fff;
}
.recent-item .date { color: var(--muted); font-size: 12.5px; }
.recent-item .score { margin-left: auto; font-family: var(--mono); font-weight: 700; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: 16px; padding: 44px 20px; text-align: center; color: var(--muted);
}
.empty b { display: block; color: var(--ink); margin-bottom: 6px; }

/* ============================== auth ============================== */
.auth-wrap { display: flex; justify-content: center; padding: 58px 0 80px; }
.auth-card { width: min(430px, 100%); border: 1px solid var(--line); border-radius: 22px; background: #fff; padding: 34px; box-shadow: var(--shadow-md); }
.auth-card h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -0.6px; }
.auth-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.input {
  width: 100%; height: 46px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 14px;
  font-size: 15px; background: #fff; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79,70,229,0.10); }
.input.code { font-family: var(--mono); letter-spacing: 8px; text-align: center; font-size: 18px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.auth-alt { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--accent-ink); font-weight: 600; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 4px; flex: 1; border-radius: 999px; background: var(--soft-2); }
.steps i.on { background: var(--ink); }

/* ============================== misc ============================== */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 80;
  max-width: min(90vw, 520px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #7f1d1d; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.42); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px;
}
.modal {
  width: min(420px, 100%); background: #fff; border-radius: 18px; padding: 26px;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
}
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.skeleton {
  border-radius: 12px; background: linear-gradient(90deg, #f1f5f9 25%, #e9eef5 37%, #f1f5f9 63%);
  background-size: 400% 100%; animation: shimmer 1.2s infinite; height: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view { animation: fadeUp 0.28s ease both; }

/* ============================== footer ============================== */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 30px 0 36px; background: #fff; }
.footer-inner { width: min(1120px, calc(100% - 48px)); margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-brand { font-weight: 700; margin-bottom: 4px; }
.footer-text { margin: 0; color: var(--muted); font-size: 13px; }
.footer-meta { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12.5px; text-align: right; }

/* ============================== AI ============================== */
.ai-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--ink); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(15, 23, 42, 0.5); transition: transform 0.15s ease, background 0.15s ease;
}
.ai-fab:hover { transform: translateY(-2px); background: #000; }
.ai-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); background: #fff; z-index: 70;
  border-left: 1px solid var(--line); box-shadow: -20px 0 60px -30px rgba(15, 23, 42, 0.4);
  transform: translateX(102%); transition: transform 0.25s ease; display: flex; flex-direction: column;
}
.ai-panel.open { transform: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.ai-title { font-weight: 700; font-size: 16px; }
.ai-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ai-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #fbfcfe; }
.ai-msg { max-width: 88%; border-radius: 14px; padding: 11px 14px; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.ai-msg-bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.ai-msg-user { background: var(--accent); color: #fff; align-self: flex-end; }
.ai-msg code { font-family: var(--mono); font-size: 12.5px; }
.ai-msg pre { background: #0b1220; color: #dbe4f0; padding: 12px; border-radius: 10px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.6; }
.ai-form { display: flex; gap: 8px; padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.ai-form button { flex: none; width: 64px; padding: 0 10px; }
.ai-form textarea {
  flex: 1; resize: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px;
  font-size: 13.5px; line-height: 1.5; outline: none; max-height: 120px;
}
.ai-form textarea:focus { border-color: var(--accent); }

/* ============================ 一起耍起 theme ============================ */
:root {
  --ink: #232a3d;
  --ink-2: #2f3650;
  --muted: #6f7690;
  --muted-2: #9aa0b5;
  --line: rgba(178, 154, 112, 0.28);
  --line-strong: rgba(146, 122, 82, 0.38);
  --bg: #fbf8f2;
  --soft: rgba(255, 255, 255, 0.62);
  --soft-2: rgba(244, 238, 229, 0.86);
  --accent: #5577ad;
  --accent-ink: #3d5c8c;
  --accent-soft: rgba(120, 150, 200, 0.16);
  --gold: #c6a05e;
  --gold-deep: #a9823f;
  --gold-soft: rgba(198, 160, 94, 0.14);
  --green: #3f8f74;
  --green-soft: rgba(63, 143, 116, 0.12);
  --amber: #a97a35;
  --amber-soft: rgba(198, 160, 94, 0.16);
  --red: #b45a5a;
  --red-soft: rgba(180, 90, 90, 0.1);
  --shadow-sm: 0 2px 6px rgba(60, 72, 110, 0.06);
  --shadow-md: 0 26px 60px -34px rgba(56, 68, 112, 0.55);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-strong: rgba(255, 255, 255, 0.82);
}

body {
  background: var(--bg);
  color: var(--ink);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url("/assets/bg-swirl-soft.jpg") center top / cover no-repeat;
  opacity: 0.34;
  filter: blur(0.6px) saturate(1.05);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 720px at 8% -6%, rgba(255, 255, 255, 0.96), transparent 62%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(180deg, rgba(251, 248, 242, 0.42), rgba(251, 248, 242, 0.95) 46%, #fbf8f2 100%);
}

/* topbar */
.topbar {
  background: rgba(255, 252, 246, 0.74);
  border-bottom: 1px solid rgba(198, 160, 94, 0.26);
  box-shadow: 0 10px 30px -26px rgba(60, 72, 110, 0.5);
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 8px 18px -10px rgba(60, 80, 130, 0.65);
  flex: none;
}
.brand-name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--ink);
}
.beta-tag {
  margin-left: 4px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--gold-deep);
  background: rgba(198, 160, 94, 0.14);
  border: 1px solid rgba(198, 160, 94, 0.4);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--font);
  font-weight: 600;
}
.nav a { color: var(--muted); }
.nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.55); }
.nav a.active {
  color: var(--gold-deep);
  background: rgba(198, 160, 94, 0.12);
  box-shadow: inset 0 -2px 0 rgba(198, 160, 94, 0.6);
}
.user-pill { background: rgba(255, 255, 255, 0.66); border-color: var(--line); }
.avatar {
  background: linear-gradient(135deg, rgba(120, 150, 200, 0.28), rgba(216, 167, 182, 0.32));
  color: var(--accent-ink);
}

/* hero */
.hero {
  position: relative;
  padding: 86px 0 70px;
  background:
    linear-gradient(90deg, rgba(255, 252, 246, 0.95) 0%, rgba(255, 252, 246, 0.84) 40%, rgba(255, 252, 246, 0.38) 68%, rgba(255, 252, 246, 0.58) 100%),
    url("/assets/bg-swirl.jpg") center 24% / cover no-repeat;
  border-bottom: 1px solid rgba(198, 160, 94, 0.22);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(198, 160, 94, 0.55) 0 1px, transparent 1.6px);
  background-size: 140px 140px, 220px 220px;
  background-position: 20px 30px, 90px 110px;
  opacity: 0.32;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(198, 160, 94, 0.4);
  color: var(--gold-deep);
  backdrop-filter: blur(6px);
}
.eyebrow .dot { background: var(--gold); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -1.2px;
  color: #202840;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(
    100deg,
    #4d6fa5 0%,
    #b97f94 25%,
    #c39a52 50%,
    #b97f94 75%,
    #4d6fa5 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: heroGradientFlow 7s linear infinite;
}
@keyframes heroGradientFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: -200% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 em { animation: none; }
}
.hero p.lead { color: #5b627c; }
.hero-stat b { font-family: var(--serif); color: #273151; }
.hero-stat span { color: var(--muted); }
.paper-preview {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(198, 160, 94, 0.38);
  box-shadow: 0 34px 70px -40px rgba(50, 66, 110, 0.6);
  backdrop-filter: blur(16px) saturate(130%);
}
.paper-preview-title { font-family: var(--serif); color: #2a3352; }
.preview-code {
  background: #1c2438;
  border: 1px solid rgba(198, 160, 94, 0.35);
  color: #e7e3d8;
}
.preview-code .k { color: #e9b7a3; }
.preview-code .c { color: #9fc0e8; }
.preview-opt {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(178, 154, 112, 0.3);
}
.preview-opt.good {
  border-color: rgba(63, 143, 116, 0.35);
  background: rgba(63, 143, 116, 0.14);
  color: #2f705b;
}

/* section headings */
.section-head h2,
.page-head h1,
.result-summary h2,
.chart-head b,
.auth-card h1,
.modal h3 {
  font-family: var(--serif);
  letter-spacing: -0.4px;
}
.section-link { color: var(--gold-deep); }

/* cards & glass */
.subject-card,
.panel,
.stat-card,
.chart-card,
.question-card,
.review-card,
.auth-card,
.result-hero,
.recent-item,
.dash-banner,
.feature {
  background: var(--glass);
  border: 1px solid rgba(198, 168, 116, 0.3);
  box-shadow: 0 22px 50px -36px rgba(56, 68, 112, 0.55);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
}
.subject-card.ready:hover {
  border-color: rgba(198, 160, 94, 0.55);
  box-shadow: 0 30px 60px -36px rgba(56, 68, 112, 0.6);
}
.subject-icon {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(198, 160, 94, 0.3);
  font-family: var(--serif);
  color: #3f4a6b;
}
.feature { background: rgba(255, 255, 255, 0.5); }
.feature-icon { border-color: rgba(198, 160, 94, 0.3); background: rgba(255, 255, 255, 0.7); }
.dash-banner {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(246, 238, 226, 0.72));
  border-color: rgba(198, 160, 94, 0.36);
}
.stat-card.accent {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(240, 232, 220, 0.6));
  border-color: rgba(198, 160, 94, 0.42);
}
.stat-card b { font-family: var(--serif); }

/* tags and badges */
.tag { background: rgba(255, 255, 255, 0.55); border-color: var(--line); }
.tag-accent { color: var(--gold-deep); background: var(--gold-soft); border-color: rgba(198, 160, 94, 0.35); }
.badge-chapter { background: rgba(255, 255, 255, 0.55); color: #5d6480; border-color: var(--line); }
.badge-type { background: rgba(255, 255, 255, 0.7); border-color: var(--line-strong); }
.badge-easy { color: #2f705b; background: var(--green-soft); }
.badge-medium { color: var(--amber); background: var(--amber-soft); }
.badge-hard { color: var(--red); background: var(--red-soft); }

/* buttons */
.btn-primary {
  background: linear-gradient(135deg, #33486f, #46648f);
  color: #fff;
  box-shadow: 0 12px 26px -16px rgba(51, 72, 111, 0.85);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #283a5d, #3a557d); }
.btn-accent { background: linear-gradient(135deg, var(--gold), #d9ba82); color: #3a2f1c; }
.btn-accent:hover:not(:disabled) { background: linear-gradient(135deg, var(--gold-deep), #cfae74); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(160, 136, 96, 0.36);
  color: var(--ink);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--ink); }
.btn-quiet { color: var(--muted); }
.input, .fill-input { background: rgba(255, 255, 255, 0.72); border-color: var(--line-strong); }
.input:focus, .fill-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(85, 119, 173, 0.12); }
.chip {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(160, 136, 96, 0.34);
  backdrop-filter: blur(6px);
}
.chip.on {
  background: linear-gradient(135deg, #33486f, #46648f);
  border-color: transparent;
  color: #fff;
}
.seg { background: rgba(244, 238, 229, 0.8); }
.seg button.on { background: rgba(255, 255, 255, 0.92); }
.mix-easy { background: rgba(63, 143, 116, 0.12); color: #2f705b; }
.mix-medium { background: rgba(198, 160, 94, 0.16); color: var(--amber); }
.mix-hard { background: rgba(180, 90, 90, 0.1); color: var(--red); }

/* quiz */
.quiz-top { background: rgba(255, 252, 246, 0.84); border-bottom-color: rgba(198, 160, 94, 0.24); }
.quiz-progress-bar { background: rgba(244, 238, 229, 0.9); }
.quiz-progress-bar i { background: linear-gradient(90deg, #5577ad, #d8a7b6); }
.quiz-timer { background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); }
.q-code {
  background: #1a2234;
  border: 1px solid rgba(198, 160, 94, 0.32);
  color: #e8e4d9;
}
.opt {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(160, 136, 96, 0.32);
}
.opt:hover { border-color: var(--gold-deep); }
.opt.sel {
  border-color: var(--accent);
  background: rgba(120, 150, 200, 0.14);
  box-shadow: 0 0 0 3px rgba(85, 119, 173, 0.1);
}
.opt.sel .letter { background: var(--accent); border-color: var(--accent); }
.opt.correct { border-color: rgba(63, 143, 116, 0.5); background: rgba(63, 143, 116, 0.12); }
.opt.wrong { border-color: rgba(180, 90, 90, 0.45); background: rgba(180, 90, 90, 0.08); }
.qnav button { background: rgba(255, 255, 255, 0.65); border-color: var(--line); }
.qnav button.done { background: var(--gold-soft); border-color: rgba(198, 160, 94, 0.4); color: var(--gold-deep); }
.qnav button.cur { border-color: var(--ink); color: var(--ink); }

/* result */
.result-hero {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 243, 0.72) 55%, rgba(245, 238, 228, 0.7));
}
.ring-track { stroke: rgba(244, 238, 229, 0.95); }
.ring-value { stroke: #5577ad; filter: drop-shadow(0 4px 10px rgba(85, 119, 173, 0.35)); }
.ring-text b { font-family: var(--serif); }
.verdict.ok { color: #2f705b; background: var(--green-soft); }
.verdict.no { color: var(--red); background: var(--red-soft); }
.review-code { background: rgba(255, 255, 255, 0.55); border-color: var(--line); }
.analysis { background: rgba(255, 255, 255, 0.55); border-color: var(--line); }

/* stats */
.bar-fill { background: rgba(198, 160, 94, 0.28); }
.bar-fill.has { background: linear-gradient(180deg, #7d9bcd, #d8a7b6); }
.table th { color: var(--muted); }
.empty { background: rgba(255, 255, 255, 0.42); border-color: rgba(160, 136, 96, 0.35); }

/* auth split layout */
.auth-page {
  display: grid;
  grid-template-columns: 1.05fr 430px;
  gap: 42px;
  align-items: center;
  padding: 54px 0 76px;
}
.auth-visual {
  position: relative;
  min-height: 580px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(198, 160, 94, 0.4);
  box-shadow: 0 40px 80px -46px rgba(48, 62, 104, 0.65);
}
.auth-visual img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 36, 58, 0.08), rgba(28, 36, 58, 0.55));
}
.auth-visual-copy {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 34px;
  z-index: 2;
  color: #fff;
}
.auth-visual-copy span {
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(255, 244, 220, 0.85);
  text-transform: uppercase;
}
.auth-visual-copy h2 {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: 1px;
  text-shadow: 0 6px 30px rgba(20, 28, 48, 0.45);
}
.auth-card {
  width: 100%;
  padding: 34px;
  box-shadow: 0 34px 70px -44px rgba(48, 62, 104, 0.6);
}
.auth-card .sub { color: var(--muted); }
.auth-wrap { padding: 0; }
.auth-alt a { color: var(--gold-deep); }

/* art banner (home) */
.art-banner {
  position: relative;
  display: block;
  min-height: 300px;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(198, 160, 94, 0.42);
  box-shadow: 0 40px 80px -50px rgba(48, 62, 104, 0.7);
  background: url("/assets/bg-clock-web.jpg") center 36% / cover no-repeat;
}
.art-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(24, 32, 54, 0.72) 0%, rgba(24, 32, 54, 0.42) 46%, rgba(24, 32, 54, 0.08) 78%);
}
.art-banner-copy {
  position: relative;
  z-index: 2;
  padding: 48px 52px;
  max-width: 560px;
  color: #fff;
}
.art-banner-copy span.kicker {
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(255, 238, 205, 0.9);
}
.art-banner-copy h2 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: 0.5px;
}
.art-banner-copy p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  max-width: 420px;
}
.art-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f3e2bd;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.art-banner:hover .art-cta { color: #fff; }

/* footer */
.footer {
  background: rgba(255, 252, 246, 0.66);
  border-top: 1px solid rgba(198, 160, 94, 0.26);
  backdrop-filter: blur(10px);
}
.footer-brand { font-family: var(--serif); letter-spacing: 1px; }
.footer-meta { color: var(--muted); }

/* AI */
.ai-fab {
  background: linear-gradient(150deg, #5577ad, #b98aa0 62%, #c6a05e);
  box-shadow: 0 18px 34px -14px rgba(60, 78, 120, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.ai-fab:hover { background: linear-gradient(150deg, #4b6a9e, #b07e96 62%, #c6a05e); }
.ai-panel {
  background: rgba(255, 252, 246, 0.92);
  backdrop-filter: blur(18px);
  border-left-color: rgba(198, 160, 94, 0.3);
}
.ai-messages { background: rgba(255, 255, 255, 0.35); }
.ai-msg-bot { background: rgba(255, 255, 255, 0.85); border-color: var(--line); }
.ai-msg-user { background: linear-gradient(135deg, #5577ad, #6d86b4); }
.ai-form textarea { background: rgba(255, 255, 255, 0.7); border-color: var(--line-strong); }
.ai-head { border-bottom-color: var(--line); }
.ai-form { border-top-color: var(--line); }

/* toast / modal */
.toast { background: #2a3352; box-shadow: 0 18px 40px -20px rgba(30, 40, 66, 0.7); }
.modal { background: rgba(255, 252, 246, 0.96); border: 1px solid rgba(198, 160, 94, 0.35); }
.modal-backdrop { background: rgba(28, 36, 58, 0.45); }

/* ============================== responsive ============================== */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero { padding-top: 52px; }
  .hero-card { max-width: 520px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .result-hero { flex-wrap: wrap; }
  .result-actions { flex-direction: row; margin-left: 0; }
  .dash-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .container, .narrow, .topbar-inner, .footer-inner { width: calc(100% - 32px); }
  .nav { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero-stats { gap: 18px; }
  .hero h1 { letter-spacing: -1px; }
  .question-card { padding: 20px; }
  .quiz-top { top: 66px; }
  .quiz-top-inner { gap: 10px; }
  .quiz-timer { font-size: 12px; padding: 6px 9px; }
  .q-stem { font-size: 15.5px; }
  .q-code { font-size: 12.5px; padding: 14px; }
  .opt { font-size: 14.5px; padding: 12px 13px; }
  .result-hero { padding: 22px; gap: 20px; }
  .ring { width: 108px; height: 108px; }
  .ring-text b { font-size: 24px; }
  .review-card { padding: 18px; }
  .panel { padding: 20px; }
  .practice-foot { flex-direction: column; align-items: stretch; }
  .footer-meta { text-align: left; }
  .user-email { display: none; }
  .ai-fab { right: 16px; bottom: 16px; }
}

/* theme responsive additions */
@media (max-width: 1020px) {
  .auth-page { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; padding: 40px 0 64px; }
  .auth-visual { display: none; }
}
@media (max-width: 720px) {
  .hero { background-position: center top; padding: 58px 0 46px; }
  .hero::before { opacity: 0.2; }
  .brand-name { font-size: 17px; letter-spacing: 0.8px; }
  .brand-logo { width: 34px; height: 34px; border-radius: 10px; }
  .art-banner { min-height: 240px; }
  .art-banner-copy { padding: 28px 24px; }
  .art-banner-copy h2 { font-size: 23px; }
  .art-banner-copy p { font-size: 13px; margin-bottom: 16px; }
  .auth-card { padding: 26px; }
}

/* ============================ wrong book ============================ */
.wrong-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.84), rgba(247, 239, 227, 0.72));
}
.wrong-count { font-family: var(--serif); font-size: 19px; color: var(--ink-2); }
.wrong-count b { font-size: 38px; color: var(--gold-deep); margin-right: 4px; }
.wrong-chapters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wrong-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex: none; }
.wrong-list { display: grid; gap: 10px; }
.wrong-item {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(198, 168, 116, 0.3);
  border-radius: 14px;
  padding: 0 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px -28px rgba(56, 68, 112, 0.5);
}
.wrong-item summary {
  display: flex; align-items: center; gap: 10px; padding: 13px 0;
  cursor: pointer; list-style: none; flex-wrap: wrap;
}
.wrong-item summary::-webkit-details-marker { display: none; }
.wrong-item[open] summary { border-bottom: 1px dashed var(--line); }
.wrong-index {
  width: 24px; height: 24px; border-radius: 50%; background: var(--gold-soft);
  color: var(--gold-deep); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: none;
}
.wrong-stem {
  flex: 1; min-width: 220px; font-size: 14px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wrong-toggle { font-size: 12px; color: var(--gold-deep); flex: none; }
.wrong-body { padding: 14px 0 18px; }
@media (max-width: 720px) {
  .wrong-hero { flex-direction: column; align-items: stretch; padding: 20px; }
  .wrong-actions { align-items: stretch; }
  .wrong-stem { white-space: normal; }
}
/* ============================ AI settings ============================ */
.ai-head-actions { display: flex; align-items: center; gap: 8px; }
.ai-config-link {
  font-size: 12px; color: var(--gold-deep); padding: 5px 10px; border-radius: 8px;
  border: 1px solid rgba(198, 160, 94, 0.4); background: rgba(198, 160, 94, 0.08);
}
.ai-config-link:hover { background: rgba(198, 160, 94, 0.16); }
.ai-set-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.settings-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.ai-help {
  margin-top: 20px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.85; color: var(--muted);
}
.ai-help b { color: var(--ink); }
select.input { padding: 0 12px; cursor: pointer; }
/* mobile navigation: keep the columns visible under the header */
@media (max-width: 720px) {
  .topbar-inner {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    row-gap: 0;
  }
  .nav {
    display: flex;
    order: 10;
    flex: 1 0 100%;
    width: 100%;
    margin: 0;
    padding: 5px 0 8px;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(198, 160, 94, 0.22);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    flex: none;
    padding: 7px 9px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .header-practice { display: none; }
  .quiz-top { top: 102px; }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 8px; }
  .brand { gap: 8px; }
  .brand-logo { width: 30px; height: 30px; border-radius: 9px; }
  .brand-name { font-size: 15px; letter-spacing: 0.5px; }
  .nav-right { gap: 6px; }
  .nav-right .btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
  .reg-free { display: none; }
}
@media (max-width: 400px) {
  .beta-tag { display: none; }
}
.wrong-subjects { margin-top: 16px; }

/* ============================ math typography ============================ */
.q-stem sup, .q-stem sub, .review-stem sup, .review-stem sub,
.opt sup, .opt sub, .analysis sup, .analysis sub,
.answer-row sup, .answer-row sub, .wrong-stem sup, .wrong-stem sub {
  font-size: 0.72em;
  line-height: 0;
}
.math-root {
  display: inline-flex;
  align-items: flex-start;
  vertical-align: middle;
  line-height: 1.05;
  margin: 0 0.05em;
}
.math-root-sign {
  font-size: 1.18em;
  line-height: 1;
  transform: translateY(-0.06em);
}
.math-root-body {
  border-top: 1px solid currentColor;
  margin-left: -0.04em;
  padding: 1px 2px 0 2px;
  line-height: 1.25;
}
.math-lim {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
  margin: 0 0.1em;
  transform: translateY(-0.14em);
}
.math-lim-op {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.02em;
}
.math-lim-sub {
  font-size: 0.62em;
  margin-top: 1px;
  white-space: nowrap;
}
.math-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  line-height: 1.05;
  margin: 0 0.12em;
  font-size: 0.92em;
  transform: translateY(-0.1em);
}
.math-frac .num { padding: 0 0.18em; }
.math-frac .den {
  border-top: 1px solid currentColor;
  padding: 1px 0.18em 0;
}
.count-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.count-input { width: 92px; text-align: center; padding: 0 8px; }

/* AI weakness analysis */
.analysis-panel { padding: 22px 24px; }
.analysis-content { font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.analysis-content.muted { color: var(--muted); }
.analysis-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.analysis-text { white-space: normal; }
.analysis-text strong { color: var(--ink); }
.analysis-text pre { margin: 10px 0; }
.analysis-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.analysis-loading { color: var(--muted); padding: 8px 0; }
/* ============================== ladder ============================== */
.user-pill { text-decoration: none; color: inherit; }
.avatar-img { overflow: hidden; padding: 0; }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.ladder-badge {
  display: inline-block; margin-top: 12px;
  font-family: Georgia, "Songti SC", serif; font-size: 14px; letter-spacing: 1px;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px;
}
.ladder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; margin-top: 24px; align-items: start; }
.ladder-main { min-width: 0; }
.ladder-formula {
  display: flex; flex-direction: column; gap: 5px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.ladder-formula b { font-size: 15px; }
.ladder-formula span { font-size: 13px; color: var(--ink-2); }
.rank-list { display: grid; gap: 10px; margin-top: 16px; }
.rank-row {
  display: grid; grid-template-columns: 38px 44px minmax(0, 1fr) 110px 82px;
  gap: 12px; align-items: center; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: 0 14px 30px -26px rgba(30,40,70,.5);
}
.rank-row.top { background: linear-gradient(100deg, rgba(216,190,140,.13), var(--surface) 55%); }
.rank-row.is-me { border-color: var(--accent-ink); box-shadow: 0 0 0 2px rgba(62,92,138,.12); }
.rank-no { text-align: center; font-family: Georgia, serif; font-size: 20px; color: var(--ink-2); }
.rank-row.top .rank-no { font-size: 24px; }
.rank-avatar {
  width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; overflow: hidden;
}
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank-person { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rank-person b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rank-person span { color: var(--muted); font-size: 12px; }
.rank-meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rank-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c9a86a, #9a742f); }
.rank-score { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.rank-score b { font-family: Georgia, serif; font-size: 20px; color: var(--accent-ink); }
.rank-score span { color: var(--muted); font-size: 11px; }
.ladder-me {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.ladder-me .rank-person { flex: 1; }
.ladder-me .rank-score { min-width: 74px; }
.ladder-note {
  margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink-2);
}
.ladder-note h3 { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.ladder-note p { margin: 0 0 10px; font-size: 13px; line-height: 1.8; }
.ladder-side { min-width: 0; }

/* ============================== profile ============================== */
.profile-panel { max-width: 720px; margin-top: 22px; }
.profile-top { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.avatar-preview {
  width: 92px; height: 92px; border-radius: 50%; flex: 0 0 92px; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(120,150,200,.28), rgba(216,167,182,.32));
  color: var(--accent-ink); font-family: Georgia, serif; font-size: 34px; font-weight: 700;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.profile-avatar-actions label { cursor: pointer; }

@media (max-width: 860px) {
  .ladder-layout { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 32px 40px minmax(0, 1fr) 72px; }
  .rank-meter { display: none; }
  .ladder-badge { display: none; }
}
@media (max-width: 560px) {
  .profile-top { align-items: flex-start; }
  .avatar-preview { width: 72px; height: 72px; flex-basis: 72px; font-size: 26px; }
  .rank-row { padding: 10px 12px; gap: 8px; }
  .rank-score b { font-size: 17px; }
}
/* ============================ achievements ============================ */
.achievement-entry {
  display: flex; align-items: center; gap: 18px; margin-top: 18px; max-width: 720px;
  border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.achievement-entry-mark {
  width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 26px; color: var(--gold-deep, #9a742f);
  background: linear-gradient(135deg, #f3e5c8, #e8d1a5); border: 1px solid #e0cba4;
}
.achievement-entry-text { flex: 1; min-width: 0; }
.achievement-entry-text h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.achievement-entry-text p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.achievement-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  margin: 22px 0; max-width: 720px;
}
.achievement-summary > div {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px 18px;
}
.achievement-summary b { display: block; font-family: Georgia, serif; font-size: 26px; color: var(--accent-ink); }
.achievement-summary span { font-size: 12px; color: var(--muted); }
.achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.achievement-card {
  min-height: 180px; border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  background: var(--surface); display: flex; flex-direction: column; align-items: flex-start;
  box-shadow: 0 18px 36px -32px rgba(30,40,70,.45);
}
.achievement-card.locked { background: linear-gradient(145deg, #f4f1ea, #ebe6db); }
.achievement-icon {
  width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 26px; font-weight: 700; color: #8c7a58;
  background: rgba(255,255,255,.55); border: 1px solid #ded2bb; margin-bottom: 16px;
}
.achievement-card h3 { margin: 0 0 8px; font-size: 17px; }
.achievement-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.achievement-state {
  margin-top: auto; padding-top: 14px; font-size: 12px; color: #a18a60; letter-spacing: .5px;
}
.achievement-card.unlocked { background: linear-gradient(145deg, #fffaf0, #f7ecd7); border-color: #e3cfaa; }
.achievement-card.unlocked .achievement-icon { color: var(--gold-deep, #9a742f); background: #f7e8c8; }
.achievement-card.unlocked .achievement-state { color: #1f7a54; }
.achievement-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; color: var(--muted); font-size: 13px; }
.achievement-foot p { margin: 0; }
@media (max-width: 860px) {
  .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .achievement-grid { grid-template-columns: 1fr; }
  .achievement-entry { align-items: flex-start; flex-wrap: wrap; }
  .achievement-entry .btn { margin-left: 72px; }
  .achievement-summary { gap: 8px; }
  .achievement-summary > div { padding: 12px; }
}
.ai-context-hint {
  padding: 8px 16px; font-size: 11.5px; color: var(--muted);
  background: rgba(255,255,255,.55); border-top: 1px dashed var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ========================= math proof grading ========================= */
.badge-ai { background: #eef2fb; color: #3e5c8a; border-color: #c9d6e8; }
.solution-box {
  margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: #fcfaf5;
}
.solution-box-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.solution-box-head b { font-size: 14px; }
.solution-box-head span { color: var(--muted); font-size: 12px; }
.solution-text {
  width: 100%; resize: vertical; min-height: 150px; border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.8; outline: none;
  background: #fff; color: var(--ink); font-family: inherit;
}
.solution-text:focus { border-color: var(--accent); }
.solution-upload-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.solution-upload-row label { cursor: pointer; }
.solution-image-preview { margin-top: 12px; }
.solution-image-preview img { max-width: 100%; max-height: 360px; border-radius: 12px; border: 1px solid var(--line); }
.solution-hint { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.proof-review { margin-top: 12px; display: grid; gap: 12px; }
.proof-submitted { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf6; }
.proof-submitted > b { display: block; margin-bottom: 8px; font-size: 13px; }
.proof-text { white-space: pre-wrap; font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.proof-image { max-width: 100%; max-height: 420px; border-radius: 12px; border: 1px solid var(--line); margin-top: 10px; }
.ai-grade-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ai-grade-box.pass { border-color: #b9d7c5; background: #f5fbf7; }
.ai-grade-box.fail { border-color: #e5c4c4; background: #fffafa; }
.ai-grade-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ai-grade-head span:first-child { font-size: 13px; color: var(--muted); }
.ai-grade-head b { font-family: Georgia, serif; font-size: 24px; color: var(--accent-ink); }
.ai-grade-head span:last-child { font-size: 12px; color: var(--muted); }
.ai-grade-box.pass .ai-grade-head b { color: #1f7a54; }
.ai-grade-box.fail .ai-grade-head b { color: #b24c4c; }
.proof-reference { border-top: 1px dashed var(--line); padding-top: 10px; }
.proof-reference summary { cursor: pointer; font-size: 13px; color: var(--gold-deep); }
.proof-reference .analysis { margin-top: 8px; }
@media (max-width: 560px) {
  .solution-box { padding: 12px; }
  .solution-text { min-height: 130px; }
}
/* ============================== English ============================== */
.subject-card { text-decoration: none; color: inherit; }
.eng-page-head { max-width: 900px; }
.eng-picker {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.eng-picker label { font-size: 13px; color: var(--muted); }
.eng-picker .input { max-width: 340px; }
.eng-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.eng-mode-card {
  text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  transition: transform .15s ease, border-color .15s ease;
}
.eng-mode-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.eng-mode-card b { font-size: 15px; color: var(--ink); }
.eng-mode-card span { font-size: 12px; color: var(--muted); }
.eng-paper-list { display: grid; gap: 10px; }
.eng-paper-card {
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.eng-paper-cover {
  width: 54px; height: 54px; flex: 0 0 54px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-family: Georgia, serif; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #5577ad, #9a742f); font-size: 12px;
}
.eng-paper-card > div:nth-child(2) { flex: 1; min-width: 0; }
.eng-paper-card h3 { margin: 0 0 4px; font-size: 15px; }
.eng-paper-card p { margin: 0; font-size: 12px; color: var(--muted); }
.eng-toolbar {
  position: sticky; top: 0; z-index: 80; background: rgba(248,247,243,.94);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.eng-toolbar-inner { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.eng-toolbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eng-toolbar-actions { display: flex; gap: 8px; }
.eng-body { max-width: 1180px; padding-top: 26px; padding-bottom: 70px; }
.eng-paper-head h1 { margin: 0 0 6px; font-size: 28px; }
.eng-paper-head p { margin: 0 0 18px; color: var(--muted); }
.eng-section { margin-top: 26px; }
.eng-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eng-section-head h2 { margin: 0; font-size: 20px; }
.eng-section-head span { font-size: 12px; color: var(--muted); }
.eng-reading { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.eng-passage {
  position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow: auto;
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: #fffdf8;
  font-size: 14.5px; line-height: 1.95; color: var(--ink-2);
}
.eng-passage p { margin: 0 0 14px; }
.eng-passage-title { font-family: Georgia, serif; font-size: 16px; color: var(--ink); margin-bottom: 12px; }
.eng-questions { display: grid; gap: 12px; }
.eng-listening { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.eng-question {
  border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 16px;
}
.eng-question.is-correct { border-color: #b9d7c5; background: #fbfffc; }
.eng-question.is-wrong { border-color: #e5c4c4; background: #fffafa; }
.eng-q-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.eng-stem { font-size: 14px; line-height: 1.75; margin-bottom: 9px; }
.eng-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.eng-option {
  display: flex; align-items: flex-start; gap: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 10px;
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
.eng-option:hover { border-color: var(--accent); }
.eng-option.sel { border-color: var(--accent); background: #eef3fb; }
.eng-option.correct { border-color: #6fb08c; background: #eef9f2; }
.eng-option.wrong { border-color: #cc8888; background: #fbeeee; }
.eng-letter { font-weight: 700; color: var(--accent-ink); }
.eng-answer-hint { margin-top: 7px; font-size: 12px; color: #1f7a54; }
.eng-select-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eng-select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: #fff; font-size: 13px; }
.eng-wordbank {
  display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; margin-bottom: 14px;
  border: 1px dashed var(--line-strong); border-radius: 12px; background: #fbfaf6; font-size: 13px;
}
.eng-wordbank b { color: var(--accent-ink); }
.eng-audio {
  position: sticky; top: 66px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 14px; border: 1px solid #cfd9e8; border-radius: 14px;
  background: #f3f7fd; box-shadow: 0 12px 24px -22px rgba(30,40,70,.5);
}
.eng-audio-title { font-weight: 700; font-size: 14px; color: var(--accent-ink); }
.eng-audio audio { flex: 1; min-width: 240px; height: 36px; }
.eng-audio-tip { font-size: 12px; color: var(--muted); }
.eng-audio-empty { border-color: var(--line); background: #faf8f3; color: var(--muted); font-size: 13px; }
.eng-subjective { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; }
.eng-directions { font-size: 14px; line-height: 1.8; color: var(--ink-2); margin-bottom: 12px; }
.eng-writing {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; line-height: 1.8; resize: vertical; outline: none; font-family: inherit;
}
.eng-writing:focus { border-color: var(--accent); }
.eng-model { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.eng-model summary { cursor: pointer; color: var(--gold-deep); font-size: 13px; }
.eng-model div { margin-top: 10px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.eng-result {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; margin: 18px 0;
  border: 1px solid #b9d7c5; border-radius: 16px; background: #f5fbf7;
}
.eng-result > div { display: flex; flex-direction: column; min-width: 82px; }
.eng-result b { font-family: Georgia, serif; font-size: 26px; color: #1f7a54; }
.eng-result span { font-size: 12px; color: var(--muted); }
.eng-result-note { flex: 1; min-width: 200px; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .eng-mode-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .eng-reading { grid-template-columns: 1fr; }
  .eng-passage { position: static; max-height: none; }
  .eng-listening { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .eng-mode-grid, .eng-options { grid-template-columns: 1fr; }
  .eng-paper-card { flex-wrap: wrap; }
  .eng-toolbar-title { font-size: 12px; }
  .eng-body { padding-top: 16px; }
  .eng-audio { position: static; }
}
.eng-listen-group {
  margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 16px; background: #fffdf8;
}
.eng-listen-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.eng-listen-head > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eng-listen-head b { font-size: 14px; color: var(--ink); }
.eng-listen-head span { font-size: 12px; color: var(--muted); }
.eng-listen-questions { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 700px) {
  .eng-listen-questions { grid-template-columns: 1fr; }
}
/* ============================ Contribution ============================ */
.narrow { max-width: 980px; }
.contribute-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(240px,.65fr); gap: 18px; margin-top: 22px; align-items: start; }
.contribute-form { display: flex; flex-direction: column; gap: 10px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.field-label span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.contrib-text { min-height: 190px; resize: vertical; line-height: 1.75; }
.upload-box { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fbfaf6; }
.contrib-preview img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; display: block; }
.contrib-note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.contribute-tips h3 { margin: 0 0 10px; font-size: 15px; }
.contribute-tips ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.contrib-result { margin-top: 22px; border-color: #b9d7c5; background: #fbfffc; }
.contrib-result.bad { border-color: #e5c4c4; background: #fffafa; }
.contrib-result-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.contrib-result-head h2 { margin: 10px 0 0; font-size: 20px; }
.contrib-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.contrib-stem { font-size: 15px; line-height: 1.9; margin: 10px 0; white-space: pre-wrap; }
.contrib-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.contrib-options div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.contrib-options b { color: var(--accent-ink); margin-right: 8px; }
.contrib-analysis { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.contrib-analysis p { margin: 4px 0 0; white-space: pre-wrap; }
.contrib-message { margin-top: 10px; font-size: 12px; color: #1f7a54; }
@media (max-width: 800px) {
  .contribute-grid { grid-template-columns: 1fr; }
  .contrib-options { grid-template-columns: 1fr; }
}
/* AI math + English listening AI */
.ai-math-inline { white-space: normal; }
.ai-math-display {
  overflow-x: auto; overflow-y: hidden; margin: 10px 0; padding: 2px 0;
}
.ai-math-display .katex-display { margin: 0.35em 0; }
.ai-msg .katex { font-size: 1.04em; }
.eng-listen-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Math answer keyboard */
.math-keyboard {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: #fbfaf6; padding: 8px 10px; display: grid; gap: 6px;
}
.math-keyboard-row { display: flex; align-items: center; gap: 8px; }
.math-keyboard-row > span { flex: 0 0 34px; font-size: 11px; color: var(--muted); }
.math-keyboard-row > div { display: flex; flex-wrap: wrap; gap: 5px; }
.math-key {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 7px; background: #fff; color: var(--ink); cursor: pointer;
  font-family: "Times New Roman", "Songti SC", serif; font-size: 15px; line-height: 1;
}
.math-key:hover { border-color: var(--accent); background: #eef3fb; }
.math-key:active { transform: translateY(1px); }
.math-keyboard-tip { font-size: 11px; color: var(--muted); }
@media (max-width: 600px) {
  .math-keyboard-row { align-items: flex-start; }
  .math-keyboard-row > div { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
}
/* =====================================================================
   NEO / 2026 — dark editorial shell, acid accents, paper-light workspace
   ===================================================================== */
:root {
  --nx-bg: #07090d;
  --nx-panel: #0d1118;
  --nx-line: rgba(255,255,255,.13);
  --nx-text: #f4f5ef;
  --nx-muted: #8b94a3;
  --nx-lime: #d8ff58;
  --nx-coral: #ff6b4a;
  --nx-cyan: #7fe7ff;
  --nx-cream: #f2eee3;
  --nx-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", Georgia, serif;
}

body {
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(127,231,255,.06), transparent 65%),
    #f1ede3;
}

/* ---------- shell ---------- */
.topbar {
  background: rgba(7,9,13,.84);
  border-bottom: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 8px 40px -20px rgba(0,0,0,.7);
}
.topbar-inner { height: 70px; }
.brand { color: var(--nx-text); }
.brand-name { color: var(--nx-text) !important; }
.brand-name { font-weight: 700; letter-spacing: -.4px; }
.brand-logo { border-radius: 12px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.nav { gap: 2px; }
.nav a { color: #9ba4b2; font-size: 13px; padding: 9px 11px; border-radius: 8px; letter-spacing: .02em; }
.nav a:hover { color: var(--nx-text); background: rgba(255,255,255,.07); }
.nav a.active { color: var(--nx-bg); background: var(--nx-lime); font-weight: 700; }
.nav-right .user-pill { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: var(--nx-text); }
.nav-right .user-email { color: #c5cbd4; }
.nav-right .avatar { background: var(--nx-lime); color: #15170e; }
.nav-right .btn-ghost { background: transparent; color: var(--nx-text); border-color: rgba(255,255,255,.18); }
.nav-right .btn-quiet { color: #c5cbd4; }
.nav-right .btn-primary { background: var(--nx-lime); color: var(--nx-bg); }
.footer { background: var(--nx-bg); border-top: 1px solid rgba(255,255,255,.09); color: var(--nx-text); }
.footer-brand { color: var(--nx-text); }
.footer-text, .footer-meta { color: #8b94a3; }

/* ---------- home shell ---------- */
.nx-home {
  background: var(--nx-bg);
  color: var(--nx-text);
  overflow: hidden;
}
.nx-home .container { width: min(1200px, calc(100% - 48px)); }
.nx-home ::selection { background: var(--nx-lime); color: #0a0b10; }

/* ---------- hero ---------- */
.nx-hero { position: relative; isolation: isolate; overflow: hidden; padding-top: 52px; background: #07090d; }
.nx-aurora {
  position: absolute; inset: -20% -10% 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(600px 420px at 72% 28%, rgba(216,255,88,.13), transparent 68%),
    radial-gradient(520px 380px at 12% 12%, rgba(127,231,255,.12), transparent 70%),
    radial-gradient(460px 340px at 78% 86%, rgba(255,107,74,.10), transparent 70%);
  filter: blur(20px);
}
.nx-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .34;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 82%);
}
.nx-hero-grid {
  display: grid; grid-template-columns: minmax(0,1.04fr) minmax(360px,.96fr);
  align-items: center; gap: 46px; min-height: 610px; padding-bottom: 72px;
}
.nx-hero-copy { position: relative; z-index: 2; }
.nx-rail { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.nx-status {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .14em; color: var(--nx-lime);
}
.nx-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--nx-lime); box-shadow: 0 0 14px var(--nx-lime); animation: nxPulse 2s ease-in-out infinite; }
.nx-rail-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: #626b7a; }
.nx-kicker {
  display: flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 12px; letter-spacing: .18em; color: #b6bdc8; text-transform: uppercase; margin-bottom: 18px;
}
.nx-kicker span { color: var(--nx-coral); }
.nx-display {
  margin: 0; font-family: var(--nx-serif); font-weight: 600;
  font-size: clamp(66px, 8.4vw, 126px); line-height: .84; letter-spacing: -.075em;
  color: var(--nx-text);
}
.nx-display span {
  color: transparent; -webkit-text-stroke: 1.5px rgba(244,245,239,.65);
  font-style: italic; padding-right: .035em;
}
.nx-display em { font-style: italic; color: var(--nx-lime); font-weight: 500; }
.nx-display::after { content: ""; display: block; width: 64px; height: 2px; background: var(--nx-coral); margin-top: 26px; }
.nx-lead {
  max-width: 500px; margin: 26px 0 0; color: #aab2bf; font-size: 16px; line-height: 1.85;
}
.nx-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.nx-btn-primary {
  background: var(--nx-lime); color: #10120b; border: 1px solid var(--nx-lime);
  box-shadow: 0 0 0 1px rgba(216,255,88,.12), 0 18px 40px -24px rgba(216,255,88,.65);
}
.nx-btn-primary:hover { background: #e5ff8b; border-color: #e5ff8b; transform: translateY(-2px); }
.nx-btn-primary span { font-size: 18px; line-height: 1; }
.nx-btn-ghost { background: transparent; color: var(--nx-text); border: 1px solid rgba(255,255,255,.25); }
.nx-btn-ghost:hover { border-color: var(--nx-lime); color: var(--nx-lime); background: rgba(216,255,88,.05); }
.nx-stats { display: flex; gap: 0; margin-top: 46px; }
.nx-stats > div { min-width: 116px; padding: 0 24px; border-left: 1px solid rgba(255,255,255,.14); }
.nx-stats > div:first-child { padding-left: 0; border-left: 0; }
.nx-stats b { display: block; font-family: var(--nx-serif); font-size: 28px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; color: var(--nx-text); }
.nx-stats span { display: block; margin-top: 5px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: #6f7887; }

/* hero art */
.nx-hero-art { position: relative; min-height: 470px; display: flex; align-items: center; justify-content: center; }
.nx-orbit { position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; pointer-events: none; }
.nx-orbit-a { width: 530px; height: 530px; animation: nxSpin 34s linear infinite; border-style: dashed; }
.nx-orbit-b { width: 390px; height: 390px; animation: nxSpin 26s linear infinite reverse; border-color: rgba(216,255,88,.14); }
.nx-terminal {
  position: relative; z-index: 2; width: min(100%, 410px); border-radius: 22px;
  background: linear-gradient(145deg, rgba(18,23,31,.94), rgba(9,12,18,.97));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 40px 100px -42px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.4);
  transform: rotate(-2.2deg);
}
.nx-terminal::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(127,231,255,.08), transparent 35%, rgba(216,255,88,.06));
}
.nx-terminal-head, .nx-terminal-foot {
  display: flex; justify-content: space-between; gap: 10px; padding: 13px 17px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: #778290;
}
.nx-terminal-head { border-bottom: 1px solid rgba(255,255,255,.09); }
.nx-terminal-head span:first-child { display: inline-flex; align-items: center; gap: 7px; color: #b9c2ce; }
.nx-terminal-head i { width: 6px; height: 6px; border-radius: 50%; background: var(--nx-coral); box-shadow: 0 0 10px var(--nx-coral); }
.nx-terminal-foot { border-top: 1px solid rgba(255,255,255,.09); }
.nx-terminal .paper-preview { background: transparent; border: 0; box-shadow: none; padding: 17px 19px 20px; color: var(--nx-text); }
.nx-terminal .paper-preview-head { color: #818b99; }
.nx-terminal .preview-q { color: #d6dbe2; }
.nx-terminal .preview-code { background: #05070a; border: 1px solid rgba(255,255,255,.1); color: #c8f3da; }
.nx-terminal .preview-code .k { color: var(--nx-lime); }
.nx-terminal .preview-opt { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.12); color: #aeb8c5; }
.nx-terminal .preview-opt.good { color: #11140b; background: var(--nx-lime); border-color: var(--nx-lime); }
.nx-float {
  position: absolute; z-index: 3; border: 1px solid rgba(255,255,255,.17);
  background: rgba(13,17,24,.84); backdrop-filter: blur(12px); border-radius: 13px;
  padding: 10px 13px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: #7f8998;
  box-shadow: 0 16px 30px -22px rgba(0,0,0,.8);
}
.nx-float b { display: block; color: var(--nx-lime); font-family: var(--font); font-size: 14px; letter-spacing: 0; margin-bottom: 2px; }
.nx-float-a { top: 34px; right: -4px; animation: nxFloat 6s ease-in-out infinite; }
.nx-float-b { bottom: 56px; left: -12px; animation: nxFloat 7s ease-in-out infinite reverse; }
.nx-float-b b { color: var(--nx-cyan); }
.nx-float-c { right: 12px; bottom: 2px; font-family: var(--nx-serif); font-size: 17px; line-height: 1.05; color: #8992a0; transform: rotate(4deg); }
.nx-float-c b { color: var(--nx-text); font-family: var(--nx-serif); font-size: 26px; font-weight: 500; letter-spacing: -.04em; }

/* marquee */
.nx-marquee { border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); overflow: hidden; }
.nx-marquee-track {
  display: flex; align-items: center; gap: 26px; width: max-content; padding: 15px 0;
  animation: nxMarquee 32s linear infinite;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: #8d97a6;
}
.nx-marquee-track i { color: var(--nx-coral); font-style: normal; }
.nx-marquee-track span:nth-child(5n+1) { color: var(--nx-lime); }

/* ---------- bento ---------- */
.nx-section { padding: 82px 0; }
.nx-bento-section { border-bottom: 1px solid rgba(255,255,255,.09); background: #080a0f; }
.nx-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.nx-overline { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--nx-lime); margin-bottom: 13px; }
.nx-section-head h2 { margin: 0; font-family: var(--nx-serif); font-size: clamp(36px, 4.5vw, 58px); line-height: .95; letter-spacing: -.06em; font-weight: 500; }
.nx-section-head > p { max-width: 290px; margin: 0 0 4px; color: #7f8998; font-size: 13px; line-height: 1.8; }
.nx-bento { display: grid; grid-template-columns: repeat(12, minmax(0,1fr)); gap: 13px; }
.nx-subject {
  position: relative; grid-column: span 4; min-height: 292px; padding: 20px;
  border-radius: 23px; display: flex; flex-direction: column; overflow: hidden;
  color: #0a0d0b; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
}
.nx-subject:hover { transform: translateY(-7px); box-shadow: 0 26px 50px -30px rgba(0,0,0,.8); }
.nx-subject-cpp { background: var(--nx-lime); }
.nx-subject-math { background: #f0a58c; }
.nx-subject-english { background: #a9def1; }
.nx-subject-top { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; color: rgba(10,13,11,.56); }
.nx-index { font-size: 11px; color: rgba(10,13,11,.75); }
.nx-label { flex: 1; }
.nx-arrow { font-family: var(--sans); font-size: 19px; line-height: 1; color: rgba(10,13,11,.8); }
.nx-subject-body { display: flex; align-items: flex-start; gap: 16px; margin-top: auto; padding-top: 26px; }
.nx-subject-mark { flex: none; width: 58px; height: 58px; border-radius: 15px; border: 1px solid rgba(10,13,11,.22); display: flex; align-items: center; justify-content: center; font-family: var(--nx-serif); font-weight: 700; font-size: 19px; letter-spacing: -.06em; background: rgba(255,255,255,.18); }
.nx-subject h3 { margin: 0 0 7px; font-family: var(--nx-serif); font-size: 24px; line-height: 1; letter-spacing: -.05em; font-weight: 600; }
.nx-subject p { margin: 0; max-width: 180px; font-size: 12px; line-height: 1.7; color: rgba(10,13,11,.62); }
.nx-subject-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 24px; border-top: 1px solid rgba(10,13,11,.16); padding-top: 12px; }
.nx-subject-foot b { display: block; font-family: var(--nx-serif); font-size: 26px; line-height: 1; letter-spacing: -.05em; font-weight: 500; }
.nx-subject-foot span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: rgba(10,13,11,.55); }
.nx-bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; opacity: .55; }
.nx-bars i { width: 3px; display: block; background: #0a0d0b; }
.nx-bars i:nth-child(1) { height: 30%; } .nx-bars i:nth-child(2) { height: 52%; } .nx-bars i:nth-child(3) { height: 38%; } .nx-bars i:nth-child(4) { height: 78%; } .nx-bars i:nth-child(5) { height: 100%; }
.nx-mini-card {
  grid-column: span 4; min-height: 170px; padding: 20px; border-radius: 21px;
  border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.025);
  display: flex; flex-direction: column; color: var(--nx-text);
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.nx-mini-card:hover { border-color: rgba(216,255,88,.55); background: rgba(216,255,88,.055); transform: translateY(-4px); }
.nx-mini-card b { font-family: var(--nx-serif); font-size: 24px; line-height: 1.1; letter-spacing: -.04em; font-weight: 500; }
.nx-mini-card p { margin: 9px 0 0; color: #7d8796; font-size: 12px; line-height: 1.7; max-width: 260px; }
.nx-mini-arrow { margin-top: auto; padding-top: 16px; font-family: var(--mono); font-size: 10px; letter-spacing: .07em; color: var(--nx-lime); }
.nx-mini-wrong b { color: var(--nx-coral); }
.nx-mini-ladder b { color: var(--nx-cyan); }

/* manifesto */
.nx-manifesto { padding: 105px 0 115px; background: #07090d; }
.nx-manifesto-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: end; }
.nx-manifesto h2 { margin: 0; font-family: var(--nx-serif); font-size: clamp(56px, 7vw, 104px); line-height: .82; letter-spacing: -.08em; font-weight: 500; }
.nx-manifesto h2 em { font-style: italic; color: transparent; -webkit-text-stroke: 1px rgba(244,245,239,.7); }
.nx-manifesto-copy { max-width: 430px; padding-bottom: 7px; }
.nx-manifesto-copy p { margin: 0; color: #949daa; font-size: 15px; line-height: 1.9; }
.nx-text-link { display: inline-flex; gap: 12px; margin-top: 25px; color: var(--nx-lime); font-size: 13px; font-weight: 600; border-bottom: 1px solid rgba(216,255,88,.4); padding-bottom: 3px; }
.nx-text-link span { transition: transform .2s ease; }
.nx-text-link:hover span { transform: translateX(5px); }
.nx-manifesto-note { margin-top: 42px; font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: #4f5866; }

/* ---------- light workspace refinements ---------- */
.page-head h1 { font-family: var(--nx-serif); letter-spacing: -.055em; font-weight: 600; }
.panel { border-radius: 18px; box-shadow: 0 22px 50px -40px rgba(27,36,52,.35); }
.question-card { border-radius: 22px; box-shadow: 0 30px 70px -55px rgba(27,36,52,.5); }
.quiz-top { background: rgba(242,238,227,.88); backdrop-filter: blur(12px); }
.btn-primary { background: #10141b; }
.btn-primary:hover:not(:disabled) { background: #000; }
.btn-accent { background: #151a24; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .nx-hero-grid { grid-template-columns: 1fr; gap: 26px; padding-top: 28px; }
  .nx-hero-art { min-height: 420px; transform: scale(.94); }
  .nx-bento { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .nx-subject { grid-column: span 3; }
  .nx-mini-card { grid-column: span 3; }
  .nx-manifesto-inner { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 680px) {
  .topbar-inner { height: 62px; overflow: hidden; }
  .brand-name { font-size: 14px; }
  .nav { overflow-x: auto; margin-left: 6px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 8px 9px; font-size: 12px; white-space: nowrap; }
  .nx-home .container { width: min(100% - 28px, 1200px); }
  .nx-hero { padding-top: 30px; }
  .nx-rail { margin-bottom: 25px; }
  .nx-rail-meta { display: none; }
  .nx-display { font-size: clamp(58px, 17vw, 90px); }
  .nx-lead { font-size: 14px; }
  .nx-stats > div { min-width: 0; flex: 1; padding: 0 12px; }
  .nx-stats b { font-size: 22px; }
  .nx-stats span { font-size: 8.5px; }
  .nx-hero-art { min-height: 380px; transform: none; margin: 0 -10px; }
  .nx-terminal { transform: rotate(-1.2deg); }
  .nx-float-a { right: 0; top: 0; }
  .nx-float-b { left: 0; bottom: 20px; }
  .nx-float-c { display: none; }
  .nx-section { padding: 55px 0; }
  .nx-section-head { display: block; }
  .nx-section-head > p { margin-top: 14px; }
  .nx-bento { grid-template-columns: 1fr; }
  .nx-subject, .nx-mini-card { grid-column: 1; }
  .nx-subject { min-height: 250px; }
  .nx-manifesto { padding: 70px 0 80px; }
  .nx-manifesto h2 { font-size: clamp(50px, 15vw, 76px); }
}

@keyframes nxPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes nxSpin { to { transform: rotate(360deg); } }
@keyframes nxFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes nxMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .nx-orbit, .nx-float, .nx-status i, .nx-marquee-track { animation: none !important; }
}
/* ---------- inner-page editorial band ---------- */
body { overflow-x: hidden; }
.page-head {
  position: relative; margin-top: 24px; padding: 34px 38px 38px;
  border-radius: 26px; overflow: hidden; color: var(--nx-text);
  background:
    radial-gradient(620px 250px at 88% 0%, rgba(216,255,88,.13), transparent 70%),
    linear-gradient(135deg, #0b0e14, #10151d);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 30px 70px -55px rgba(0,0,0,.75);
}
.page-head::after {
  content: ""; position: absolute; right: -40px; bottom: -70px; width: 220px; height: 220px;
  border: 1px solid rgba(216,255,88,.25); border-radius: 50%; pointer-events: none;
}
.page-head .eyebrow { color: var(--nx-lime); border-color: rgba(216,255,88,.3); background: rgba(216,255,88,.07); }
.page-head h1 { position: relative; z-index: 1; color: var(--nx-text); font-size: clamp(34px, 5vw, 58px); line-height: 1; margin: 14px 0 12px; }
.page-head p { position: relative; z-index: 1; color: #a5afbd; max-width: 680px; margin: 0; font-size: 14px; line-height: 1.8; }
.panel {
  background: #fbf8ef; border-color: #d9d2c3;
  box-shadow: 0 2px 0 rgba(160,150,130,.22), 0 28px 60px -52px rgba(25,31,43,.55);
}
.question-card, .result-hero, .result-card { background: #fbf8ef; border-color: #d9d2c3; }
.opt, .fill-input, .eng-option, .eng-writing, .eng-select { background: #fffdf7; border-color: #d9d2c3; }
.opt:hover { border-color: #11151c; }
.chip { background: #fbf8ef; border-color: #d9d2c3; }
.chip:hover { border-color: #11151c; }
.chip.on { background: #10141b; border-color: #10141b; color: var(--nx-lime); }
.section-head h2 { font-family: var(--nx-serif); letter-spacing: -.04em; }
.page-head + .panel, .page-head + .grid-3, .page-head + .contribute-grid { margin-top: 18px; }
.quiz-top { background: rgba(242,238,227,.94); border-bottom-color: #d9d2c3; }
.quiz-timer, .progress-track { border-color: #d9d2c3; }
@media (max-width: 680px) {
  .page-head { margin-top: 14px; padding: 26px 22px 28px; border-radius: 20px; }
  .page-head h1 { font-size: 38px; }
}
/* auth: dark editorial card */
.auth-page { padding: 26px 0 50px; }
.auth-card {
  background: #0b0e14; color: var(--nx-text); border-color: rgba(255,255,255,.14);
  box-shadow: 0 40px 90px -60px rgba(0,0,0,.85);
}
.auth-card h1 { color: var(--nx-text); font-family: var(--nx-serif); font-size: 38px; letter-spacing: -.06em; }
.auth-card .sub { color: #8e98a6; }
.auth-card .field label { color: #c7ced8; }
.auth-card .input { background: #fffdf7; color: #10141b; border-color: #3a414c; }
.auth-card .input::placeholder { color: #8c94a1; }
.auth-card .auth-alt { color: #8e98a6; }
.auth-card .auth-alt a { color: var(--nx-lime); }
.auth-card .btn-primary { background: var(--nx-lime); color: #0b0e14; }
.auth-card .form-error { background: rgba(255,107,74,.14); color: #ffb4a4; border-color: rgba(255,107,74,.3); }
.auth-card .form-ok { background: rgba(216,255,88,.1); color: var(--nx-lime); }
@media (max-width: 860px) { .auth-page { padding: 12px 0 30px; } .auth-card { padding: 26px 22px; } }
/* AI panel: dark glass */
.ai-panel { background: #0b0e14; color: var(--nx-text); border-left-color: rgba(255,255,255,.12); box-shadow: -30px 0 80px -40px rgba(0,0,0,.9); }
.ai-head, .ai-form { border-color: rgba(255,255,255,.1); }
.ai-title { color: var(--nx-text); }
.ai-sub { color: #7f8998; }
.ai-messages { background: #080a0f; }
.ai-msg-bot { background: #11161f; border-color: rgba(255,255,255,.1); color: #d9dee6; }
.ai-msg-user { background: var(--nx-lime); color: #0b0e14; }
.ai-form textarea { background: #11161f; color: var(--nx-text); border-color: rgba(255,255,255,.14); }
.ai-form textarea::placeholder { color: #697383; }
.ai-form .btn-primary { background: var(--nx-lime); color: #0b0e14; }
.ai-context-hint, .ai-config-link { color: #7f8998; }
/* ---------- cosmic depth layer ---------- */
.nx-hero {
  background:
    radial-gradient(1200px 680px at 72% 18%, rgba(20,38,52,.55), transparent 70%),
    radial-gradient(900px 520px at 15% 8%, rgba(31,24,40,.48), transparent 72%),
    #05070c;
}
.nx-cosmos-canvas {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: .95;
}
.nx-aurora { z-index: 1; opacity: .9; }
.nx-grid { z-index: 1; opacity: .26; }
.nx-hero-copy, .nx-hero-art { z-index: 2; }
.nx-hud {
  position: absolute; top: 29px; z-index: 3; font-family: var(--mono);
  font-size: 8.5px; line-height: 1.7; letter-spacing: .14em; color: #566172;
}
.nx-hud b { color: var(--nx-cyan); font-weight: 500; }
.nx-hud-left { left: 24px; }
.nx-hud-right { right: 24px; text-align: right; }
.nx-planet {
  position: absolute; z-index: 1; width: 300px; height: 300px; right: -70px; bottom: -100px;
  border-radius: 50%; opacity: .62; pointer-events: none;
  background:
    radial-gradient(circle at 32% 27%, rgba(180,238,255,.45), rgba(31,66,87,.4) 26%, rgba(6,13,22,.96) 68%),
    #060b13;
  box-shadow: inset -36px -28px 70px rgba(0,0,0,.95), 0 0 90px rgba(127,231,255,.12);
}
.nx-planet i {
  position: absolute; left: -55px; top: 42%; width: 410px; height: 120px;
  border: 1px solid rgba(216,255,88,.28); border-left-color: transparent; border-right-color: transparent;
  border-radius: 50%; transform: rotate(-20deg); filter: blur(.2px);
}
.nx-planet b {
  position: absolute; left: -36px; top: 47%; width: 372px; height: 80px; border-radius: 50%;
  border: 1px solid rgba(127,231,255,.12); transform: rotate(-20deg);
}
.nx-hero-art::after {
  content: ""; position: absolute; inset: 9% 4%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(216,255,88,.06), transparent 62%);
  filter: blur(26px);
}
.nx-terminal {
  background: linear-gradient(145deg, rgba(20,27,38,.62), rgba(7,10,16,.72));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 40px 120px -45px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.1), 0 0 0 1px rgba(0,0,0,.45);
}
.nx-float {
  background: rgba(10,14,21,.52);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-color: rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 20px 40px -26px rgba(0,0,0,.9);
}
.nx-mini-card {
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.018));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.nx-subject { box-shadow: inset 0 1px 0 rgba(255,255,255,.34), inset 0 -20px 40px rgba(0,0,0,.05); }
.nx-subject::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.26), transparent 32%, transparent 70%, rgba(255,255,255,.1));
  mix-blend-mode: soft-light;
}
.page-head {
  background:
    radial-gradient(620px 250px at 88% 0%, rgba(216,255,88,.14), transparent 70%),
    radial-gradient(480px 240px at 12% 100%, rgba(127,231,255,.1), transparent 70%),
    linear-gradient(135deg, #0b0e14, #10151d);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.page-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 64% 20%, rgba(216,255,88,.9), transparent 60%),
    radial-gradient(1px 1px at 82% 62%, rgba(127,231,255,.8), transparent 60%),
    radial-gradient(1.4px 1.4px at 38% 76%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 54% 50%, rgba(255,255,255,.55), transparent 60%);
}
.auth-card {
  background: rgba(9,12,18,.74);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 40px 100px -50px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.1);
}
.ai-panel {
  background: rgba(8,11,17,.82);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}
@media (max-width: 980px) {
  .nx-hud { display: none; }
  .nx-planet { width: 230px; height: 230px; right: -80px; bottom: -80px; }
  .nx-planet i { width: 310px; left: -40px; }
  .nx-planet b { width: 280px; left: -25px; }
}
/* extra nebula + deep-field dust */
.nx-aurora {
  background:
    radial-gradient(720px 460px at 68% 30%, rgba(89,74,160,.22), transparent 68%),
    radial-gradient(600px 420px at 72% 28%, rgba(216,255,88,.12), transparent 68%),
    radial-gradient(620px 440px at 10% 12%, rgba(127,231,255,.15), transparent 70%),
    radial-gradient(520px 360px at 82% 88%, rgba(255,107,74,.10), transparent 70%);
  filter: blur(26px);
}
.nx-bento-section, .nx-manifesto {
  background-image:
    radial-gradient(1px 1px at 12% 24%, rgba(255,255,255,.65), transparent 60%),
    radial-gradient(1px 1px at 72% 16%, rgba(216,255,88,.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 43% 70%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1px 1px at 88% 54%, rgba(127,231,255,.55), transparent 60%),
    radial-gradient(1px 1px at 26% 82%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(1px 1px at 61% 42%, rgba(255,255,255,.4), transparent 60%);
  background-repeat: repeat;
  background-size: 520px 330px;
}
.nx-manifesto { background-color: #07090d; }
/* ---------- 3D hero layer ---------- */
.nx-hero3d {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0; transition: opacity .8s ease;
  filter: saturate(1.12);
}
.nx-hero-art.has-3d .nx-hero3d { opacity: 1; }
.nx-hero-art.has-3d .nx-planet,
.nx-hero-art.has-3d .nx-orbit { opacity: 0; visibility: hidden; }
.nx-hero-art .nx-terminal,
.nx-hero-art .nx-float { position: relative; z-index: 2; }
.nx-hero-art .nx-float { position: absolute; }
.nx-hero-art.has-3d::before {
  content: ""; position: absolute; inset: 12% 2% 4% 8%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 58% 48%, rgba(127,231,255,.16), transparent 56%);
  filter: blur(30px);
}
.nx-subject {
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease;
}
.nx-subject:hover {
  transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(-7px);
}
@media (max-width: 900px) {
  .nx-hero3d { display: none; }
  .nx-hero-art.has-3d .nx-planet { opacity: .62; visibility: visible; }
}
/* deeper glass over the 3D scene */
.nx-hero-art.has-3d .nx-terminal {
  background: linear-gradient(145deg, rgba(18,26,38,.48), rgba(6,10,16,.6));
  border-color: rgba(180,233,255,.2);
}
/* let the 3D planet breathe outside the right column without moving the terminal */
.nx-hero3d { left: 0; right: -118px; width: auto; }
@media (max-width: 1100px) { .nx-hero3d { right: -46px; } }
/* ========== glass subject cards ========== */
.nx-subject{
  --subject-accent:#d8ff58;
  --mx:50%; --my:0%;
  color:var(--nx-text);
  background:
    linear-gradient(145deg,
      color-mix(in srgb, var(--subject-accent) 13%, rgba(255,255,255,.055)),
      rgba(8,12,18,.52) 58%,
      rgba(8,12,18,.64));
  border:1px solid color-mix(in srgb, var(--subject-accent) 28%, rgba(255,255,255,.18));
  backdrop-filter:blur(24px) saturate(150%);
  -webkit-backdrop-filter:blur(24px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -24px 50px rgba(0,0,0,.2),
    0 34px 70px -44px rgba(0,0,0,.9);
  isolation:isolate;
}
.nx-subject-cpp{--subject-accent:#d8ff58}
.nx-subject-math{--subject-accent:#ff8b6e}
.nx-subject-english{--subject-accent:#8fdcff}
.nx-subject::before{
  content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;
  background:radial-gradient(360px circle at var(--mx) var(--my),
    color-mix(in srgb, var(--subject-accent) 24%, transparent), transparent 64%);
  opacity:.9;transition:opacity .35s ease;
}
.nx-subject::after{
  content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;
  background:linear-gradient(115deg,rgba(255,255,255,.16),transparent 28%,transparent 72%,rgba(255,255,255,.06));
  mix-blend-mode:screen;opacity:.55;
}
.nx-subject:hover{
  border-color:color-mix(in srgb, var(--subject-accent) 58%, rgba(255,255,255,.3));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.38),
    inset 0 -24px 50px rgba(0,0,0,.16),
    0 38px 90px -38px color-mix(in srgb, var(--subject-accent) 22%, transparent);
}
.nx-subject-top{color:rgba(244,245,239,.56)}
.nx-index{color:rgba(244,245,239,.85)}
.nx-arrow{color:rgba(244,245,239,.8)}
.nx-subject h3{color:var(--nx-text)}
.nx-subject p{color:rgba(244,245,239,.64)}
.nx-subject-mark{
  color:var(--subject-accent);
  background:color-mix(in srgb, var(--subject-accent) 10%, rgba(255,255,255,.045));
  border-color:color-mix(in srgb, var(--subject-accent) 34%, rgba(255,255,255,.18));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), 0 0 30px -12px var(--subject-accent);
}
.nx-subject-foot{border-top-color:rgba(255,255,255,.16)}
.nx-subject-foot b{color:var(--nx-text)}
.nx-subject-foot span{color:rgba(244,245,239,.55)}
.nx-bars i{background:var(--subject-accent);opacity:.85}
.nx-subject.ready:hover{transform:perspective(900px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg)) translateY(-7px)}

/* moving glass highlight */
@keyframes glassDrift{
  0%,100%{transform:translate3d(-2%,0,0) scale(1)}
  50%{transform:translate3d(2%,-1%,0) scale(1.04)}
}
.nx-subject::after{animation:glassDrift 9s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.nx-subject::after{animation:none}}