/* ==========================================================================
   AI News · 共享设计系统
   Warm Editorial · Instrument Serif + Inter + JetBrains Mono
   ========================================================================== */

/* ---------- 1. 字体（Google Fonts CDN）---------- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- 2. CSS 变量 · 浅色（默认） ---------- */
:root {
  --theme-transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  --radius: 10px; --radius-sm: 8px; --radius-lg: 14px; --radius-full: 999px;
  --shadow-card: none;
  --shadow-card-hover: 0 2px 8px rgba(0,0,0,.06);
  --surface-card: transparent;
  --surface-elevated: var(--surface-1);
  --border: var(--border-default);
  --border-strong: var(--border-strong);
  --nav-width: 220px;
  --m-tabbar-h: 56px;
  --m-topbar-h: 52px;
  --sidebar-gradient: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-2) 100%);
  --font-body: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  --font-serif: 'Instrument Serif', 'Georgia', serif;
  --font-display: 'Instrument Serif', 'Georgia', serif;
  --text-xs: 11px; --text-sm: 13px; --text-base: 14px; --text-md: 15px;
  --text-lg: 17px; --text-xl: 20px; --text-2xl: 24px; --text-3xl: 30px; --text-4xl: 36px;
  --leading-tight: 1.25; --leading-normal: 1.5; --leading-relaxed: 1.65;
  --card-padding: 16px;
  --timeline-rail-width: 40px; --timeline-dot-size: 8px;
  --chip-padding-y: 5px; --chip-padding-x: 14px; --chip-font-size: 12px;
  --tag-padding-y: 3px; --tag-padding-x: 8px; --tag-radius: 6px; --tag-font-size: 12px;
  --btn-padding-y: 8px; --btn-padding-x: 16px; --btn-font-size: var(--text-sm);
  /* Backward-compatible aliases for inline styles */
  --accent-cyan: var(--accent); --accent-cyan-rgb: var(--accent-rgb); --accent-cyan-fg: var(--accent-fg);
  --text-primary: var(--text-0); --text-secondary: var(--text-2); --text-tertiary: var(--text-3);
  --bg-elev-1: var(--surface-1); --bg-elev-2: var(--surface-3);
  --border-subtle: var(--border-default); --font-serif-sc: var(--font-serif);
}

:root[data-theme="light"] {
  --bg-0: #FAFAF7; --bg-1: #FFFFFF; --bg-2: #F2F0EB; --bg-3: #EAE7E0;
  --surface-0: var(--bg-0); --surface-1: var(--bg-1); --surface-2: var(--bg-1); --surface-3: var(--bg-2);
  --text-0: #1a1a1a; --text-1: #333333; --text-2: #666666; --text-3: #999999;
  --text-soft-strong: rgba(26,26,26,.55);
  --border-default: rgba(0,0,0,.06); --border-strong: rgba(0,0,0,.12);
  --border-faint: rgba(0,0,0,.04);
  --accent: #E8453C; --accent-rgb: 232,69,60; --accent-fg: #E8453C;
  --accent-soft: rgba(232,69,60,.07);
  --accent-emerald: #D97706; --accent-emerald-fg: #B45309;
  --score-high-bg: rgba(232,69,60,.07); --score-high-fg: #E8453C;
  --score-mid-bg: rgba(217,119,6,.08); --score-mid-fg: #D97706;
  --score-muted-bg: rgba(153,153,153,.1); --score-muted-fg: #999;
  --selected-badge-bg: rgba(232,69,60,.07); --selected-badge-fg: #E8453C; --selected-badge-border: rgba(232,69,60,.2);
  --timeline-reason-bg: transparent; --timeline-reason-fg: #E8453C;
  --tag-bg: transparent; --tag-border: transparent; --tag-fg: #E8453C;
  --tag-opacity: .55;
  --theme-color-meta: #FAFAF7;
  --d-bg: #FAFAF7; --d-text: #1a1a1a; --d-accent: #E8453C;
  --search-bg: #FFFFFF;
}

