:root {
  --background: #f7f4ee;
  --surface: #fffefa;
  --ink: #1f2d30;
  --muted: #536064;
  --line: #d9d1c4;
  --accent: #a7372e;
  --accent-hover: #872820;
  --success: #176851;
  --error: #a12e27;
  color: var(--ink);
  background: var(--background);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--background); }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(167, 55, 46, .35); outline-offset: 3px; }

.page-shell { width: min(100% - 48px, 1120px); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--ink); border-radius: 50%; font-family: Georgia, "Songti SC", serif; font-size: 19px; font-weight: 400; }
.header-note { color: var(--muted); font-size: 11px; }

main { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 28px 42px; padding: 72px 0 64px; }
.hero { align-self: center; padding: 8px 0; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .2em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Songti SC", serif; font-weight: 500; }
h1 { margin-bottom: 24px; font-size: clamp(52px, 5.5vw, 76px); letter-spacing: -.06em; line-height: 1.06; }
h1 em { color: var(--accent); font-style: normal; }
.hero-copy { max-width: 375px; margin-bottom: 32px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.hero-rule { display: flex; align-items: center; width: min(100%, 310px); color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 700; }
.hero-rule span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid currentColor; border-radius: 50%; }
.hero-rule i { flex: 1; height: 1px; background: var(--line); }

.lookup-card { position: relative; padding: 34px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 12px; box-shadow: 0 18px 45px rgba(31, 45, 48, .07); }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 34px; }
.card-heading .eyebrow { margin-bottom: 10px; }
h2 { margin-bottom: 0; font-size: 28px; letter-spacing: -.04em; line-height: 1.3; }
.card-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; color: var(--accent); background: #f8eae6; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; font-weight: 700; }
label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 750; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; color: var(--ink); background: white; border: 1px solid #bcb6ac; border-radius: 7px; outline: none; font-size: 14px; }
input::placeholder { color: #7c8586; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(167, 55, 46, .1); }
input[aria-invalid="true"] { border-color: var(--error); }
button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 17px; color: white; background: var(--accent); border: 0; border-radius: 7px; font-size: 13px; font-weight: 750; white-space: nowrap; }
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { cursor: wait; opacity: .65; }
.field-hint, .status { color: var(--muted); font-size: 11px; line-height: 1.6; }
.field-hint { margin: 10px 0 0; }
.status { min-height: 18px; margin: 7px 0 0; }
.status[data-state="success"] { color: var(--success); }
.status[data-state="error"] { color: var(--error); }
.lookup-result { margin-top: 26px; padding: 18px; background: #f8f4ee; border: 1px solid var(--line); border-radius: 8px; }
.lookup-result[hidden] { display: none; }
.lookup-result[data-state="tracked"] { border-color: #b5d0c3; background: #f0f7f2; }
.lookup-result[data-state="invalid"] { border-color: #e3beb8; background: #fcf3f0; }
.lookup-result h3 { margin-bottom: 7px; font-size: 15px; }
.lookup-result p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.lookup-result ul { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.lookup-result li { display: flex; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.5; }
.lookup-result li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.lookup-result li span:last-child { flex: 0 0 auto; color: var(--muted); }

.guide { grid-column: 1 / -1; margin-top: 44px; padding-top: 34px; border-top: 1px solid var(--line); }
.guide-heading { margin-bottom: 24px; }
.guide-heading .eyebrow { margin-bottom: 8px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.guide-item { padding: 22px; background: rgba(255, 254, 250, .7); border: 1px solid var(--line); border-radius: 10px; }
.guide-number { display: block; margin-bottom: 22px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 800; }
h3 { margin-bottom: 10px; font-size: 16px; }
.guide-item p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0 30px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 820px) {
  main { grid-template-columns: 1fr; gap: 28px; padding-top: 52px; }
  .hero { padding: 0; }
  .hero-copy { max-width: 560px; }
  .hero-rule { display: none; }
  .guide { grid-column: 1; margin-top: 16px; }
}

@media (max-width: 620px) {
  .page-shell { width: min(100% - 32px, 480px); }
  .site-header { padding: 18px 0; }
  .header-note { display: none; }
  main { padding: 44px 0 48px; }
  h1 { margin-bottom: 18px; font-size: clamp(46px, 13vw, 62px); }
  .hero-copy { margin-bottom: 0; font-size: 14px; }
  .lookup-card { padding: 24px 20px; }
  .card-heading { margin-bottom: 26px; }
  h2 { font-size: 25px; }
  .guide-grid { grid-template-columns: 1fr; gap: 10px; }
  .guide-item { padding: 18px 20px; }
  .guide-number { margin-bottom: 12px; }
}

@media (max-width: 380px) {
  .card-heading h2 { font-size: 22px; }
  .input-row { grid-template-columns: 1fr; }
  .input-row button { width: 100%; }
  .site-footer { flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
