/* ai.21mins.com — design system (2026-09-19 redesign)
   One type scale, one spacing scale, solid colour tokens (no opacity-dimmed text), AA contrast in both themes. */

:root {
  /* colour */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --text: #18181b;
  --text-2: #3f3f46;      /* body secondary  — 10:1 on surface */
  --text-3: #6b6b76;      /* meta only       — 5.1:1 on surface */
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-soft: #eef2ff;
  --accent-on: #ffffff;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --t-local: #047857;
  --t-agent: #4338ca;
  --t-newtech: #b45309;
  --t-industry: #52525b;
  --shadow: 0 1px 2px rgba(24, 24, 27, .05);

  /* type scale */
  --fs-xs: 0.8125rem;   /* 13 — meta */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-md: 1rem;        /* 16 — body */
  --fs-lg: 1.125rem;    /* 18 — item title */
  --fs-xl: 1.375rem;    /* 22 — section */
  --fs-2xl: 1.75rem;    /* 28 — page title */
  --lh-body: 1.75;
  --lh-tight: 1.4;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* space + shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r-md: 12px;
  --col: 760px;
  --wide: 920px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f12;
    --surface: #18181c;
    --surface-2: #222228;
    --text: #ededf0;
    --text-2: #c4c4cc;
    --text-3: #9494a0;
    --border: #2a2a31;
    --border-strong: #3a3a44;
    --accent: #a5b4fc;
    --accent-hover: #c7d2fe;
    --accent-soft: #1e1b4b;
    --accent-on: #0f0f12;
    --ok: #6ee7b7; --ok-soft: #052e22;
    --warn: #fcd34d; --warn-soft: #2b1d05;
    --danger: #fca5a5; --danger-soft: #2a1111;
    --t-local: #6ee7b7; --t-agent: #a5b4fc; --t-newtech: #fcd34d; --t-industry: #a1a1aa;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- site header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header-inner { max-width: var(--wide); margin: 0 auto; padding: var(--s4) var(--s4) 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s5); }
.brand { display: flex; align-items: baseline; gap: var(--s3); text-decoration: none; color: var(--text); margin-right: auto; }
.brand-name { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; }
.brand-tag { font-size: var(--fs-xs); color: var(--text-3); }
.site-nav { display: flex; gap: var(--s1); }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); text-decoration: none;
  color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.owner-badge { font-size: var(--fs-xs); color: var(--ok); background: var(--ok-soft); padding: 2px var(--s2); border-radius: 999px; align-self: center; }

/* ---------- layout ---------- */
.page { max-width: var(--col); margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.page-title { font-size: var(--fs-2xl); line-height: 1.25; margin: 0 0 var(--s2); letter-spacing: -.015em; }
.page-lede { color: var(--text-2); margin: 0 0 var(--s5); }
.banner { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); border-radius: var(--r-sm); padding: var(--s3) var(--s4); margin-bottom: var(--s4); font-size: var(--fs-sm); }
.empty { color: var(--text-3); text-align: center; padding: var(--s7) var(--s4); }
.toast { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: var(--s2) var(--s4); border-radius: 999px; font-size: var(--fs-sm); z-index: 50; }

/* ---------- daily toolbar ---------- */
.toolbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); margin: 0 calc(-1 * var(--s4)) var(--s5); padding: var(--s3) var(--s4) 0; }
.toolbar-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.datenav { display: flex; align-items: center; gap: var(--s1); margin-right: auto; }
.datenav-date { font-size: var(--fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; padding: 0 var(--s2); }
.datenav-dow { color: var(--text-3); font-size: var(--fs-sm); font-weight: 400; margin-left: var(--s1); }
.icon-btn, .ghost-btn {
  min-height: 36px; min-width: 36px; padding: 0 var(--s3); border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-sm);
}
.icon-btn:hover, .ghost-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn[disabled] { color: var(--border-strong); cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; min-height: 34px; padding: 0 var(--s3); font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tabs { display: flex; gap: var(--s1); overflow-x: auto; margin-top: var(--s2); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 40px; padding: 0 var(--s3); border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: var(--fs-sm); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab .n { color: var(--text-3); font-weight: 400; margin-left: 4px; font-variant-numeric: tabular-nums; }
.subnav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); font-size: var(--fs-xs); color: var(--text-3); margin: calc(-1 * var(--s2)) 0 var(--s5); }
.subnav a { color: var(--text-2); text-decoration: none; padding: 6px 0; }
.subnav a:hover { color: var(--accent); text-decoration: underline; }
.viewhead { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s5); }
.viewhead h1 { font-size: var(--fs-xl); margin: 0; }
.viewhead .count { color: var(--text-3); font-size: var(--fs-sm); }

