:root {
  --paper: #f6f0e3;
  --paper-deep: #ede3cf;
  --card: rgba(255, 252, 244, 0.78);
  --card-solid: #fdf9f0;
  --ink: #3a342b;
  --muted: #6e655a;
  --faint: #a49a8a;
  --line: rgba(122, 96, 66, 0.22);
  --line-strong: rgba(106, 78, 52, 0.36);
  --accent: #b8452f;
  --accent-deep: #9c3523;
  --accent-soft: #f3ddd3;
  --seal: #b8452f;
  --gold: #8a6a3f;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.7;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(122, 96, 66, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  z-index: 0;
}
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 18px 22px 68px;
}
.site-masthead {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  margin: 0 2px 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.masthead-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  transform: rotate(-3deg);
}
.masthead-copy { display: grid; gap: 1px; }
.masthead-copy span { color: var(--accent); font: 10px var(--mono); letter-spacing: .14em; }
.masthead-copy b { color: var(--ink); font-size: 15px; font-weight: 600; }
.masthead-edition { margin-left: auto; color: var(--faint); font: 10px var(--mono); letter-spacing: .1em; }
.hub-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(255, 252, 244, 0.55);
}
.hub-back:hover { color: var(--accent); border-color: var(--accent); }

.screen { display: none; }
.screen-active { display: block; animation: fadeIn 0.28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.scroll-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 30px;
  box-shadow: 0 16px 38px rgba(96, 74, 50, 0.08);
  backdrop-filter: blur(8px);
}
.hero-card { position: relative; overflow: hidden; }
.hero-card::before, .result-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(184, 69, 47, .16);
  border-radius: 12px;
  pointer-events: none;
}
.hero-card > *, .result-card > * { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font: 500 11px var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow.small { font-size: 10px; margin-bottom: 4px; }
.hero-card h1 {
  max-width: 580px;
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.28;
  margin: 0 0 14px;
}
.hero-lead {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 18px;
  max-width: 480px;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; }
.tag-row span {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 252, 244, 0.5);
}

