:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-subtle: #f0ede6;
  --ink: #171717;
  --ink-secondary: #4b4a46;
  --ink-muted: #76736b;
  --border: #e2ddd3;
  --accent: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-ink: #1e3a8a;
  --badge-safety-bg: #fef2f2;
  --badge-safety-ink: #991b1b;
  --badge-model-bg: #eff6ff;
  --badge-model-ink: #1d4ed8;
  --badge-product-bg: #ecfdf5;
  --badge-product-ink: #065f46;
  --shadow: 0 1px 2px rgba(23, 23, 23, 0.04), 0 8px 24px rgba(23, 23, 23, 0.04);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #111214;
  --surface: #191b1f;
  --surface-subtle: #22252b;
  --ink: #f3f4f6;
  --ink-secondary: #c7cbd4;
  --ink-muted: #8b92a0;
  --border: #2a2e36;
  --accent: #60a5fa;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent-ink: #93c5fd;
  --badge-safety-bg: rgba(239, 68, 68, 0.14);
  --badge-safety-ink: #fca5a5;
  --badge-model-bg: rgba(96, 165, 250, 0.14);
  --badge-model-ink: #93c5fd;
  --badge-product-bg: rgba(16, 185, 129, 0.14);
  --badge-product-ink: #6ee7b7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / Masthead */
.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
}

.brand-dot {
  color: var(--accent);
}

.brand-date {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.theme-btn {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

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

/* Hero Digest */
.hero {
  padding: 36px 0 24px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 20px;
  color: var(--ink-secondary);
  font-size: 1rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.hero-stats strong {
  color: var(--ink);
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 8px 0 24px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.search-wrap {
  position: relative;
  flex: 1 1 220px;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent);
}

/* News List */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 56px;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

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

.news-card.featured {
  border-left: 4px solid var(--accent);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-safety {
  background: var(--badge-safety-bg);
  color: var(--badge-safety-ink);
}

.badge-model {
  background: var(--badge-model-bg);
  color: var(--badge-model-ink);
}

.badge-product {
  background: var(--badge-product-bg);
  color: var(--badge-product-ink);
}

.badge-featured {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.18rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.card-original {
  margin: 0 0 12px;
  font-size: 0.84rem;
  color: var(--ink-muted);
  font-style: italic;
}

.card-summary {
  margin: 0 0 14px;
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.card-highlights {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--ink-secondary);
  font-size: 0.88rem;
}

.card-highlights li {
  margin-bottom: 4px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.83rem;
}

.card-source {
  color: var(--ink-muted);
  font-weight: 500;
}

.card-link {
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.card-link:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--ink-muted);
  font-size: 0.83rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero-card {
    padding: 20px;
  }
  .news-card {
    padding: 18px;
  }
  .search-wrap {
    max-width: 100%;
  }
}