:root[data-theme="dark"] {
  --bg-0: #1a1815; --bg-1: #221f1b; --bg-2: #2a2622; --bg-3: #33302a;
  --surface-0: var(--bg-0); --surface-1: var(--bg-1); --surface-2: var(--bg-1); --surface-3: var(--bg-2);
  --text-0: #f5f3ef; --text-1: #d0ccc4; --text-2: #9a958a; --text-3: #6b665c;
  --text-soft-strong: rgba(245,243,239,.5);
  --border-default: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.14);
  --border-faint: rgba(255,255,255,.04);
  --accent: #FF6B5C; --accent-rgb: 255,107,92; --accent-fg: #FF6B5C;
  --accent-soft: rgba(255,107,92,.1);
  --accent-emerald: #F59E0B; --accent-emerald-fg: #FBBF24;
  --score-high-bg: rgba(255,107,92,.1); --score-high-fg: #FF6B5C;
  --score-mid-bg: rgba(245,158,11,.1); --score-mid-fg: #F59E0B;
  --score-muted-bg: rgba(107,102,92,.12); --score-muted-fg: #6b665c;
  --selected-badge-bg: rgba(255,107,92,.1); --selected-badge-fg: #FF6B5C; --selected-badge-border: rgba(255,107,92,.25);
  --timeline-reason-bg: transparent; --timeline-reason-fg: #FF6B5C;
  --tag-bg: transparent; --tag-border: transparent; --tag-fg: #FF6B5C;
  --tag-opacity: .55;
  --theme-color-meta: #1a1815;
  --sidebar-gradient: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-2) 100%);
  --d-bg: #1a1815; --d-text: #f5f3ef; --d-accent: #FF6B5C;
  --search-bg: var(--bg-1);
}

/* ---------- 3. 全局 reset ---------- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--text-base); line-height: var(--leading-normal);
  background: var(--bg-0); color: var(--text-0);
  transition: var(--theme-transition);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul,ol { list-style: none; }
button,input,textarea { font: inherit; color: inherit; border: none; background: none; outline: none; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- 4. App Shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr;
  min-height: 100vh;
}

/* ---------- 5. Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--sidebar-gradient);
  border-right: 1px solid var(--border-default);
  display: flex; flex-direction: column;
  padding: 24px 16px 16px;
  overflow-y: auto;
  z-index: 10;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px; font-weight: 400;
  color: var(--text-0);
  padding: 0 8px 12px;
  margin-bottom: 4px;
  letter-spacing: -.3px;
}
.sidebar-brand em { font-style: italic; color: var(--accent); }
.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 24px;
  line-height: 1;
}
.sidebar-close:hover { background: var(--accent-soft); color: var(--accent); }
.brand-orbit, .orbit-dot { display: none; }
.sidebar-divider { height: 1px; background: var(--border-default); margin: 8px 4px 12px; }
.nav-group { margin-bottom: 18px; }
.nav-group-label { font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 1.5px; padding: 0 8px 6px; }
.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 500; color: var(--text-2);
  border: 1px solid transparent;
  transition: all .12s ease;
  white-space: nowrap;
}
.nav-item:hover { color: var(--accent); background: var(--accent-soft); }
.nav-item--active {
  background: var(--accent-soft);
  color: var(--accent); font-weight: 600;
}
.nav-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; opacity: .7; }
.nav-item--active .nav-icon { opacity: 1; }
.sidebar-spacer { flex: 1; }
.theme-toggle-root--desktop {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 45;
}
.theme-menu { position: relative; }
.theme-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.theme-menu-button:hover,
.theme-menu--open .theme-menu-button {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--selected-badge-border);
}
.theme-menu-button svg { width: 15px; height: 15px; flex-shrink: 0; }
.theme-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 118px;
  padding: 4px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  box-shadow: 0 14px 34px rgba(0,0,0,.14);
}
.theme-menu--open .theme-menu-panel { display: flex; flex-direction: column; gap: 1px; }
.theme-option { display: flex; align-items: center; cursor: pointer; font-size: 12px; color: var(--text-2); padding: 7px 9px; border-radius: 6px; transition: all .12s ease; position: relative; white-space: nowrap; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:hover { color: var(--text-1); background: var(--accent-soft); }
.theme-option--active { color: var(--accent); background: var(--accent-soft); }
body.sidebar-is-open .theme-toggle-root--desktop,
body.sidebar-is-open .m-topbar-actions {
  opacity: 0;
  pointer-events: none;
}
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border-default); font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }
.login-link { font-size: var(--text-sm); color: var(--text-2); transition: color .12s ease; }
.login-link:hover { color: var(--accent); }

/* ---------- 6. 移动端顶栏 + tabbar ---------- */
.m-topbar {
  display: none;
  position: sticky; top: 0; z-index: 40;
  height: var(--m-topbar-h);
  align-items: center; gap: 12px;
  padding: 0 12px;
  background: transparent;
}
.m-topbar-menu, .m-topbar-back {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text-1);
}
.m-topbar-menu:hover, .m-topbar-back:hover { background: var(--accent-soft); color: var(--accent); }
.m-topbar-title {
  margin-right: auto;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: -.3px;
}
.m-topbar-actions { margin-left: 0; display: flex; align-items: center; justify-content: flex-end; }
.m-topbar .theme-menu-button { height: 34px; box-shadow: none; }
.m-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--m-tabbar-h);
  background: var(--bg-1);
  border-top: 1px solid var(--border-default);
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.m-tabbar-list { display: flex; height: 100%; }
.m-tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; color: var(--text-3);
  transition: color .12s ease;
}
.m-tabbar-item--active { color: var(--accent); }
.m-tabbar-item svg { width: 20px; height: 20px; }
body.sidebar-is-open .m-tabbar {
  opacity: 0;
  pointer-events: none;
}

