/* =========================================================
   知高点 · 高中全科复习系统
   Design tokens / layout / components
   ========================================================= */

:root {
  --bg: #f4f6fb;
  --bg-grad-1: #e9efff;
  --bg-grad-2: #fdf3e8;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --ink: #101725;
  --ink-2: #2d3648;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e5e9f2;
  --line-strong: #d6dce9;
  --brand: #2f5dff;
  --brand-ink: #1d43cc;
  --brand-soft: #eaf0ff;
  --ok: #0f9d6a;
  --ok-soft: #e6f7f0;
  --warn: #d97706;
  --warn-soft: #fef3e2;
  --danger: #d64545;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 2px 6px rgba(16, 24, 40, .05), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 14px 34px -14px rgba(16, 24, 40, .22), 0 4px 10px -4px rgba(16, 24, 40, .08);
  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --header-h: 64px;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0c1017;
  --bg-grad-1: #14203a;
  --bg-grad-2: #231a12;
  --panel: #141a24;
  --panel-soft: #171e29;
  --ink: #eef3fb;
  --ink-2: #c8d2e2;
  --muted: #93a0b4;
  --faint: #6d7b90;
  --line: #222c3a;
  --line-strong: #2e3a4c;
  --brand: #6a8bff;
  --brand-ink: #a9bcff;
  --brand-soft: #1b2540;
  --ok: #3ecf9a;
  --ok-soft: #12291f;
  --warn: #f0b35b;
  --warn-soft: #2a2114;
  --danger: #ff7b7b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-md: 0 18px 40px -16px rgba(0, 0, 0, .65), 0 4px 12px -4px rgba(0, 0, 0, .4);
  --bg-grad-1: #16213a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 12% -8%, var(--bg-grad-1), transparent 62%),
    radial-gradient(680px 420px at 92% 2%, var(--bg-grad-2), transparent 60%);
  opacity: .9;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

::selection { background: var(--brand); color: #fff; }

.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #8b5cf6, #f59e0b);
  z-index: 90;
  transition: width .12s linear;
}

/* ------------------------------ header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), #7a5cff);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0;
  box-shadow: 0 6px 16px -8px rgba(47, 93, 255, .9);
  font-family: "Songti SC", "STSong", serif;
}

.brand-mark.small { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16.5px; letter-spacing: .5px; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 1.2px; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.main-nav a {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--muted);
  transition: .18s ease;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--ink); background: var(--panel); }
.main-nav a.active { color: var(--brand-ink); background: var(--brand-soft); font-weight: 600; }

.search-mini {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 12px;
  min-width: 220px;
  flex: 0 1 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: .18s ease;
}
.search-mini:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.search-mini svg { width: 16px; height: 16px; color: var(--faint); flex-shrink: 0; }
.search-mini input {
  border: 0; outline: 0; background: transparent;
  width: 100%; font-size: 13px;
}
.search-mini input::placeholder { color: var(--faint); }
.search-mini kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  line-height: 1.4;
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-size: 16px;
  transition: .18s ease;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.logout-btn { color: var(--muted); }
.logout-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); }
.logout-btn svg { width: 16px; height: 16px; }
body.auth-locked, body.modal-open { overflow: hidden; }

/* ------------------------------ layout ------------------------------ */
main { display: block; outline: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.page { padding: 34px 0 80px; }

/* ------------------------------ hero ------------------------------ */
.hero {
  position: relative;
  padding: 58px 0 26px;
  overflow: hidden;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--brand-ink);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.18;
  letter-spacing: -1px;
  font-weight: 800;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--brand) 10%, #7a5cff 55%, #e0699b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  transition: .2s ease;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: linear-gradient(145deg, var(--brand), #4b46e8);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(47, 93, 255, .8);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(47, 93, 255, .9); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 52px;
  align-items: center;
}
.hero-visual {
  position: relative;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), var(--panel));
  box-shadow: var(--shadow-md);
  padding: 18px;
  transform: rotate(.6deg);
}
.hv-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 14px; }
.hv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.hv-title { margin-left: 6px; font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .5px; }
.hv-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
  padding: 16px;
  margin-bottom: 10px;
}
.hv-card:last-child { margin-bottom: 0; }
.hv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.hv-kicker { font-size: 11px; color: var(--faint); letter-spacing: 1px; }
.hv-chip { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.hv-formula { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.hv-formula em { font-style: normal; color: var(--brand); font-weight: 600; }
.hv-bars { display: flex; align-items: flex-end; gap: 6px; height: 42px; margin-top: 10px; }
.hv-bars i { display: block; flex: 1; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 55%, transparent), color-mix(in srgb, var(--brand) 12%, transparent)); }
.hv-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--faint); padding: 10px 4px 0; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 54px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.stat {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  padding: 20px 22px;
}
.stat b { display: block; font-size: 27px; letter-spacing: -.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat b .unit { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* ------------------------------ sections ------------------------------ */
.section { padding: 46px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head h2 { margin: 0 0 4px; font-size: 23px; letter-spacing: -.3px; }
.section-head p { margin: 0; font-size: 13.5px; color: var(--muted); }
.section-head .more { font-size: 13px; color: var(--brand-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.section-head .more:hover { gap: 8px; }

/* ------------------------------ subject cards ------------------------------ */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.subject-card {
  position: relative;
  display: block;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.subject-card::after {
  content: attr(data-char);
  position: absolute;
  right: -6px;
  bottom: -34px;
  font-size: 116px;
  line-height: 1;
  font-weight: 700;
  font-family: "Songti SC", "STSong", serif;
  color: var(--sc);
  opacity: .07;
  pointer-events: none;
  transition: .28s ease;
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--sc) 38%, var(--line)); }
.subject-card:hover::after { transform: scale(1.06) rotate(-4deg); opacity: .11; }

.sc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sc-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 21px;
  font-weight: 700;
  font-family: "Songti SC", "STSong", serif;
  color: var(--sc);
  background: color-mix(in srgb, var(--sc) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--sc) 16%, transparent);
}
.sc-name { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.sc-en { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--faint); }
.sc-arrow { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--muted); transition: .22s ease; }
.subject-card:hover .sc-arrow { background: var(--sc); border-color: var(--sc); color: #fff; transform: rotate(-45deg); }
.sc-arrow svg { width: 14px; height: 14px; }

.sc-desc { font-size: 13px; color: var(--muted); line-height: 1.7; min-height: 44px; margin: 0 0 16px; }
.sc-meta { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--faint); margin-bottom: 10px; }
.sc-meta b { color: var(--ink-2); font-weight: 600; }
.sc-progress { height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.sc-progress i { display: block; height: 100%; border-radius: 99px; background: var(--sc); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.sc-progress-label { margin-top: 7px; font-size: 11px; color: var(--faint); display: flex; justify-content: space-between; }

/* ------------------------------ filter chips ------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 32px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
  transition: .18s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 600; }
[data-theme="dark"] .chip.active { background: var(--ink); color: #0c1017; }
.chip .count { font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }

/* ------------------------------ subject page ------------------------------ */
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--faint); margin-bottom: 22px; flex-wrap: wrap; }
.crumb a:hover { color: var(--brand-ink); }
.crumb .sep { opacity: .5; }
.crumb .here { color: var(--muted); }

.subject-hero {
  position: relative;
  border-radius: 26px;
  padding: 34px 36px;
  margin-bottom: 28px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--sc) 20%, var(--line));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--sc) 9%, var(--panel)) 0%, var(--panel) 62%);
}
.subject-hero::before {
  content: attr(data-char);
  position: absolute;
  right: 24px;
  top: -40px;
  font-size: 190px;
  line-height: 1;
  font-family: "Songti SC", "STSong", serif;
  color: var(--sc);
  opacity: .08;
  pointer-events: none;
}
.sh-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; position: relative; }
.sh-icon {
  width: 62px; height: 62px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px; font-weight: 700;
  color: #fff;
  background: linear-gradient(150deg, var(--sc), color-mix(in srgb, var(--sc) 62%, #000 6%));
  box-shadow: 0 12px 24px -12px var(--sc);
}
.sh-title { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.5px; line-height: 1.25; }
.sh-en { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.sh-desc { position: relative; max-width: 640px; color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.sh-stats { position: relative; display: flex; flex-wrap: wrap; gap: 26px; align-items: center; }
.sh-stat b { font-size: 21px; letter-spacing: -.3px; }
.sh-stat span { font-size: 11.5px; color: var(--faint); margin-left: 4px; }
.sh-progress { flex: 1; min-width: 200px; max-width: 320px; }
.sh-progress .bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--sc) 14%, var(--line)); overflow: hidden; }
.sh-progress .bar i { display: block; height: 100%; background: var(--sc); border-radius: 99px; }
.sh-progress small { display: block; font-size: 11px; color: var(--faint); margin-top: 6px; }

.toolbar {
  position: sticky;
  top: calc(var(--header-h) + 1px);
  z-index: 30;
  display: grid;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tb-label {
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--faint);
  flex-shrink: 0;
  padding-right: 2px;
}
.tb-divider { width: 1px; height: 18px; background: var(--line); flex-shrink: 0; margin: 0 2px; }
.mod-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: 100%;
}
.mod-select select {
  height: 32px;
  max-width: 250px;
  padding: 0 30px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis;
  transition: .18s ease;
}
.mod-select select:hover { border-color: var(--line-strong); }
.mod-select select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.mod-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.module-block { scroll-margin-top: 130px; padding-top: 26px; }
.module-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.module-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 7px;
  background: var(--panel);
}
.module-head h3 { margin: 0; font-size: 18px; letter-spacing: -.2px; }
.module-head .line { flex: 1; height: 1px; background: var(--line); }
.module-head .cnt { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

.point-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.point-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 17px 18px 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: .2s ease;
}
.point-card:hover { border-color: color-mix(in srgb, var(--sc) 45%, var(--line)); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.point-card .pc-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.point-card h4 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .1px; line-height: 1.5; }
.point-card h4 a::after { content: ""; position: absolute; inset: 0; }
.point-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; font-size: 11px; color: var(--faint); }
.pc-foot .go { display: inline-flex; align-items: center; gap: 4px; color: var(--sc); font-weight: 600; opacity: 0; transform: translateX(-4px); transition: .2s ease; }
.point-card:hover .pc-foot .go { opacity: 1; transform: none; }

