:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --border: #dde0ed;
  --border-hover: #b8bdd6;
  --accent: #6d28d9;
  --accent-mid: #7c3aed;
  --accent-dim: rgba(109, 40, 217, 0.08);
  --accent-glow: 0 0 0 3px rgba(109,40,217,0.14), 0 8px 32px rgba(109,40,217,0.1);
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 60px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-hover: 0 10px 36px rgba(15,23,42,0.11), 0 3px 10px rgba(15,23,42,0.06);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════
   NAVBAR
═══════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  transition: box-shadow var(--transition);
}

.header.scrolled {
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  border-bottom-color: var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6d28d9, #0ea5e9);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  background: linear-gradient(120deg, #6d28d9, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Category nav */
.nav-cats {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 28px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}

.nav-cats::-webkit-scrollbar { display: none; }

.nav-cat-btn {
  background: none;
  border: none;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition), background var(--transition);
  font-family: inherit;
  user-select: none;
}

.nav-cat-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.nav-cat-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

.nav-cat-icon { display: flex; align-items: center; opacity: 0.75; }
.nav-cat-btn.active .nav-cat-icon { opacity: 1; }

.nav-cat-count {
  background: rgba(109, 40, 217, 0.15);
  color: var(--accent);
  border-radius: 20px;
  padding: 0px 7px;
  font-size: 10.5px;
  font-weight: 700;
}

/* Header right */
.header-right { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* ── Language Switcher ───────────────────────────── */
.lang-switcher { position: relative; }

.lang-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 11px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.lang-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.lang-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.lang-chevron {
  opacity: 0.5;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.lang-btn[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 156px;
  z-index: 400;
  overflow: hidden;
  animation: dropdown-in 0.15s ease;
}

.lang-dropdown.open { display: block; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.lang-option:hover { background: var(--surface-2); color: var(--text-primary); }
.lang-option.active { color: var(--accent); font-weight: 600; background: var(--accent-dim); }

.lang-option-native { flex: 1; }
.lang-option-code { font-size: 10.5px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }

.refresh-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.refresh-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.refresh-btn:disabled { opacity: 0.45; cursor: default; }
.refresh-icon { display: inline-block; }
.refresh-btn.spinning .refresh-icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero {
  position: relative;
  padding: 68px 28px 56px;
  text-align: center;
  overflow: hidden;
}

/* Layered background */
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% -5%,  rgba(109,40,217,0.09) 0%, transparent 65%),
    radial-gradient(ellipse 45% 40% at 15% 85%,  rgba(14,165,233,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 85%,  rgba(109,40,217,0.06) 0%, transparent 60%),
    linear-gradient(to bottom, #faf5ff, #f4f5fa);
  pointer-events: none;
}

/* Dot grid */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(109,40,217,0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black, transparent);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

/* Eyebrow */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(109,40,217,0.18);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 24px;
}

.eyebrow-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* Title */
.hero-title {
  font-size: clamp(38px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -2px;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero-gradient {
  background: linear-gradient(110deg, #6d28d9 10%, #0ea5e9 55%, #6d28d9 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 5s ease-in-out infinite;
}

@keyframes gradient-flow {
  0%, 100% { background-position: 0% center; }
  50%       { background-position: 100% center; }
}

/* Subtitle */
.hero-sub {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto 32px;
  white-space: nowrap;
}

/* Search bar */
.hero-search-wrap {
  position: relative;
  max-width: 620px;
  margin: 0 auto 22px;
}

.hero-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.hero-search-wrap:focus-within .hero-search-icon { color: var(--accent); }

.hero-search {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 15px 24px 15px 52px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  box-shadow: var(--shadow-md);
  animation: breathe 3.5s ease-in-out infinite;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-search::placeholder { color: var(--text-muted); }

@keyframes breathe {
  0%, 100% { box-shadow: var(--shadow-md); }
  50%       { box-shadow: var(--shadow-md), 0 0 0 4px rgba(109,40,217,0.1), 0 0 28px rgba(109,40,217,0.08); }
}

.hero-search:focus {
  animation: none;
  border-color: var(--accent);
  box-shadow:
    var(--shadow-md),
    0 0 0 4px rgba(109,40,217,0.14),
    0 0 60px rgba(109,40,217,0.1);
}

/* Source chips */
.hero-sources {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.src-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.src-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.reddit-chip {
  color: #c2410c;
  border-color: rgba(194,65,12,0.25);
  background: #fff7ed;
}

.src-more {
  color: var(--accent);
  border-color: rgba(109,40,217,0.2);
  background: var(--accent-dim);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   MAIN
═══════════════════════════════════════ */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.status-bar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  margin-right: 7px;
  animation: pulse 2.5s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ═══════════════════════════════════════
   CARD GRID
═══════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .news-grid { grid-template-columns: 1fr; } }

/* ── Card ──────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(109,40,217,0.3);
  box-shadow: var(--shadow-hover), var(--accent-glow);
}

.card-img-wrap {
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-image { transform: scale(1.05); }

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.source-favicon {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
}

.source-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.cat-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Light-mode category colors */
.cat-行业 { background: #dbeafe; color: #1d4ed8; }
.cat-模型 { background: #ede9fe; color: #5b21b6; }
.cat-工具 { background: #d1fae5; color: #065f46; }
.cat-研究 { background: #fef3c7; color: #92400e; }
.cat-社区 { background: #ffedd5; color: #c2410c; }

.time-label {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}

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

.card-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Skeleton ──────────────────────────── */
.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-image,
.skeleton-line {
  background: linear-gradient(90deg, #eef0f8 25%, #e2e4ef 50%, #eef0f8 75%);
  background-size: 200% 100%;
  animation: sweep 1.7s ease-in-out infinite;
}

.skeleton-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line { border-radius: 4px; height: 11px; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w70 { width: 70%; }
.skeleton-line.w85 { width: 85%; }
.skeleton-line.w55 { width: 55%; }
.skeleton-line.tall { height: 15px; }

@keyframes sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ───────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
}

.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p  { color: var(--text-muted); font-size: 14px; }

/* ── Pagination ────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 44px;
}

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 8px 15px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.page-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(109,40,217,0.3); }

/* ── Footer ────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 28px 52px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 2.2;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-cats { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 16px 40px; }
  .hero-sub { display: none; }
  .hero-sources { display: none; }
  .header-inner { padding: 0 16px; }
  .main { padding: 20px 16px 60px; }
  .footer { padding: 24px 16px 40px; }
}