/* 移动端遮罩 */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 35;
  opacity: 0; transition: opacity .25s ease;
}
.sidebar-backdrop.is-open { display: block; opacity: 1; }

/* ---------- 7. Main content ---------- */
.main-content { padding: 32px 48px 60px; min-width: 0; }
.page-header { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border-default); }
.page-header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-family: var(--font-display); font-size: 48px; font-weight: 400; color: var(--text-0); line-height: 1.05; letter-spacing: -.5px; margin-bottom: 10px; }
.page-subtitle { font-size: var(--text-sm); color: var(--text-2); line-height: 1.6; max-width: 480px; }
.beta-badge { display: inline-flex; align-items: center; padding: 2px 10px; font-size: 10px; font-weight: 600; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent); border: 1px solid var(--selected-badge-border); letter-spacing: .5px; }
.data-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: -16px 0 20px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-faint);
  color: var(--text-3);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.data-status span { display: inline-flex; align-items: baseline; gap: 4px; }
.data-status strong {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.data-status--mock strong,
.data-status--fallback strong,
.data-status--error strong { color: var(--accent); }
.data-status--error { color: var(--accent); }
.data-empty {
  padding: 36px 0;
  border-top: 1px solid var(--border-faint);
  border-bottom: 1px solid var(--border-faint);
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1.7;
  text-align: center;
}
.hot-topic-item .data-empty { border-top: 0; }

/* ---------- 8. Category bar ---------- */
.category-bar { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.cat-pill {
  padding: var(--chip-padding-y) var(--chip-padding-x);
  font-size: var(--chip-font-size); font-weight: 500;
  color: var(--text-2); border-radius: var(--radius-full);
  border: 1px solid var(--border-default); background: transparent;
  transition: all .12s ease; white-space: nowrap;
}
.cat-pill:hover { border-color: rgba(var(--accent-rgb),.25); color: var(--accent); }
.cat-pill--active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- 9. Search bar ---------- */
.search-bar { display: flex; align-items: center; gap: 0; margin-bottom: 20px; border: 1px solid var(--border-default); border-radius: var(--radius); background: var(--search-bg); padding: 0 16px; transition: border-color .15s ease; }
.search-bar:focus-within { border-color: rgba(var(--accent-rgb), 0.3); }
.search-input { flex: 1; padding: 12px 0; font-size: var(--text-base); color: var(--text-0); background: transparent; min-width: 0; }
.search-input::placeholder { color: var(--text-3); }
.search-btn { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; color: var(--text-3); transition: color .12s ease; }
.search-btn:hover { color: var(--accent); }

/* ---------- 10. Hot topics ---------- */
.hot-topics { margin-bottom: 32px; }
.hot-topics-title { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); font-weight: 600; color: var(--text-0); margin-bottom: 14px; }
.hot-topics-title::after { content: ''; flex: 1; height: 1px; background: var(--border-default); }
.hot-topics-list { display: flex; flex-direction: column; gap: 0; }
.hot-topic-item { display: block; padding: 0; }
.hot-topic-link { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-faint); color: inherit; text-decoration: none; transition: padding-left .12s ease; }
.hot-topic-link:hover { padding-left: 4px; }
.hot-rank { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text-3); flex-shrink: 0; width: 24px; text-align: center; }
.hot-rank--top { color: var(--accent); }
.hot-text { font-size: var(--text-sm); color: var(--text-1); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.hot-source-count { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-mono); }
.hot-freshness { font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-body); }
.hot-freshness--fresh { color: var(--accent); }
.hot-freshness--continuing { color: var(--text-2); }
.hot-time { font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-mono); }