/* ---------- feature strip ---------- */
.strip { margin-bottom: var(--s5); }
.strip-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s2); }
.eyebrow { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.strip-link { display: block; padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); text-decoration: none; color: var(--text); margin-bottom: var(--s2); }
.strip-link:hover { border-color: var(--border-strong); border-left-color: var(--accent); }
.strip-title { display: block; font-weight: 650; line-height: var(--lh-tight); }
.strip-sub { display: block; color: var(--text-2); font-size: var(--fs-sm); margin-top: 2px; }

/* ---------- sections + items ---------- */
.section { margin-bottom: var(--s6); }
.section-head { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s2); padding-left: var(--s3); border-left: 3px solid var(--tc, var(--border-strong)); }
.section-head h2 { font-size: var(--fs-xl); margin: 0; line-height: 1.3; }
.section-head .n { color: var(--text-3); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.section[data-topic="local"] { --tc: var(--t-local); }
.section[data-topic="agent"] { --tc: var(--t-agent); }
.section[data-topic="newtech"] { --tc: var(--t-newtech); }
.section[data-topic="industry"] { --tc: var(--t-industry); }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.item + .item { border-top: 1px solid var(--border); }
.item-head { display: flex; gap: var(--s4); width: 100%; text-align: left; background: transparent; border: 0; padding: var(--s4); cursor: pointer; align-items: flex-start; }
.item-head:hover { background: var(--surface-2); }
.item-main { flex: 1; min-width: 0; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s1); }
.item-meta .dot::before { content: "·"; margin-right: var(--s2); }
.pill { font-size: 0.75rem; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pill-zh { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-watch { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-rated { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.item-title { font-size: var(--fs-lg); font-weight: 650; line-height: var(--lh-tight); margin: 0; color: var(--text); }
.item-gist { color: var(--text-2); font-size: 0.9375rem; line-height: 1.65; margin: var(--s1) 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item[data-open="true"] .item-gist { display: none; }
.item-thumb { flex: none; width: 112px; height: 74px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); }
.item[data-open="true"] .item-thumb { display: none; }
.chev { flex: none; align-self: center; color: var(--text-3); font-size: var(--fs-sm); transition: transform .15s; }
.item[data-open="true"] .chev { transform: rotate(90deg); }
.item-body { padding: 0 var(--s4) var(--s4); }
.item-en { color: var(--text-3); font-size: var(--fs-sm); margin: 0 0 var(--s3); }
.item-figure { margin: 0 0 var(--s4); }
.item-figure img { display: block; max-width: 100%; max-height: 300px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.item-summary { margin: 0 0 var(--s4); padding-left: 1.25em; color: var(--text); }
.item-summary li { margin-bottom: var(--s2); }
.terms { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); margin: 0 0 var(--s4); }
.term { font-family: var(--mono); font-size: 0.78rem; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.quote { margin: 0 0 var(--s4); padding: var(--s2) var(--s4); border-left: 3px solid var(--border-strong); color: var(--text-2); font-size: 0.9375rem; font-style: italic; line-height: 1.65; }
.why { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); background: var(--accent-soft); border-radius: var(--r-sm); font-size: 0.9375rem; line-height: 1.7; }
.why b { color: var(--accent); font-weight: 650; margin-right: var(--s1); }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--fs-sm); color: var(--text-3); }
.btn-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--s4); border-radius: var(--r-sm); background: var(--accent); color: var(--accent-on); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
.btn-link:hover { background: var(--accent-hover); color: var(--accent-on); }
.gh { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-2); }

