:root {
  color-scheme: light;
  --paper: #f5f0e5;
  --ink: #222923;
  --green: #1e473b;
  --muted: #56605a;
  --line: #bdb6a7;
  --accent: #aa322b;
  font-family: Inter, "PingFang HK", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .75; }
:focus-visible { outline: 3px solid #b24431; outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(100% - 96px, 1240px); margin-inline: auto; }

.masthead { border-top: 5px solid var(--accent); }
.masthead-inner {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand strong { display: block; font-size: 23px; letter-spacing: -.055em; line-height: 1.12; }
.brand-region { display: block; font-size: 10px; font-weight: 750; letter-spacing: .1em; margin-top: 4px; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 650; }
.site-nav a { text-decoration: none; }
.site-nav a:hover, .footer a:hover { color: var(--accent); }
#language { border: 1px solid #746f65; background: transparent; padding: 6px 12px; color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: stretch;
  gap: clamp(28px, 5vw, 78px);
  padding-block: clamp(35px, 5vw, 78px) 42px;
}
.hero-copy { padding-block: 12px 1px; }
.section-label {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
  color: var(--accent);
  letter-spacing: .12em;
}
.section-label > span:first-child { width: 9px; height: 9px; background: var(--accent); }
h1 { margin: 0; font-size: clamp(46px, 6vw, 92px); line-height: 1.06; letter-spacing: -.066em; font-weight: 820; }
:lang(zh) h1 { letter-spacing: -.04em; }
.intro { margin: 20px 0 28px; font-size: 17px; color: var(--muted); max-width: 34ch; }
.tracking { margin: 0; padding: 20px 22px; background: var(--green); color: #fffdf6; }
.tracking label { display: block; font-size: 14px; font-weight: 740; margin-bottom: 8px; }
.tracking-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.tracking input { min-width: 0; min-height: 49px; width: 100%; background: #fffdf6; border: 1px solid #fffdf6; border-radius: 0; color: #222923; padding: 10px 12px; }
.tracking input::placeholder { color: #64665f; }
.tracking button { min-height: 49px; padding: 8px 15px; border: 1px solid #b44636; background: var(--accent); color: white; font-weight: 760; display: flex; align-items: center; gap: 10px; }
.tracking button:hover:not(:disabled) { background: #8e2a24; }
.tracking .arrow { font-size: 18px; }
.tracking p { color: #e3eadf; font-size: 12px; margin: 9px 0 0; }
.tracking :focus-visible { outline-color: #ffe296; }

.port { min-width: 0; margin: 0; align-self: stretch; display: grid; grid-template-rows: 1fr auto; }
.port img { display: block; width: 100%; height: 100%; min-height: 350px; object-fit: cover; object-position: 50% 50%; }
.port figcaption { border-bottom: 1px solid var(--line); padding: 10px 1px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); font-size: 12px; }
.port figcaption strong { color: var(--ink); font-weight: 650; }
.port figcaption span { font-family: ui-monospace, monospace; white-space: nowrap; }

.results { margin: 0 0 40px; border: 1px solid var(--line); background: #fffdf6; padding: clamp(18px, 3vw, 34px); }
.results-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.results h2, .help h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.result-number { font: 13px ui-monospace, monospace; margin: 6px 0 0; overflow-wrap: anywhere; }
.source-note, #result-status { color: var(--muted); font-size: 14px; }
.source-note { margin: 0; }
#result-status:empty, .events:empty { display: none; }
.events { padding: 5px 0 0; margin: 16px 0 0; list-style: none; }
.events li { position: relative; border-left: 1px solid #97a89d; margin-left: 5px; padding: 0 0 19px 20px; }
.events li:last-child { padding-bottom: 0; border-color: transparent; }
.events li::before { content: ""; position: absolute; top: 7px; left: -5px; width: 9px; height: 9px; background: var(--green); }
.events li:first-child::before { background: var(--accent); }
.event-title { margin: 0 0 3px; font-weight: 720; overflow-wrap: anywhere; }
.event-meta { color: var(--muted); font-size: 13px; margin: 0; }
.help { border-top: 1px solid var(--line); padding-block: 25px 35px; display: grid; grid-template-columns: 1fr 1.7fr 1.7fr; gap: 24px 42px; }
.help h3 { margin: 0 0 4px; font-size: 15px; }
.help p { margin: 0; font-size: 14px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding: 19px 0 24px; }
.footer-inner { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.footer-links { display: inline-flex; margin-left: 14px; gap: 14px; }
.footer-links a { text-decoration: none; }
.footer small { color: var(--muted); font-size: 11px; }

@media (max-width: 900px) {
  .shell { width: min(100% - 48px, 1240px); }
  .hero { grid-template-columns: 1fr 1fr; gap: 24px; }
  .port img { min-height: 300px; }
  .tracking { padding: 15px; }
  .tracking button { padding-inline: 10px; }
}
@media (max-width: 690px) {
  .shell { width: calc(100% - 32px); }
  .masthead-inner { min-height: 68px; gap: 10px; }
  .brand { gap: 7px; }
  .brand img { width: 28px; height: 28px; }
  .brand strong { font-size: 20px; }
  .brand-region { font-size: 9px; }
  .site-nav { gap: 12px; font-size: 13px; }
  .help-link { display: none; }
  #language { padding-inline: 7px; }
  .hero { grid-template-columns: 1fr; gap: 25px; padding-block: 23px 29px; }
  .hero-copy { padding-top: 4px; }
  .section-label { margin-bottom: 11px; }
  .intro { margin: 12px 0 19px; font-size: 15px; }
  .port img { height: auto; min-height: 0; aspect-ratio: 2 / 1; }
  .help { grid-template-columns: 1fr; gap: 14px; }
  .footer-links { display: flex; margin: 6px 0 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
