/* ========== 基础重置与变量 ========== */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #e2e5ef;
  --text: #1a1d2e;
  --text-secondary: #6b7189;
  --accent: #4361ee;
  --accent-hover: #3a56d4;
  --ai: #7c3aed;
  --tech: #0891b2;
  --economy: #d97706;
  --military: #dc2626;
  --international: #059669;
  --car: #ea580c;
  --phone: #db2777;
  --trump: #9333ea;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* ========== 布局容器 ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== 顶部导航 ========== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-title .icon { font-size: 1.4rem; }

.header-date {
  font-size: .85rem;
  color: var(--text-secondary);
}

/* ========== 分类导航 ========== */
.category-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 60px;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.category-nav::-webkit-scrollbar { display: none; }

.nav-list {
  display: flex;
  list-style: none;
  gap: 4px;
  padding: 10px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-item a {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all .2s;
}

.nav-item a:hover,
.nav-item a:focus,
.nav-item a.active {
  background: var(--bg);
  color: var(--text);
  border-radius: 20px;
  outline: none;
}

.nav-item a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 20px;
}

/* 分类标签颜色 */
.nav-item[data-cat="ai"] a:hover,
.nav-item[data-cat="ai"] a.active { color: var(--ai); background: rgba(124,58,237,.08); }
.nav-item[data-cat="tech"] a:hover,
.nav-item[data-cat="tech"] a.active { color: var(--tech); background: rgba(8,145,178,.08); }
.nav-item[data-cat="economy"] a:hover,
.nav-item[data-cat="economy"] a.active { color: var(--economy); background: rgba(217,119,6,.08); }
.nav-item[data-cat="military"] a:hover,
.nav-item[data-cat="military"] a.active { color: var(--military); background: rgba(220,38,38,.08); }
.nav-item[data-cat="international"] a:hover,
.nav-item[data-cat="international"] a.active { color: var(--international); background: rgba(5,150,105,.08); }
.nav-item[data-cat="car"] a:hover,
.nav-item[data-cat="car"] a.active { color: var(--car); background: rgba(234,88,12,.08); }
.nav-item[data-cat="phone"] a:hover,
.nav-item[data-cat="phone"] a.active { color: var(--phone); background: rgba(219,39,119,.08); }
.nav-item[data-cat="trump"] a:hover,
.nav-item[data-cat="trump"] a.active { color: var(--trump); background: rgba(147,51,234,.08); }

/* ========== 分类区块 ========== */
.category-section {
  margin-top: 40px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-dot.ai { background: var(--ai); }
.category-dot.tech { background: var(--tech); }
.category-dot.economy { background: var(--economy); }
.category-dot.military { background: var(--military); }
.category-dot.international { background: var(--international); }
.category-dot.car { background: var(--car); }
.category-dot.phone { background: var(--phone); }
.category-dot.trump { background: var(--trump); }

.category-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.category-count {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* ========== 新闻卡片 ========== */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.news-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
}

.news-card-title a { color: var(--text); }
.news-card-title a:hover { color: var(--accent); }

.news-card-summary {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .78rem;
  color: var(--text-secondary);
}

.news-source {
  background: rgba(67,97,238,.1);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}

/* ========== 首页：每日卡片 ========== */
.daily-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}

.daily-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.daily-card-date {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.daily-card-stats {
  font-size: .85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.daily-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.tag.ai { background: rgba(124,58,237,.1); color: var(--ai); }
.tag.tech { background: rgba(8,145,178,.1); color: var(--tech); }
.tag.economy { background: rgba(217,119,6,.1); color: var(--economy); }
.tag.military { background: rgba(220,38,38,.1); color: var(--military); }
.tag.international { background: rgba(5,150,105,.1); color: var(--international); }
.tag.car { background: rgba(234,88,12,.1); color: var(--car); }
.tag.phone { background: rgba(219,39,119,.1); color: var(--phone); }
.tag.trump { background: rgba(147,51,234,.1); color: var(--trump); }

/* ========== 页脚 ========== */
.site-footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .8rem;
  color: var(--text-secondary);
}

/* ========== 响应式 ========== */
@media (min-width: 640px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .header-inner { padding: 0 4px; }
  .category-section { margin-top: 28px; }
  .news-card { padding: 16px; }
  .nav-list { padding: 8px 12px; }
}