/* ---------- owner bar ---------- */
.owner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4) var(--s3); border-top: 1px dashed var(--border); background: var(--surface); }
.owner .seg button { min-height: 32px; font-size: var(--fs-xs); }
.owner .seg button[aria-pressed="true"][data-r="-1"] { background: var(--danger-soft); color: var(--danger); }
.owner .seg button[aria-pressed="true"][data-r="2"] { background: var(--ok-soft); color: var(--ok); }
.save-btn { min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px dashed var(--border-strong); background: transparent; font-size: var(--fs-xs); cursor: pointer; color: var(--text-2); }
.save-btn[aria-pressed="true"] { border-style: solid; border-color: var(--warn); background: var(--warn-soft); color: var(--warn); font-weight: 650; }
.danger-btn { min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--border); background: transparent; font-size: var(--fs-xs); cursor: pointer; color: var(--text-3); margin-left: auto; }
.danger-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.danger-btn.undo { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); font-weight: 650; }
.owner input[type="text"], .owner select { min-height: 32px; padding: 0 var(--s2); border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); font-size: var(--fs-xs); min-width: 0; }
.owner input[type="text"] { flex: 1 1 200px; }
.owner-row { display: flex; flex-wrap: wrap; gap: var(--s2); width: 100%; }
.note-field { display: flex; align-items: center; gap: var(--s2); flex: 1 1 240px; min-width: 0; }
.note-field input[type="text"] { flex: 1 1 auto; }
.save-status { flex: none; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; min-width: 0; }
.save-status.saved { color: var(--ok); }
.save-status.failed { color: var(--danger); }

