:root {
  --ink: #172328;
  --muted: #657174;
  --paper: #f7f3ea;
  --paper-deep: #ece4d6;
  --surface: #fffdf8;
  --coral: #df684f;
  --teal: #1c6b68;
  --yellow: #e6b84e;
  --line: #d8d0c3;
  --shadow: 0 18px 40px rgba(23, 35, 40, 0.1);
}

* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.55 "Microsoft YaHei", "PingFang SC", sans-serif; overflow-x: hidden; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.app-shell { min-height: 100dvh; max-width: 1180px; margin: 0 auto; padding: 18px 22px 54px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .12em; font-weight: 700; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--coral); color: #fff; border-radius: 50%; font-size: 16px; }
.back-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 9px 16px; font-size: 14px; min-height: 44px; }
.back-btn:hover { background: var(--surface); }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: end; margin: 30px 0 56px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(38px, 6vw, 72px); line-height: 1.03; letter-spacing: -.03em; max-width: 620px; }
.hero-copy { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-photo { min-height: 290px; background: #d7c4aa url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1000&q=80") center/cover; border-radius: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-photo::after { content: "TRAVEL / 02"; position: absolute; bottom: 16px; left: 18px; color: #fff; font-size: 11px; letter-spacing: .15em; font-weight: 800; }

.section-kicker { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.section-kicker h2 { font-size: 26px; margin: 0; }
.section-kicker span { color: var(--muted); font-size: 13px; }
.mode-grid, .character-grid, .event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-card, .character-card, .event-card, .question-card, .result-panel, .game-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 22px rgba(23,35,40,.05); }
.mode-card { min-height: 245px; padding: 26px; display: flex; flex-direction: column; justify-content: space-between; transition: transform .2s ease, box-shadow .2s ease; }
.mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.mode-card.primary { background: var(--teal); color: #f7f3ea; border-color: var(--teal); }
.mode-card.primary .card-meta, .mode-card.primary .card-desc { color: #cde4df; }
.mode-number { font-size: 12px; letter-spacing: .14em; font-weight: 800; }
.mode-card h3 { font-size: 30px; line-height: 1.1; margin: 24px 0 8px; }
.card-desc { color: var(--muted); max-width: 420px; }
.card-meta { color: var(--muted); font-size: 13px; }
.arrow-btn { align-self: flex-start; border: 0; background: transparent; padding: 8px 0; font-weight: 800; }
.primary .arrow-btn { color: #fff; }

.subtle-note { color: var(--muted); font-size: 13px; margin: 26px 0 0; }
.screen-title { max-width: 760px; margin: 30px 0; }
.screen-title h1 { font-size: clamp(36px, 5vw, 58px); margin-bottom: 12px; }
.progress { height: 6px; background: var(--paper-deep); border-radius: 999px; margin: 20px 0 30px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--coral); transition: width .25s ease; }
.question-card { padding: 28px; }
.question-card h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.2; margin-bottom: 24px; }
.option-list { display: grid; gap: 10px; }
.option { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-height: 56px; background: #fff; text-align: left; transition: background .18s ease, border .18s ease, transform .18s ease; }
.option:hover { border-color: var(--teal); transform: translateX(3px); }
.option.selected { background: #e7f0ec; border-color: var(--teal); }
.option-dot { width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 50%; flex: 0 0 auto; margin-top: 1px; }
.selected .option-dot { border: 6px solid var(--teal); }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.btn { min-height: 46px; border-radius: 999px; border: 1px solid var(--ink); padding: 10px 20px; background: var(--ink); color: #fff; font-weight: 700; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.coral { background: var(--coral); border-color: var(--coral); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.character-card, .event-card { padding: 20px; text-align: left; transition: transform .2s ease, border .2s ease; }
.character-card:hover, .event-card:hover { transform: translateY(-3px); }
.character-card.selected, .event-card.selected { border: 2px solid var(--coral); padding: 19px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-deep); color: var(--teal); font-size: 22px; font-weight: 800; margin-bottom: 18px; }
.character-card h3, .event-card h3 { font-size: 21px; margin-bottom: 5px; }
.character-card p, .event-card p { color: var(--muted); margin-bottom: 12px; font-size: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f0e7d9; color: #725b40; padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.event-card { min-height: 190px; }
.event-card.locked { opacity: .62; }
.event-card.locked::after { content: "资料整理中"; display: inline-block; margin-top: 10px; color: var(--muted); font-size: 12px; }

.selection-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.selection-layout > section { min-width: 0; }
.game-panel { padding: 26px; }
.game-panel h2 { font-size: 30px; margin-bottom: 8px; }
.game-meta { color: var(--muted); margin-bottom: 24px; }
.stat { margin: 14px 0; }
.stat-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.meter { height: 10px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter span { height: 100%; display: block; background: var(--teal); transition: width .25s ease; }
.meter.coral span { background: var(--coral); }
.box-stage { min-height: 220px; display: grid; place-items: center; background: #f2eadc; border: 1px dashed #cdbda7; border-radius: 12px; margin: 20px 0; position: relative; overflow: hidden; }
.boxes { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; max-width: 300px; }
.box { width: 34px; height: 34px; display: grid; place-items: center; background: var(--yellow); color: #6c4d18; border: 1px solid #bd8f2c; font-size: 11px; font-weight: 800; }
.box.done { background: var(--teal); color: #fff; border-color: var(--teal); }
.choice-list { display: grid; gap: 10px; }
.choice-list .btn { text-align: left; border-radius: 10px; background: #fff; color: var(--ink); border-color: var(--line); }
.choice-list .btn:hover { border-color: var(--teal); background: #eef5f2; }
.result-panel { padding: 30px; max-width: 820px; }
.score { font-size: 72px; line-height: 1; color: var(--coral); font-weight: 800; margin: 10px 0; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.result-metric { padding: 14px; background: #f2eadc; border-radius: 10px; }
.result-metric strong { display: block; font-size: 24px; }
.ranking { display: grid; gap: 8px; margin: 10px 0 24px; }
.score-note { margin: -4px 0 10px; color: var(--muted); font-size: 13px; }
.analysis-block { margin: 22px 0 28px; padding: 18px; background: #f2eadc; border-left: 4px solid var(--coral); border-radius: 8px; }
.analysis-block p { margin-bottom: 14px; }
.analysis-block p strong { display: block; margin-bottom: 6px; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.analysis-grid div { display: grid; gap: 3px; }
.analysis-grid span { color: var(--muted); font-size: 12px; }
.analysis-grid strong { font-size: 14px; }
.rank-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; background: #f2eadc; border-radius: 8px; }
.rank-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-row strong { font-size: 15px; }
.rank-row em { font-style: normal; color: var(--teal); font-weight: 800; font-variant-numeric: tabular-nums; }
.source-line { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; }
.footer { border-top: 1px solid var(--line); margin-top: 64px; padding-top: 16px; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .app-shell { padding: 12px 16px calc(40px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 6px 0 18px; gap: 10px; }
  .brand { font-size: 12px; letter-spacing: .08em; }
  .brand-mark { width: 26px; height: 26px; font-size: 14px; }
  .back-btn { padding: 8px 14px; font-size: 13px; }
  .hero, .selection-layout { grid-template-columns: 1fr; gap: 22px; }
  .hero { margin: 14px 0 40px; }
  .hero-copy { font-size: 16px; }
  .hero-photo { min-height: 180px; border-radius: 14px; }
  .section-kicker { flex-direction: column; align-items: flex-start; gap: 4px; }
  .section-kicker h2 { font-size: 22px; }
  .mode-grid, .event-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .character-card { padding: 14px; }
  .character-card.selected { padding: 13px; }
  .avatar { width: 44px; height: 44px; font-size: 18px; margin-bottom: 10px; }
  .character-card h3 { font-size: 17px; }
  .character-card p { font-size: 12px; margin-bottom: 8px; }
  .mode-card { min-height: 0; padding: 22px; }
  .mode-card h3 { font-size: 26px; margin: 16px 0 6px; }
  .event-card { min-height: 0; }
  .screen-title { margin: 20px 0; }
  h1 { font-size: clamp(30px, 9vw, 42px); }
  .screen-title h1 { font-size: clamp(28px, 8vw, 40px); }
  .question-card, .game-panel, .result-panel { padding: 20px; }
  .question-card h2 { font-size: 22px; }
  .game-panel h2 { font-size: 24px; }
  .actions { flex-wrap: wrap; }
  .actions .btn { flex: 1 1 auto; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .score { font-size: 56px; }
  .box-stage { min-height: 170px; }
  .footer { margin-top: 44px; }
}

@media (max-width: 400px) {
  .btn { padding: 10px 16px; }
  .score { font-size: 48px; }
  .question-card h2 { font-size: 20px; }
}

@media (hover: none) {
  .mode-card:hover, .character-card:hover, .event-card:hover { transform: none; }
  .option:hover { transform: none; border-color: var(--line); }
  .option.selected:hover { border-color: var(--teal); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