/* ---------- 11. Timeline (精选) ---------- */
.timeline { display: flex; flex-direction: column; gap: 28px; }
.timeline-date-group { display: flex; flex-direction: column; }
.date-group-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.date-label { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; color: var(--text-0); }
.date-sublabel { font-family: var(--font-body); font-size: var(--text-sm); color: var(--text-3); font-weight: 500; }
.date-toggle { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; color: var(--text-3); transition: all .12s ease; }
.date-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.date-toggle .chevron { transition: transform .2s ease; }
.date-toggle.is-collapsed .chevron { transform: rotate(-90deg); }
.date-group--collapsed .timeline-item,
.date-group--collapsed .feed-item { display: none !important; }

.timeline-item { display: flex; gap: 0; position: relative; margin-bottom: 0; }
.timeline-item--last .timeline-line--end { height: 60%; }
.timeline-time { width: var(--timeline-rail-width); flex-shrink: 0; text-align: right; padding-right: 14px; padding-top: 20px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); line-height: 1; }
.timeline-rail { position: relative; width: 20px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: var(--timeline-dot-size); height: var(--timeline-dot-size); background: var(--accent); border-radius: 50%; margin-top: 22px; flex-shrink: 0; box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.3); }
.timeline-line { width: 2px; flex: 1; background: var(--border-default); min-height: 40px; }
.timeline-body.is-collapsed { display: none; }