/* ---------- long-form (features, project briefs) ---------- */
.kicker { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .04em; margin: 0 0 var(--s2); }
.note-box { font-size: var(--fs-sm); line-height: 1.7; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: var(--s5); color: var(--text-2); }
.prose { font-size: var(--fs-md); line-height: 1.85; }
.prose h2 { font-size: var(--fs-xl); line-height: 1.3; margin: var(--s7) 0 var(--s3); padding-top: var(--s2); border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: var(--fs-lg); margin: var(--s5) 0 var(--s2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: var(--s6) 0; }
.prose blockquote { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code, .inline code { font-family: var(--mono); font-size: 0.86em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.prose pre { overflow-x: auto; padding: var(--s3) var(--s4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: 1.6; }
.prose pre code { border: 0; padding: 0; background: none; }
.table-scroll { overflow-x: auto; margin: 0 0 var(--s4); }
.prose table { border-collapse: collapse; font-size: var(--fs-sm); min-width: 100%; line-height: 1.6; }
.prose th, .prose td { border: 1px solid var(--border); padding: var(--s2) var(--s3); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); white-space: nowrap; font-weight: 650; }

/* ---------- cards (features list, projects) ---------- */
.card-link { display: block; padding: var(--s4) var(--s5); margin-bottom: var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.card-link:hover { border-color: var(--border-strong); color: var(--text); }
.card-title { font-size: var(--fs-lg); font-weight: 650; line-height: var(--lh-tight); margin-bottom: var(--s1); }
.card-sub { color: var(--text-2); font-size: 0.9375rem; line-height: 1.65; }
.card-meta { color: var(--text-3); font-size: var(--fs-xs); margin-top: var(--s3); }
.card-next { margin-top: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); line-height: 1.65; }
.block { margin-bottom: var(--s6); }
.block > h2 { font-size: var(--fs-xl); margin: 0 0 var(--s3); }
.plain-list { margin: 0; padding-left: 1.25em; }
.plain-list li { margin-bottom: var(--s2); }
.cmd { position: relative; border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3) var(--s4); margin-bottom: var(--s3); background: var(--surface); }
.cmd-label { font-weight: 650; }
.cmd-hint { font-size: var(--fs-xs); color: var(--text-3); margin: 2px 72px var(--s2) 0; line-height: 1.55; }
.cmd pre { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-all; line-height: 1.55; }
.cmd .ghost-btn { position: absolute; top: var(--s3); right: var(--s4); min-height: 30px; font-size: var(--fs-xs); }
.material { padding: var(--s3) 0; border-bottom: 1px solid var(--border); }
.material:last-child { border-bottom: 0; }
.material-day { margin: var(--s4) 0 var(--s1); font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.material a { font-weight: 600; color: var(--text); text-decoration: none; }
.material a:hover { color: var(--accent); text-decoration: underline; }
.material-meta { font-size: var(--fs-xs); color: var(--text-3); margin-left: var(--s2); }
.material-why { margin-top: 2px; font-size: 0.9375rem; line-height: 1.7; color: var(--text-2); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--s7); }
.site-footer-inner { max-width: var(--wide); margin: 0 auto; padding: var(--s5) var(--s4) var(--s6); font-size: var(--fs-xs); color: var(--text-3); line-height: 1.7; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); justify-content: space-between; }
.site-footer a, .site-footer button { color: var(--text-2); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; font-size: inherit; }

/* ---------- phone (tuned on an iPhone 16 Pro Max, 430x932) ----------
   Before: header 148px + toolbar 97px meant the first item started at 737px — 79% of the screen gone.
   After: one-line header, compact toolbar, first item around 300px. Body text goes UP (15 -> 16.5px):
   Chinese at 15px on a 430pt screen is tiring, and the phone is where this actually gets read. */
@media (max-width: 620px) {
  :root {
    --fs-xs: 0.8125rem;
    --fs-sm: 0.9063rem;   /* 14.5 */
    --fs-md: 1.0313rem;   /* 16.5 — body */
    --fs-lg: 1.1875rem;   /* 19   — item title */
    --fs-xl: 1.25rem;     /* 20   — section */
    --fs-2xl: 1.5rem;     /* 24   — page title */
    --lh-body: 1.8;       /* Chinese needs more air than Latin */
    --gutter: 18px;
  }
  body { font-size: var(--fs-md); }

  /* one-line header: brand shrinks, nav scrolls sideways, sign-in becomes an icon */
  .site-header { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); }
  .site-header-inner {
    padding: 6px max(var(--s3), env(safe-area-inset-left)) 0 max(var(--s3), env(safe-area-inset-right));
    gap: var(--s2); align-items: center; flex-wrap: nowrap;
  }
  .brand { margin-right: 0; flex: none; }
  .brand-name { font-size: 1.0625rem; }
  .brand-tag { display: none; }
  .site-nav {
    flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; justify-content: flex-end;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { min-height: 40px; padding: 0 10px; font-size: var(--fs-sm); }
  .owner-slot { flex: none; }
  .owner-slot .ghost-btn { font-size: 0; min-width: 40px; padding: 0 10px; }
  .owner-slot .ghost-btn::after { content: "登录"; font-size: var(--fs-xs); }
  .owner-badge { font-size: 0; padding: 0; background: none; }
  .owner-badge::after { content: "●"; font-size: 12px; color: var(--ok); }

  .page {
    padding: var(--s3) max(var(--gutter), env(safe-area-inset-left))
             calc(var(--s7) + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-right));
  }
  .page-title { line-height: 1.3; }
  .page-lede { font-size: var(--fs-sm); }

  /* toolbar: date + density on one row, topic tabs scroll under it */
  .toolbar {
    top: calc(52px + env(safe-area-inset-top));
    margin: 0 calc(-1 * var(--gutter)) var(--s3);
    padding: 6px var(--gutter) 0;
  }
  .toolbar-row { flex-wrap: nowrap; gap: var(--s2); }
  .datenav-date { font-size: var(--fs-md); padding: 0 4px; }
  .datenav-dow { font-size: var(--fs-xs); }
  .icon-btn { min-height: 38px; min-width: 38px; padding: 0 8px; }
  .seg button { min-height: 36px; padding: 0 10px; font-size: var(--fs-xs); }
  .tabs { margin-top: 2px; }
  .tab { min-height: 38px; padding: 0 10px; }
  .subnav { margin: 0 0 var(--s3); gap: var(--s1) var(--s2); }
  .subnav a { padding: 4px 0; }

  /* strip: one feature on a phone, not two */
  .strip { margin-bottom: var(--s4); }
  .strip-link { padding: var(--s3); }
  .strip-link:nth-of-type(n + 2) { display: none; }

  /* items: tighter chrome, roomier text */
  .section { margin-bottom: var(--s5); }
  .section-head h2 { font-size: var(--fs-xl); }
  .item-head { padding: var(--s3); gap: var(--s3); align-items: flex-start; }
  .item-title { font-size: var(--fs-lg); line-height: 1.45; }
  .item-gist { font-size: var(--fs-sm); line-height: 1.7; -webkit-line-clamp: 3; }
  .item-thumb { width: 72px; height: 72px; border-radius: 10px; }
  .item-body { padding: 0 var(--s3) var(--s3); }
  .item-summary { padding-left: 1.1em; }
  .item-summary li { margin-bottom: var(--s3); }
  .quote, .why { font-size: var(--fs-sm); }
  .btn-link { min-height: 42px; padding: 0 var(--s4); }
  .chev { display: none; }

  /* owner controls stack instead of squeezing */
  .owner { padding: var(--s2) var(--s3) var(--s3); gap: var(--s2); }
  .owner .seg { flex: 1 1 100%; }
  .owner .seg button { flex: 1; min-height: 40px; }
  .save-btn, .danger-btn { min-height: 38px; }
  .danger-btn { margin-left: 0; }
  .note-field { flex: 1 1 100%; }

  /* long-form */
  .prose { font-size: var(--fs-md); line-height: 1.85; }
  .prose h2 { font-size: var(--fs-xl); margin-top: var(--s6); }
  .prose h3 { font-size: var(--fs-lg); }
  .prose table { font-size: var(--fs-xs); }
  .cmd pre { font-size: 0.75rem; }
  .cmd-hint { margin-right: 64px; }

  .card-link { padding: var(--s3) var(--s4); }
  .card-title { font-size: var(--fs-lg); }
}

