/* ===== YLF News — 三栏阅读界面 ===== */

/* --- 设计系统 --- */
:root {
  --bg-deep: #07070a;
  --bg-base: #0d0d12;
  --bg-surface: #14141a;
  --bg-elevated: #1c1c24;
  --bg-hover: #252530;
  --border-subtle: rgba(255,255,255,0.06);
  --border-medium: rgba(255,255,255,0.1);
  --text-primary: #e8e6e3;
  --text-secondary: #9a9894;
  --text-tertiary: #5c5a56;
  --accent: #f04e32;
  --accent-soft: rgba(240,78,50,0.15);
  --accent-glow: rgba(240,78,50,0.3);
  --success: #4ade80;
  --warning: #fbbf24;
  --font-mono: "SF Mono", "Fira Code", "JetBrains Mono", monospace;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  --sidebar-left-w: 240px;
  --sidebar-right-w: 200px;
  --nav-h: 48px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-deep: #f5f3f0;
    --bg-base: #faf8f5;
    --bg-surface: #ffffff;
    --bg-elevated: #f0ece6;
    --bg-hover: #eae5de;
    --border-subtle: rgba(0,0,0,0.06);
    --border-medium: rgba(0,0,0,0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent-soft: rgba(240,78,50,0.08);
    --accent-glow: rgba(240,78,50,0.15);
  }
}

:root[data-theme="light"] {
  --bg-deep: #f5f3f0;
  --bg-base: #faf8f5;
  --bg-surface: #ffffff;
  --bg-elevated: #f0ece6;
  --bg-hover: #eae5de;
  --border-subtle: rgba(0,0,0,0.06);
  --border-medium: rgba(0,0,0,0.1);
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --accent-soft: rgba(240,78,50,0.08);
  --accent-glow: rgba(240,78,50,0.15);
}

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

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.85; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

/* --- 顶部导航 --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(7,7,10,0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

:root[data-theme="light"] .site-header {
  background: rgba(250,248,245,0.85);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.site-brand:hover { text-decoration: none; opacity: 1; }

.site-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: block;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  display: none;
}

@media (min-width: 768px) {
  .brand-tagline { display: inline; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: all 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- 三栏布局 --- */
.app-layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar-left {
  width: var(--sidebar-left-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  padding: 20px 0;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 32px 40px;
}

.sidebar-right {
  width: var(--sidebar-right-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  border-left: 1px solid var(--border-subtle);
  padding: 20px 16px;
}

/* 单栏布局（文章详情页） */
.app-layout.layout-single .main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 40px;
}

/* 非首页页面隐藏侧边栏，主内容区居中 */
body:not([data-page-layout="home"]) .sidebar-left,
body:not([data-page-layout="home"]) .sidebar-right {
  display: none;
}

body:not([data-page-layout="home"]) .main-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 40px;
}

/* 移动端隐藏侧边栏 */
@media (max-width: 1024px) {
  .sidebar-left, .sidebar-right { display: none; }
  .main-content { padding: 20px; }
  body:not([data-page-layout="home"]) .main-content { padding: 20px; }
}

/* --- 左侧时间线导航 --- */
.timeline-header {
  padding: 0 16px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timeline-month {
  margin-bottom: 4px;
}

.month-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.month-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.month-toggle.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.month-toggle .month-chevron {
  font-size: 10px;
  transition: transform 0.2s;
  color: var(--text-tertiary);
}

.month-toggle.collapsed .month-chevron {
  transform: rotate(-90deg);
}

.month-dates {
  padding: 2px 0 6px 24px;
}

.month-dates.collapsed {
  display: none;
}

.timeline-date {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 16px;
  margin: 2px 8px 2px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
  border: none;
  background: none;
  font-family: inherit;
  width: calc(100% - 8px);
  text-align: left;
}

/* 时间线竖线 */
.timeline-date::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-medium);
  transition: all 0.2s;
}

.timeline-date::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
  z-index: -1;
}

.timeline-date:first-child::after { top: 50%; }
.timeline-date:last-child::after { bottom: 50%; }

.timeline-date:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.timeline-date:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.timeline-date.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.timeline-date.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-date .date-day {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  min-width: 32px;
}