/* ---------- 12. Timeline card（editorial · 无背景） ---------- */
.timeline-card {
  display: block; color: inherit; text-decoration: none;
  flex: 1; min-width: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-faint);
  border-radius: 0;
  padding: 18px 0;
  margin-bottom: 0;
  transition: padding-left .12s ease;
}
.timeline-card:hover { padding-left: 4px; box-shadow: none; border-color: var(--border-default); }
.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; color: var(--text-0); line-height: 1.35; margin-bottom: 6px; }
.source-avatar, .source-avatar-sm { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #fff; }
.source-name { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }
.source-handle { font-size: 10px; color: var(--text-3); }
.source-name-sm { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; }
.source-handle-sm { font-size: 10px; color: var(--text-3); }
.card-sep { color: var(--text-3); font-size: var(--text-xs); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 9px; font-weight: 600; border-radius: var(--radius-full); white-space: nowrap; letter-spacing: .3px; }
.badge--featured { background: var(--accent-soft); color: var(--accent); }
.card-score { margin-left: auto; font-family: var(--font-display); font-weight: 400; font-size: 20px; padding: 0; border-radius: 0; white-space: nowrap; background: none !important; }
.score--high { color: var(--accent); }
.score--mid { color: var(--accent-emerald); }
.score--muted { color: var(--text-3); }
.card-body { margin-bottom: 8px; }
.card-body p { font-size: var(--text-sm); color: var(--text-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-media { margin-bottom: 10px; }
.media-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 140px; background: var(--surface-3); border-radius: var(--radius-sm); border: 1px solid var(--border-default); color: var(--text-3); font-size: var(--text-xs); }
.media-placeholder--video { position: relative; }
.media-placeholder--video::after { content: ''; position: absolute; bottom: 10px; right: 10px; width: 36px; height: 36px; background: rgba(0,0,0,0.6); border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; padding: 0; font-size: var(--text-xs); color: var(--tag-fg); background: var(--tag-bg); border: none; border-radius: 0; white-space: nowrap; opacity: var(--tag-opacity); transition: opacity .12s ease; }
.tag::before { content: '#'; }
.tag:hover { opacity: 1; }
.card-relations { margin-bottom: 8px; }
.relation-link { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-3); transition: color .12s ease; }
.relation-link:hover { color: var(--accent); }
.card-divider { display: none; }
.card-reason { display: flex; gap: 4px; align-items: flex-start; margin-top: 8px; }
.reason-label { font-size: var(--text-xs); font-weight: 500; color: var(--accent); white-space: nowrap; flex-shrink: 0; }
.reason-text { font-size: var(--text-xs); color: var(--accent); opacity: .8; line-height: var(--leading-relaxed); }

/* ---------- 13. Feed (全部动态) ---------- */
.feed { display: flex; flex-direction: column; }
.feed-date-group { margin-bottom: 8px; }
.feed-item { padding: 16px 0; border-bottom: 1px solid var(--border-faint); transition: padding-left .12s ease; }
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { padding-left: 4px; }
.feed-item-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.feed-item-source { display: flex; align-items: center; gap: 6px; min-width: 0; }
.feed-event-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-default); color: var(--accent); font-size: 10px; font-weight: 700; white-space: nowrap; }
.feed-time { font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-mono); }
.feed-item-title { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 400; color: var(--text-0); line-height: 1.35; margin-bottom: 6px; transition: color .12s ease; }
.feed-item-title:hover { color: var(--accent); }
.feed-item-summary { font-size: var(--text-sm); color: var(--text-2); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.feed-item-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 14. AI 日报 ---------- */
.daily-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  font-family: var(--font-body);
}
.date-nav { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding-right: 8px; }
.date-nav-latest { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; color: var(--text-1); border: 1px solid var(--border-default); margin-bottom: 12px; transition: all .12s ease; width: 100%; }
.date-nav-latest:hover { background: var(--accent-soft); border-color: rgba(var(--accent-rgb),.2); color: var(--accent); }
.date-nav-btn--active { background: var(--accent-soft); border-color: rgba(var(--accent-rgb),.2); color: var(--accent); }
.date-nav-current { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--border-default); margin-bottom: 12px; }
.date-nav-day { font-family: var(--font-display); font-size: 24px; font-weight: 400; color: var(--text-0); }
.date-nav-month { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono); }
.date-nav-archive-header { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-sm); font-weight: 600; color: var(--text-1); padding: 8px 4px 8px 0; }
.date-nav-select { display: none; width: 100%; margin-bottom: 10px; border: 1px solid var(--border-default); background: var(--surface-1); color: var(--text-1); border-radius: var(--radius-sm); min-height: 36px; padding: 6px 8px; font-size: var(--text-sm); }
.date-nav-list { display: flex; flex-direction: column; gap: 0; }
.date-nav-item { display: flex; gap: 8px; padding: 8px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background .12s ease; }
.date-nav-item:hover { background: var(--accent-soft); }
.date-nav-item--active { background: var(--accent-soft); }
.date-nav-item-day { font-family: var(--font-display); font-size: var(--text-md); font-weight: 400; color: var(--accent); flex-shrink: 0; width: 32px; }
.date-nav-item-headline { font-size: var(--text-xs); color: var(--text-2); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.daily-content { min-width: 0; }
.daily-masthead { padding-bottom: 24px; border-bottom: 1px solid var(--border-default); margin-bottom: 32px; }
.masthead-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.masthead-title-group { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.masthead-title { font-family: var(--font-display); font-weight: 400; font-size: 56px; line-height: 1.05; color: var(--text-0); letter-spacing: -.5px; }
.masthead-title-sub { font-family: var(--font-display); font-weight: 400; font-size: 36px; color: var(--text-0); }
.masthead-tagline { font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: 2px; align-self: flex-end; padding-bottom: 8px; }
.masthead-slogan { font-family: var(--font-display); font-size: var(--text-md); color: var(--text-2); margin-left: auto; align-self: flex-end; padding-bottom: 8px; }
.masthead-date-cn { font-family: var(--font-display); font-size: var(--text-sm); color: var(--text-2); }
.daily-fallback-note { display: inline-flex; margin-top: 10px; padding: 6px 10px; border: 1px solid var(--border-default); border-radius: 6px; color: var(--accent); background: var(--surface-1); font-size: var(--text-xs); line-height: 1.5; }
.masthead-divider { margin-top: 12px; height: 1px; background: var(--border-default); }

.daily-section { margin-bottom: 40px; }
.daily-section-header { display: flex; align-items: baseline; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-default); margin-bottom: 16px; }
.daily-section-num { font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); color: var(--accent); }
.daily-section-titles { display: flex; flex-direction: column; gap: 2px; }
.daily-section-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); color: var(--text-0); }
.daily-section-subtitle { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 1px; }
.daily-section-body { display: flex; flex-direction: column; gap: 24px; }
.daily-story { padding-left: 0; }
.daily-story--sub { padding-left: 16px; border-left: 2px solid var(--border-default); }
.daily-story-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--text-0); line-height: 1.4; margin-bottom: 8px; }
.daily-story-text { font-size: var(--text-base); color: var(--text-1); line-height: var(--leading-relaxed); }
.daily-story-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.daily-story-list li { display: flex; gap: 8px; font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); }
.story-bullet { color: var(--accent); flex-shrink: 0; }