/* very narrow phones keep the nav readable by dropping the brand word */
@media (max-width: 380px) {
  .brand-name { font-size: 1rem; }
  .site-nav a { padding: 0 8px; }
}

/* ---- 热点 ---- */
.hot-row { text-decoration: none; color: inherit; align-items: center; }
.hot-row:hover { background: var(--surface-2); }
.heat { flex: none; width: 68px; text-align: right; }
.heat-n { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.heat-k { font-size: 0.7rem; color: var(--text-3); }
#hotbar { position: static; margin-bottom: var(--s5); border-bottom: 0; padding: 0; }
#hotbar .toolbar-row { gap: var(--s3); }
@media (max-width: 560px) { .heat { width: 54px; } .heat-n { font-size: var(--fs-md); } }

/* ---- 开源榜 ---- */
#repobar { position: static; margin-bottom: var(--s5); border-bottom: 0; padding: 0; }
#repobar .toolbar-row { gap: var(--s3); }
.repo-row .heat-n { color: var(--ok); }            /* the growth number is the headline of this page */
.repo-name { font-family: var(--mono); font-size: var(--fs-md); overflow-wrap: break-word; }
.repo-en { font-style: normal; color: var(--text-3); }
.rank-n { font-variant-numeric: tabular-nums; color: var(--text-3); }
.pill-new { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.repo-why {
  display: flex; gap: var(--s2); align-items: baseline;
  padding: var(--s2) var(--s4) var(--s3) calc(68px + var(--s4) + var(--s3));
  font-size: var(--fs-sm); color: var(--text-2); line-height: 1.6;
}
.repo-why-k { flex: none; font-size: 0.7rem; color: var(--text-3); }
.note-line { color: var(--text-3); font-size: var(--fs-sm); text-align: center; margin-top: var(--s5); }
/* 「那又怎样」block: sits above the ranking, because a list of fast-growing repos is not yet an answer */
.digest {
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s4); margin-bottom: var(--s5);
}
.digest-part + .digest-part { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border-strong); }
.digest-h { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .04em; color: var(--accent); margin: 0 0 var(--s3); }
.digest-proj + .digest-proj { margin-top: var(--s3); }
.digest-proj-name { display: block; font-size: var(--fs-xs); color: var(--text-3); text-decoration: none; margin-bottom: var(--s1); }
.digest-proj-name:hover { color: var(--accent); }
.digest-line { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); margin-bottom: var(--s1); }
.digest-repo { font-family: var(--mono); font-size: 0.8125rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border-strong); margin-right: var(--s2); }
.digest-repo:hover { color: var(--accent); }
.digest-try { display: flex; gap: var(--s3); align-items: baseline; }
.digest-try + .digest-try { margin-top: var(--s3); }
.digest-rank {
  flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-on);
  font-size: 0.6875rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.digest-step { margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.65; color: var(--text-2); }
