:root {
  color-scheme: light;
  --paper: #f5f0e4;
  --surface: #fffdf6;
  --ink: #203b4b;
  --muted: #586a70;
  --line: #d9d9cb;
  --stamp: #ac3c2c;
  --stamp-soft: #f9e9dd;
  --green: #426456;
  --shadow: 0 14px 40px rgb(42 51 48 / 6%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.7; }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 1px solid #bcc5bf; border-radius: 9px; padding: 10px 15px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.5; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
button:hover { background: #eeefe5; border-color: #7a9089; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button:disabled:active { transform: none; }
button.primary { background: var(--stamp); border-color: var(--stamp); color: #fffcf5; }
button.primary:hover { background: #943225; border-color: #943225; }
button.danger { color: #9a392a; border-color: #cfb3a3; }
button.danger:hover { background: #fae9df; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #24738b; outline-offset: 4px; }
a { color: var(--ink); text-underline-offset: 4px; }
.page-shell { max-width: 1250px; margin: 0 auto; padding: 0 36px; }
.topbar { min-height: 86px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.home-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; font-family: Georgia, "Songti SC", serif; font-weight: 700; font-size: 19px; }
.home-link:hover { text-decoration: underline; }
.topbar > span { color: var(--muted); font-size: 12px; max-width: 52%; text-align: right; letter-spacing: .04em; }
.hero { max-width: 800px; padding: 49px 0 35px; }
.eyebrow { margin: 0 0 11px; font-size: 11px; font-weight: 800; line-height: 1.5; color: var(--stamp); letter-spacing: .14em; overflow-wrap: anywhere; }
h1 { margin: 0 0 18px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(37px, 4.8vw, 58px); line-height: 1.15; letter-spacing: -.03em; font-weight: 700; }
h1 span { color: var(--stamp); }
.intro { max-width: 650px; margin: 0; color: #425b65; font-size: 17px; }
.hero-note { display: inline-block; margin: 16px 0 0; color: var(--muted); border-left: 3px solid #bcaa88; padding-left: 12px; font-size: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 24px; align-items: start; }
.journey-panel { min-width: 0; border: 1px solid var(--line); border-radius: 20px; padding: 27px; background: var(--surface); box-shadow: var(--shadow); }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid #e2e2d6; }
.route-meta { min-width: 0; }
.route-meta strong { display: block; font-size: 15px; }
#seedLabel { color: var(--muted); font-size: 11px; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.route-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.route-actions button { padding: 8px 11px; font-size: 12px; }
.progress-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; padding: 0; margin: 25px 0 32px; gap: 8px; counter-reset: route-step; }
.progress-list li { min-width: 0; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: #677573; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; counter-increment: route-step; }
.progress-list li::before { content: counter(route-step, decimal-leading-zero); display: flex; justify-content: center; align-items: center; width: 29px; height: 29px; background: #f1f1e7; border: 1px solid #d2d8cc; border-radius: 50%; color: #677573; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.progress-list li::after { content: ""; position: absolute; height: 1px; top: 14px; left: 36px; right: 0; background: #d4d9ce; }
.progress-list li:last-child::after { display: none; }
.progress-list li.is-current { color: var(--stamp); font-weight: 750; }
.progress-list li.is-current::before { background: var(--stamp); border-color: var(--stamp); color: var(--surface); box-shadow: 0 0 0 4px #f8eade; }
.progress-list li.is-done { color: var(--green); }
.progress-list li.is-done::before { background: #e6eee3; border-color: #aabfa8; color: var(--green); }
.round-heading { margin-bottom: 21px; }
.round-heading .eyebrow { margin-bottom: 9px; }
.round-heading h2 { margin: 0 0 9px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(24px, 2.7vw, 32px); line-height: 1.4; font-weight: 700; letter-spacing: -.02em; }
.round-heading > p:last-child { color: var(--muted); font-size: 14px; margin: 0; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.choice-card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 244px; position: relative; padding: 24px 23px 21px; background: #f3f2e7; border: 1px solid #ccd5c8; border-radius: 14px; color: var(--ink); text-align: left; font-weight: 400; overflow-wrap: anywhere; }
.choice-card:nth-child(2) { background: #fcf0df; border-color: #ddcbb0; }
.choice-card:hover { background: #e9eee2; border-color: #7b988a; transform: translateY(-3px); box-shadow: 0 10px 24px rgb(38 65 53 / 7%); }
.choice-card:nth-child(2):hover { background: #f9e7cf; border-color: #bc8a5d; }
.choice-card:active { transform: translateY(0); }
.choice-label { color: #597064; font-size: 10px; letter-spacing: .13em; font-weight: 750; line-height: 1.5; margin-bottom: 21px; }
.choice-card:nth-child(2) .choice-label { color: #93603c; }
.choice-title { display: block; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 23px; font-weight: 700; line-height: 1.45; margin-bottom: 13px; }
.choice-detail { display: block; color: #4b6264; font-size: 13px; font-weight: 400; line-height: 1.85; margin-bottom: 25px; }
.choice-arrow { display: flex; margin-top: auto; width: 32px; height: 32px; align-items: center; justify-content: center; color: #355c50; border: 1px solid #9bb09f; border-radius: 50%; font-size: 17px; }
.choice-card:nth-child(2) .choice-arrow { color: #895835; border-color: #c9a37e; }
#backButton { margin-top: 20px; font-size: 13px; background: transparent; }
.game-status { margin: 17px 0 0; color: var(--muted); font-size: 12px; min-height: 22px; }
.notice { color: #7c4932; background: #fff0df; border: 1px solid #e0c7ac; border-radius: 9px; padding: 11px 13px; font-size: 12px; overflow-wrap: anywhere; }
.ticket { position: relative; margin-top: 5px; border: 1px solid #cdcdbd; border-radius: 12px; padding: 27px; background: #faf6e9; box-shadow: 0 6px 0 #e5e4d5; overflow-wrap: anywhere; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 47%; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid #cdcdbd; }
.ticket::before { left: -11px; border-left-color: transparent; border-bottom-color: transparent; transform: rotate(45deg); }
.ticket::after { right: -11px; border-right-color: transparent; border-top-color: transparent; transform: rotate(45deg); }
.ticket-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; border-bottom: 1px dashed #b6bead; padding-bottom: 20px; margin-bottom: 22px; }
.ticket-top .eyebrow { margin: 0; color: #5a6b66; font-size: 10px; }
.ticket-stamp { display: inline-block; max-width: 100%; border: 2px solid #ae4936; border-radius: 4px; padding: 4px 9px; color: #9e3f2d; font-size: 11px; font-weight: 800; letter-spacing: .1em; line-height: 1.7; transform: rotate(-6deg); }
#ticketTitle { margin: 0 0 17px; font-family: Georgia, "Songti SC", "STSong", serif; font-size: clamp(25px, 3vw, 35px); line-height: 1.4; letter-spacing: -.025em; }
.ticket-route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--stamp); font-size: 12px; margin-bottom: 15px; }
.ticket-route > span { max-width: 100%; }
#ticketStory { color: #3d555e; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 17px; line-height: 1.95; margin: 0 0 22px; }
#ticketDetails { padding: 21px 0 0; margin: 0; border-top: 1px dashed #b6bead; list-style: none; display: grid; gap: 14px; }
#ticketDetails li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 13px; font-size: 12px; color: #566861; line-height: 1.8; }
#ticketDetails strong { color: #3b554c; font-size: 11px; font-weight: 750; }
#ticketDetails span { min-width: 0; }
.ticket-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #d4d7c8; color: #64716a; font-size: 10px; line-height: 1.7; letter-spacing: .03em; }
.ticket-bottom span { min-width: 0; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.result-actions button { font-size: 12px; }
.side-panel { min-width: 0; display: grid; gap: 18px; }
.side-panel > section { background: rgb(255 253 246 / 72%); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.side-panel h2 { color: var(--ink); font-size: 16px; line-height: 1.5; margin: 0 0 13px; }
.side-panel p { color: #52666b; font-size: 12px; line-height: 1.85; margin: 9px 0 0; }
.side-panel .eyebrow { color: var(--stamp); font-size: 10px; line-height: 1.5; margin: 0 0 9px; }
.side-panel ol, .side-panel ul:not(.shelf-list) { color: #52666b; font-size: 12px; padding-left: 18px; margin: 0; }
.side-panel li + li { margin-top: 8px; }
.shelf-list { list-style: none; display: grid; gap: 10px; padding: 0; margin: 18px 0 0; }
.shelf-list li + li { margin-top: 0; }
.shelf-ticket { display: block; width: 100%; min-width: 0; border: 1px solid #cfcebd; border-left: 3px solid #b15b41; border-radius: 6px; background: #faf5e7; padding: 12px 13px; text-align: left; overflow-wrap: anywhere; }
.shelf-ticket:hover { background: #f3ebd7; border-color: #af9f82; border-left-color: #a54b34; }
.shelf-ticket strong { display: block; font-family: Georgia, "Songti SC", "STSong", serif; font-size: 15px; font-weight: 700; line-height: 1.6; }
.shelf-ticket span { display: block; margin-top: 4px; color: #62716b; font-size: 10px; font-weight: 400; line-height: 1.7; }
.empty-note { padding: 13px 0 0; color: #6c7972; }
.side-panel .storage-status, .storage-status { border-left: 3px solid #b9c6ad; background: #eff1e6; border-radius: 4px; padding: 9px 11px; color: #4f6554; font-size: 11px; }
.storage-status.is-error { background: #fff0df; border-color: #bc8761; color: #805036; }
.copy-fallback { margin-top: 18px; border: 1px solid #d7c5ad; border-radius: 10px; background: #fff6e9; padding: 14px; }
.copy-fallback label, .copy-fallback p { display: block; color: #79523b; font-size: 12px; margin: 0 0 8px; }
.copy-fallback textarea { display: block; resize: vertical; min-height: 132px; max-height: 420px; width: 100%; min-width: 0; padding: 11px; border: 1px solid #b8bca9; border-radius: 6px; background: #fffdf7; color: var(--ink); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 35px 0 29px; color: var(--muted); font-size: 11px; }
footer p { margin: 0; }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
dialog { width: min(448px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 48px); overflow: auto; margin: auto; padding: 27px; border: 1px solid #c5cbbd; border-radius: 17px; background: var(--surface); color: var(--ink); box-shadow: 0 25px 90px rgb(22 38 45 / 24%); }
dialog::backdrop { background: rgb(24 40 48 / 48%); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.4; }
dialog p { margin: 0 0 23px; color: #4e6269; font-size: 14px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.dialog-actions button { font-size: 13px; margin: 0; }
.dialog-actions button:last-child { background: var(--stamp); border-color: var(--stamp); color: #fffdf7; }
.dialog-actions button:last-child:hover { background: #943225; border-color: #943225; }

@media (max-width: 1030px) {
  .page-shell { padding: 0 26px; }
  .layout { grid-template-columns: minmax(0, 1fr) 264px; gap: 18px; }
  .journey-panel { padding: 22px; }
  .side-panel > section { padding: 19px; }
  .choice-card { padding: 20px 17px; }
  .choice-title { font-size: 21px; }
  .ticket { padding: 23px; }
}

@media (max-width: 850px) {
  .page-shell { max-width: 740px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .side-panel > section:last-child { grid-column: 1 / -1; }
  .hero { padding: 37px 0 29px; }
  .hero h1 { font-size: 45px; }
  .choice-card { min-height: 237px; padding: 24px; }
  .choice-title { font-size: 24px; }
  .choice-detail { font-size: 14px; }
}

@media (max-width: 540px) {
  .page-shell { padding: 0 16px; }
  .topbar { min-height: 72px; gap: 12px; }
  .home-link { font-size: 17px; }
  .topbar > span { max-width: 45%; font-size: 10px; }
  .hero { padding: 29px 0 25px; }
  .hero h1 { font-size: 38px; }
  .intro { font-size: 15px; }
  .hero-note { font-size: 11px; }
  .journey-panel { padding: 18px; border-radius: 16px; }
  .toolbar { gap: 12px; padding-bottom: 16px; }
  .route-actions { width: 100%; gap: 6px; }
  .route-actions button { flex: 1 1 auto; padding: 8px; font-size: 11px; }
  .progress-list { margin: 23px 0 27px; gap: 6px; }
  .progress-list li { font-size: 10px; gap: 8px; }
  .progress-list li::before { width: 27px; height: 27px; font-size: 9px; }
  .progress-list li::after { left: 32px; top: 13px; }
  .round-heading h2 { font-size: 25px; }
  .round-heading > p:last-child { font-size: 13px; }
  .choices { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .choice-card { min-height: 170px; padding: 21px; }
  .choice-label { margin-bottom: 13px; }
  .choice-title { font-size: 23px; margin-bottom: 8px; padding-right: 26px; }
  .choice-detail { font-size: 13px; margin-bottom: 9px; padding-right: 25px; }
  .choice-arrow { position: absolute; right: 17px; bottom: 18px; width: 29px; height: 29px; }
  #backButton { width: 100%; margin-top: 16px; }
  .ticket { padding: 21px 18px; border-radius: 9px; }
  .ticket-top { gap: 13px; padding-bottom: 18px; margin-bottom: 20px; }
  .ticket-stamp { font-size: 10px; }
  #ticketTitle { font-size: 26px; }
  #ticketStory { font-size: 16px; }
  #ticketDetails li { grid-template-columns: 45px minmax(0, 1fr); gap: 9px; font-size: 12px; }
  #ticketDetails strong { font-size: 10px; }
  .ticket-bottom { font-size: 9px; }
  .result-actions { gap: 8px; margin-top: 23px; }
  .result-actions button { flex: 1 1 44%; font-size: 11px; padding: 9px; }
  .side-panel { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .side-panel > section:last-child { grid-column: auto; }
  .side-panel > section { border-radius: 14px; padding: 21px; }
  footer { padding: 24px 0; gap: 3px; }
  dialog { padding: 22px; border-radius: 14px; }
  .dialog-actions { flex-direction: column; }
  .dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:hover, button:active, .choice-card:hover, .choice-card:active { transform: none; }
}
