:root {
  color-scheme: light;
  --paper: #f7f6ef;
  --surface: #fffef9;
  --ink: #1d342c;
  --muted: #536458;
  --line: #ced3c5;
  --field-line: #99a69b;
  --pine: #224d40;
  --pine-deep: #173e33;
  --persimmon: #ae4528;
  --persimmon-deep: #91351e;
  --focus: #a93c1e;
  --radius: 18px;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
h1, h2, p, figure, dl, dd { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
svg { display: block; }
::selection { background: #f3cfad; color: #213b30; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
#desk, #guide { scroll-margin-top: 1rem; }
#desk:focus:not(:focus-visible) { outline: none; }

.shell { width: min(70rem, calc(100% - clamp(2.25rem, 10vw, 8rem))); margin-inline: auto; }
.skip-link { position: absolute; z-index: 10; top: .5rem; left: .5rem; padding: .7rem .9rem; border-radius: 6px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .brand, .header-nav, .header-nav a, .destination, .panel-heading, .account-heading, .refresh-button, .account-identity { display: flex; align-items: center; }
.header-inner { min-height: 4.65rem; justify-content: space-between; gap: 1rem; }
.brand, .header-nav a { text-decoration: none; }
.brand { flex: 0 0 auto; gap: .65rem; border-radius: 8px; font-size: 1.25rem; font-weight: 750; letter-spacing: .045em; }
.brand-mark { width: 2.45rem; height: 2.45rem; }
.header-nav { gap: clamp(.85rem, 2.6vw, 2.2rem); }
.header-nav a { min-height: 2.75rem; gap: .4rem; padding-inline: .15rem; border-radius: 3px; font-size: .88rem; font-weight: 600; }
.header-nav a:hover, .site-footer a:hover { color: var(--persimmon); text-decoration: underline; }
.header-nav svg, .destination svg, .heading-icon, .refresh-button svg, .account-identity svg { width: 1.2rem; height: 1.2rem; flex: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.header-nav .guide-link { color: var(--pine); }

.notice { position: sticky; top: .65rem; z-index: 4; overflow-wrap: anywhere; }
.notice:not(:empty), .script-note, .policy-note { padding: .8rem 1rem; border: 1px solid #b9cebf; border-inline-start: 4px solid #43785d; border-radius: 8px; background: #eef5e9; color: #284c37; font-size: .9rem; }
.notice:not(:empty), .script-note { margin-top: 1.1rem; }
.notice[role="alert"]:not(:empty), .notice[data-kind="error"]:not(:empty), .notice.error:not(:empty), .script-note, .policy-note { border-color: #dfb29e; border-inline-start-color: #a34529; background: #fff0e6; color: #743420; }
.notice[data-kind="success"]:not(:empty) { border-inline-start-color: #31734e; background: #eaf4e7; }

.auth-stage { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(20rem, .91fr); grid-template-areas: "intro form" "ticket form"; grid-template-rows: auto 1fr; align-items: start; column-gap: clamp(2.5rem, 6.1vw, 5.8rem); row-gap: clamp(1.6rem, 2.1vw, 2.35rem); padding-block: clamp(2.15rem, 4vw, 4rem) clamp(2.7rem, 4.6vw, 4.8rem); }
.auth-intro { grid-area: intro; align-self: end; min-width: 0; }
.destination { width: fit-content; gap: .4rem; color: #865037; font-size: .82rem; font-weight: 700; letter-spacing: .09em; }
.destination::before { content: ""; width: 1.55rem; height: 2px; margin-right: .15rem; background: #c6754b; }
.destination svg { width: 1rem; height: 1rem; stroke-width: 1.8; }
.auth-intro h1, .account-heading h1 { color: var(--ink); font-size: clamp(2.5rem, 4.6vw, 4rem); line-height: 1.19; letter-spacing: -.045em; font-weight: 750; }
.auth-intro h1 { margin: .55rem 0 .85rem; }
.intro-copy { max-width: 28em; color: var(--muted); font-size: 1rem; line-height: 1.8; text-wrap: pretty; }
.surface { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.entry-panel { grid-area: form; padding: clamp(1.35rem, 2.4vw, 2.05rem); box-shadow: 0 3px 0 -1px #e6e7dc, 0 14px 32px -27px #354e3c; }
.panel-heading { justify-content: space-between; gap: .75rem; }
h2 { font-size: 1.4rem; font-weight: 730; line-height: 1.35; letter-spacing: -.025em; }
.heading-icon { width: 1.5rem; height: 1.5rem; color: #697b6e; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; padding: .25rem; margin: 1.2rem 0 1.15rem; border: 1px solid #d6dace; border-radius: 10px; background: #edeee5; }
.mode-switch button { min-height: 2.5rem; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; }
.mode-switch button:hover { color: var(--pine); }
.mode-switch button[aria-pressed="true"], .mode-switch button[aria-selected="true"] { border-color: #c8cfc1; background: var(--surface); color: var(--pine-deep); box-shadow: 0 1px 3px #263e2d14; }
.stack-form { display: grid; gap: 1rem; }
.field { min-width: 0; display: grid; gap: .38rem; }
.field label { width: fit-content; font-size: .89rem; font-weight: 650; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.field-action { min-height: 1.55rem; padding: 0 .15rem; border: 0; border-radius: 3px; background: transparent; color: var(--pine); font-size: .86rem; text-decoration: underline; text-underline-offset: .2em; }
input { display: block; width: 100%; min-width: 0; min-height: 2.95rem; padding: .6rem .8rem; border: 1px solid var(--field-line); border-radius: 8px; color: var(--ink); background: #fffefa; font-size: 1rem; line-height: 1.35; }
input::placeholder { color: #647266; opacity: 1; }
input:hover:not(:disabled) { border-color: #76897a; }
input:focus-visible { border-color: var(--focus); outline-offset: 2px; }
input[aria-invalid="true"], input:user-invalid { border-color: #a83a24; background-color: #fff8f2; }
.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.button { display: inline-flex; min-height: 2.85rem; align-items: center; justify-content: center; gap: .55rem; padding: .62rem 1rem; border: 1px solid transparent; border-radius: 8px; font-size: .94rem; font-weight: 650; line-height: 1.4; text-align: center; }
.button-primary { width: 100%; min-height: 3rem; margin-top: .15rem; border-color: var(--persimmon); background: var(--persimmon); color: white; }
.button-primary:hover:not(:disabled) { border-color: var(--persimmon-deep); background: var(--persimmon-deep); }
.button-primary::after { content: ""; display: block; width: .43rem; height: .43rem; margin-left: .15rem; border-top: 1.6px solid currentColor; border-right: 1.6px solid currentColor; transform: rotate(45deg); }
.button-secondary { border-color: #aab7a9; background: var(--surface); color: var(--pine-deep); }
.button-secondary:hover:not(:disabled) { background: #edf1e7; border-color: #819484; }
.button-ink { border-color: var(--pine); background: var(--pine); color: #fffef7; }
.button-ink:hover:not(:disabled) { background: var(--pine-deep); }
.form-hint, .policy-note, .empty-message { font-size: .87rem; line-height: 1.65; overflow-wrap: anywhere; }
.form-hint, .empty-message { color: var(--muted); }
.form-hint:empty, .policy-note:empty { display: none; }
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .62; }
form[aria-busy="true"] button[type="submit"], button[aria-busy="true"] { cursor: progress; }
form[aria-busy="true"] .button-primary::after, .button-primary[aria-busy="true"]::after { width: .85rem; height: .85rem; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; transform: none; }

/* 保留票根打孔和海岸线的间距，窄屏时整张票移到表单后。 */
.coast-ticket { --stub: clamp(3.5rem, 11%, 4.2rem); grid-area: ticket; position: relative; isolation: isolate; display: grid; width: 100%; max-width: 40rem; aspect-ratio: 2.44; grid-template-columns: minmax(0, 1fr) var(--stub); align-self: start; overflow: hidden; border: 1px solid #a6b19b; border-radius: 13px; background: #e5ead5; box-shadow: 0 3px 0 -1px #d5d7c6, 0 14px 20px -18px #3f5143; }
.coast-ticket::before, .coast-ticket::after { content: ""; position: absolute; z-index: 2; right: calc(var(--stub) - .47rem); width: .94rem; height: .94rem; border: 1px solid #a6b19b; border-radius: 50%; background: var(--paper); }
.coast-ticket::before { top: -.5rem; }
.coast-ticket::after { bottom: -.5rem; }
.ticket-picture { position: relative; overflow: hidden; }
.coast-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.ticket-name { position: absolute; top: 7.5%; left: 4.3%; color: #315443; font-family: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 500; font-size: clamp(1.8rem, 3.45vw, 3.15rem); line-height: 1; letter-spacing: -.055em; }
.ticket-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .65rem; padding: 1.15rem .35rem 1.25rem; border-inline-start: 1px dashed #94a08a; background: repeating-linear-gradient(135deg, #f0ecd600 0 4px, #6e735908 4px 5px), #f0ecd7; color: #4a604d; }
.stub-compass { width: 1.6rem; height: 1.6rem; }
.stub-label { writing-mode: vertical-rl; font-size: .78rem; font-weight: 650; letter-spacing: .27em; }
.stub-waves { display: grid; gap: 3px; justify-items: center; }
.stub-waves i { display: block; width: 1.08rem; height: 1px; background: currentColor; }
.stub-waves i:nth-child(2) { width: .75rem; }
.stub-waves i:last-child { width: .47rem; }

.account-stage { padding-block: clamp(2rem, 4vw, 3.8rem) clamp(2.6rem, 4.5vw, 4rem); }
.account-heading { justify-content: space-between; gap: 1rem; margin-bottom: 1.65rem; }
.account-heading > div { min-width: 0; }
.account-heading h1 { font-size: clamp(2.1rem, 3.8vw, 3.2rem); }
.account-heading .button { flex: none; }
.account-identity { gap: .3rem; margin-top: .5rem; color: var(--muted); font-size: .93rem; overflow-wrap: anywhere; }
.account-identity svg { width: 1.05rem; height: 1.05rem; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-areas: "benefits redeem" "benefits subscription"; align-items: start; gap: 1rem 1.45rem; }
.benefit-panel, .redeem-panel, .subscription-panel { min-width: 0; padding: clamp(1.2rem, 2.3vw, 2rem); }
.benefit-panel { grid-area: benefits; border: 1px solid #294f41; border-radius: var(--radius); background: var(--pine); color: #fbfaef; box-shadow: 0 3px 0 -1px #c7cdbd; }
.benefit-panel :focus-visible { outline-color: #ffcb94; }
.refresh-button { min-height: 2.6rem; justify-content: center; gap: .35rem; padding: .38rem .7rem; border: 1px solid #8fa89a; border-radius: 7px; background: transparent; color: inherit; font-size: .85rem; font-weight: 600; }
.refresh-button:hover:not(:disabled) { background: #335c4c; }
.refresh-button svg { width: 1rem; height: 1rem; }
.balance-list { display: grid; gap: 1.5rem; margin-top: 1.65rem; }
.balance-list dt, .expiry-row dt { color: #d2ded0; font-size: .84rem; }
.balance-list dd, .expiry-row dd { margin-top: .25rem; overflow-wrap: anywhere; }
.plan-name { font-size: 1.22rem; font-weight: 650; }
.quota-value { font-size: clamp(1.85rem, 3.2vw, 2.75rem); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.22; }
progress { display: block; appearance: none; width: 100%; height: .45rem; margin: .82rem 0 .45rem; overflow: hidden; border: 0; border-radius: 1rem; background: #547567; color: #f2b17c; }
progress::-webkit-progress-bar { border-radius: 1rem; background: #547567; }
progress::-webkit-progress-value { border-radius: 1rem; background: #f2b17c; }
progress::-moz-progress-bar { border-radius: 1rem; background: #f2b17c; }
.quota-detail { min-height: 1.25em; color: #dae4d6; font-size: .85rem; overflow-wrap: anywhere; }
.expiry-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem .7rem; margin-top: 1.7rem; padding-top: 1rem; border-top: 1px dashed #79988a; }
.expiry-row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.redeem-panel { grid-area: redeem; }
.redeem-panel .stack-form { margin-top: 1.2rem; }
.redeem-panel .form-hint { margin-top: -.35rem; }
.subscription-panel { grid-area: subscription; }
.subscription-panel:has(#subscribe-actions:not([hidden])) { border-color: #a9c1aa; background: #eef3e9; }
.subscription-panel .empty-message, #subscribe-actions { margin-top: .8rem; }
.subscription-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .85rem; }
#manual-copy { margin-top: .8rem; border-style: dashed; color: var(--pine-deep); }

.guide-section { display: grid; grid-template-columns: minmax(12rem, .58fr) minmax(0, 1.42fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; padding: clamp(1.85rem, 3vw, 2.8rem) 0; border-top: 1px solid var(--line); }
.guide-heading { display: flex; align-items: center; gap: .72rem; padding-block: .65rem; }
.guide-heading::before { content: ""; width: .46rem; height: 1.32rem; border-radius: 1px; background: #c5754c; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.guide-heading h2 { font-size: 1.4rem; }
.guide-list { min-width: 0; }
.guide-list details { border-bottom: 1px solid var(--line); }
.guide-list summary { display: flex; min-height: 3.3rem; justify-content: space-between; align-items: center; gap: 1.2rem; padding: .7rem .3rem .7rem 0; list-style: none; cursor: pointer; color: var(--ink); font-size: .98rem; font-weight: 600; }
.guide-list summary::-webkit-details-marker { display: none; }
.guide-list summary::after { content: ""; display: block; width: .52rem; height: .52rem; flex: none; margin: 0 .18rem .23rem 0; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.guide-list details[open] summary::after { margin-block: .2rem 0; transform: rotate(225deg); }
.guide-list summary:hover { color: var(--persimmon); }
.guide-list details p { max-width: 46em; margin: 0 1.75rem 1.1rem 0; color: var(--muted); font-size: .92rem; line-height: 1.8; }
.site-footer { display: flex; justify-content: flex-end; padding: 0 0 1.2rem; }
.site-footer a { display: inline-flex; min-height: 2.75rem; align-items: center; gap: .35rem; border-radius: 3px; color: var(--muted); font-size: .83rem; text-decoration: none; }

@media (max-width: 54rem) {
  .auth-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "form" "ticket"; grid-template-rows: auto; max-width: 39rem; margin-inline: auto; row-gap: 1.45rem; }
  .intro-copy { max-width: none; }
  .entry-panel { padding: 1.5rem; }
  .coast-ticket { aspect-ratio: 3; }
  .ticket-name { font-size: clamp(1.8rem, 6vw, 2.75rem); }
  .guide-section { grid-template-columns: minmax(9rem, .45fr) minmax(0, 1.55fr); }
}

@media (max-width: 43rem) {
  .shell { width: calc(100% - 2.25rem); }
  .header-inner { min-height: 3.95rem; }
  .brand { font-size: 1.08rem; gap: .45rem; }
  .brand-mark { width: 2.12rem; height: 2.12rem; }
  .header-nav { gap: .9rem; }
  .header-nav .desk-link { display: none; }
  .auth-stage { padding-block: 1.6rem 2.25rem; row-gap: 1.2rem; }
  .auth-intro h1 { margin-block: .4rem .55rem; font-size: clamp(2rem, 8.3vw, 2.8rem); }
  .intro-copy { font-size: .94rem; line-height: 1.7; }
  .destination { font-size: .76rem; }
  .entry-panel { padding: 1.18rem; }
  .mode-switch { margin-block: .95rem 1rem; }
  .stack-form { gap: .88rem; }
  .coast-ticket { --stub: 2.95rem; aspect-ratio: 2.75; border-radius: 10px; }
  .ticket-stub { gap: .3rem; padding-block: .65rem; }
  .stub-compass { width: 1.13rem; height: 1.13rem; }
  .stub-label { font-size: .65rem; letter-spacing: .16em; }
  .stub-waves { gap: 2px; }
  .stub-waves i { width: .78rem; }
  .stub-waves i:nth-child(2) { width: .54rem; }
  .stub-waves i:last-child { width: .33rem; }
  .account-heading { margin-bottom: 1.15rem; }
  .account-heading .button { min-height: 2.6rem; padding-inline: .7rem; }
  .account-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "benefits" "redeem" "subscription"; }
  .balance-list { gap: .9rem; margin-top: 1.1rem; }
  .expiry-row { margin-top: 1rem; }
  .guide-section { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: 1.4rem 0 1rem; }
  .guide-heading { padding: .15rem 0; }
  .guide-heading h2 { font-size: 1.25rem; }
}

@media (max-width: 23rem) {
  .shell { width: calc(100% - 1.65rem); }
  .entry-panel { padding: 1rem; }
  .inline-field .button { padding-inline: .58rem; }
  .subscription-buttons .button { flex: 1 1 8rem; }
}

/* 短屏优先留下可提交的空间，输入框和按钮仍保留正常触控尺寸。 */
@media (max-width: 43rem) and (max-height: 40rem) {
  .header-inner { min-height: 3.25rem; }
  .auth-stage { padding-top: 1rem; row-gap: .8rem; }
  .auth-intro h1 { margin-block: .2rem .3rem; }
  .intro-copy { font-size: .875rem; line-height: 1.52; }
  .entry-panel { padding: .8rem 1rem; }
  .entry-panel h2 { font-size: 1.18rem; }
  .mode-switch { margin-block: .55rem .65rem; }
  .entry-panel .stack-form { gap: .6rem; }
  .entry-panel .field { gap: .25rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .mode-switch button, .header-nav a, .guide-list summary { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
  form[aria-busy="true"] .button-primary::after, .button-primary[aria-busy="true"]::after { animation: waiting .85s linear infinite; }
  @keyframes waiting { to { transform: rotate(360deg); } }
}

@media (forced-colors: active) {
  .mode-switch button[aria-pressed="true"], .mode-switch button[aria-selected="true"] { border: 2px solid Highlight; }
  .button, .benefit-panel, .notice:not(:empty) { border: 1px solid ButtonText; }
  progress { appearance: auto; }
}