/* ---------- 15. Changelog ---------- */
.changelog-wrapper, .about-wrapper, .feedback-wrapper { max-width: 720px; }
.changelog-label, .about-label, .feedback-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
.changelog-heading, .about-heading, .feedback-heading { font-family: var(--font-display); font-weight: 400; font-size: 48px; color: var(--text-0); line-height: 1.05; letter-spacing: -.5px; margin-bottom: 8px; }
.changelog-subtitle, .about-subtitle, .feedback-subtitle { font-size: var(--text-sm); color: var(--text-2); margin-bottom: 32px; max-width: 480px; }
.changelog-timeline { display: flex; flex-direction: column; gap: 32px; }
.cl-group { display: flex; flex-direction: column; gap: 16px; }
.cl-date { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--text-0); padding-bottom: 8px; border-bottom: 1px solid var(--border-default); }
.cl-weekday { color: var(--text-3); font-weight: 400; margin-left: 8px; font-family: var(--font-body); font-size: var(--text-sm); }
.cl-entry { display: flex; gap: 14px; }
.cl-rail { display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.cl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.3); flex-shrink: 0; }
.cl-line { width: 2px; flex: 1; background: var(--border-default); margin-top: 4px; min-height: 20px; }
.cl-entry:last-child .cl-line { display: none; }
.cl-content { flex: 1; min-width: 0; padding-bottom: 8px; }
.cl-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cl-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.pill { display: inline-flex; align-items: center; padding: 1px 8px; font-size: 10px; font-weight: 600; border-radius: var(--radius-full); }
.pill--cyan { background: var(--accent-soft); color: var(--accent); }
.pill--emerald { background: rgba(var(--accent-rgb),.05); color: var(--accent-emerald); }
.pill--amber { background: var(--score-mid-bg); color: var(--score-mid-fg); }
.cl-title { font-size: var(--text-md); font-weight: 600; color: var(--text-0); line-height: 1.4; margin-bottom: 4px; }
.cl-desc { font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); }
.cl-bullets { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.cl-bullets li { display: flex; gap: 6px; font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); }
.cl-bullets li::before { content: '·'; color: var(--accent); flex-shrink: 0; }

/* ---------- 16. About ---------- */
.about-heading .about-name { color: var(--accent); font-style: italic; }
.about-poem { font-family: var(--font-display); font-size: var(--text-lg); color: var(--text-1); line-height: 1.8; margin: 24px 0; padding-left: 16px; border-left: 3px solid var(--accent); }
.about-poem p { margin-bottom: 4px; }
.about-cta { font-size: var(--text-md); color: var(--text-1); margin-bottom: 24px; }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 32px; }
.contact-card { background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s ease, border-color .2s ease; }
.contact-card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--border-strong); }
.contact-card-header { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 1px; text-transform: uppercase; }
.contact-card-qr { aspect-ratio: 1; background: var(--surface-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: var(--text-sm); }
.contact-card-banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-3); border-radius: var(--radius-sm); }
.banner-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-emerald)); }
.banner-name { font-size: var(--text-sm); font-weight: 500; color: var(--text-1); }
.contact-card-name { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--text-0); }
.contact-card-tagline { font-size: var(--text-xs); color: var(--text-2); line-height: var(--leading-relaxed); }
.about-footer { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); padding-top: 16px; border-top: 1px solid var(--border-default); }