@media (max-width: 620px) {
  .repo-name { font-size: var(--fs-sm); }
  .repo-why { padding-left: var(--s4); padding-right: var(--s4); flex-direction: column; gap: 2px; font-size: var(--fs-xs); }
  /* the three filters have to fit on one line with the date nav, or they wrap mid-word ("观察名 / 单") */
  #repobar .seg button { padding: 0 var(--s2); font-size: var(--fs-xs); white-space: nowrap; }
  #repobar .datenav-date { white-space: nowrap; }
}

/* ---------- bottom tab bar (phones only) ---------- */
.tabbar { display: none; }
@media (max-width: 620px) {
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: saturate(180%) blur(12px);
  }
  .tabbar-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 52px; text-decoration: none; color: var(--text-3); font-size: 0.6875rem;
  }
  .tabbar-item[aria-current="page"] { color: var(--accent); }
  .tabbar-icon { font-size: 1.05rem; line-height: 1; }
  body { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  /* the top nav becomes secondary on phones: 关于 + sign-in live there, the rest moved to the bar */
  .site-nav a:not([href="about.html"]) { display: none; }
  /* header slides away while reading, comes back on scroll-up */
  .site-header { transition: transform .22s ease; }
  body.chrome-hidden .site-header { transform: translateY(-100%); }
  body.chrome-hidden .toolbar { top: env(safe-area-inset-top); }
  .toolbar { transition: top .22s ease; }
}

/* ---------- swipe to rate (touch devices) ---------- */
.item { position: relative; overflow: hidden; }
.item-head { position: relative; background: var(--surface); will-change: transform; }
.swipe-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--s4); font-size: var(--fs-sm); font-weight: 650; color: transparent; pointer-events: none;
}
.swipe-hint.on.no    { background: var(--danger-soft); color: var(--danger); justify-content: flex-end; }
.swipe-hint.on.yes   { background: var(--accent-soft); color: var(--accent); justify-content: flex-start; }
.swipe-hint.on.love  { background: var(--ok-soft);     color: var(--ok);     justify-content: flex-start; }
.quickwhy { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) var(--s3); background: var(--surface); border-top: 1px dashed var(--border); }
.quickwhy-tag { font-size: var(--fs-xs); font-weight: 650; padding: 3px 8px; border-radius: 999px; }
.quickwhy-tag.no { background: var(--danger-soft); color: var(--danger); }
.quickwhy-tag.yes { background: var(--accent-soft); color: var(--accent); }
.quickwhy-tag.love { background: var(--ok-soft); color: var(--ok); }
.quickwhy .note-field { flex: 1 1 200px; }
.quickwhy input[type="text"] { width: 100%; min-height: 38px; padding: 0 var(--s2); border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); }
/* scroll affordance on the topic tabs */
.tabs { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
@media (max-width: 620px) { .item-gist { font-size: 0.9688rem; } }
