:root {
  color-scheme: light;
  --ink: #192844;
  --muted: #536178;
  --canvas: #f4f3ee;
  --paper: #fffefa;
  --line: #d9dee5;
  --blue: #2948b2;
  --blue-dark: #203787;
  --blue-soft: #eaf0ff;
  --mint: #bce5d4;
  --red: #bd4939;
  --error: #9a3026;
  --radius: 16px;
  --text: system-ui, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
a { color: var(--blue-dark); text-underline-offset: .18em; }
h1, h2, h3, p { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shell { width: min(100% - 32px, 1080px); margin-inline: auto; }
.masthead { background: var(--ink); color: white; }
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { color: inherit; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.06rem; font-weight: 750; }
.masthead :focus-visible, .showcase :focus-visible { outline-color: var(--mint); }
.route-mark { position: relative; width: 28px; height: 24px; border: 1px solid #8da2cf; border-radius: 5px; flex: none; }
.route-mark::before { content: ""; position: absolute; width: 15px; height: 2px; background: var(--mint); top: 10px; left: 5px; transform: rotate(-27deg); }
.route-mark::after { content: ""; position: absolute; width: 5px; height: 5px; background: var(--mint); top: 12px; left: 4px; border-radius: 50%; box-shadow: 14px -7px var(--mint); }
.text-button { color: inherit; border: 0; background: none; padding: 8px 0 8px 6px; min-height: 44px; }
.header-help { color: #e0e8fd; font-size: .875rem; }

.setup { display: grid; gap: 21px; margin-block: 24px; }
.intro { padding: 0 3px; }
.intro h1 { font-size: clamp(1.77rem, 5.8vw, 3.55rem); font-weight: 800; letter-spacing: -.045em; line-height: 1.19; }
.intro > p { color: var(--muted); margin-top: 10px; max-width: 30em; }
.desktop-break { display: none; }
.sample-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sample {
  background: transparent;
  color: var(--blue-dark);
  border: 1px solid #acb9d4;
  border-radius: 7px;
  min-height: 44px;
  padding: 6px 12px;
  font-size: .875rem;
  font-weight: 650;
}
.sample:hover { background: var(--blue-soft); }
.travel-art { display: none; }

.trip-form, .result-head, .check-group, .phrase-card, .sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.trip-form { padding: 18px 15px; min-width: 0; }
.form-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 12px; }
.form-head h2 { font-size: 1.25rem; }
.form-head > span { color: var(--muted); font-size: .8125rem; }
.field { margin-bottom: 14px; min-width: 0; }
.field label:not(.choice), .field legend { display: block; margin-bottom: 5px; font-weight: 690; font-size: .875rem; }
.choice-row { display: grid; gap: 7px; }
.country-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.purpose-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.party-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice { display: block; position: relative; cursor: pointer; min-width: 0; }
.choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 5px 2px;
  border: 1px solid #c8d0dc;
  border-radius: 7px;
  font-size: .875rem;
  text-align: center;
}
.choice input:checked + span { color: var(--blue-dark); font-weight: 730; background: var(--blue-soft); border-color: var(--blue); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-pair > div { min-width: 0; }
.custom-city { margin-top: 10px; }
.optional { color: var(--muted); font-size: .8125rem; font-weight: 450; }
.select-wrap { position: relative; }
.select-wrap::after {
  position: absolute;
  content: "";
  top: calc(50% - 5px);
  right: 16px;
  width: 8px;
  height: 8px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
input[type="text"], input[type="date"], select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--ink);
  background: white;
  border: 1px solid #aeb8c8;
  border-radius: 7px;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
input[type="date"] { inline-size: 100%; }
select { appearance: none; padding-right: 36px; }
textarea { resize: vertical; margin-top: 4px; }
.notes { margin-bottom: 14px; }
.notes summary { width: max-content; max-width: 100%; cursor: pointer; min-height: 44px; padding: 9px 0; color: var(--muted); font-size: .875rem; }
.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: .9375rem;
  font-weight: 690;
}
.primary { background: var(--blue); color: white; }
.primary:hover:not(:disabled) { background: var(--blue-dark); }
.secondary { background: white; color: var(--blue-dark); border-color: #c2cce0; }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--blue-soft); }
.quiet { background: transparent; color: var(--blue-dark); }
.submit, .cancel-edit { width: 100%; }
.submit { min-height: 50px; font-size: 1rem; }
.cancel-edit { margin-top: 8px; }
.privacy-line { color: var(--muted); margin-top: 9px; font-size: .8125rem; }
.form-error { border-radius: 8px; padding: 9px 10px; color: var(--error); background: #fff0ed; font-size: .875rem; }
.trip-form .form-error { margin-bottom: 10px; }
.result-head .form-error { margin-top: 12px; }

.result { margin-block: 24px 36px; }
.result-head { padding: 18px; }
.trip-meta, .phrase-hint { color: var(--muted); font-size: .9rem; }
.result-head h1 { font-size: clamp(1.7rem, 5.2vw, 3rem); line-height: 1.18; margin-top: 5px; overflow-wrap: anywhere; }
.result-head .ai-notice { margin-top: 10px; }
.ai-notice { color: var(--blue-dark); font-size: .8125rem; font-weight: 690; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.views { display: flex; gap: 9px; padding: 4px; background: #e4e9f2; border-radius: 11px; margin-top: 14px; }
.views button {
  flex: 1;
  color: var(--ink);
  background: transparent;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  font-size: .9375rem;
  font-weight: 700;
}
.views button[aria-pressed="true"] { color: var(--blue-dark); border-color: #c5d0e2; background: var(--paper); }
.progress-row { margin-block: 13px; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.progress-row span { color: var(--muted); font-size: .875rem; }
progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 20px; background: #e0e6f0; color: var(--blue); }
progress::-webkit-progress-bar { border-radius: 20px; background: #e0e6f0; }
progress::-webkit-progress-value { border-radius: 20px; background: var(--blue); }
progress::-moz-progress-bar { border-radius: 20px; background: var(--blue); }
.check-grid, .phrase-grid { display: grid; gap: 12px; align-items: start; }
.check-group { padding: 14px 14px 1px; min-width: 0; }
.check-group h2 { font-size: 1.1rem; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.check-group ul { margin: 0; padding: 0; list-style: none; }
.check-item { padding-block: 10px 13px; }
.check-item + .check-item { border-top: 1px solid var(--line); }
.check-title { display: flex; align-items: center; gap: 11px; min-height: 44px; font-weight: 720; cursor: pointer; }
.check-title input { width: 21px; height: 21px; flex: none; margin: 0; accent-color: var(--blue); cursor: pointer; }
.check-title span { overflow-wrap: anywhere; }
.check-detail { margin: 0 0 0 32px; color: var(--muted); overflow-wrap: anywhere; }
.stage { display: inline-block; margin-right: 7px; border-radius: 4px; padding: 0 6px; font-size: .8125rem; font-weight: 650; color: var(--blue-dark); background: var(--blue-soft); }
.stage-after { color: #1d594a; background: #e1f3eb; }
.check-links { margin: 3px 0 0 32px; display: flex; gap: 0 12px; flex-wrap: wrap; }
.check-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .8125rem; overflow-wrap: anywhere; }
.phrase-hint { margin-block: 13px; }
.phrase-card { min-width: 0; padding: 14px; }
.phrase-card h2 { font-size: .95rem; }
.phrase-card .phrase-local { margin-top: 8px; font-size: 1.25rem; font-weight: 755; line-height: 1.4; overflow-wrap: anywhere; }
.phrase-card p + p { margin-top: 5px; }
.reading { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.phrase-card .ai-notice { margin-top: 11px; }
.phrase-card .button { width: 100%; margin-top: 9px; }
.site-footer { color: var(--muted); font-size: .8125rem; display: flex; gap: 4px 14px; flex-wrap: wrap; padding-block: 12px 22px; border-top: 1px solid var(--line); }

dialog { color: var(--ink); }
dialog::backdrop { background: #111a32a3; }
body:has(dialog[open]) { overflow: hidden; }
.sheet { width: min(100% - 28px, 480px); padding: 0; max-height: calc(100% - 32px); overflow: auto; }
.sheet-content { padding: 20px; }
.sheet-content h2 { font-size: 1.35rem; }
.sheet-content h3 { font-size: 1rem; margin-top: 14px; }
.sheet-content p { color: var(--muted); margin-top: 8px; }
.dialog-actions { margin-top: 17px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.showcase {
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  border: 0;
  padding: 0;
  background: var(--ink);
  color: white;
}
.showcase-layout {
  display: grid;
  grid-template-rows: auto minmax(auto, 1fr) auto;
  min-height: 100%;
  max-width: 1000px;
  margin-inline: auto;
  padding:
    max(14px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}
.showcase-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.showcase-head h2 { color: var(--mint); font-size: 1rem; }
.show-button { border-color: #8292b7; background: transparent; color: white; }
.showcase-content { display: grid; justify-items: center; align-content: center; text-align: center; padding-block: 26px; gap: 13px; }
.show-local { font-size: clamp(1.85rem, 8vw, 4.8rem); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; word-break: normal; }
.show-zh { font-size: clamp(1.05rem, 4.8vw, 1.7rem); overflow-wrap: anywhere; }
.show-reading { color: #cad7f3; font-size: clamp(.95rem, 4vw, 1.25rem); overflow-wrap: anywhere; }
.showcase-foot { text-align: center; }
.showcase-foot .ai-notice { color: #e0e8ff; margin-bottom: 9px; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.pager span { color: #dbe5ff; font-variant-numeric: tabular-nums; font-size: .875rem; }
.show-next { background: var(--mint); color: var(--ink); }

@media (min-width: 580px) {
  .shell { width: min(100% - 52px, 1080px); }
  .trip-form { padding: 23px; }
  .check-grid, .phrase-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-head { padding: 24px; }
}
@media (min-width: 830px) {
  .header-inner { min-height: 69px; }
  .setup { grid-template-columns: .94fr 1.06fr; gap: clamp(32px, 6vw, 92px); margin-block: 42px 40px; align-items: start; }
  .intro { padding-top: 37px; }
  .intro p { margin-top: 18px; }
  .desktop-break { display: block; }
  .sample-actions { margin-top: 22px; }
  .travel-art {
    display: block;
    margin-top: 28px;
    aspect-ratio: 1.55;
    background: var(--ink) url("/hero_20261204.webp") center / cover no-repeat;
    border-radius: var(--radius);
  }
  .field { margin-bottom: 14px; }
  .trip-form { padding: 24px 27px; }
  .phrase-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result { margin-block: 38px; }
  .views { max-width: 420px; }
}
@media (max-width: 350px) {
  .shell { width: calc(100% - 24px); }
  .trip-form { padding-inline: 11px; }
  .choice-row { gap: 5px; }
  .choice span { font-size: .8125rem; }
  .field-pair { gap: 6px; }
  input[type="date"] { padding-inline: 4px; }
}