.tag {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 7px;
  border-radius: 5px;
  white-space: nowrap;
}
.tag-freq-必考 { background: var(--warn-soft); color: var(--warn); }
.tag-freq-高频 { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand-ink); }
.tag-freq-常考 { background: var(--panel-soft); color: var(--muted); border: 1px solid var(--line); }
.tag-freq-了解 { background: transparent; color: var(--faint); border: 1px solid var(--line); }
.tag-lv { border: 1px solid var(--line); color: var(--faint); background: transparent; font-weight: 500; }
.tag-lv-base { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.tag-lv-mid { color: var(--brand-ink); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 18%, transparent); }
.tag-lv-hard { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }

.master-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid; place-items: center;
  background: var(--panel);
  flex-shrink: 0;
  transition: .18s ease;
  padding: 0;
}
.master-dot svg { width: 11px; height: 11px; opacity: 0; stroke-width: 2.6; color: #fff; }
.master-dot:hover { border-color: var(--ok); }
.master-dot.on { background: var(--ok); border-color: var(--ok); }
.master-dot.on svg { opacity: 1; }
.point-card .fav-dot {
  position: absolute;
  top: 14px;
  right: 42px;
  z-index: 2;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
}
.point-card .fav-dot.on {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
  background: var(--warn-soft);
}
.point-card .pc-check { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* ------------------------------ detail ------------------------------ */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 34px; align-items: start; }

.article {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: 38px 40px 34px;
  box-shadow: var(--shadow-xs);
}
.article-head { padding-bottom: 24px; border-bottom: 1px dashed var(--line); margin-bottom: 26px; }
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.article h1 { margin: 0 0 12px; font-size: clamp(25px, 3.2vw, 34px); letter-spacing: -.6px; line-height: 1.3; }
.article-lead { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.85; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; font-size: 12px; color: var(--faint); }
.article-meta span { display: inline-flex; align-items: center; gap: 5px; }
.article-meta svg { width: 13px; height: 13px; }

.article h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  margin: 30px 0 14px;
  letter-spacing: .2px;
}
.article h2::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--sc, var(--brand));
}
.article h2:first-of-type { margin-top: 0; }

