/* 泰华新闻 UI 2026-11 — shared design layer.
   Loaded after each page's inline <style>. Selectors are prefixed with
   `html .page-*` so they win over the inline base rules without !important.
   Colors flow through --tg-* tokens; the legacy page variables (--ink,
   --muted, --line, --light, --card) are remapped onto them so the inline CSS
   picks up the same palette in light and dark mode. */

:root {
  --tg-brand: #df2028;
  --tg-brand-strong: #b9151c;
  --tg-brand-soft: #fff1f2;
  --tg-brand-line: #ffd5d9;
  --tg-bg: #f3f4f6;
  --tg-surface: #ffffff;
  --tg-surface-2: #f8f9fb;
  --tg-surface-3: #eff1f5;
  --tg-line: #e5e8ee;
  --tg-line-strong: #d5dae2;
  --tg-title: #101828;
  --tg-ink: #1f2937;
  --tg-ink-2: #3b4656;
  --tg-muted: #667085;
  --tg-faint: #6b7587; /* 4.6:1 on white (was #98a2b3, 2.6:1) */
  --tg-brand-text: #c41a21; /* red text on pale chips, 5.4:1 */
  --tg-topbar: rgba(255, 255, 255, 0.86);
  --tg-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --tg-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -16px rgba(16, 24, 40, 0.18);
  --tg-shadow-lg: 0 24px 56px -24px rgba(16, 24, 40, 0.35);
  --tg-radius: 14px;
  --tg-radius-md: 10px;
  --tg-radius-sm: 8px;
  --tg-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;

  --red: var(--tg-brand);
  --ink: var(--tg-ink);
  --muted: var(--tg-muted);
  --light: var(--tg-bg);
  --line: var(--tg-line);
  --card: var(--tg-surface);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --tg-brand-soft: rgba(223, 32, 40, 0.16);
  --tg-brand-line: rgba(255, 107, 115, 0.38);
  --tg-bg: #0c1118;
  --tg-surface: #141a24;
  --tg-surface-2: #19212d;
  --tg-surface-3: #212a38;
  --tg-line: #252f3f;
  --tg-line-strong: #334155;
  --tg-title: #f3f5f8;
  --tg-ink: #e2e7ee;
  --tg-ink-2: #c4ccd8;
  --tg-muted: #9aa5b5;
  --tg-faint: #8893a5;
  --tg-brand-text: #ff6b73;
  --tg-topbar: rgba(12, 17, 24, 0.84);
  --tg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --tg-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px -16px rgba(0, 0, 0, 0.55);
  --tg-shadow-lg: 0 24px 56px -24px rgba(0, 0, 0, 0.7);
  --ink: var(--tg-ink);
  --muted: var(--tg-muted);
  --light: var(--tg-bg);
  --line: var(--tg-line);
  --card: var(--tg-surface);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --tg-brand-soft: rgba(223, 32, 40, 0.16);
    --tg-brand-line: rgba(255, 107, 115, 0.38);
    --tg-bg: #0c1118;
    --tg-surface: #141a24;
    --tg-surface-2: #19212d;
    --tg-surface-3: #212a38;
    --tg-line: #252f3f;
    --tg-line-strong: #334155;
    --tg-title: #f3f5f8;
    --tg-ink: #e2e7ee;
    --tg-ink-2: #c4ccd8;
    --tg-muted: #9aa5b5;
    --tg-faint: #8893a5;
    --tg-brand-text: #ff6b73;
    --tg-topbar: rgba(12, 17, 24, 0.84);
    --tg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --tg-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px -16px rgba(0, 0, 0, 0.55);
    --tg-shadow-lg: 0 24px 56px -24px rgba(0, 0, 0, 0.7);
    --ink: var(--tg-ink);
    --muted: var(--tg-muted);
    --light: var(--tg-bg);
    --line: var(--tg-line);
    --card: var(--tg-surface);
  }
}

/* ---------- Base ---------- */
html body {
  color: var(--tg-ink);
  background: var(--tg-bg);
  font-family: var(--tg-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt" 0;
}

html ::selection { background: rgba(223, 32, 40, 0.18); }
html body time,
html body .tg-num { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
html body .topbar {
  background: var(--tg-topbar);
  border-bottom: 1px solid var(--tg-line);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  transition: box-shadow 0.2s ease;
}

html body .topbar.is-scrolled { box-shadow: 0 6px 20px -14px rgba(16, 24, 40, 0.35); }

html body .logo { color: var(--tg-title); font-weight: 800; letter-spacing: 0.02em; }
html body .logo img,
html body .logo-icon { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(193, 24, 42, 0.45); }

html body .nav { min-height: 64px; }
html .page-home .nav { height: 64px; }
html .page-home .navlinks a { height: 64px; }
html body .navlinks { gap: 4px; align-self: stretch; align-items: stretch; color: var(--tg-ink-2); font-weight: 600; }
html body .navlinks a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
html body .navlinks a:hover { color: var(--tg-brand); }
html body .navlinks a.active { color: var(--tg-brand); font-weight: 800; border-bottom-color: transparent; }
html body .navlinks a.active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--tg-brand);
}

html body .search {
  color: var(--tg-faint);
  background: var(--tg-surface-3);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
html body .search:focus-within {
  background: var(--tg-surface);
  border-color: var(--tg-brand-line);
  box-shadow: 0 0 0 4px rgba(223, 32, 40, 0.08);
}
html body .search input { color: var(--tg-ink); }
html body .search input::placeholder { color: var(--tg-faint); }
html body .search .tg-search-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
html body .search kbd {
  flex: none;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--tg-line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  color: var(--tg-faint);
  font: 600 11px/1 var(--tg-font);
}
html body .search:focus-within kbd { display: none; }

html body .theme-toggle { width: 34px; height: 34px; color: var(--tg-muted); }
html body .theme-toggle:hover { color: var(--tg-ink); background: var(--tg-surface-3); }

html body .publish {
  height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  background: var(--tg-brand);
  font-weight: 700;
  box-shadow: 0 6px 16px -8px rgba(223, 32, 40, 0.7);
  transition: background 0.15s ease, transform 0.15s ease;
}
html body .publish:hover { background: var(--tg-brand-strong); }
html body .publish:active { transform: translateY(1px); }
html[data-theme="dark"] body .publish { color: #fff; background: var(--tg-brand); border: 0; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body .publish { color: #fff; background: var(--tg-brand); border: 0; }
}

/* ---------- Ticker ---------- */
html body .ticker { background: var(--tg-surface); border-bottom-color: var(--tg-line); }
html body .ticker-inner { color: var(--tg-ink-2); }
html body .ticker-inner::after { background: linear-gradient(90deg, transparent, var(--tg-surface) 76%); }
html body .ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 2px 10px 2px 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
html body .ticker-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #fff;
  animation: tg-pulse 1.8s ease-in-out infinite;
}
html body .ticker-items a { color: var(--tg-ink-2); transition: color 0.15s ease; }
html body .ticker-items a:hover { color: var(--tg-brand); }
html body .ticker-items time { margin-right: 4px; color: var(--tg-faint); font-size: 12.5px; }