/* ---------- 17. Feedback ---------- */
.feedback-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: var(--text-sm); font-weight: 600; color: var(--text-1); }
.textarea-wrapper { position: relative; }
.form-textarea { width: 100%; min-height: 140px; padding: 12px 14px; padding-bottom: 32px; font-size: var(--text-base); color: var(--text-0); background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); resize: vertical; transition: border-color .15s ease; font-family: var(--font-body); line-height: var(--leading-relaxed); }
.form-textarea:focus, .form-input:focus { border-color: rgba(var(--accent-rgb), 0.3); }
.form-input { width: 100%; padding: 10px 14px; font-size: var(--text-base); color: var(--text-0); background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); transition: border-color .15s ease; }
.char-counter { position: absolute; bottom: 8px; right: 12px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.form-submit { align-self: flex-start; padding: var(--btn-padding-y) var(--btn-padding-x); font-size: var(--btn-font-size); font-weight: 600; color: #fff; background: var(--accent); border-radius: var(--radius-sm); transition: opacity .15s ease, transform .1s ease; }
.form-submit:hover { opacity: 0.9; }
.form-submit:active { transform: scale(0.98); }
.feedback-success { display: none; padding: 16px; background: var(--accent-soft); border: 1px solid var(--selected-badge-border); border-radius: var(--radius-sm); color: var(--accent); font-size: var(--text-sm); }
.feedback-success.is-visible { display: block; }

/* ---------- 18. Agent 接入 ---------- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 1px; margin-bottom: 16px; }
.breadcrumb-parent { color: var(--text-3); }
.breadcrumb-current { color: var(--accent); }
.breadcrumb-sep { color: var(--text-3); }
.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--border-default); margin-bottom: 28px; }
.tab-btn { padding: 10px 16px; font-size: var(--text-sm); font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s ease, border-color .12s ease; }
.tab-btn:hover { color: var(--text-0); }
.tab-btn--active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel--active { display: block; }
.doc-section { margin-bottom: 32px; }
.doc-section--last { margin-bottom: 0; }
.doc-section-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); color: var(--text-0); margin-bottom: 12px; }
.doc-section-desc { font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); margin-bottom: 12px; }
.doc-compat { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-bottom: 12px; line-height: 1.6; }
.doc-highlight { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--accent-soft); border: 1px solid var(--selected-badge-border); border-radius: var(--radius-full); color: var(--accent); font-size: var(--text-sm); font-weight: 500; }
.code-block { background: var(--surface-3); border: 1px solid var(--border-default); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.code-block-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--border-default); }
.code-block-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 1px; }
.copy-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; font-size: 10px; color: var(--text-2); border-radius: var(--radius-sm); transition: all .12s ease; }
.copy-btn:hover { background: var(--accent-soft); color: var(--accent); }
.copy-btn.is-copied { color: var(--accent-emerald); }
.code-block-content { display: block; padding: 14px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-1); white-space: pre-wrap; word-break: break-all; line-height: var(--leading-relaxed); }
.doc-note { font-size: var(--text-sm); color: var(--text-2); line-height: var(--leading-relaxed); margin-top: 8px; }
.trigger-list { display: flex; flex-direction: column; gap: 6px; }
.trigger-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.trigger-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trigger-text { font-size: var(--text-sm); color: var(--text-1); }
.trigger-text--muted { color: var(--text-2); }
.tab-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: var(--text-3); text-align: center; }
.tab-placeholder p { font-size: var(--text-sm); }

/* ---------- 19. 详情页 ---------- */
.item-detail { }
.item-back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text-2); margin-bottom: 16px; transition: color .12s ease; }
.item-back:hover { color: var(--accent); }
.item-header { margin-bottom: 20px; }
.item-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-3xl); color: var(--text-0); line-height: 1.3; margin-bottom: 12px; }
.item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-2); }
.item-content { font-size: var(--text-md); color: var(--text-1); line-height: 1.8; }
.item-content p { margin-bottom: 16px; }
.item-content h2, .item-content h3 { font-family: var(--font-display); font-weight: 400; color: var(--text-0); margin: 24px 0 12px; line-height: 1.4; }
.item-content h2 { font-size: var(--text-xl); }
.item-content h3 { font-size: var(--text-lg); }
.item-content ul, .item-content ol { margin: 12px 0 16px; padding-left: 24px; }
.item-content li { margin-bottom: 6px; }
.item-content code { font-family: var(--font-mono); font-size: 0.9em; padding: 2px 6px; background: var(--surface-3); border-radius: 4px; color: var(--accent); }
.item-content pre { background: var(--surface-3); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; margin: 16px 0; }
.item-content pre code { padding: 0; background: transparent; color: var(--text-1); }
.item-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; margin: 16px 0; color: var(--text-2); font-style: italic; }
.item-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 16px 0; }
.item-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-default); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.item-source-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--accent); transition: opacity .12s ease; }
.item-source-link:hover { opacity: 0.8; }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1024px) {
  .main-content { padding: 28px 32px 60px; }
  .daily-shell { grid-template-columns: 200px 1fr; gap: 24px; }
  .masthead-title { font-size: 44px; }
  .masthead-title-sub { font-size: 28px; }
}