.timeline-date .date-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* --- 中间内容区 --- */
.content-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.content-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 空状态 */
.news-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.news-empty p {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* 新闻条目卡片 */
.news-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: all 0.2s;
}

.news-item:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.news-item-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.news-rank {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
}

.news-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  flex: 1;
}

.news-title a {
  color: var(--text-primary);
}

.news-title a:hover {
  opacity: 1;
  color: var(--accent);
}

.news-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.news-score.high {
  background: var(--accent);
  color: #fff;
}

.news-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-tertiary);
}

.news-meta .meta-source {
  color: var(--text-secondary);
  font-weight: 500;
}

.news-meta .meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* 分类分组 */
.category-section {
  margin-bottom: 40px;
}

.category-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-section-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
}

.category-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 8px;
}

/* 卡片内参考链接 */
.news-references {
  margin: 10px 0 14px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
}

.news-references summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  user-select: none;
}

.news-references summary:hover {
  color: var(--text-primary);
}

.news-references ul {
  margin: 8px 0 4px 16px;
  padding: 0;
}

.news-references li {
  margin-bottom: 4px;
  line-height: 1.6;
}

.news-references li a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
}

.news-references li a:hover {
  border-bottom-color: var(--accent);
  opacity: 1;
}

/* --- 右侧分类 TOC --- */
.toc-header {
  padding: 0 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-category {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 3px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-category:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toc-category.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* --- 文章详情页 (post.html) --- */
.post-detail {
  max-width: 720px;
  margin: 0 auto;
}

.post-breadcrumb {
  margin-bottom: 24px;
  font-size: 13px;
}

.post-breadcrumb a {
  color: var(--text-secondary);
}

.post-detail h1 {
  font-size: 22px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.post-body {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-primary);
}

.post-body h2 {
  font-size: 17px;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-body h3 {
  font-size: 15px;
  margin: 24px 0 12px;
}

.post-body p {
  margin-bottom: 14px;
}

.post-body a {
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
}

.post-body a:hover {
  border-bottom-color: var(--accent);
}

.post-body ul, .post-body ol {
  margin: 12px 0 16px 20px;
}

.post-body li {
  margin-bottom: 6px;
}

.post-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.post-body details {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.post-body summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.post-body details ul {
  margin-top: 10px;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.post-body pre {
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 16px 0;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.tag-list {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  margin: 4px 4px 0 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 来源行 */
.source-line {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* 背景段落 */
.background-section {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
}

/* 社区讨论链接 */
.community-links {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.community-links a {
  margin-right: 10px;
}

/* --- 归档页面 --- */
.archive-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-year {
  margin-bottom: 32px;
}

.archive-year > h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.archive-month {
  margin-bottom: 20px;
}

.archive-month > h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: none;
}

.archive-post {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.archive-post:last-child {
  border-bottom: none;
}

.archive-post-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
  min-width: 48px;
}

.archive-post a {
  color: var(--text-primary);
  font-weight: 500;
}

.archive-post a:hover {
  color: var(--accent);
  opacity: 1;
}

/* --- 信息源页面 --- */
.sources-page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sources-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sources-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s;
}

.category-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.category-header h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.category-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.category-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.source-item:last-child {
  border-bottom: none;
}

.source-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}

.source-icon--twitter { background: #1da1f2; }
.source-icon--rss { background: #f26522; }
.source-icon--github { background: #6e7681; }
.source-icon--hackernews { background: #ff6600; }
.source-icon--reddit { background: #ff4500; }
.source-icon--telegram { background: #0088cc; }

/* --- Page (关于等) --- */
.post-detail h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-detail .post-body h2 {
  font-size: 18px;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.post-detail .post-body h3 {
  font-size: 15px;
  margin: 20px 0 10px;
}

.post-detail .post-body p {
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.post-detail .post-body strong {
  color: var(--text-primary);
}

.post-detail .post-body a {
  border-bottom: 1px solid var(--accent-soft);
}

.post-detail .post-body a:hover {
  border-bottom-color: var(--accent);
}

.post-detail .post-body ul,
.post-detail .post-body ol {
  margin: 12px 0 16px 20px;
}

.post-detail .post-body li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.post-detail .post-body code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.post-detail .post-body pre {
  background: var(--bg-elevated);
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 16px 0;
}

.post-detail .post-body pre code {
  background: none;
  padding: 0;
}

.post-detail .post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.post-detail .post-body th,
.post-detail .post-body td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.post-detail .post-body th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.post-detail .post-body tr:hover td {
  background: var(--bg-hover);
}

/* --- Footer --- */
.site-footer {
  padding: 32px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

/* --- 滚动条美化 --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ================================================================
   MOBILE DEFAULTS — hidden on desktop (> 1024px)
   ================================================================ */
.mobile-tabbar,
.mobile-sheet,
.sheet-overlay,
.mobile-category-bar {
  display: none;
}

/* ================================================================
   MOBILE OPTIMIZATIONS  (< 1024px)
   ================================================================ */

/* 移动端隐藏桌面侧边栏，调整主内容 */
@media (max-width: 1024px) {
  .sidebar-left, .sidebar-right { display: none; }
  .main-content { padding: 16px; padding-bottom: calc(16px + var(--tabbar-h)); }
  body:not([data-page-layout="home"]) .main-content { padding: 16px; padding-bottom: calc(16px + var(--tabbar-h)); }

  /* TabBar 高度变量 */
  :root { --tabbar-h: 64px; }

  /* --- 移动端 Header 简化 --- */
  .site-header { height: 52px; }
  .header-inner { padding: 0 16px; }
  .site-nav a { display: none; }  /* 隐藏桌面端导航链接 */
  .brand-tagline { display: none; }
  .site-logo { width: 28px; height: 28px; }

  /* --- 底部 TabBar --- */
  .mobile-tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--tabbar-h);
    background: rgba(13, 13, 18, 0.92);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  :root[data-theme="light"] .mobile-tabbar {
    background: rgba(250, 248, 245, 0.92);
  }

  .tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px;
    border: none;
    background: none;
    color: var(--text-tertiary);
    font-family: inherit;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    flex: 1;
    max-width: 72px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }

  .tabbar-item .tabbar-icon {
    font-size: 20px;
    line-height: 1;
    filter: grayscale(1);
    opacity: 0.7;
    transition: all 0.2s;
  }

  .tabbar-item .tabbar-label {
    font-size: 10px;
    font-weight: 500;
    transition: all 0.2s;
  }

  .tabbar-item.active {
    color: var(--accent);
  }

  .tabbar-item.active .tabbar-icon {
    filter: grayscale(0);
    opacity: 1;
    transform: translateY(-1px);
  }

  .tabbar-item.active .tabbar-label {
    font-weight: 600;
  }

  /* --- 底部弹出面板 (Bottom Sheet) --- */
  .mobile-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 75vh;
    background: var(--bg-surface);
    border-radius: 20px 20px 0 0;
    border-top: 1px solid var(--border-subtle);
    z-index: 300;
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-sheet.open {
    transform: translateY(0);
  }

  .sheet-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 6px;
    flex-shrink: 0;
  }

  .sheet-handle span {
    width: 36px;
    height: 4px;
    background: var(--border-medium);
    border-radius: 2px;
  }

  .sheet-header {
    padding: 6px 20px 14px;
    flex-shrink: 0;
  }

  .sheet-header h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    text-align: center;
  }

  .sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .sheet-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  /* --- 移动端日期网格 --- */
  .date-grid {
    overflow-y: auto;
    padding: 0 16px 16px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
  }

  .date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
  }

  .date-cell .date-day-num {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
  }

  .date-cell .date-weekday {
    font-size: 10px;
    opacity: 0.7;
  }

  .date-cell .date-count {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
  }

  .date-cell.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
  }

  .date-cell.active .date-count {
    color: rgba(255, 255, 255, 0.7);
  }

  .date-cell:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  /* --- 移动端分类网格 --- */
  .category-grid {
    overflow-y: auto;
    padding: 0 16px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
  }

  .category-cell .cat-name {
    flex: 1;
  }

  .category-cell .cat-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
  }

  .category-cell.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
  }

  .category-cell:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  /* --- 移动端分类标签横条（内容区顶部） --- */
  .mobile-category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 16px;
    margin-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .mobile-category-bar::-webkit-scrollbar { display: none; }

  .mobile-category-bar .mob-cat-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }

  .mobile-category-bar .mob-cat-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
  }

  /* --- 移动端新闻卡片优化 --- */
  .content-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .content-title {
    font-size: 20px;
  }

  .content-subtitle {
    font-size: 12px;
  }

  .news-item {
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: var(--radius-md);
  }

  .news-item:hover {
    transform: none;
    box-shadow: none;
  }

  .news-item-header {
    gap: 8px;
    margin-bottom: 8px;
  }

  .news-rank {
    font-size: 11px;
    padding: 1px 6px;
  }

  .news-title {
    font-size: 14px;
    line-height: 1.45;
  }

  .news-score {
    font-size: 10px;
    padding: 1px 5px;
  }

  .news-summary {
    font-size: 12.5px;
    line-height: 1.65;
    margin-bottom: 8px;
    -webkit-line-clamp: 2;
  }

  .news-meta {
    gap: 6px;
    font-size: 11px;
  }

  .news-meta .meta-tag {
    padding: 1px 6px;
    font-size: 10px;
  }

  .news-references {
    margin: 6px 0 10px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .category-section {
    margin-bottom: 24px;
  }

  .category-section-title {
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .category-section-title::before {
    height: 16px;
  }

  .category-count {
    font-size: 11px;
    padding: 1px 8px;
  }

  /* 空状态 */
  .news-empty {
    padding: 60px 20px;
  }

  .empty-icon {
    font-size: 40px;
  }

  /* --- 移动端文章详情页 --- */
  .post-detail {
    padding-top: 8px;
  }

  .post-breadcrumb {
    margin-bottom: 16px;
    font-size: 12px;
  }

  .post-detail h1 {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .post-meta-line {
    margin-bottom: 20px;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .post-body {
    font-size: 13.5px;
    line-height: 1.75;
  }

  .post-body h2 {
    font-size: 15px;
    margin: 24px 0 12px;
    padding-bottom: 6px;
  }

  .post-body h3 {
    font-size: 14px;
    margin: 18px 0 8px;
  }

  .post-body p {
    margin-bottom: 12px;
  }

  .post-body ul, .post-body ol {
    margin: 10px 0 12px 16px;
  }

  .post-body blockquote {
    margin: 12px 0;
    padding: 10px 12px;
    font-size: 12px;
  }

  .post-body details {
    margin: 12px 0;
    padding: 10px 12px;
  }

  .post-body code {
    font-size: 11.5px;
  }

  .post-body pre {
    padding: 12px;
    margin: 12px 0;
    font-size: 11.5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tag-list {
    margin-top: 24px;
    padding-top: 16px;
  }

  .tag {
    padding: 2px 8px;
    font-size: 11px;
    margin: 3px 3px 0 0;
  }

  /* --- 移动端归档页 --- */
  .archive-page h1 {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .archive-year > h2 {
    font-size: 17px;
    margin-bottom: 12px;
  }

  .archive-month > h3 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .archive-post {
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
  }

  .archive-post-date {
    font-size: 11px;
    min-width: 40px;
  }

  /* --- 移动端信息源页 --- */
  .sources-page h1 {
    font-size: 20px;
  }

  .sources-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .sources-desc {
    font-size: 13px;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-card {
    padding: 14px 16px;
  }

  .category-card:hover {
    transform: none;
    box-shadow: none;
  }

  .category-header h2 {
    font-size: 14px;
  }

  .category-desc {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .source-item {
    padding: 4px 0;
    font-size: 12px;
  }

  /* --- 移动端 Footer --- */
  .site-footer {
    padding: 20px 16px;
    font-size: 11px;
    margin-top: 24px;
  }

  /* --- 通用页面移动端 --- */
  .post-detail h1 {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .post-detail .post-body h2 {
    font-size: 16px;
    margin: 20px 0 10px;
  }

  .post-detail .post-body h3 {
    font-size: 14px;
    margin: 16px 0 8px;
  }

  .post-detail .post-body p {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .post-detail .post-body table {
    font-size: 11px;
  }

  .post-detail .post-body th,
  .post-detail .post-body td {
    padding: 6px 8px;
  }

  /* --- 手机端更紧凑 (< 640px) --- */
  .date-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- 小屏手机横条日期 (< 480px) --- */
@media (max-width: 480px) {
  .date-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tabbar-item .tabbar-icon {
    font-size: 18px;
  }

  .tabbar-item .tabbar-label {
    font-size: 9px;
  }
}