@keyframes tg-pulse { 50% { opacity: 0.35; } }

/* ---------- Shared surfaces ---------- */
html .page-home .channels,
html .page-home .main-column,
html .page-home .right-column > section,
html .page-home .section-block,
html .page-list .channel-list,
html .page-list .feed,
html .page-list .panel,
html .page-article .article,
html .page-article .panel,
html .page-search .search-panel,
html .page-search .result-list {
  background: var(--tg-surface);
  border-color: var(--tg-line);
  border-radius: var(--tg-radius);
  box-shadow: var(--tg-shadow);
}

html .page-home .main-column { overflow: hidden; }

html body .panel-title { color: var(--tg-title); font-weight: 800; }
html body .panel-title small {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--tg-muted);
  background: var(--tg-surface-3);
  font-size: 11.5px;
  font-weight: 700;
}

/* ---------- Home: channels ---------- */
html .page-home .channel,
html .page-list .channel { color: var(--tg-ink-2); border-radius: var(--tg-radius-sm); transition: color 0.15s ease, background 0.15s ease; }
html .page-home .channel small,
html .page-list .channel small { color: var(--tg-faint); }
html .page-home .channel.active,
html .page-home .channel:hover,
html .page-list .channel.active,
html .page-list .channel:hover { color: var(--tg-brand); background: var(--tg-brand-soft); }
html .page-home .channel.active span:first-child { font-weight: 800; }
html .page-home .channel-group-title { color: var(--tg-faint); letter-spacing: 0.06em; }
html .page-home .side-tag { color: var(--tg-ink-2); background: var(--tg-surface-2); font-weight: 600; }
html .page-home .side-tag:hover { color: var(--tg-brand); background: var(--tg-brand-soft); }
html .page-home .side-tag small { color: var(--tg-faint); }

