/* ============================================================
   EatSignal — shared styles (modern-minimal + Apple Health 节奏)
   Direction: Linear / Vercel / Notion 2024 / Stripe docs
   ============================================================ */

:root {
  /* Direction palette: modern-minimal */
  --bg:        oklch(98.7% 0.006 145);
  --surface:   oklch(100% 0 0);
  --surface-2: oklch(97.3% 0.006 155);
  --fg:        oklch(18% 0.012 250);
  --muted:     oklch(54% 0.012 250);
  --muted-2:   oklch(72% 0.008 250);
  --border:    oklch(92% 0.005 250);
  --border-2:  oklch(96% 0.004 250);
  --accent:    oklch(61% 0.16 153);
  --accent-tint: oklch(96% 0.045 153);

  /* Traffic-light signal system */
  --green:      #22c55e;
  --green-tint: oklch(96% 0.05 145);
  --green-fg:   oklch(38% 0.14 145);

  --yellow:      #facc15;
  --yellow-tint: oklch(96% 0.06 95);
  --yellow-fg:   oklch(45% 0.13 80);

  --red:      #ef4444;
  --red-tint: oklch(96% 0.04 25);
  --red-fg:   oklch(45% 0.18 25);

  /* Typography */
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                  'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
                  system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                  'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
                  system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Radius / spacing */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-1: 0 1px 0 rgba(15, 17, 22, 0.04);
  --shadow-2: 0 8px 24px -12px rgba(15, 17, 22, 0.16),
              0 2px 6px -2px rgba(15, 17, 22, 0.06);
  --shadow-3: 0 18px 54px -32px rgba(16, 42, 28, 0.38),
              0 8px 24px -18px rgba(16, 42, 28, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% -8%, oklch(91% 0.08 145 / 0.52), transparent 34%),
    radial-gradient(circle at 88% 6%, oklch(94% 0.06 92 / 0.46), transparent 30%),
    linear-gradient(180deg, oklch(99% 0.006 145) 0%, var(--bg) 42%, oklch(97% 0.005 245) 100%);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 38%, transparent);
  outline-offset: 3px;
}

::selection { background: var(--accent-tint); color: var(--fg); }

/* ---------- Type scale ---------- */
.display-1 {
  font-family: var(--font-display);
  font-weight: 760;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}
.display-2 {
  font-family: var(--font-display);
  font-weight: 740;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12;
  letter-spacing: 0;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.muted { color: var(--muted); }
.mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklch, var(--bg) 82%, white 12%);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 22%, var(--red) 32%, transparent 33%),
    radial-gradient(circle at 50% 50%, var(--yellow) 32%, transparent 33%),
    radial-gradient(circle at 50% 78%, var(--green) 32%, transparent 33%),
    linear-gradient(180deg, oklch(21% 0.014 250), oklch(15% 0.01 250));
  background-size: 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 6px 18px -10px rgba(15,17,22,.45);
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.nav-link {
  padding: 7px 11px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--muted);
  transition: background .14s, color .14s;
}
.nav-link:hover { background: var(--surface-2); color: var(--fg); }
.nav-link.active { color: var(--fg); background: var(--surface-2); }
.nav-spacer { flex: 1; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, oklch(23% 0.014 250), oklch(15% 0.01 250));
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 20px -16px rgba(15,17,22,.55);
  transition: opacity .14s, transform .12s, box-shadow .14s;
}
.nav-cta:hover { opacity: .92; color: var(--bg); transform: translateY(-1px); box-shadow: 0 14px 24px -16px rgba(15,17,22,.6); }

/* ---------- Signal pills ---------- */
.signal-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in oklch, currentColor 10%, transparent);
}
.signal-dot.green  { background: var(--green); color: var(--green); }
.signal-dot.yellow { background: var(--yellow); color: var(--yellow); }
.signal-dot.red    { background: var(--red); color: var(--red); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.pill.green  { background: var(--green-tint);  color: var(--green-fg);  border-color: transparent; }
.pill.yellow { background: var(--yellow-tint); color: var(--yellow-fg); border-color: transparent; }
.pill.red    { background: var(--red-tint);    color: var(--red-fg);    border-color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .08s;
  box-shadow: var(--shadow-1);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.985); }
