:root {
  --paper: #f3ecdf;
  --paper-2: #fffaf3;
  --ink: #1c1915;
  --muted: #5f584e;
  --asphalt: #171c27;
  --asphalt-2: #242b3b;
  --amber: #f5a524;
  --amber-2: #ffd27a;
  --lane: #0f6e62;
  --line: rgba(28, 25, 21, 0.12);
  --shadow: 0 22px 50px rgba(28, 25, 21, 0.1);
  --serif: "Palatino Linotype", Palatino, "KaiTi", "STKaiti", "楷体", "Songti SC", serif;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --radius: 28px;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(245, 165, 36, 0.18), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
}

body.page-login {
  background:
    radial-gradient(circle at 80% -10%, rgba(245, 165, 36, 0.28), transparent 28%),
    #121722;
  color: #fffaf3;
}

img, svg { max-width: 100%; }

button, input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

::selection { background: var(--amber); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

[id] { scroll-margin-top: 88px; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--amber);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  z-index: 80;
}

.skip:focus { top: 12px; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(243, 236, 223, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.page-login .topbar {
  background: rgba(18, 23, 34, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.logo-word { display: flex; flex-direction: column; line-height: 1.05; }
.logo-word strong { font-size: 18px; letter-spacing: 0.08em; }
.logo-word small { font-size: 11px; letter-spacing: 0.22em; color: var(--muted); }
.page-login .logo-word small { color: rgba(255, 250, 243, 0.62); }

.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.main-nav a span {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.main-nav a[aria-current="page"] { background: var(--asphalt); color: var(--paper-2); }
.main-nav a[aria-current="page"] span { color: var(--amber); }
.main-nav a:hover { background: rgba(28, 25, 21, 0.06); }

.page-login .main-nav a:hover { background: rgba(255, 255, 255, 0.06); }
.page-login .main-nav a[aria-current="page"] { background: var(--amber); color: var(--ink); }
.page-login .main-nav a[aria-current="page"] span { color: var(--ink); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 42px; padding: 0 14px; }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { background: #ffbe45; }
.btn-ink { background: var(--asphalt); color: var(--paper-2); }
.btn-ink:hover { background: #2a3142; }
.btn-ghost { background: transparent; color: #fffaf3; border-color: rgba(255, 255, 255, 0.38); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-line { background: transparent; color: var(--ink); border-color: rgba(28, 25, 21, 0.2); }
.tiny-only { display: none; }

.hero-shell {
  margin-top: 22px;
  background:
    radial-gradient(circle at 88% 12%, rgba(245, 165, 36, 0.45), transparent 26%),
    linear-gradient(160deg, #1d2433, #121722 62%);
  color: #fffaf3;
  border-radius: 36px;
  padding: clamp(22px, 4vw, 48px);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-shell::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 18px;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 22px, transparent 22px 40px);
  opacity: 0.85;
  border-radius: 999px;
}

.hero-grid, .split, .auth-grid, .three, .feature-grid, .dict-grid, .clip-grid {
  display: grid;
  gap: 18px;
}

.hero-grid { grid-template-columns: 1.15fr 0.85fr; align-items: center; position: relative; z-index: 1; }
.split { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
.auth-grid { grid-template-columns: 1.05fr 0.95fr; align-items: start; }
.three, .feature-grid, .dict-grid { grid-template-columns: repeat(3, 1fr); }
.clip-grid { grid-template-columns: repeat(3, 1fr); }

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.2;
  margin-bottom: 8px;
}

h3 { font-size: 22px; line-height: 1.35; margin-bottom: 8px; }

.lede, .page-intro p { font-size: 18px; max-width: 40em; }

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.eyebrow.ink { color: var(--lane); }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.dash, .paper-card, .clip, .panel, .auth-card, .faq, .audience article, .path, .essay {
  background: var(--paper-2);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(28, 25, 21, 0.06);
}

.dash, .paper-card, .panel, .auth-card, .path, .essay, .faq, .audience article { padding: 22px; }

.dash-label, .kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--lane);
  margin-bottom: 8px;
}

.steps { list-style: none; padding: 0; margin: 8px 0 18px; counter-reset: step; }
.steps li { position: relative; min-height: 52px; padding: 0 0 8px 46px; }
.steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber);
  font-size: 13px;
  font-weight: 800;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 40px;
  bottom: 0;
  border-left: 2px dashed rgba(28, 25, 21, 0.28);
}
.steps a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-weight: 800;
  text-decoration: none;
}

.section { margin-top: 56px; }
.section-head { max-width: 40em; margin-bottom: 18px; }

.marquee {
  margin-top: 22px;
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 12px 0;
}

.marquee-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: ticker 32s linear infinite;
}

.chip, .filters button, .sticker {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.path { min-height: 100%; }
.path .mile {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  color: var(--amber);
  -webkit-text-stroke: 1px var(--ink);
}
.path a { font-weight: 800; color: var(--lane); }

.scene {
  position: relative;
  height: 180px;
  border-radius: 22px;
  overflow: hidden;
  background: #243044;
}

.scene .road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: #2a241c;
}

.scene .road::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 46%;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 16px, transparent 16px 30px);
}