/* ---------- Home: hero ---------- */
html .page-home .hero-card { border-radius: 0; background: #0b1220; }
html .page-home .hero-card img { transition: transform 0.6s ease; }
html .page-home .hero-card:hover img { transform: scale(1.025); }
html .page-home .hero-card::after {
  background:
    linear-gradient(0deg, rgba(6, 10, 18, 0.92) 0%, rgba(6, 10, 18, 0.62) 38%, rgba(6, 10, 18, 0.12) 72%, rgba(6, 10, 18, 0) 100%),
    linear-gradient(90deg, rgba(6, 10, 18, 0.5), rgba(6, 10, 18, 0) 70%);
}
html .page-home .hero-content { max-width: 640px; padding: 28px 30px 26px; }
html .page-home .hero-content h1,
html .page-home .hero-content .hero-title {
  margin-bottom: 10px;
  color: #fff;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.22;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
html .page-home .hero-content p {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
html .page-home .tag { padding: 4px 11px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.05em; box-shadow: 0 6px 18px -6px rgba(223, 32, 40, 0.8); }
html .page-home .hero-meta { margin-top: 14px; gap: 8px; }
html .page-home .hero-meta span {
  padding: 2px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
}

html .page-home .quick-grid { padding: 14px 18px; gap: 0; background: var(--tg-surface); border-bottom-color: var(--tg-line); }
html .page-home .quick-item { padding: 4px 16px; border-right-color: var(--tg-line); transition: color 0.15s ease; }
html .page-home .quick-item:first-child { padding-left: 0; }
html .page-home .quick-item:last-child { padding-right: 0; }
html .page-home .quick-item b {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 800;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}
html .page-home .quick-item span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--tg-ink-2);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
html .page-home .quick-item:hover span { color: var(--tg-brand); }

/* ---------- Feed tools (segmented tabs) ---------- */
html .page-home .feed-tools,
html .page-list .tools { border-bottom-color: var(--tg-line); }
html .page-home .feed-tools strong,
html .page-list .tools strong { color: var(--tg-title); font-weight: 800; }
html .page-home .tabs,
html .page-list .tabs {
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--tg-surface-3);
}
html .page-home .tab,
html .page-list .tab {
  height: 28px;
  border: 0;
  padding: 0 14px;
  color: var(--tg-muted);
  background: transparent;
  font-weight: 700;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
html .page-home .tab:hover,
html .page-list .tab:hover { color: var(--tg-ink); }
html .page-home .tab.active,
html .page-list .tab.active {
  color: var(--tg-brand);
  background: var(--tg-surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}
html[data-theme="dark"] .page-home .tab,
html[data-theme="dark"] .page-list .tab { background: transparent; border: 0; }
html[data-theme="dark"] .page-home .tab.active,
html[data-theme="dark"] .page-list .tab.active { background: var(--tg-surface-2); border: 0; color: #ff6b73; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .page-home .tab,
  html:not([data-theme="light"]) .page-list .tab { background: transparent; border: 0; }
  html:not([data-theme="light"]) .page-home .tab.active,
  html:not([data-theme="light"]) .page-list .tab.active { background: var(--tg-surface-2); border: 0; color: #ff6b73; }
}

/* ---------- Feed items (home + list pages) ---------- */
html .page-home .article,
html .page-list .article {
  position: relative;
  gap: 20px;
  padding: 20px;
  border-bottom-color: var(--tg-line);
  transition: background 0.15s ease;
}
html .page-home .article:hover,
html .page-list .article:hover { background: var(--tg-surface-2); }
html .page-home .article h2,
html .page-list .article h2 {
  margin-bottom: 8px;
  color: var(--tg-title);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.42;
  transition: color 0.15s ease;
}
html .page-home .article a:hover h2,
html .page-list .article a:hover h2 { color: var(--tg-brand); }
html .page-home .article p,
html .page-list .article p {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 12px;
  color: var(--tg-muted);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
html .page-home .article-meta,
html .page-list .article .meta {
  align-items: center;
  gap: 6px 12px;
  color: var(--tg-faint);
  font-size: 12.5px;
}
html .page-home .article-meta strong,
html .page-list .article .meta strong {
  padding: 1px 8px;
  border-radius: 6px;
  color: var(--tg-brand);
  background: var(--tg-brand-soft);
  font-size: 12px;
  font-weight: 700;
}
html .page-home .article-meta > :nth-child(n+3)::before,
html .page-list .article .meta > :nth-child(n+3)::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 8px 3px 0;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.6;
  vertical-align: middle;
}

html .page-home .thumb-media,
html .page-list .thumb-media,
html .page-home .thumb-empty,
html .page-list .thumb-empty { border-radius: var(--tg-radius-md); background: var(--tg-surface-3); }
html .page-home .thumb-media img,
html .page-list .thumb-media img { transition: transform 0.4s ease; }
html .page-home .article:hover .thumb-media img,
html .page-list .article:hover .thumb-media img { transform: scale(1.04); }
html .page-home .thumb-link,
html .page-list .thumb-link { border-radius: var(--tg-radius-md); overflow: hidden; }

html .page-home .feed-loading,
html .page-list .feed-loading { color: var(--tg-muted); font-weight: 600; }
html .page-home .feed-loading.manual {
  border-color: var(--tg-brand-line);
  background: var(--tg-brand-soft);
  color: var(--tg-brand);
  font-weight: 700;
}
html .page-home .empty,
html .page-list .empty { color: var(--tg-muted); }

/* ---------- Ranking lists ---------- */
html body .rank-list { gap: 4px; }
html body .rank-item {
  margin: 0 -8px;
  padding: 7px 8px;
  border-radius: var(--tg-radius-sm);
  color: var(--tg-ink-2);
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.15s ease, background 0.15s ease;
}
html body .rank-item:hover { color: var(--tg-brand); background: var(--tg-surface-2); }
html body .rank-item::before { border-radius: 6px; color: var(--tg-muted); background: var(--tg-surface-3); font-variant-numeric: tabular-nums; }
html body .rank-item:nth-child(1)::before { color: #fff; background: var(--tg-brand); }
html body .rank-item:nth-child(2)::before { color: #fff; background: #f26b21; }
html body .rank-item:nth-child(3)::before { color: #fff; background: #d99211; }

/* ---------- Home: lower modules ---------- */
html .page-home .home-lower { margin-top: -22px; }
html .page-home .section-head { border-bottom-color: var(--tg-line); }
html .page-home .section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tg-title);
  font-size: 19px;
  font-weight: 800;
}
html .page-home .section-head h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--tg-brand);
}
html .page-home .section-head a { color: var(--tg-muted); font-weight: 700; }
html .page-home .section-head a:hover { color: var(--tg-brand); }
html .page-home .topic-card {
  border-color: var(--tg-line);
  border-radius: var(--tg-radius-md);
  background: var(--tg-surface);
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
html .page-home .topic-card:hover {
  border-color: var(--tg-brand-line);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow-lg);
  transform: translateY(-2px);
}
html .page-home .topic-card h3 { color: var(--tg-title); font-weight: 800; }
html .page-home .topic-card small { color: var(--tg-brand); background: var(--tg-brand-soft); font-weight: 700; }
html .page-home .topic-card > span { color: var(--tg-ink); font-weight: 700; }
html .page-home .city-link {
  border-radius: var(--tg-radius-md);
  background: var(--tg-surface-2);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.2s ease;
}
html .page-home .city-link:hover { background: var(--tg-surface); border-color: var(--tg-brand-line); transform: translateY(-2px); }
html .page-home .city-link strong { color: var(--tg-title); }
html .page-home .city-count { color: var(--tg-brand); font-weight: 700; }
html .page-home .source-intro { border-radius: var(--tg-radius-md); background: linear-gradient(135deg, #111827, #1f2937 60%, #3b0d12); }
html .page-home .source-step { border-color: var(--tg-line); border-radius: var(--tg-radius-md); background: var(--tg-surface); }
html .page-home .source-step strong { color: var(--tg-title); }

/* ---------- Footer ---------- */
html body footer { background: var(--tg-surface); border-top-color: var(--tg-line); color: var(--tg-faint); }
html body .footer-col strong { color: var(--tg-title); font-weight: 800; }
html body .footer-col a { color: var(--tg-muted); transition: color 0.15s ease; }
html body .footer-col a:hover { color: var(--tg-brand); }
html body .copyright { border-top-color: var(--tg-line); color: var(--tg-faint); }
html[data-theme="dark"] body .footer-logo { filter: brightness(1.6) saturate(0.9); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body .footer-logo { filter: brightness(1.6) saturate(0.9); }
}

/* ---------- Back to top ---------- */
.tg-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease;
}
.tg-top.show { opacity: 1; transform: none; pointer-events: auto; }
.tg-top:hover { color: var(--tg-brand); }
.tg-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Article page ---------- */
.tg-progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--tg-brand), #ff7a45);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

html .page-article .nav { min-height: 64px; }
html .page-article .search {
  flex: 0 1 230px;
  min-width: 0;
  height: 38px;
  margin-left: 6px;
  padding: 0 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
}
html .page-article .search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; }
@media (max-width: 900px) { html .page-article .search { margin-left: auto; } }
@media (max-width: 560px) { html .page-article .search { display: none; } html .page-article .tg-font-trigger { margin-left: auto; } }
html .page-article .head { padding: 30px 36px 22px; }
html .page-article .breadcrumb { font-weight: 700; }
html .page-article .breadcrumb a { color: var(--tg-brand); }
html .page-article .head h1 {
  margin: 14px 0 14px;
  color: var(--tg-title);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.005em;
}
html .page-article .deck {
  padding-left: 14px;
  border-left: 3px solid var(--tg-brand);
  color: var(--tg-ink-2);
  font-size: 17px;
  line-height: 1.7;
}
html .page-article .meta { gap: 8px 14px; color: var(--tg-faint); }
html .page-article .meta strong { padding: 1px 8px; border-radius: 6px; color: var(--tg-brand); background: var(--tg-brand-soft); font-weight: 700; }
html .page-article .meta .editor-link { color: var(--tg-ink-2); text-decoration-color: var(--tg-line-strong); }
html .page-article .cover { border-color: var(--tg-line); background: var(--tg-surface-3); }
html .page-article .cover figcaption { color: var(--tg-faint); background: var(--tg-surface); }
html .page-article .body {
  max-width: 760px;
  padding: 32px 36px 36px;
  color: var(--tg-ink);
  font-size: 18px;
  line-height: 1.9;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
html .page-article .body p { margin: 0 0 1.15em; }
/* Bilingual (Thai + Chinese) articles: Thai paragraphs are folded behind a toggle (checkbox + label, works without
   JS); Thai-only bodies get a short note. */
html .page-article .thai-toggle-input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
html .page-article .thai-toggle-note,
html .page-article .lang-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 1.15em; padding: 10px 14px; border: 1px solid var(--tg-line); border-radius: var(--tg-radius-md); background: var(--tg-surface-2); color: var(--tg-muted); font-size: 15px; line-height: 1.6; }
html .page-article .thai-toggle { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--tg-brand-soft); color: var(--tg-brand-text); font-weight: 700; cursor: pointer; user-select: none; -webkit-user-select: none; }
html .page-article .thai-toggle-on { display: none; }
html .page-article .thai-toggle-input:checked ~ .thai-toggle-note .thai-toggle-on { display: inline; }
html .page-article .thai-toggle-input:checked ~ .thai-toggle-note .thai-toggle-off { display: none; }
html .page-article .thai-toggle-input:focus-visible ~ .thai-toggle-note .thai-toggle { outline: 2px solid var(--tg-brand); outline-offset: 2px; }
html .page-article .body .thai-original { display: none; }
html .page-article .thai-toggle-input:checked ~ .thai-original { display: block; color: var(--tg-muted); font-size: 0.94em; }
html .page-article .inline-image img,
html .page-article .inline-video img { border-color: var(--tg-line); border-radius: var(--tg-radius-md); background: var(--tg-surface-3); }
html .page-article .tag-row a { color: var(--tg-brand); background: var(--tg-brand-soft); font-weight: 700; }
html .page-article .source-note { border-color: var(--tg-line); border-radius: var(--tg-radius-md); background: var(--tg-surface-2); color: var(--tg-muted); }
html .page-article .source-note a { color: var(--tg-ink-2); text-decoration: underline; text-decoration-color: var(--tg-line-strong); text-underline-offset: 3px; }
html .page-article .related { margin: 0 36px 28px; border-top-color: var(--tg-line); }
html .page-article .related h2,
html .page-article .comment-head h2 { color: var(--tg-title); font-weight: 800; }
html .page-article .related-item { color: var(--tg-ink); border-bottom-color: var(--tg-line); transition: color 0.15s ease; }
html .page-article .related-item:hover { color: var(--tg-brand); }
html .page-article .related-item span { border-left-color: var(--tg-line-strong); }
html .page-article .comments { margin: 0 36px 34px; border-top-color: var(--tg-line); }
html .page-article .comment-input,
html .page-article .comment-textarea {
  border-color: var(--tg-line);
  border-radius: var(--tg-radius-sm);
  color: var(--tg-ink);
  background: var(--tg-surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
html .page-article .comment-input:focus,
html .page-article .comment-textarea:focus {
  outline: 0;
  border-color: var(--tg-brand-line);
  background: var(--tg-surface);
  box-shadow: 0 0 0 4px rgba(223, 32, 40, 0.08);
}
html .page-article .comment-submit { box-shadow: 0 6px 16px -8px rgba(223, 32, 40, 0.7); }
html .page-article .comment-empty,
html .page-article .comment-card { border-color: var(--tg-line); border-radius: var(--tg-radius-md); background: var(--tg-surface-2); }
html .page-article .comment-meta strong { color: var(--tg-title); }
html .page-article .comment-card p { color: var(--tg-ink-2); }
html .page-article .side { position: sticky; top: 84px; }

/* Share row, header trigger, bottom sheet and WeChat guide */
.tg-share {
  margin-top: 28px;
  padding: 16px 16px 12px;
  border: 1px solid var(--tg-line);
  border-radius: var(--tg-radius-md);
  background: var(--tg-surface-2);
  line-height: 1.4;
}
.tg-share-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tg-share-head span { color: var(--tg-title); font-size: 15px; font-weight: 800; }
.tg-share-head small { color: var(--tg-faint); font-size: 12px; }
.tg-share-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 14px 4px; }
.tg-share-row .tg-share-item { width: auto; }
.tg-share-item {
  flex: 0 0 auto;
  width: 64px;
  border: 0;
  padding: 2px 0 4px;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--tg-ink-2);
  background: transparent;
  font: 600 12px/1.2 var(--tg-font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tg-share-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px -8px rgba(16, 24, 40, 0.55);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tg-share-icon svg { width: 24px; height: 24px; }
.tg-share-item:hover .tg-share-icon { transform: translateY(-2px); box-shadow: 0 10px 18px -10px rgba(16, 24, 40, 0.6); }
.tg-share-item:active .tg-share-icon { transform: scale(0.94); }
.tg-share-item:focus-visible { outline: 0; }
.tg-share-item:focus-visible .tg-share-icon { outline: 3px solid rgba(223, 32, 40, 0.35); outline-offset: 2px; }
.tg-share-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tg-share-trigger {
  height: 34px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font: 700 13px/1 var(--tg-font);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tg-share-trigger svg { width: 16px; height: 16px; }
.tg-share-trigger:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
html .page-article .nav { gap: 14px; }

html.tg-sheet-lock,
html.tg-sheet-lock body { overflow: hidden; }
.tg-sheet { position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none; }
.tg-sheet.open { visibility: visible; pointer-events: auto; }
.tg-sheet-backdrop { position: absolute; inset: 0; background: rgba(9, 13, 20, 0.55); opacity: 0; transition: opacity 0.2s ease; }
.tg-sheet.open .tg-sheet-backdrop { opacity: 1; }
.tg-sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--tg-surface);
  box-shadow: 0 -20px 48px -20px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, 100%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tg-sheet.open .tg-sheet-panel { transform: translate(-50%, 0); }
.tg-sheet-handle { width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 999px; background: var(--tg-line-strong); }
.tg-sheet-panel h2 { margin: 0 0 12px; color: var(--tg-title); font-size: 16px; font-weight: 800; text-align: center; }
.tg-sheet-preview {
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--tg-line);
  border-radius: var(--tg-radius-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: var(--tg-surface-2);
}
.tg-sheet-preview img { width: 72px; height: 38px; border-radius: 6px; object-fit: cover; background: var(--tg-surface-3); }
.tg-sheet-preview img[hidden] { display: none; }
.tg-sheet-preview strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--tg-title);
  font-size: 14px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tg-sheet-preview span { color: var(--tg-faint); font-size: 12px; }
.tg-sheet-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 4px; }
.tg-sheet-grid .tg-share-item { width: auto; }
.tg-sheet-cancel {
  width: 100%;
  height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: 12px;
  color: var(--tg-ink-2);
  background: var(--tg-surface-3);
  font: 700 15px/1 var(--tg-font);
  cursor: pointer;
}
@media (min-width: 761px) {
  .tg-sheet-panel { top: 50%; bottom: auto; border-radius: 18px; transform: translate(-50%, -46%); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease; }
  .tg-sheet.open .tg-sheet-panel { transform: translate(-50%, -50%); opacity: 1; }
  .tg-sheet-handle { display: none; }
}

.tg-wx-guide {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  background: rgba(9, 13, 20, 0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #fff;
}
.tg-wx-guide.show { display: block; }
.tg-wx-arrow { position: absolute; top: 6px; right: 18px; width: 110px; height: 110px; }
.tg-wx-text { position: absolute; top: 128px; left: 24px; right: 24px; text-align: center; }
.tg-wx-text strong { display: block; font-size: 19px; line-height: 1.5; }
.tg-wx-text p { margin: 10px 0 22px; color: rgba(255, 255, 255, 0.78); font-size: 14px; }
.tg-wx-text button { height: 40px; border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 999px; padding: 0 22px; color: #fff; background: transparent; font: 700 14px/1 var(--tg-font); }
.tg-wx-cover { position: absolute; left: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; }

.tg-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 80;
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 24, 39, 0.92);
  font-size: 14px;
  font-weight: 600;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tg-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- List / category pages ---------- */
html .page-list .feed { overflow: hidden; }
html .page-list .page-head,
html .page-list .pager { background: transparent; border-color: var(--tg-line); }
html .page-list .page-head { padding: 24px 22px 18px; }
html .page-list .page-head h1 { color: var(--tg-title); font-weight: 800; }
html .page-list .channel-list { padding: 8px; }
html .page-list .channel { font-weight: 700; }
html .page-list .channel small { font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 960px) {
  html .page-list .channel-list {
    gap: 6px;
    padding: 6px;
    scrollbar-width: none;
  }
  html .page-list .channel-list::-webkit-scrollbar { display: none; }
  html .page-list .channel { min-width: max-content; min-height: 36px; padding: 0 14px; gap: 6px; border-radius: 999px; }
}
@media (max-width: 760px) {
  html .page-list .article { grid-template-columns: minmax(0, 1fr) 112px; align-items: start; }
  html .page-list .thumb-media,
  html .page-list .thumb-empty { min-height: 0; width: 112px; aspect-ratio: 4 / 3; }
  html .page-list .article h2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  html .page-list .article .meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  html .page-list .article .meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  html .page-list .page-head { padding: 18px 16px 14px; }
  html .page-list .page-head h1 { font-size: 24px; }
  html .page-list .tools { flex-direction: row; align-items: center; }
}
html .page-list .page-head p { color: var(--tg-muted); }
html .page-list .pager-btn {
  border-color: var(--tg-line);
  border-radius: 999px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.15s ease;
}
html .page-list .pager-btn:not([aria-disabled="true"]):hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }

/* ---------- Search page ---------- */
html .page-search .search-panel h1 { color: var(--tg-title); font-weight: 800; }
html .page-search .search-box input { border-color: var(--tg-line-strong); color: var(--tg-ink); background: var(--tg-surface); font-weight: 600; }
html .page-search .search-box input:focus { border-color: var(--tg-brand-line); box-shadow: 0 0 0 4px rgba(223, 32, 40, 0.08); }
html .page-search .search-box button { font-weight: 800; }
html .page-search .chip { border-color: var(--tg-line); color: var(--tg-ink-2); background: var(--tg-surface); font-weight: 600; }
html .page-search .chip:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
html .page-search .suggestion-title { color: var(--tg-faint); font-weight: 700; }
html .page-search .result { transition: background 0.15s ease; }
html .page-search .result:hover { background: var(--tg-surface-2); }
html .page-search .result p { color: var(--tg-muted); }
html .page-search .meta { align-items: center; color: var(--tg-faint); font-size: 12.5px; }
html .page-search .meta strong { padding: 1px 8px; border-radius: 6px; color: var(--tg-brand); background: var(--tg-brand-soft); font-size: 12px; font-weight: 700; }
html .page-search .result-head { color: var(--tg-muted); font-weight: 700; }
html .page-search .result h2 { color: var(--tg-title); font-weight: 700; }
html .page-search .result:hover h2 { color: var(--tg-brand); }
html .page-search .result mark { padding: 0 2px; border-radius: 3px; color: inherit; background: rgba(255, 196, 0, 0.32); }
html .page-search .result-skeleton {
  height: 104px;
  margin: 0 0 1px;
  border-bottom: 1px solid var(--tg-line);
  background:
    linear-gradient(var(--tg-surface-3) 0 0) 20px 22px / 58% 18px no-repeat,
    linear-gradient(var(--tg-surface-3) 0 0) 20px 54px / 86% 12px no-repeat,
    linear-gradient(var(--tg-surface-3) 0 0) 20px 76px / 32% 10px no-repeat;
  animation: tg-pulse 1.4s ease-in-out infinite;
}

/* ---------- Static info pages ---------- */
html .page-static .topbar { position: sticky; top: 0; z-index: 20; }
html .page-static .page,
html .page-static main > section,
html .page-static .card {
  border-color: var(--tg-line);
  border-radius: var(--tg-radius);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
html .page-static h1,
html .page-static h2,
html .page-static h3 { color: var(--tg-title); }
html .page-static .lead { color: var(--tg-ink-2); }
html .page-static .stat { border-color: var(--tg-line); background: var(--tg-surface-2); }
html .page-static footer a { color: var(--tg-muted); }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  html body .navlinks a.active::after { display: none; }
  html .page-home .nav { height: auto; gap: 10px; }
  html body .search kbd { display: none; }
  html .page-home .hero-content { padding: 18px 18px 16px; }
  html .page-home .hero-content h1,
  html .page-home .hero-content .hero-title { font-size: 23px; line-height: 1.3; }
  html .page-home .hero-content p { font-size: 13.5px; }
  html .page-home .hero-meta { display: none; }
  html .page-home .article,
  html .page-list .article { gap: 12px; padding: 15px 14px; }
  html .page-home .article h2,
  html .page-list .article h2 { font-size: 16.5px; line-height: 1.45; }
  html .page-home .article p,
  html .page-list .article p { font-size: 13.5px; line-height: 1.55; }
  html .page-home .article-meta > :nth-child(n+3)::before,
  html .page-list .article .meta > :nth-child(n+3)::before { margin-right: 6px; }
  html .page-home .publish { display: none; }
  html .page-home .theme-toggle { margin-left: auto; }
  html .page-home .feed-tools { flex-direction: row; align-items: center; padding: 12px 14px; }
  html .page-home .tabs { width: auto; }
  html .page-home .article-meta,
  html .page-list .article .meta { flex-wrap: nowrap; min-width: 0; overflow: hidden; white-space: nowrap; }
  html .page-home .article-meta > *,
  html .page-list .article .meta > * { flex: none; }
  html .page-home .article-meta > span,
  html .page-list .article .meta > span { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  html .page-home .channels .channel,
  html .page-home .channels .side-tag { border-color: var(--tg-line); background: var(--tg-surface); }
  html .page-home .channels .channel.active { border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
  html .page-home .home-lower { margin-top: 0; }
  html body .mobile-nav {
    background: var(--tg-topbar);
    border-top-color: var(--tg-line);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
  }
  html body .mobile-nav a { position: relative; color: var(--tg-muted); font-weight: 700; }
  html body .mobile-nav a.active { color: var(--tg-brand); background: transparent; }
  html body .mobile-nav a.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--tg-brand);
    transform: translateX(-50%);
  }
  .tg-top { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); width: 40px; height: 40px; }
  .tg-share-trigger { height: 32px; padding: 0 10px; }
  .tg-share { margin-left: -4px; margin-right: -4px; padding: 14px 12px 10px; }
  .tg-share-head small { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tg-share-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 2px; }
  .tg-share-item { font-size: 11.5px; }
  .tg-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  html .page-article .head { padding: 20px 18px 18px; }
  html .page-article .head h1 { font-size: 25px; line-height: 1.35; }
  html .page-article .deck { font-size: 15.5px; }
  html .page-article .body { padding: 22px 18px 26px; font-size: 17px; line-height: 1.85; }
  html .page-article .related,
  html .page-article .comments { margin-left: 18px; margin-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html body *,
  html body *::before,
  html body *::after { transition-duration: 0.01ms !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .tg-top, .tg-progress, .tg-share, .mobile-nav, .topbar, footer, .side, .comments, .related { display: none !important; }
  html .page-article .article { border: 0; box-shadow: none; }
}

/* ---------- Skip link (pages without their own rule) ---------- */
html body .skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-160%);
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff;
  background: var(--tg-brand);
  font-weight: 800;
  transition: transform 0.16s ease;
}
html body .skip-link:focus { transform: none; }