.key-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.key-list li {
  position: relative;
  padding: 11px 14px 11px 38px;
  border-radius: 11px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 13.8px;
  color: var(--ink-2);
  line-height: 1.75;
}
.key-list li::before {
  content: attr(data-i);
  position: absolute;
  left: 13px;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--sc, var(--brand));
  font-weight: 700;
}

.formula-box { display: grid; gap: 8px; }
.formula-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--sc, var(--brand)) 18%, var(--line));
  background: color-mix(in srgb, var(--sc, var(--brand)) 5%, var(--panel));
}
.formula-row dt { font-size: 12px; color: var(--muted); font-weight: 500; }
.formula-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13.2px;
  color: var(--ink);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.tip-box {
  display: flex;
  gap: 12px;
  padding: 15px 17px;
  border-radius: 13px;
  border: 1px solid color-mix(in srgb, var(--warn) 26%, var(--line));
  background: var(--warn-soft);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink-2);
}
.tip-box .ti { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.tip-box b { color: var(--warn); margin-right: 4px; }

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
.btn-sm { height: 38px; padding: 0 15px; font-size: 13px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok.on { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
[data-theme="dark"] .btn-ok:not(.on) { color: #06231a; }
.btn-fav-on { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, var(--line)); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.pager a {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  transition: .18s ease;
  min-width: 0;
}
.pager a:hover { border-color: var(--line-strong); background: var(--panel-soft); }
.pager a.next { text-align: right; align-items: flex-end; }
.pager small { font-size: 10.5px; color: var(--faint); letter-spacing: 1px; }
.pager span { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pager a.disabled { opacity: .4; pointer-events: none; }

.aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 16px; }
.aside-card { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); padding: 20px; }
.aside-card h3 { margin: 0 0 14px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.aside-card h3 svg { width: 15px; height: 15px; color: var(--muted); }
.aside-list { display: grid; gap: 2px; margin: 0 -8px; }
.aside-list a { display: flex; gap: 9px; align-items: baseline; padding: 8px; border-radius: 8px; font-size: 12.8px; color: var(--muted); line-height: 1.5; transition: .15s ease; }
.aside-list a:hover { background: var(--panel-soft); color: var(--ink); }
.aside-list a .n { font-family: var(--font-mono); font-size: 10px; color: var(--faint); flex-shrink: 0; }
.aside-list a.current { background: color-mix(in srgb, var(--sc, var(--brand)) 13%, var(--panel)); color: var(--sc, var(--brand-ink)); font-weight: 600; }
.aside-list a.current .n { color: inherit; opacity: .7; }
.progress-mini { display: flex; align-items: center; gap: 14px; }
.ring {
  --p: 0;
  width: 58px; height: 58px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--sc, var(--brand)) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.ring b { position: relative; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pm-text { font-size: 12px; color: var(--muted); line-height: 1.6; }
.pm-text b { display: block; color: var(--ink); font-size: 13px; }

/* ------------------------------ hot / search / progress ------------------------------ */
.hot-group { margin-bottom: 30px; }
.hot-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hot-group-head .sc-icon { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
.hot-group-head h3 { margin: 0; font-size: 15px; }
.hot-group-head .cnt { font-size: 11.5px; color: var(--faint); }

.search-head { margin-bottom: 26px; }
.search-head h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.4px; }
.search-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.search-head mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; padding: 0 3px; border-radius: 3px; }
.result-list { display: grid; gap: 10px; }
.result-item {
  display: block;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  transition: .18s ease;
}
.result-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.ri-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.ri-sub { font-size: 11px; color: var(--faint); }
.ri-top h3 { margin: 0; font-size: 15.5px; font-weight: 650; }
.ri-sum { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.75; }
.ri-sum mark, .ri-top mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

.empty {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.empty .em { font-size: 34px; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }

.progress-hero {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  padding: 30px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  margin-bottom: 26px;
}
.progress-hero .ring { width: 92px; height: 92px; }
.progress-hero .ring::before { inset: 9px; }
.progress-hero .ring b { font-size: 19px; }
.ph-text h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.4px; }
.ph-text p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ph-text p b { color: var(--ink); }
.ph-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.progress-table { display: grid; gap: 10px; }
.pt-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 70px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  transition: .16s ease;
}
.pt-row:hover { border-color: var(--sc, var(--line-strong)); }
.pt-name { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.pt-name .sc-icon { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
.pt-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pt-bar i { display: block; height: 100%; border-radius: 99px; background: var(--sc); }
.pt-num { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-num b { color: var(--ink); }

.data-panel {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.data-note {
  margin: 13px 0 0;
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
}
.data-note b { color: var(--ink-2); }
.btn-danger-ghost {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}
.btn-danger-ghost:hover {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
}

/* ------------------------------ quiz ------------------------------ */
.quiz-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.quiz-head h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 30px); letter-spacing: -.6px; }
.quiz-head p { margin: 0; font-size: 13.5px; color: var(--muted); }

.quiz-dash {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 36px;
  padding: 18px 24px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.quiz-dash .qd-item b { display: block; font-size: 22px; letter-spacing: -.4px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.quiz-dash .qd-item span { font-size: 11.5px; color: var(--faint); }
.quiz-dash .qd-actions { margin-left: auto; }

.quiz-card {
  position: relative;
  overflow: hidden;
  padding: 34px 38px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}
.quiz-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--sc, var(--brand)), transparent 72%);
  opacity: .85;
}
.quiz-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.quiz-meta .sc-icon { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
.quiz-meta .qm-sub { font-size: 12.5px; color: var(--muted); }
.quiz-fav {
  margin-left: auto;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  transition: .18s ease;
}
.quiz-fav:hover { border-color: var(--line-strong); color: var(--ink); }
.quiz-fav.on { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }

.quiz-kicker { font-size: 10.5px; letter-spacing: 2px; color: var(--faint); margin-bottom: 10px; }
.quiz-title { margin: 0 0 12px; font-size: clamp(24px, 3vw, 34px); line-height: 1.35; letter-spacing: -.5px; }
.quiz-hint { margin: 0 0 22px; font-size: 14px; color: var(--muted); line-height: 1.8; }

.quiz-answer { margin-top: 6px; padding-top: 22px; border-top: 1px dashed var(--line); animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
.qa-label { margin: 18px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--sc, var(--brand)); }
.qa-label:first-child { margin-top: 0; }
.qa-summary { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ink-2); }
.quiz-answer .tip-box { margin-top: 18px; }
.quiz-answer .formula-box { margin-top: 2px; }

.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.quiz-result { margin-top: 20px; padding: 12px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 500; }
.quiz-result.ok { color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent); }
.quiz-result.bad { color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent); }
.btn-quiz-bad {
  background: color-mix(in srgb, var(--danger) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
  color: var(--danger);
}
.btn-quiz-bad:hover { background: color-mix(in srgb, var(--danger) 14%, var(--panel)); }
.quiz-foot { margin-top: 18px; font-size: 11.5px; color: var(--faint); }
.quiz-note { margin: 18px 0 0; font-size: 11.5px; color: var(--faint); text-align: center; }
.quiz-empty {
  padding: 20px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

/* ------------------------------ materials ------------------------------ */
.materials-cta {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: 20px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 7%, var(--panel)), var(--panel) 62%);
}
.materials-cta::after {
  content: "资料";
  position: absolute;
  right: 26px;
  bottom: -26px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 118px;
  line-height: 1;
  color: var(--brand);
  opacity: .045;
  pointer-events: none;
}
.mc-text { position: relative; z-index: 1; }
.mc-kicker { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--brand-ink); }
.materials-cta h2 { margin: 8px 0 6px; font-size: 22px; letter-spacing: -.4px; }
.materials-cta p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.materials-cta .btn { position: relative; z-index: 1; flex-shrink: 0; }

.materials-head { max-width: 720px; margin-bottom: 26px; }
.materials-kicker { font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--brand-ink); }
.materials-head h1 { margin: 9px 0 8px; font-size: clamp(27px, 3.4vw, 36px); letter-spacing: -.8px; line-height: 1.3; }
.materials-head p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted); }

