/* ====== Variables ====== */
:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8e8ea8;
  --accent: #3b6df0;
  --accent-light: #eef2ff;
  --accent-gradient: linear-gradient(135deg, #3b6df0 0%, #5b4cf0 50%, #7b2ff0 100%);
  --border: #e8ecf2;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 780px; margin: 0 auto; padding: 0 20px; }

/* ====== Header ====== */
.site-header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: 780px; margin: 0 auto;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 2px 8px rgba(59,109,240,0.3);
}
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: -0.3px; }
.header-stats {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg); padding: 6px 14px; border-radius: 20px;
}
.header-stats strong { color: var(--accent); }

/* ====== Hero Banner ====== */
.hero {
  background: linear-gradient(135deg, #1a1a3e 0%, #1e2a5a 40%, #1a3a5e 100%);
  color: white;
  padding: 32px 0 28px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 60% at 30% 50%, rgba(91,76,240,0.3) 0%, transparent 70%),
              radial-gradient(ellipse 50% 50% at 70% 20%, rgba(59,109,240,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px;
}
.hero-title span {
  background: linear-gradient(135deg, #7bb8ff, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 14px; color: rgba(255,255,255,0.65); margin-bottom: 16px; }
.hero-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
}
.hero-stat {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: rgba(255,255,255,0.8);
}
.hero-stat-icon { font-size: 16px; }
.hero-stat strong { color: white; font-size: 16px; }

/* ====== Filter Tabs ====== */
.filter-bar {
  display: flex; gap: 6px; padding: 14px 0 4px;
  position: sticky; top: 60px; z-index: 50;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}
.filter-tab {
  padding: 6px 16px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(59,109,240,0.25);
}
.filter-count { font-size: 11px; opacity: 0.7; margin-left: 2px; }

/* ====== Content ====== */
.content { padding: 16px 0 48px; }

/* ====== Date Section ====== */
.date-section { margin-bottom: 32px; }
.date-section:first-child { margin-top: 4px; }
.date-heading {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.date-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--accent-light);
}
.date-label { font-size: 16px; font-weight: 700; color: var(--text); }
.date-count {
  font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-light); padding: 3px 10px; border-radius: 12px;
}

/* ====== News Grid ====== */
.news-grid { display: flex; flex-direction: column; gap: 8px; }

/* ====== News Card ====== */
.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.news-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border);
  transition: background var(--transition);
}
.news-card {
  cursor: pointer;
}
.news-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
  border-color: #d0d5e0;
}
.news-card:hover::before { background: var(--accent); }
.news-card:hover .read-btn { background: var(--accent); color: #fff; }

/* Card header: source + time */
.card-hd {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.card-source {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.card-source-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.card-lang-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  font-weight: 600; letter-spacing: 0.3px;
}
.card-lang-tag.zh { background: #fef3c7; color: #b45309; }
.card-lang-tag.en { background: #dbeafe; color: #1d4ed8; }
.card-time { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* Title */
.card-title {
  font-size: 15px; font-weight: 650; line-height: 1.5; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { transition: color var(--transition); }
.card-title a:hover { color: var(--accent); }

/* Snippet */
.card-snippet {
  font-size: 14px; color: var(--text-secondary); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px;
}

/* Card footer */
.card-ft {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.card-tag {
  padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.2px;
}
.card-tag.model    { background: #fff7ed; color: #c2410c; }
.card-tag.app      { background: #f0fdf4; color: #166534; }
.card-tag.policy   { background: #fef2f2; color: #b91c1c; }
.card-tag.research { background: #f5f3ff; color: #6d28d9; }
.card-tag.opensrc  { background: #ecfeff; color: #155e75; }
.card-tag.biz      { background: #fffbeb; color: #a16207; }
.card-tag.general  { background: #f1f5f9; color: #475569; }
.read-btn {
  color: var(--accent); font-weight: 600; font-size: 12px; white-space: nowrap;
  padding: 6px 14px; border-radius: 6px; transition: all var(--transition);
  background: var(--accent-light); border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 4px;
}
.read-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ====== Empty State ====== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ====== Footer ====== */
.site-footer {
  text-align: center; padding: 28px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer p { font-size: 12px; color: var(--text-muted); margin: 3px 0; }
.site-footer .footer-brand { font-weight: 600; color: var(--text-secondary); }

/* ====== Back to Top ====== */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
  transition: all var(--transition);
  z-index: 200; opacity: 0; transform: translateY(12px);
  pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { box-shadow: var(--shadow-lg); border-color: var(--accent); }

/* ====== Mobile ====== */
@media (max-width: 640px) {
  .header-inner { padding: 10px 16px; }
  .logo-text { font-size: 16px; }
  .logo-icon { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
  .hero { padding: 24px 0 20px; }
  .hero-title { font-size: 20px; }
  .hero-stats { gap: 12px; }
  .filter-bar { position: static; }
  .news-card { padding: 12px 14px; }
  .card-title { font-size: 14px; }
  .date-heading { margin-bottom: 10px; }
  .back-to-top { right: 16px; bottom: 16px; width: 36px; height: 36px; }
}

/* ====== Animations ====== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.news-card { animation: fadeInUp 0.4s ease backwards; }
.news-card:nth-child(1) { animation-delay: 0s; }
.news-card:nth-child(2) { animation-delay: 0.03s; }
.news-card:nth-child(3) { animation-delay: 0.06s; }
.news-card:nth-child(4) { animation-delay: 0.09s; }
.news-card:nth-child(5) { animation-delay: 0.12s; }
.news-card:nth-child(n+6) { animation-delay: 0.15s; }