.scene .car {
  position: absolute;
  width: 78px;
  height: 28px;
  left: 18%;
  bottom: 24%;
  border-radius: 10px 16px 8px 8px;
  background: #fffaf3;
}

.scene .car::before {
  content: "";
  position: absolute;
  left: 16px;
  top: -12px;
  width: 36px;
  height: 16px;
  background: #d5e4ef;
  border-radius: 8px 10px 3px 3px;
}

.scene .car::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #fff4d2;
  box-shadow: 10px 0 16px 4px rgba(245, 165, 36, 0.95);
}

.scene-rain { background: linear-gradient(#1d3348, #8ea0b5 60%, #31465d); }
.scene-night { background: linear-gradient(#101624, #243044 55%, #1a140c); }
.scene-city { background: linear-gradient(#f0b429, #f7d7a8 40%, #87b7d8); }
.scene-highway { background: linear-gradient(#9fd8ef, #e7f4ea 48%, #c6d7c2); }
.scene-campus { background: linear-gradient(#ffd0c2, #fff1d6 46%, #b7e0d4); }
.scene-mountain { background: linear-gradient(#6f8f86, #d5e2d2 48%, #8c7a64); }

.scene-rain::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 10px, rgba(255, 255, 255, 0.28) 10px 11px);
  animation: rain 1.1s linear infinite;
}

.scene.is-playing .car { animation: drive 1.6s ease-in-out infinite; }

.feature, .clip { overflow: hidden; }
.feature { display: block; text-decoration: none; color: inherit; padding: 12px; }
.feature .scene, .clip .scene { margin-bottom: 12px; }
.clip { padding: 12px; }
.clip:target, .short.is-on, .essay:target, .term:target {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.clip-play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 22px;
  margin-bottom: 12px;
}

.play-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 3px 3px 0 var(--ink);
}

.page-intro { padding: 34px 0 8px; }
.page-intro h1 { font-size: clamp(36px, 5vw, 64px); }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 16px; }
.filters button { box-shadow: none; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper-2); }

.note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #e7f6f2;
  color: #14584e;
  border-radius: 20px;
  padding: 14px 16px;
  margin-top: 18px;
}

.note strong { white-space: nowrap; }

.cinema {
  background: var(--asphalt);
  color: #fffaf3;
  border-radius: 32px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.cinema-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  padding: 6px 8px 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef5b4c;
  box-shadow: 16px 0 0 var(--amber), 32px 0 0 #3dbea5;
}

.feed { display: grid; gap: 12px; }
.short { background: #242b3b; border-radius: 24px; padding: 10px; }
.short .scene { height: 280px; }
.short-caption h3, .short-caption p { color: #fffaf3; }
.short-caption h3 { margin-top: 12px; }
.short-caption .kicker { color: var(--amber-2); }
.short-caption .mini-btn,
.short-caption .like { margin: 8px 8px 0 0; }
.like, .mini-btn {
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  padding: 0 14px;
  font-weight: 800;
  background: var(--paper-2);
  color: var(--ink);
}
.like[aria-pressed="true"] { background: var(--amber); }
.feed-controls { display: flex; gap: 8px; margin: 8px 0 14px; }
.feed-controls button { flex: 1; }

.dict-grid { grid-template-columns: repeat(2, 1fr); }
.term { padding: 18px 18px 8px; }
.term h3 { font-family: var(--serif); font-size: 28px; }
.search {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  border: 1.5px solid rgba(28, 25, 21, 0.18);
  padding: 0 16px;
  background: white;
  color: var(--ink);
}

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.crumbs a { color: var(--lane); font-weight: 700; }
.page-login .crumbs, .page-login .crumbs a { color: rgba(255, 250, 243, 0.78); }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1;
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(28, 25, 21, 0.16);
  background: transparent;
  font-weight: 800;
}
.tabs button[aria-selected="true"] { background: var(--asphalt); color: var(--paper-2); }
.form-row { margin-bottom: 14px; }
label { display: block; font-weight: 800; margin-bottom: 6px; }
input {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid rgba(28, 25, 21, 0.18);
  padding: 0 14px;
  background: white;
  color: var(--ink);
}
.msg { min-height: 1.5em; font-weight: 700; }
.msg[data-state="err"] { color: #9d2430; }
.msg[data-state="ok"] { color: var(--lane); }
.help { color: var(--muted); font-size: 14px; }

.install-steps { margin: 0; padding-left: 18px; }
.install-steps li { margin: 8px 0; }
.store-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(560px, calc(100% - 24px));
}
dialog::backdrop { background: rgba(12, 14, 20, 0.72); }
.player-card { background: var(--paper-2); color: var(--ink); border-radius: 28px; padding: 14px; }
.player-card .scene { height: 230px; }
.progress { height: 8px; background: rgba(28, 25, 21, 0.1); border-radius: 99px; overflow: hidden; margin: 12px 0; }
.progress span { display: block; height: 100%; width: 0; background: var(--amber); }
.scene.is-playing + .progress span,
.player-card.is-playing .progress span { animation: load 8s linear forwards; }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.faq details {
  background: var(--paper-2);
  border-radius: 18px;
  padding: 4px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(28, 25, 21, 0.06);
}
.faq summary { min-height: 48px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.faq p { margin-top: 0; }

.audience { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 18px; }
.audience ul { margin: 0; padding-left: 18px; }
.closing {
  margin-top: 28px;
  padding: 28px;
  border-radius: 32px;
  background: var(--asphalt);
  color: #fffaf3;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.footer {
  margin-top: 56px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.page-login .footer { border-top-color: rgba(255, 255, 255, 0.12); color: rgba(255, 250, 243, 0.74); }
.footer-grid { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.footer a { font-weight: 700; }

.tabbar {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 40;
  background: rgba(23, 28, 39, 0.96);
  border-radius: 22px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}
.tabbar a {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  text-decoration: none;
  color: rgba(255, 250, 243, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}
.tabbar a span { font-size: 10px; letter-spacing: 0.08em; color: var(--amber-2); }
.tabbar a[aria-current="page"] { background: var(--amber); color: var(--ink); }
.tabbar a[aria-current="page"] span { color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--asphalt);
  color: #fffaf3;
  border-radius: 999px;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 90;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { color: var(--muted); }

@keyframes ticker { to { transform: translateX(-50%); } }
@keyframes drive { 50% { transform: translateX(18px); } }
@keyframes rain { to { transform: translateY(12px); } }
@keyframes load { to { width: 100%; } }

@media (max-width: 980px) {
  .main-nav { display: none; }
  .tabbar { display: flex; }
  body { padding-bottom: 108px; }
  .tiny-only { display: inline; }
  .wide-only { display: none; }
  .hero-grid, .split, .auth-grid, .three, .feature-grid, .clip-grid, .audience, .closing { grid-template-columns: 1fr; }
  .toast { bottom: 112px; }
  .hero-shell::after { display: none; }
}

@media (max-width: 720px) {
  .dict-grid { grid-template-columns: 1fr; }
  .container { width: min(1120px, calc(100% - 20px)); }
  .note { flex-direction: column; gap: 4px; }
  h1 { font-size: clamp(34px, 10vw, 48px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
  .marquee-track { flex-wrap: wrap; width: auto; }
}

@media print {
  .topbar, .tabbar, .toast, .filters, .feed-controls { display: none !important; }
  body { background: white; padding: 0; }
}