.materials-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}
.materials-form {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}
.mf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mf-field { margin-bottom: 16px; }
.mf-field label,
.mf-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.mf-field input,
.mf-field select,
.mf-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: .18s ease;
}
.mf-field input,
.mf-field select { height: 44px; padding: 0 13px; }
.mf-field textarea { min-height: 86px; padding: 11px 13px; line-height: 1.7; resize: vertical; }
.mf-field input:focus,
.mf-field select:focus,
.mf-field textarea:focus {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent);
}
.subject-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-chip { position: relative; cursor: pointer; }
.subject-chip input { position: absolute; opacity: 0; pointer-events: none; }
.subject-chip span {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12.5px;
  transition: .16s ease;
}
.subject-chip input:checked + span {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}
.subject-chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.mf-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  cursor: pointer;
}
.mf-consent input { width: 15px; height: 15px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--brand); }
.mf-consent a { color: var(--brand-ink); text-decoration: underline; }
.mf-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, var(--panel));
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.6;
}
.mf-submit { width: 100%; height: 46px; justify-content: center; }
.mf-note { margin: 12px 0 0; text-align: center; font-size: 11.5px; line-height: 1.7; color: var(--faint); }

.materials-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}
.materials-aside h3 { margin: 0 0 12px; font-size: 14px; }
.materials-qr { padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.materials-qr img { display: block; width: 100%; height: auto; border-radius: 8px; }
.materials-aside p { margin: 12px 0; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.materials-aside .btn { width: 100%; justify-content: center; }
.materials-aside-note { margin-bottom: 0 !important; text-align: center; font-size: 11px !important; color: var(--faint) !important; }

.materials-success {
  max-width: 640px;
  margin: 34px auto 0;
  padding: 44px 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.ms-icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 26px;
  font-weight: 700;
}
.materials-success h1 { margin: 0 0 10px; font-size: 28px; letter-spacing: -.5px; }
.materials-success p { max-width: 470px; margin: 0 auto 20px; font-size: 13.5px; line-height: 1.85; color: var(--muted); }
.ms-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ms-note { margin: 18px 0 0 !important; font-size: 11.5px !important; color: var(--faint) !important; }

/* ------------------------------ login ------------------------------ */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow-y: auto;
  color: #1a1a2e;
  background:
    radial-gradient(760px 520px at 12% 4%, rgba(255, 255, 255, .20), transparent 62%),
    radial-gradient(820px 620px at 88% 98%, rgba(255, 118, 214, .34), transparent 62%),
    linear-gradient(140deg, #5b4cf0 0%, #7a5bff 46%, #a24fdf 100%);
  -webkit-overflow-scrolling: touch;
}
.login-shell {
  min-height: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 34px 20px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: #fff;
  font-size: 16px;
  letter-spacing: 1px;
}
.login-brand .brand-mark {
  width: 32px; height: 32px;
  font-size: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: none;
}
.login-card {
  width: 100%;
  padding: 30px 32px 24px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 80px -30px rgba(30, 10, 80, .68);
}
.login-emoji {
  margin-bottom: 10px;
  text-align: center;
  font-size: 42px;
  line-height: 1;
  filter: drop-shadow(0 6px 10px rgba(80, 40, 160, .22));
}
.login-card h1 {
  margin: 0 0 7px;
  text-align: center;
  font-size: 27px;
  letter-spacing: -.5px;
  color: #171a2b;
}
.login-sub {
  margin: 0 0 22px;
  text-align: center;
  font-size: 13.5px;
  color: #7b8094;
}
.login-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.login-tab {
  flex: 1;
  height: 42px;
  border: 1px solid #e3e5f0;
  border-radius: 10px;
  background: #fff;
  color: #6b7085;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: .18s ease;
}
.login-tab:hover { border-color: #cfd3e6; color: #3a3f55; }
.login-tab.active {
  background: #eef0ff;
  border-color: #6c5ce7;
  color: #4b3fd1;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(108, 92, 231, .12);
}
.login-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid #ffd7d7;
  border-radius: 8px;
  background: #fff1f1;
  color: #d64545;
  font-size: 12.5px;
  line-height: 1.6;
}
.login-consent-box {
  display: grid;
  gap: 9px;
  margin: 0 0 4px;
  padding: 11px 13px;
  border: 1px solid #eceef7;
  border-radius: 10px;
  background: #fafbff;
}
.login-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: #5d6377;
  cursor: pointer;
}
.login-card .login-consent input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  margin: 2px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: #6c5ce7;
  box-shadow: none;
}
.login-card .login-consent input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .18);
}
.login-consent a { color: #5a4bd6; text-decoration: underline; text-underline-offset: 2px; }
.field-label {
  display: block;
  margin: 14px 0 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4b5065;
}
.login-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #dfe2ee;
  border-radius: 10px;
  background: #fff;
  color: #1a1a2e;
  font-size: 14px;
  outline: none;
  transition: .18s ease;
}
.login-card input::placeholder { color: #a6acbd; }
.login-card input:focus {
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, .14);
}
.phone-row { display: flex; gap: 8px; }
.phone-prefix {
  flex: 0 0 62px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe2ee;
  border-radius: 10px;
  background: #f7f8fc;
  color: #3a3f52;
  font-size: 14px;
}
.phone-row input { flex: 1; width: auto; }
.code-row { display: flex; gap: 8px; margin-top: 10px; }
.code-row input { flex: 1; width: auto; }
.code-btn {
  flex: 0 0 118px;
  height: 48px;
  border: 1px solid #d9d5f7;
  border-radius: 10px;
  background: #f5f3ff;
  color: #5a4bd6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}
.code-btn:hover { background: #ede9ff; }
.code-btn:disabled { opacity: .55; cursor: default; }
.login-submit {
  width: 100%;
  height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #6a5cf0 0%, #8a4fe0 55%, #a94fd6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 14px 26px -14px rgba(108, 92, 231, .9);
  transition: .2s ease;
}
.login-submit:hover { transform: translateY(-1px); filter: brightness(1.03); }
.login-demo {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: #8a90a4;
}
.login-demo b { color: #5a4bd6; }
.login-terms {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #9aa0b2;
  line-height: 1.7;
}
.login-terms span { color: #6c5ce7; }
.login-help {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: #7a7f93;
  line-height: 1.7;
}
.login-help b { color: #079453; }
.login-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .78);
  letter-spacing: .5px;
}

/* ------------------------------ rebirth login ------------------------------ */
.login-view.rebirth-view {
  color: #dbeafe;
  background: #03050f;
}
.rebirth-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(14, 116, 144, .20), transparent 65%),
    radial-gradient(800px 500px at 90% 100%, rgba(76, 29, 149, .22), transparent 65%),
    #03050f;
}
.rb-stars {
  position: absolute;
  inset: -20%;
  opacity: .55;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(103,232,249,.65) 0 1px, transparent 1.3px),
    radial-gradient(circle, rgba(196,181,253,.55) 0 1px, transparent 1.2px);
  background-size: 137px 137px, 211px 211px, 293px 293px;
  background-position: 0 0, 40px 70px, 90px 20px;
  animation: rbStarDrift 40s linear infinite;
}
.rb-grid {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -12%;
  height: 58%;
  background-image:
    linear-gradient(rgba(34, 211, 238, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, .18) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(480px) rotateX(62deg);
  transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 88%);
  mask-image: linear-gradient(to top, #000 5%, transparent 88%);
  animation: rbGridMove 9s linear infinite;
}
.rb-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 360px;
  min-height: 360px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .35;
}
.rb-glow-a { top: -12%; left: -8%; background: #0891b2; }
.rb-glow-b { right: -10%; bottom: -14%; background: #6d28d9; opacity: .28; }
.rb-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103,232,249,.55), transparent);
  box-shadow: 0 0 18px rgba(34, 211, 238, .45);
  animation: rbScan 7s linear infinite;
}
.rebirth-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 20px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.rebirth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #e2e8f0;
  text-decoration: none;
}
.rebirth-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #06121f;
  background: linear-gradient(140deg, #67e8f9, #818cf8);
  box-shadow: 0 0 24px rgba(34, 211, 238, .32);
}
.rebirth-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.rebirth-brand-text strong { font-size: 16px; letter-spacing: 3px; }
.rebirth-brand-text small {
  margin-top: 3px;
  color: #67e8f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8px;
  letter-spacing: 2.4px;
}
.rebirth-card {
  position: relative;
  width: 100%;
  padding: 32px 42px 24px;
  overflow: hidden;
  border: 1px solid rgba(94, 234, 255, .24);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(9, 20, 39, .94), rgba(2, 6, 18, .97));
  box-shadow:
    0 0 0 1px rgba(15, 118, 110, .08) inset,
    0 40px 120px -50px rgba(34, 211, 238, .38),
    0 30px 80px -40px rgba(0, 0, 0, .9);
}
.rebirth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(125, 211, 252, .045) 0 1px, transparent 1px 3px);
  opacity: .55;
}
.rebirth-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #67e8f9, #a78bfa, transparent);
  opacity: .8;
}
.rb-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .13);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: #64748b;
}
.rb-status { display: inline-flex; align-items: center; gap: 7px; color: #5eead4; }
.rb-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px #2dd4bf;
  animation: rbPulse 1.8s ease-in-out infinite;
}
.rb-status-off { color: #fbbf24; }
.rb-status-off i { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; animation: none; }
.rb-code { color: #475569; }
.rb-hero { position: relative; z-index: 1; margin-top: 24px; }
.rb-kicker {
  margin: 0 0 10px;
  color: #67e8f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: 2.6px;
}
.rb-title {
  position: relative;
  display: inline-block;
  margin: 0 0 12px;
  font-size: clamp(40px, 5.4vw, 58px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(100deg, #f8fafc 4%, #bae6fd 34%, #67e8f9 55%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rb-title::before,
.rb-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-text-fill-color: currentColor;
  opacity: .16;
}
.rb-title::before {
  color: #22d3ee;
  transform: translate(2px, -1px);
  clip-path: inset(0 0 62% 0);
  animation: rbGlitchA 4.2s steps(2, end) infinite;
}
.rb-title::after {
  color: #f472b6;
  transform: translate(-2px, 1px);
  clip-path: inset(58% 0 0 0);
  animation: rbGlitchB 5.3s steps(2, end) infinite;
}
.rb-lead {
  margin: 0;
  color: #94a3b8;
  font-size: 17px;
  line-height: 1.8;
}
.rb-lead b { color: #a5f3fc; font-weight: 600; text-shadow: 0 0 18px rgba(103, 232, 249, .25); }
.rb-story {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding-left: 14px;
  border-left: 1px solid rgba(34, 211, 238, .22);
}
.rb-story p {
  margin: 0 0 5px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.85;
}
.rb-quote {
  margin: 12px 0 0 !important;
  padding: 10px 14px;
  border: 1px solid rgba(34, 211, 238, .18);
  border-left: 2px solid #22d3ee;
  border-radius: 0 8px 8px 0;
  background: rgba(8, 145, 178, .07);
  color: #bae6fd !important;
  font-size: 13.5px !important;
  letter-spacing: .3px;
}
.rb-terminal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 8px;
  background: rgba(2, 8, 20, .72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: .2px;
  color: #7c8da6;
}
.rb-terminal div { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rb-terminal span { color: #22d3ee; }
.rb-terminal b { margin-right: auto; color: #7c8da6; font-weight: 400; }
.rb-terminal i { color: #5eead4; font-style: normal; }
.rb-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0 0;
  border-top: 1px solid rgba(148, 163, 184, .12);
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.rb-stats div { padding: 12px 10px; text-align: center; border-right: 1px solid rgba(148, 163, 184, .10); }
.rb-stats div:last-child { border-right: 0; }
.rb-stats strong {
  display: block;
  color: #a5f3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(34, 211, 238, .25);
}
.rb-stats span { display: block; margin-top: 3px; color: #64748b; font-size: 9.5px; letter-spacing: 1.2px; }
.rb-question {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}
.rb-q-label {
  margin: 0 0 12px;
  color: #cbd5e1;
  font-size: 14.5px;
  letter-spacing: .3px;
}
.rb-q-label b { color: #67e8f9; font-weight: 600; }
.rb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 52px;
  padding: 0 18px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .4px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.rb-btn span {
  margin-right: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 8.5px;
  letter-spacing: 1.6px;
  opacity: .65;
}
.rb-btn i { font-style: normal; margin-left: 7px; }
.rb-btn-primary {
  border: 1px solid rgba(125, 211, 252, .55);
  background: linear-gradient(120deg, #0891b2 0%, #2563eb 48%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 0 26px -6px rgba(34, 211, 238, .55), inset 0 1px 0 rgba(255,255,255,.18);
}
.rb-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.28) 48%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .55s ease;
}
.rb-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px -4px rgba(34, 211, 238, .72); }
.rb-btn-primary:hover::after { transform: translateX(120%); }
.rb-btn-ghost {
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(15, 23, 42, .5);
  color: #94a3b8;
}
.rb-btn-ghost:hover { border-color: rgba(148, 163, 184, .42); color: #cbd5e1; transform: translateY(-1px); }
.rb-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.7;
  cursor: pointer;
}
.rb-consent input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 2px 0 0;
  accent-color: #22d3ee;
}
.rb-consent a { color: #67e8f9; text-decoration: underline; text-underline-offset: 2px; }
.rb-question .login-error {
  margin: 0 0 10px;
  padding: 8px 11px;
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 7px;
  background: rgba(127, 29, 29, .18);
  color: #fca5a5;
  font-size: 11.5px;
  line-height: 1.6;
}
.rb-foot {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  text-align: center;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
  letter-spacing: .4px;
}
.rebirth-foot {
  margin: 16px 0 0;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  text-align: center;
}
.rb-refused { text-align: center; }
.rb-refused .rb-topline { text-align: left; }
.rb-refused .rb-title { display: block; margin: 8px 0 10px; font-size: clamp(34px, 4.6vw, 48px); }
.rb-refused-mark {
  width: 72px;
  height: 72px;
  margin: 20px auto 4px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(251, 191, 36, .4);
  border-radius: 50%;
  color: #fbbf24;
  font-size: 27px;
  background: rgba(120, 53, 15, .12);
  box-shadow: 0 0 40px -8px rgba(251, 191, 36, .45), inset 0 0 22px rgba(251, 191, 36, .08);
}
.rb-refused .rb-lead b { color: #fbbf24; text-shadow: 0 0 18px rgba(251, 191, 36, .28); }
.rb-refused-text { margin: 18px 0 0; color: #94a3b8; font-size: 13.5px; }
.rb-quote-wide { max-width: 480px; margin: 14px auto 0 !important; text-align: left; }
.rb-actions-single { max-width: 300px; margin: 22px auto 0; grid-template-columns: 1fr; }
.rb-refused .rb-foot { margin-top: 18px; }
.rb-title, .rb-btn, .rb-quote { -webkit-font-smoothing: antialiased; }
.shake { animation: rbShake .42s ease; }

@keyframes rbStarDrift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-40px, 30px, 0); } }
@keyframes rbGridMove { from { background-position: 0 0; } to { background-position: 0 64px; } }
@keyframes rbScan { 0% { top: -4%; opacity: 0; } 12% { opacity: .7; } 88% { opacity: .5; } 100% { top: 104%; opacity: 0; } }
@keyframes rbPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }
@keyframes rbGlitchA { 0%, 92%, 100% { transform: translate(2px, -1px); } 93% { transform: translate(-3px, 1px); } 95% { transform: translate(3px, 0); } 97% { transform: translate(-1px, -1px); } }
@keyframes rbGlitchB { 0%, 90%, 100% { transform: translate(-2px, 1px); } 91% { transform: translate(3px, -1px); } 94% { transform: translate(-3px, 0); } 96% { transform: translate(2px, 1px); } }
@keyframes rbShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

@media (max-width: 720px) {
  .rebirth-shell { padding: 16px 12px 24px; }
  .rebirth-brand { margin-bottom: 14px; }
  .rebirth-card { padding: 22px 17px 18px; border-radius: 16px; }
  .rb-topline { font-size: 8px; letter-spacing: 1px; padding-bottom: 11px; }
  .rb-hero { margin-top: 18px; }
  .rb-kicker { font-size: 8px; letter-spacing: 2px; }
  .rb-title { font-size: clamp(32px, 9vw, 42px); letter-spacing: .5px; }
  .rb-lead { font-size: 15px; }
  .rb-story { margin-top: 17px; }
  .rb-story p { font-size: 12px; line-height: 1.75; }
  .rb-quote { font-size: 12px !important; padding: 9px 11px; }
  .rb-terminal { margin-top: 14px; padding: 9px 10px; font-size: 8.5px; gap: 4px; }
  .rb-stats { margin-top: 14px; grid-template-columns: repeat(2, 1fr); }
  .rb-stats div { padding: 9px 6px; }
  .rb-stats div:nth-child(2) { border-right: 0; }
  .rb-stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(148, 163, 184, .10); }
  .rb-stats strong { font-size: 20px; }
  .rb-stats span { font-size: 8.5px; }
  .rb-question { margin-top: 16px; }
  .rb-q-label { font-size: 13px; margin-bottom: 10px; }
  .rb-actions { grid-template-columns: 1fr; gap: 8px; }
  .rb-btn { height: 48px; font-size: 13px; }
  .rb-consent { font-size: 10px; }
  .rb-foot { font-size: 8.5px; line-height: 1.5; }
  .rebirth-foot { margin-top: 14px; font-size: 8px; }
  .rb-refused-mark { width: 58px; height: 58px; font-size: 22px; margin-top: 14px; }
  .rb-refused .rb-title { font-size: 32px; }
}

@media (max-width: 520px) {
  .rb-terminal { display: none; }
  .rb-consent { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .rb-stars, .rb-grid, .rb-scan, .rb-status i, .rb-title::before, .rb-title::after, .shake { animation: none !important; }
}

body.auth-locked .contact-bubble { display: none; }

/* ------------------------------ contact ------------------------------ */
.contact-bubble {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 170;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(145deg, #12b56a, #078a4b);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 30px -12px rgba(7, 138, 75, .9);
  transition: .2s ease;
}
.contact-bubble:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(7, 138, 75, .95); }
.contact-bubble svg { width: 18px; height: 18px; stroke-width: 1.9; }
.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(10, 16, 28, .58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.contact-modal {
  position: relative;
  width: min(660px, 100%);
  padding: 32px 36px 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .55);
  animation: rise .3s cubic-bezier(.2, .8, .2, 1);
}
.contact-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: .18s ease;
}
.contact-close:hover { background: var(--panel-soft); color: var(--ink); }
.contact-close svg { width: 16px; height: 16px; }
.contact-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--ok);
}
.contact-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.contact-modal h2 { margin: 10px 0 10px; font-size: 30px; letter-spacing: -.6px; }
.contact-desc {
  max-width: 540px;
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
}
.contact-grid {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin-top: 22px;
}
.contact-qr {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.contact-qr img { display: block; width: 100%; height: auto; border-radius: 9px; }
.contact-info h3 { margin: 4px 0 8px; font-size: 16px; }
.contact-info p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--muted);
}
.contact-info .contact-tip {
  padding: 9px 12px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  color: color-mix(in srgb, var(--ok) 82%, var(--ink));
  font-size: 12.5px;
}
.contact-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.btn-wechat {
  height: 44px;
  padding: 0 20px;
  background: linear-gradient(145deg, #12b56a, #079453);
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(7, 148, 83, .9);
}
.btn-wechat:hover { transform: translateY(-1px); }
.btn-wechat svg { width: 16px; height: 16px; }
.contact-actions .btn-ghost { height: 44px; }
.contact-register {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ok);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact-register:hover { color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.contact-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--faint);
}

/* ------------------------------ footer ------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 55%, transparent); margin-top: 20px; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 46px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 26px 50px;
}
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand strong { font-size: 15px; }
.footer-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.footer-links a:hover { color: var(--brand-ink); }
.footer-note { flex-basis: 100%; margin: 4px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.9; }

/* ------------------------------ toast ------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 16px);
  background: #101725;
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 300;
  max-width: 80vw;
  text-align: center;
}
[data-theme="dark"] .toast { background: #eef3fb; color: #101725; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .mod-select { flex-basis: 100%; }
  .mod-select select { width: 100%; max-width: none; }
  .tb-divider { display: none; }
  .login-shell { padding: 24px 14px; }
  .login-brand { margin: 6px 0 16px; }
  .login-card { padding: 26px 20px 20px; border-radius: 22px; }
  .login-card h1 { font-size: 24px; }
  .login-card input { font-size: 16px; }
  .login-emoji { font-size: 36px; }
  .contact-bubble { right: 14px; bottom: 16px; height: 42px; padding: 0 15px 0 12px; font-size: 12.5px; }
  .contact-modal { padding: 26px 20px 20px; border-radius: 22px; }
  .contact-modal h2 { font-size: 25px; }
  .contact-desc { font-size: 13.5px; }
  .contact-grid { grid-template-columns: 1fr; gap: 18px; }
  .contact-qr { width: 200px; margin: 0 auto; }
  .contact-actions { flex-direction: column; }
  .contact-actions .btn { width: 100%; justify-content: center; }
  .contact-close { top: 12px; right: 12px; }
}
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .materials-layout { grid-template-columns: 1fr; }
  .materials-aside { position: static; }
  .materials-qr { max-width: 220px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .materials-cta { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .materials-cta .btn { width: 100%; justify-content: center; }
  .materials-cta h2 { font-size: 19px; }
  .materials-form { padding: 20px 18px; }
  .mf-grid { grid-template-columns: 1fr; gap: 0; }
  .materials-success { padding: 30px 20px; }
  .ms-actions .btn { flex: 1; justify-content: center; }
  .materials-head h1 { font-size: 27px; }
}

/* ------------------------------ animation ------------------------------ */
.reveal { animation: rise .42s cubic-bezier(.2, .8, .2, 1); }
.reveal-2 { animation: rise .5s .05s cubic-bezier(.2, .8, .2, 1); }
.reveal-3 { animation: rise .55s .1s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------ responsive ------------------------------ */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 520px; }
  .detail-layout { grid-template-columns: 1fr; }
  .aside { position: static; grid-template-columns: 1fr 1fr; }
  .main-nav a { padding: 7px 9px; font-size: 13.5px; }
  .search-mini { flex-basis: 220px; min-width: 170px; }
  .search-mini kbd { display: none; }
}

@media (max-width: 860px) {
  :root { --header-h: 58px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .main-nav { display: none; }
  .quiz-head { flex-direction: column; align-items: flex-start; }
  .quiz-card { padding: 24px 20px; border-radius: 18px; }
  .quiz-dash { gap: 14px 24px; padding: 16px 18px; }
  .quiz-dash .qd-actions { margin-left: 0; width: 100%; }
  .brand-text small { display: none; }
  .search-mini { flex: 1; min-width: 0; }
  .search-mini input { font-size: 12.5px; }
  .hero { padding-top: 38px; }
  .hero-stats { grid-template-columns: 1fr 1fr; margin-top: 38px; }
  .stat { padding: 16px 18px; }
  .stat b { font-size: 23px; }
  .article { padding: 26px 20px; border-radius: 18px; }
  .subject-hero { padding: 24px 20px; border-radius: 20px; }
  .subject-hero::before { font-size: 130px; right: 0; top: -18px; }
  .sh-icon { width: 50px; height: 50px; font-size: 24px; border-radius: 15px; }
  .formula-row { grid-template-columns: 1fr; gap: 4px; }
  .aside { grid-template-columns: 1fr; }
  .pt-row { grid-template-columns: 1fr 64px; gap: 10px 14px; }
  .pt-row .pt-bar { grid-column: 1 / -1; order: 3; }
  .progress-hero { padding: 24px 20px; }
  .ph-actions { margin-left: 0; }
  .footer-inner { padding: 30px 16px 38px; }
  .wrap, .hero-inner { padding: 0 16px; }
  .page { padding-top: 22px; }
  .section { padding-top: 34px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .pager { flex-direction: column; }
  .pager a.next { text-align: left; align-items: flex-start; }
}

@media (max-width: 520px) {
  .hero h1 { letter-spacing: -.4px; }
  .hero-actions .btn { flex: 1; justify-content: center; }
  .search-mini { padding: 0 8px 0 10px; }
  .point-grid { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 23px; }
  .toolbar { gap: 8px; }
  .chip { height: 30px; padding: 0 11px; font-size: 12px; }
}

/* ------------------------------ print ------------------------------ */
@media print {
  .site-header, .site-footer, .read-progress, .aside, .article-actions, .pager, .toolbar { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .article { border: 0; padding: 0; box-shadow: none; }
  .detail-layout { display: block; }
}