.btn.primary { background: linear-gradient(180deg, oklch(24% 0.016 250), oklch(15% 0.01 250)); color: var(--bg); border-color: oklch(18% 0.012 250); }
.btn.primary:hover { background: linear-gradient(180deg, oklch(29% 0.014 250), oklch(18% 0.012 250)); }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-1);
}
.card.hover { transition: border-color .14s, background .14s, transform .14s; }
.card.hover:hover { border-color: oklch(82% 0.01 250); transform: translateY(-1px); }

/* ---------- Footer ---------- */
.foot {
  margin-top: 80px;
  padding: 28px 0 36px;
  border-top: 1px solid color-mix(in oklch, var(--border) 75%, transparent);
  color: var(--muted);
  font-size: 12.5px;
  background: color-mix(in oklch, var(--surface) 62%, transparent);
}
.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.foot .brand { font-size: 14px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }

/* ---------- Empty / placeholder ---------- */
.empty {
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--muted);
}

/* ---------- Product polish layer ---------- */
html body .nav {
  box-shadow: 0 10px 30px -28px rgba(15, 17, 22, .45);
}

html body .nav-link {
  border-radius: 10px;
}

html body .nav-link.active {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow-1);
}

html body .hero {
  position: relative;
}

html body .hero::before {
  content: "";
  position: absolute;
  inset: 22px 28px auto 28px;
  height: min(460px, 58vw);
  pointer-events: none;
  border-radius: 28px;
  background:
    linear-gradient(135deg, oklch(96% 0.04 145 / .68), transparent 42%),
    linear-gradient(315deg, oklch(96% 0.045 92 / .58), transparent 46%);
  opacity: .9;
  z-index: -1;
}

html body .hero-eyebrow,
html body .hot a.chip,
html body .marquee-chip,
html body .tg,
html body .qf .c,
html body .filters .f {
  box-shadow: var(--shadow-1);
}

html body .search,
html body .search-big {
  border-radius: 18px;
  border-color: color-mix(in oklch, var(--border) 72%, var(--green) 28%);
  box-shadow: var(--shadow-2);
}

html body .search:focus-within,
html body .search-big:focus-within {
  box-shadow: 0 0 0 5px color-mix(in oklch, var(--accent-tint) 82%, transparent), var(--shadow-3);
}

html body .search .go,
html body .share-btn {
  background: linear-gradient(180deg, oklch(59% 0.17 150), oklch(46% 0.15 150));
  box-shadow: 0 12px 24px -16px rgba(19, 122, 70, .68);
}

html body .preview-card,
html body .map-teaser,
html body .mode-card,
html body .leg,
html body .row-list,
html body .no-result,
html body .hot-card,
html body .score-card,
html body .panel,
html body .alt-block,
html body .related-card,
html body .col,
html body .mode-explainer {
  border-color: color-mix(in oklch, var(--border) 82%, white 18%);
  box-shadow: var(--shadow-2);
}

html body .preview-card,
html body .score-card {
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface) 94%, var(--green-tint) 6%), var(--surface));
}

html body .cat {
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}

html body .cat:hover,
html body .hot-card:hover,
html body .related-card:hover,
html body .alt-card:hover,
html body .mode-card:hover,
html body .col:hover {
  border-color: color-mix(in oklch, var(--accent) 34%, var(--border));
  box-shadow: var(--shadow-3);
}

html body .map-grid .col {
  padding: 15px 12px 13px;
  background:
    linear-gradient(180deg, color-mix(in oklch, var(--surface) 96%, var(--green-tint) 4%), var(--surface));
}