/* ---------- City & topic collections ---------- */
html .page-topic .hero { border-radius: var(--tg-radius); box-shadow: var(--tg-shadow); }
html .page-topic .hero h1 { font-weight: 800; }
html .page-topic .eyebrow { font-weight: 800; letter-spacing: 0.05em; }
html .page-topic .card,
html .page-topic .side-card {
  border-color: var(--tg-line);
  border-radius: var(--tg-radius);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
html .page-topic .card { overflow: hidden; }
html .page-topic .section-head { border-bottom-color: var(--tg-line); }
html .page-topic .section-head h2,
html .page-topic .side-card h2 { color: var(--tg-title); font-weight: 800; }
html .page-topic .city-tab,
html .page-topic .topic-tab {
  border-color: var(--tg-line);
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font-weight: 700;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
html .page-topic .city-tab:hover,
html .page-topic .topic-tab:hover { color: var(--tg-brand); }
html .page-topic .city-tab.active,
html .page-topic .topic-tab.active { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
html .page-topic .lead,
html .page-topic .feature { border-radius: var(--tg-radius-md); }
html .page-topic .brief,
html .page-topic .issue { border-color: var(--tg-line); border-radius: var(--tg-radius-sm); background: var(--tg-surface-2); }
html .page-topic .brief strong { color: var(--tg-title); }
html .page-topic .article { border-bottom-color: var(--tg-line); transition: background 0.15s ease; }
html .page-topic .article:hover { background: var(--tg-surface-2); }
html .page-topic .article h3 { color: var(--tg-title); font-size: 19px; font-weight: 700; line-height: 1.42; }
html .page-topic .article:hover h3 { color: var(--tg-brand); }
html .page-topic .article p { color: var(--tg-muted); }
html .page-topic .meta { color: var(--tg-faint); }
html .page-topic .thumb-media,
html .page-topic .thumb-empty { border-radius: var(--tg-radius-md); background: var(--tg-surface-3); }
html .page-topic .topic-tags a { color: var(--tg-brand); background: var(--tg-brand-soft); font-weight: 700; }
html .page-topic .city-list a,
html .page-topic .series-list a { border-color: var(--tg-line); color: var(--tg-ink-2); font-weight: 700; }
html .page-topic .city-list a.active { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
html .page-topic .insight { color: var(--tg-muted); }
html .page-topic .faq-item { border-color: var(--tg-line); }

/* ---------- Static pages without their own dark styles ---------- */
html .page-static .topbar { background: var(--tg-topbar); }
html .page-static .navlinks a { color: var(--tg-ink-2); }
html .page-static p,
html .page-static li { color: var(--tg-muted); }
html .page-static input,
html .page-static textarea,
html .page-static select {
  border-color: var(--tg-line-strong);
  color: var(--tg-ink);
  background: var(--tg-surface);
}
html .page-static footer { border-top: 1px solid var(--tg-line); }
html .page-static .main,
html .page-static .panel,
html .page-static .hero {
  border-color: var(--tg-line);
  border-radius: var(--tg-radius);
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
html .page-static .step,
html .page-static .contact-box,
html .page-static .secondary { border-color: var(--tg-line); background: var(--tg-surface-2); color: var(--tg-ink); }
html .page-static .note,
html .page-static .rule,
html .page-static .contact { border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
html .page-static .input,
html .page-static .select,
html .page-static .textarea { border-color: var(--tg-line-strong); color: var(--tg-ink); background: var(--tg-surface); }
html .page-static footer { background: var(--tg-surface); color: var(--tg-faint); }

/* Theme toggle: moon + sparkle icon, slightly larger and outlined like the share pill */
html body .theme-toggle { border: 1px solid var(--tg-line); background: var(--tg-surface); }
html body .theme-toggle svg { width: 18px; height: 18px; stroke-width: 2; }
html body .theme-toggle:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-surface); }

/* ---------- Mobile polish (2026-11-11, round 3) ---------- */
/* Thumbnails fade in once loaded (attribute is only set by site.js). */
html .thumb-media img[data-tg-fade] { transition: opacity 0.35s ease, transform 0.4s ease; }
html .thumb-media img[data-tg-fade]:not(.tg-loaded) { opacity: 0; }
html .thumb-media:has(img[data-tg-fade]:not(.tg-loaded)) {
  background: linear-gradient(100deg, var(--tg-surface-3) 30%, var(--tg-surface-2) 50%, var(--tg-surface-3) 70%) 0 0 / 220% 100%;
  animation: tg-shimmer 1.3s linear infinite;
}
@keyframes tg-shimmer { to { background-position: -220% 0; } }

/* Header search icon (phones) */
.tg-search-link { display: none; }

/* Font size control on article pages */
.tg-font-trigger {
  width: 34px;
  height: 34px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  padding: 0;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 32px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tg-font-trigger span:first-child { font-size: 11px; }
.tg-font-trigger span:last-child { font-size: 16px; }
.tg-font-trigger:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
html[data-font="l"] .page-article .body { font-size: 20px; }
html[data-font="xl"] .page-article .body { font-size: 22px; line-height: 1.85; }
html[data-font="l"] .page-article .deck { font-size: 18px; }
html[data-font="xl"] .page-article .deck { font-size: 19.5px; }

/* Channel panel opened from the 栏目 tab */
.tg-channel-sheet { display: grid; gap: 16px; }
.tg-channel-group h3 { margin: 0 0 8px; color: var(--tg-faint); font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; }
.tg-channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tg-channel-chip {
  min-height: 40px;
  border: 1px solid var(--tg-line);
  border-radius: 10px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  color: var(--tg-ink);
  background: var(--tg-surface-2);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}
.tg-channel-chip:hover,
.tg-channel-chip.active { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }

@media (max-width: 760px) {
  /* Bottom bar slides away while reading and returns on any upward scroll. */
  html body .mobile-nav { transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); will-change: transform; }
  html.tg-nav-hidden body .mobile-nav { transform: translateY(calc(100% + 2px)); }
  html body .mobile-nav a.tg-to-top { color: var(--tg-brand); }
  .tg-top { transition: opacity 0.2s ease, transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.15s ease; }

  /* One-row header on home and list pages: search becomes an icon. */
  html .page-home .nav,
  html .page-list .nav { flex-wrap: nowrap; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
  html .page-home .search,
  html .page-list .search { display: none; }
  html .page-home .logo img,
  html .page-home .logo-icon,
  html .page-list .logo img { width: 36px; height: 36px; }
  html .page-home .logo,
  html .page-list .logo { font-size: 19px; }
  .tg-search-link {
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 1px solid var(--tg-line);
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    color: var(--tg-ink-2);
    background: var(--tg-surface);
  }
  .tg-search-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  html .page-home .theme-toggle,
  html .page-list .theme-toggle { margin-left: 0; }

  html[data-font="l"] .page-article .body { font-size: 19px; }
  html[data-font="xl"] .page-article .body { font-size: 21px; }
  .tg-font-trigger { width: 32px; height: 32px; line-height: 30px; }
}

/* Desktop WeChat QR dialog */
.tg-qr { display: grid; justify-items: center; gap: 10px; padding: 4px 0 2px; text-align: center; }
.tg-qr-code {
  width: 208px;
  height: 208px;
  padding: 8px;
  border: 1px solid var(--tg-line);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--tg-muted);
  background: #fff;
  font-size: 13px;
}
.tg-qr-code svg { width: 100%; height: 100%; display: block; }
.tg-qr-tip { max-width: 300px; margin: 4px 0 0; color: var(--tg-ink-2); font-size: 14px; line-height: 1.6; }
.tg-qr-url { color: var(--tg-faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tg-qr-copy {
  height: 36px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font: 700 13px/1 var(--tg-font);
  cursor: pointer;
}
.tg-qr-copy:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }

/* Article "你可能喜欢" picture cards */
html .page-article .related-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
html .page-article .related-card {
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: var(--tg-radius-md);
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--tg-ink);
  transition: background 0.15s ease;
}
html .page-article .related-card:hover { background: var(--tg-surface-2); }
html .page-article .related-thumb { width: 120px; height: 80px; border-radius: 8px; overflow: hidden; background: var(--tg-surface-3); }
html .page-article .related-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 0.4s ease; }
html .page-article .related-card:hover .related-thumb img { transform: scale(1.05); }
html .page-article .related-text { min-width: 0; display: grid; gap: 6px; }
html .page-article .related-text strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--tg-title);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 0.15s ease;
}
html .page-article .related-card:hover strong { color: var(--tg-brand); }
html .page-article .related-meta { display: flex; gap: 8px; align-items: center; color: var(--tg-faint); font-size: 12px; }
html .page-article .related-meta em { font-style: normal; color: var(--tg-brand); font-weight: 700; }
@media (max-width: 760px) {
  html .page-article .related-cards { grid-template-columns: 1fr; }
  html .page-article .related-card { grid-template-columns: 104px minmax(0, 1fr); }
  html .page-article .related-thumb { width: 104px; height: 70px; }
}

/* Home right column: only the last panel sticks, so tall columns never get clipped */
html .page-home .right-column { position: static; align-self: stretch; align-content: start; }
html .page-home .right-column > section:last-child { position: sticky; top: 84px; }
html .page-home .digest-list { display: grid; gap: 2px; }
html .page-home .digest-item {
  margin: 0 -8px;
  padding: 8px;
  border-radius: var(--tg-radius-sm);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  color: var(--tg-ink-2);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
}
html .page-home .digest-item:hover { color: var(--tg-brand); background: var(--tg-surface-2); }
html .page-home .digest-item b {
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--tg-brand);
  background: var(--tg-brand-soft);
  font-size: 12px;
  font-weight: 700;
}
html .page-home .digest-item span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
html .page-home .quick-links { display: flex; flex-wrap: wrap; gap: 6px; }
html .page-home .quick-links + .quick-links { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--tg-line); }
html .page-home .quick-links a {
  padding: 4px 10px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}