.access-panel {
  margin-top: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 20px;
  background: rgba(255, 252, 244, .48);
}
.access-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.panel-kicker { margin: 0; color: var(--accent); font: 500 11px var(--mono); letter-spacing: 0.1em; }
.panel-desc { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.pill {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 9px;
}
.warning-box {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(255, 252, 244, 0.4);
}
.warning-box strong { display: block; font-size: 13px; color: var(--accent-deep); margin-bottom: 4px; }
.warning-box p { margin: 3px 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.input-label { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.access-form { display: grid; grid-template-columns: minmax(0, 1fr) 142px; gap: 9px; }
.code-input {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 13px;
  background: var(--card-solid);
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  outline: none;
  text-transform: uppercase;
}
.code-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184, 69, 47, 0.13); }
.primary-btn {
  min-height: 48px;
  box-shadow: 0 7px 15px rgba(156, 53, 35, .16);
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  background: var(--accent);
  color: #fdf9f0;
  font-size: 14px;
  font-weight: 600;
}
.primary-btn:disabled { opacity: 0.6; cursor: wait; }
.ghost-btn {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}
.ghost-btn:disabled { opacity: 0.45; cursor: default; }
.form-message { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: #5d7d5a; }
.form-message.error { color: #a93e3e; }
.form-message.center { text-align: center; }
.disclaimer { margin-top: 16px; font-size: 11.5px; color: var(--faint); line-height: 1.6; }

.claim-panel { margin-top: 22px; border-top: 1px dashed var(--line-strong); padding-top: 18px; }
.claim-divider { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.claim-divider::before, .claim-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.claim-divider span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); letter-spacing: 0.08em; }
.claim-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.claim-desc { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.claim-form { margin-bottom: 4px; }
.claim-result { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 11px; padding: 11px 13px; border-radius: 11px; background: rgba(184, 69, 47, 0.06); border: 1px solid rgba(184, 69, 47, 0.28); }
.claim-result[hidden] { display: none; }
.claim-result span { font-size: 12px; color: var(--muted); }
.claim-result strong { font: 600 14px var(--mono); color: var(--accent-deep); letter-spacing: 0.08em; flex: 1; }
.mini-btn { min-height: 34px; padding: 0 11px; font-size: 12px; }
@media (max-width: 420px) {
  .claim-result { align-items: stretch; flex-direction: column; }
  .mini-btn { width: 100%; }
}

.quiz-topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.phase-text { margin: 0; color: var(--muted); font-size: 13px; }
.counter { font: 500 12px var(--mono); color: var(--accent); }
.progress-wrap { height: 5px; border-radius: 999px; background: rgba(122, 96, 66, 0.14); margin-bottom: 18px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #d0785f); border-radius: 999px; transition: width 0.3s ease; }
.scene-label { margin: 0 0 6px; color: var(--accent); font: 500 11px var(--mono); letter-spacing: 0.12em; }
.question-card h2 { font-size: 22px; font-weight: 600; line-height: 1.45; margin: 0 0 20px; letter-spacing: -0.01em; }
.option-list { display: grid; gap: 10px; }
.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px 15px;
  background: rgba(255, 252, 244, 0.66);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.option-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.option-btn.option-picked { border-color: var(--accent); background: var(--accent-soft); }
.option-title { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.option-desc { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.quiz-actions { display: flex; gap: 10px; margin-top: 16px; }

.result-card { position: relative; padding: 28px 24px; }
.result-hero { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.serial { margin: 0 0 4px; font: 500 12px var(--mono); color: var(--accent); }
.dynasty { margin: 0 0 8px; font-size: 13px; color: var(--gold); letter-spacing: 0.08em; }
.result-hero h2 { font-size: 27px; font-weight: 600; line-height: 1.35; margin: 0 0 8px; letter-spacing: -0.015em; }
.result-subtitle { margin: 0; color: var(--muted); font-size: 14.5px; }

.score-grid { display: grid; gap: 10px; margin: 0 0 20px; }
.score-item { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.score-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; margin-bottom: 5px; }
.score-top b { font: 500 12px var(--mono); color: var(--accent); }
.score-track { height: 7px; border-radius: 999px; background: rgba(122, 96, 66, 0.13); overflow: hidden; }
.score-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #d0785f); }

.result-section { margin: 0 0 18px; }
.result-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  gap: 7px;
}
.result-section h3 span {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
}
.result-section p { margin: 0; font-size: 14px; color: var(--ink); line-height: 1.85; }
.result-section ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.result-section li {
  font-size: 13.5px;
  color: var(--ink);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.5);
}
.keyword-list { display: flex; flex-wrap: wrap; gap: 7px; }
.keyword-list span {
  font-size: 12.5px;
  color: var(--accent-deep);
  border: 1px solid rgba(184, 69, 47, 0.35);
  border-radius: 999px;
  padding: 4px 11px;
  background: rgba(184, 69, 47, 0.05);
}
.epithet { margin-top: 8px !important; color: var(--muted) !important; font-size: 13.5px !important; }
.quote-section p {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--accent-deep);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}
.note-section { border-top: 1px dashed var(--line); padding-top: 16px; }
.note-section p { color: var(--muted); }

.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.result-actions .primary-btn { grid-column: 1 / -1; }

@media (max-width: 420px) {
  .app-shell { padding: 14px 14px 52px; }
  .site-masthead { margin-bottom: 16px; }
  .scroll-card { padding: 24px 18px; }
  .hero-card::before, .result-card::before { inset: 8px; }
  .hero-card h1 { font-size: 34px; }
  .access-panel { padding: 16px; }
  .result-hero h2 { font-size: 23px; }
  .access-form { grid-template-columns: 1fr; }
  .access-form .primary-btn { width: 100%; }
  .result-actions { grid-template-columns: 1fr; }
  .result-actions .primary-btn { grid-column: auto; }
  .app-shell { padding: 14px 12px 48px; }
  .scroll-card { padding: 20px 16px; }
}