html body .map-grid .col h3 {
  color: color-mix(in oklch, var(--muted) 82%, var(--fg) 18%);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

html body .map-grid .col .item {
  min-height: 36px;
}

html body .map-grid .col .item:hover,
html body .row-list .row:hover {
  background: color-mix(in oklch, var(--green-tint) 46%, var(--surface));
}

html body .row-list .row {
  transition: background .14s, transform .14s;
}

html body .row-list .row:hover {
  transform: translateX(2px);
}

html body .mode-seg,
html body .mode-seg-sm,
html body .map-teaser-bar .seg {
  background: color-mix(in oklch, var(--surface) 76%, var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

html body .mode-seg .m.on,
html body .mode-seg-sm .m.on,
html body .map-teaser-bar .seg .s.on,
html body .qf .c.on,
html body .filters .f.on {
  background: linear-gradient(180deg, oklch(24% 0.016 250), oklch(15% 0.01 250));
  color: var(--bg);
}

html body .panel.pros {
  background: linear-gradient(180deg, color-mix(in oklch, var(--green-tint) 42%, var(--surface)), var(--surface));
}

html body .panel.cons {
  background: linear-gradient(180deg, color-mix(in oklch, var(--red-tint) 34%, var(--surface)), var(--surface));
}

html body .panel.suggestion {
  background: linear-gradient(135deg, color-mix(in oklch, var(--yellow-tint) 58%, var(--surface)), color-mix(in oklch, var(--green-tint) 36%, var(--surface)));
}

html body .ring-big,
html body .preview-card .ring {
  filter: drop-shadow(0 16px 18px rgba(22, 101, 52, .14));
}

/* ---------- Mobile app navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid color-mix(in oklch, var(--border) 80%, white 20%);
  border-radius: 18px;
  background: color-mix(in oklch, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(18px);
  backdrop-filter: saturate(150%) blur(18px);
  box-shadow: 0 18px 44px -26px rgba(15,17,22,.5);
}

.bottom-nav a {
  min-width: 0;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.bottom-nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}

.bottom-nav .bn-ico {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: block;
  position: relative;
}

.bottom-nav .bn-home {
  background: linear-gradient(135deg, var(--green), color-mix(in oklch, var(--green) 42%, white));
}

.bottom-nav .bn-map {
  background:
    linear-gradient(90deg, transparent 45%, rgba(255,255,255,.7) 46% 54%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(255,255,255,.7) 46% 54%, transparent 55%),
    linear-gradient(135deg, var(--yellow), color-mix(in oklch, var(--yellow) 42%, white));
}

.bottom-nav .bn-search {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.bottom-nav .bn-search::after {
  content: "";
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: absolute;
  right: -5px;
  bottom: 0;
  transform: rotate(45deg);
}

.bottom-nav .bn-about {
  background:
    radial-gradient(circle at 50% 28%, var(--red) 14%, transparent 16%),
    radial-gradient(circle at 50% 50%, var(--yellow) 14%, transparent 16%),
    radial-gradient(circle at 50% 72%, var(--green) 14%, transparent 16%),
    currentColor;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .shell        { padding: 0 18px; }
  .nav-inner    { padding: 0 18px; gap: 10px; height: 52px; }
  .nav-links    { display: none; }
  .nav-cta      { padding: 6px 11px; font-size: 12.5px; }
  .nav-cta .full-label { display: none; }
  body          { padding-bottom: 76px; }
  .bottom-nav   { display: grid; }
  .foot         { margin-top: 56px; padding: 22px 0 90px; }
  .foot-inner   { padding: 0 18px; gap: 10px; }
  .card         { padding: 16px; }
  .btn          { height: 40px; padding: 0 14px; }
  .btn.sm       { height: 30px; padding: 0 10px; }
  /* iOS auto-zoom guard: input/select/textarea must be ≥ 16px */
  input, select, textarea { font-size: 16px; }
}

@media (max-width: 420px) {
  .shell        { padding: 0 14px; }
  .nav-inner    { padding: 0 14px; gap: 8px; }
  .foot-inner   { padding: 0 14px; }
}