@media (max-width: 768px) {
  :root { --nav-width: 0px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; right: 0; top: 0;
    width: 100%;
    height: auto;
    max-height: min(82vh, 430px);
    padding: 16px 28px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border-default);
    transform: translateY(-105%);
    transition: transform .24s ease, box-shadow .24s ease;
    z-index: 50;
  }
  .sidebar.is-open { transform: translateY(0); box-shadow: 0 18px 34px rgba(0,0,0,0.18); }
  .sidebar-brand {
    height: var(--m-topbar-h);
    padding: 0;
    margin-bottom: 8px;
    align-items: center;
  }
  .sidebar-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    color: var(--text-1);
  }
  .sidebar .nav-group--primary { display: none; }
  .sidebar-spacer { flex: 0; }

  .m-topbar { display: flex; }
  .m-tabbar { display: block; }
  .theme-toggle-root--desktop { display: none; }
  .m-topbar .theme-menu-value { font-size: 10px; }
  .m-topbar .theme-menu-panel { right: 0; }

  .main-content { padding: 20px 16px calc(60px + var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-top: 16px; }
  .main-content.has-topbar { padding-top: 0; }

  /* daily 在移动端变成单列 */
  .daily-shell { grid-template-columns: 1fr; gap: 16px; }
  .date-nav { position: static; max-height: none; }
  .date-nav-select { display: block; }
  .date-nav-list { max-height: 170px; overflow-y: auto; }

  .masthead-title { font-size: 36px; }
  .masthead-title-sub { font-size: 22px; }
  .masthead-slogan, .masthead-tagline { margin-left: 0; align-self: flex-start; padding-bottom: 0; }

  .page-title { font-size: 36px; }
  .changelog-heading, .about-heading, .feedback-heading { font-size: 36px; }
  .timeline-time { width: 36px; padding-right: 10px; font-size: 10px; }
  .hot-meta { display: none; }
  .hot-text { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

  .contact-cards { grid-template-columns: 1fr; }
  .item-title { font-size: var(--text-2xl); }

  /* body 加底部留白给 tabbar */
  body { padding-bottom: env(safe-area-inset-bottom, 0); }
}

@media (max-width: 480px) {
  .sidebar { padding: 12px 24px 16px; }
  .main-content { padding: 12px 12px calc(60px + var(--m-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .page-header { margin-bottom: 16px; }
  .category-bar { margin-bottom: 12px; }
  .card-body p { -webkit-line-clamp: 4; }
  .feed-item-title, .card-title { font-size: var(--text-md); }
}

/* ---------- 21. 打印 ---------- */
@media print {
  .sidebar, .m-topbar, .m-tabbar, .sidebar-backdrop { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  .main-content { padding: 0; max-width: 100%; }
}

/* ---------- 22. 工具类 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }
