/* ─────────────────────────────────────────────────────────────
 * Todo Tomato Zen — Landing styles (light, warm white, Anthropic-ish)
 * Shared between /zh/index.html and /en/index.html
 * ───────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #FAF9F5;
  --surface:  #FFFFFF;
  --surface2: #F5F2EA;
  --border:   #EAE6DC;
  --text:     #1F1E1C;
  --muted:    #6B665C;
  --tomato:   #C8442A;
  --tomato-d: #A8371F;
  --potato:   #8C6E4F;
  --leaf:     #5B8C5A;
  --shadow:   0 1px 2px rgba(31,30,28,.04), 0 8px 24px rgba(31,30,28,.06);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, "Segoe UI",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--tomato); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  height: 60px;
  background: rgba(250, 249, 245, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; color: var(--text);
}
.nav-logo .emoji { font-size: 1.3rem; }
.nav-links { display: flex; gap: 1.8rem; list-style: none; }
.nav-links a {
  color: var(--muted); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: color .15s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.lang-switch {
  display: inline-flex; gap: 2px;
  background: var(--surface2);
  border-radius: 8px; padding: 3px;
  font-size: .78rem;
}
.lang-switch a {
  color: var(--muted); padding: 4px 10px; border-radius: 6px;
  text-decoration: none; transition: background .15s, color .15s;
}
.lang-switch a:hover { color: var(--text); text-decoration: none; }
.lang-switch a.active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem clamp(3rem, 8vw, 5rem);
  max-width: 880px; margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 1.8rem;
}
.hero-eyebrow .tag-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--tomato);
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}
.hero h1 .accent { color: var(--tomato); }
.hero-sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}
.hero-actions {
  display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center;
}

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.6rem;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--tomato); color: #fff;
}
.btn-primary:hover { background: var(--tomato-d); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--text); }

/* ── Section common ──────────────────────────────────────────── */
section {
  padding: clamp(3.5rem, 7vw, 6rem) 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}
section.wide { max-width: 1180px; }
.section-eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tomato);
  margin-bottom: .85rem;
}
section h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 720px;
}
.section-lede {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  color: var(--muted);
  max-width: 640px;
  line-height: 1.7;
}

/* ── Sedentary facts ─────────────────────────────────────────── */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 2.8rem;
}
.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow);
}
.fact-stat {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tomato);
  line-height: 1.1;
  margin-bottom: .6rem;
}
.fact-stat .unit { font-size: 1.2rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.fact-text {
  font-size: .92rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: .8rem;
}
.fact-source {
  font-size: .75rem;
  color: var(--muted);
}
.fact-source a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
}
.fact-source a:hover { color: var(--tomato); text-decoration-color: var(--tomato); }

.bridge-note {
  margin-top: 2.4rem;
  padding: 1.4rem 1.6rem;
  background: var(--surface2);
  border-radius: 12px;
  border-left: 3px solid var(--leaf);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
}

/* ── Story (tomato + potato + tomtato) ───────────────────────── */
.story-section { background: var(--surface2); }
.story-section section { max-width: 980px; }
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2.5rem;
  align-items: start;
}
.story-grid > div h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .6rem;
  display: flex; align-items: center; gap: .5rem;
}
.story-grid > div h3 .emoji { font-size: 1.5rem; }
.story-grid > div p {
  color: var(--muted);
  line-height: 1.7;
  font-size: .96rem;
  margin-bottom: 1rem;
}
.story-quote {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  margin: 2.8rem 0 1rem;
  padding-left: 1.4rem;
  border-left: 3px solid var(--potato);
  font-style: normal;
}
.story-quote-small {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.7;
}

/* ── Features (slim) ─────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: 2.5rem;
}
.feature {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.feature-icon { font-size: 1.7rem; margin-bottom: .8rem; }
.feature h4 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.feature p { color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ── Download ────────────────────────────────────────────────── */
.download-section section { max-width: 980px; }

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2.4rem;
}
.dl-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .1s;
}
.dl-card.disabled { opacity: .55; }
.dl-card:not(.disabled):hover { border-color: var(--tomato); transform: translateY(-2px); }
.dl-card-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.dl-card-icon { font-size: 1.9rem; line-height: 1; }
.dl-card-name { font-size: 1.05rem; font-weight: 600; }
.dl-card-sub { font-size: .8rem; color: var(--muted); }
.dl-card-actions {
  display: flex; flex-direction: column; gap: .5rem;
  margin-top: auto;
}
.dl-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .9rem;
  border-radius: 8px;
  font-size: .85rem;
  text-decoration: none;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.dl-btn:hover {
  background: var(--tomato); color: #fff; border-color: var(--tomato);
  text-decoration: none;
}
.dl-btn.primary {
  background: var(--tomato); color: #fff; border-color: var(--tomato);
}
.dl-btn.primary:hover { background: var(--tomato-d); border-color: var(--tomato-d); }
.dl-btn.disabled {
  background: var(--surface2); color: var(--muted);
  cursor: not-allowed; pointer-events: none;
}
.dl-btn .chev { font-size: .85em; opacity: .7; }

.dl-extra {
  margin-top: 1.4rem; text-align: center;
}
.dl-extra details {
  display: inline-block;
  font-size: .85rem;
  color: var(--muted);
}
.dl-extra summary {
  cursor: pointer; padding: .3rem;
  list-style: none;
}
.dl-extra summary::-webkit-details-marker { display: none; }
.dl-extra summary::before { content: "▸ "; transition: transform .15s; display: inline-block; }
.dl-extra details[open] summary::before { content: "▾ "; }
.dl-extra-links { margin-top: .6rem; display: flex; flex-direction: column; gap: .3rem; }
.dl-extra-links a { font-size: .85rem; }

/* ── What's new ──────────────────────────────────────────────── */
.changelog-section section { max-width: 880px; }
.changelog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.6rem 1.8rem;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}
.changelog-meta {
  display: flex; align-items: center; gap: .8rem;
  margin-bottom: .8rem;
  font-size: .8rem;
  color: var(--muted);
}
.changelog-version {
  background: var(--surface2);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600; color: var(--text); font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.changelog-title {
  font-size: 1.15rem; font-weight: 600; margin-bottom: .8rem;
}
.changelog-body {
  font-size: .95rem; line-height: 1.7; color: var(--text);
}
.changelog-body p { margin-bottom: .6rem; }
.changelog-body ul { padding-left: 1.4rem; margin: .4rem 0 .8rem; }
.changelog-body li { margin-bottom: .3rem; color: var(--muted); }
.changelog-body code {
  background: var(--surface2);
  padding: 1px 6px; border-radius: 4px;
  font-size: .88em;
}
.changelog-more { margin-top: 1rem; font-size: .85rem; }
.changelog-loading, .changelog-error {
  font-size: .9rem; color: var(--muted); padding: 1rem 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.4rem 1.5rem;
  background: var(--surface2);
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .85rem;
  color: var(--muted);
}
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .story-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 480px) {
  .nav-right { gap: .5rem; }
  .nav-logo span:not(.emoji) { display: none; }
}

/* ─────────────────────────────────────────────────────────────
 * Dashboard styles (used by /<lang>/app/)
 * ───────────────────────────────────────────────────────────── */

.dashboard {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1.2rem 4rem;
}

.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.8rem; flex-wrap: wrap; gap: .8rem;
}
.dash-greeting { font-size: 1.05rem; color: var(--muted); }
.dash-greeting strong { color: var(--text); font-weight: 600; }
.dash-actions { display: flex; gap: .6rem; }
.dash-btn {
  font-size: .82rem; padding: .4rem .9rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.dash-btn:hover { background: var(--surface2); border-color: var(--text); text-decoration: none; }
.dash-btn.subtle { background: transparent; color: var(--muted); }

.dash-tabs {
  display: flex; gap: 4px;
  background: var(--surface2); padding: 4px;
  border-radius: 10px; margin-bottom: 1.6rem;
}
.dash-tab {
  flex: 1; text-align: center;
  padding: .55rem .8rem; border-radius: 7px;
  font-size: .9rem; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s; user-select: none;
}
.dash-tab:hover { color: var(--text); }
.dash-tab.active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.dash-section { display: none; }
.dash-section.active { display: block; }

.dash-loading, .dash-empty, .dash-error {
  text-align: center; padding: 2.5rem 1rem;
  color: var(--muted); font-size: .95rem;
}
.dash-error a { color: var(--tomato); }

/* ── Leaderboard ─────────────────────────────────────────────── */
.lb-windows {
  display: flex; gap: 4px; overflow-x: auto;
  background: var(--surface2); padding: 4px; border-radius: 10px;
  margin-bottom: 1.2rem;
}
.lb-window {
  padding: .45rem .9rem; border-radius: 7px; font-size: .85rem;
  color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.lb-window:hover { color: var(--text); }
.lb-window.active {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.lb-my-banner {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--tomato);
  padding: .9rem 1.1rem; border-radius: 10px;
  margin-bottom: 1.2rem; font-size: .92rem;
}
.lb-my-banner strong { color: var(--tomato); }
.lb-my-banner.empty { border-left-color: var(--muted); color: var(--muted); }

.lb-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 2rem; }
.lb-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .7rem; border-radius: 8px;
  font-size: .92rem;
}
.lb-row:hover { background: var(--surface2); }
.lb-row.me { background: rgba(200, 68, 42, 0.05); }
.lb-row.me .lb-nick { font-weight: 700; }
.lb-rank {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.lb-rank.gold   { background: rgba(215, 179, 100, 0.18); color: #a68030; }
.lb-rank.silver { background: rgba(160, 160, 160, 0.20); color: #6c6c6c; }
.lb-rank.bronze { background: rgba(140, 110,  79, 0.20); color: #8c6e4f; }
.lb-flag { font-size: 1rem; }
.lb-nick { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stat { color: var(--text); font-variant-numeric: tabular-nums; }
.lb-stat .avg { color: var(--muted); font-size: .82rem; margin-left: .3rem; }

.lb-block-title {
  font-size: .85rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 2.4rem 0 1rem;
}

.lb-dist-chart {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1rem .8rem;
  margin-bottom: 1.6rem;
}
.lb-dist-canvas { width: 100%; }
.lb-dist-caption {
  text-align: center; font-size: .82rem; color: var(--muted);
  margin-top: .4rem;
}

.lb-country-list { display: flex; flex-direction: column; gap: .4rem; }
.lb-country {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .7rem; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .9rem;
}
.lb-country-flag { font-size: 1.1rem; }
.lb-country-name { flex: 1; }
.lb-country-stat { color: var(--muted); font-size: .85rem; }

/* ── Warehouse (按天列表) ──────────────────────────────────────── */
.wh-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem; margin-bottom: 1.8rem;
}
.wh-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem;
}
.wh-stat-label { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.wh-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--tomato); font-variant-numeric: tabular-nums; }
.wh-stat-value.green { color: var(--leaf); }
.wh-stat-value.brown { color: var(--potato); }

.wh-chart {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; margin-bottom: 1.6rem;
}
.wh-chart-title { font-size: .9rem; color: var(--muted); margin-bottom: .8rem; }

.wh-day-list { display: flex; flex-direction: column; gap: .6rem; }
.wh-day {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.wh-day-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 1rem; cursor: pointer;
  font-size: .92rem;
}
.wh-day-head:hover { background: var(--surface2); }
.wh-day-date { font-weight: 600; min-width: 5.5rem; }
.wh-day-weekday { font-size: .82rem; color: var(--muted); }
.wh-day-stats { margin-left: auto; display: flex; gap: 1rem; color: var(--muted); font-size: .85rem; }
.wh-day-stats .num { color: var(--tomato); font-weight: 600; }