html .page-home .quick-links a:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
html .page-home .quick-subscribe { margin-top: 12px; display: flex; gap: 14px; font-size: 13px; font-weight: 700; }
html .page-home .quick-subscribe a { color: var(--tg-muted); }
html .page-home .quick-subscribe a:hover { color: var(--tg-brand); }
@media (max-width: 1040px) {
  html .page-home .right-column > section:last-child { position: static; }
}

/* List pages: numbered pagination + jump */
html .page-list .pager { flex-wrap: wrap; gap: 12px 18px; }
html .page-list .pager-actions { flex-wrap: wrap; gap: 6px; }
.pager-pages { display: flex; align-items: center; gap: 4px; }
.pager-num {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--tg-ink-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.pager-num:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
.pager-num[aria-current="page"] { color: #fff; background: var(--tg-brand); border-color: var(--tg-brand); }
.pager-gap { padding: 0 2px; color: var(--tg-faint); }
.pager-jump { display: flex; align-items: center; gap: 8px; color: var(--tg-muted); font-size: 13px; font-weight: 600; }
.pager-jump label { display: flex; align-items: center; gap: 6px; }
.pager-jump input {
  width: 66px;
  height: 32px;
  border: 1px solid var(--tg-line-strong);
  border-radius: 8px;
  padding: 0 8px;
  color: var(--tg-ink);
  background: var(--tg-surface);
  font: 600 13px/1 var(--tg-font);
  text-align: center;
}
.pager-jump input:focus { outline: 0; border-color: var(--tg-brand-line); box-shadow: 0 0 0 3px rgba(223, 32, 40, 0.1); }
.pager-jump button {
  height: 32px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font: 700 13px/1 var(--tg-font);
  cursor: pointer;
}
.pager-jump button:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
@media (max-width: 760px) {
  .pager-pages { display: none; }
  html .page-list .pager-actions { width: 100%; justify-content: space-between; }
  .pager-jump { justify-content: center; }
}

/* Home "订阅与参与" cards are links now */
html .page-home a.source-step { display: block; transition: border-color 0.15s ease, transform 0.2s ease, box-shadow 0.2s ease; }
html .page-home a.source-step:hover { border-color: var(--tg-brand-line); box-shadow: var(--tg-shadow-lg); transform: translateY(-2px); }
html .page-home a.source-step:hover strong { color: var(--tg-brand); }

/* Search page: filters, thumbnails, pager */
html .page-search .search-filters {
  margin: 16px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--tg-line);
  border-radius: var(--tg-radius);
  display: grid;
  gap: 10px;
  background: var(--tg-surface);
  box-shadow: var(--tg-shadow);
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-title { min-width: 40px; margin-right: 4px; color: var(--tg-faint); font-size: 13px; font-weight: 700; }
.filter-chip {
  height: 30px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font: 600 13px/1 var(--tg-font);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.filter-chip:hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
.filter-chip.active { color: var(--tg-brand); border-color: var(--tg-brand-line); background: var(--tg-brand-soft); }
html .page-search .result { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 16px; align-items: start; }
html .page-search .result-main { min-width: 0; }
html .page-search .result-thumb .thumb-media { width: 120px; height: 80px; border-radius: var(--tg-radius-sm); overflow: hidden; display: block; background: var(--tg-surface-3); }
html .page-search .result-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
html .page-search .result p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.search-pager { margin: 16px 0 0; display: flex; align-items: center; justify-content: center; gap: 14px; }
.search-pager[hidden] { display: none; }
.search-pager .pager-btn {
  min-width: 88px;
  height: 36px;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tg-ink-2);
  background: var(--tg-surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.search-pager .pager-btn:not([aria-disabled="true"]):hover { color: var(--tg-brand); border-color: var(--tg-brand-line); }
.search-pager .pager-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.search-page-info { color: var(--tg-muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  html .page-search .search-filters { padding: 12px; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  html .page-search .result { grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; padding: 14px 16px; }
  html .page-search .result-thumb .thumb-media { width: 96px; height: 64px; }
  html .page-search .result h2 { font-size: 16.5px; }
}

/* City/topic thumbnails now wrap a <picture> */
html .page-topic .thumb-media picture { width: 100%; height: 100%; display: block; }

/* Readable red on pale chips (category labels, tags, digest badges) */
html .page-home .article-meta strong,
html .page-list .article .meta strong,
html .page-article .meta strong,
html .page-search .meta strong,
html .page-home .digest-item b,
html .page-home .topic-card small,
html .page-article .tag-row a,
html .page-article .related-meta em,
html .page-topic .topic-tags a,
.tg-channel-chip.active,
.filter-chip.active { color: var(--tg-brand-text); }

/* Tablets (761–1040px): the top links used to be hidden while the phone bar only
   starts at 760px, so article pages had no navigation at all. Show them as a
   scrollable strip on a second header row instead. */
@media (min-width: 761px) and (max-width: 1040px) {
  html .page-home .nav,
  html .page-list .nav,
  html .page-article .nav { flex-wrap: wrap; row-gap: 0; }
  html .page-home .nav { height: auto; min-height: 64px; }
  html .page-home .navlinks,
  html .page-list .navlinks,
  html .page-article .navlinks {
    display: flex;
    order: 10;
    flex: 0 0 calc(100% + 36px);
    height: 44px;
    margin: 0 -18px;
    padding: 0 7px;
    overflow-x: auto;
    border-top: 1px solid var(--tg-line);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  html .page-home .navlinks::-webkit-scrollbar,
  html .page-list .navlinks::-webkit-scrollbar,
  html .page-article .navlinks::-webkit-scrollbar { display: none; }
  html .page-home .navlinks a,
  html .page-list .navlinks a,
  html .page-article .navlinks a { flex: none; height: 44px; }
  html .page-home .channels { top: 100px; }
  html .page-list .channel-list { top: 100px; }
  html .page-article .side { top: 100px; }
}
}

/* Visually hidden but readable by screen readers and crawlers (homepage site title). */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
