/* ==========================================================================
   Daily Briefing — Newspaper aesthetic
   Font pairing: Noto Serif TC (zh display) + EB Garamond (en body)
   Paper-toned palette inspired by traditional newsprint
   ========================================================================== */

:root {
  /* Palette — warm paper */
  --paper: #f5ecdc;
  --paper-deep: #ede1c9;
  --ink: #1a1814;
  --ink-soft: #3d3933;
  --ink-muted: #6b655b;
  --accent: #c4453c;          /* vermilion red — like Asian newspaper masthead */
  --accent-soft: #a8342c;
  --rule: #1a1814;
  --rule-soft: rgba(26, 24, 20, 0.15);

  /* Typography */
  --font-display-zh: 'Noto Serif TC', 'Source Han Serif TC', 'Songti TC', serif;
  --font-body-zh: 'Noto Serif TC', 'Source Han Serif TC', serif;
  --font-display-en: 'EB Garamond', 'Libre Caslon Text', Georgia, serif;
  --font-body-en: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, sans-serif;

  /* Spacing */
  --column-max: 1280px;
  --gutter: 32px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body-zh);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Subtle paper grain */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.015) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.015) 0%, transparent 40%);
}

/* ==========================================================================
   MASTHEAD
   ========================================================================== */

.masthead {
  max-width: var(--column-max);
  margin: 0 auto;
  padding: 48px var(--gutter) 32px;
  border-bottom: 3px double var(--rule);
}

.masthead-meta {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  padding-bottom: 24px;
}

.masthead-meta .issue-number { text-align: left; }
.masthead-meta .weather {
  text-align: center;
  display: flex;
  justify-content: center;
}
.masthead-meta .date { text-align: right; }

.weather-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.weather-city {
  font-weight: 600;
  color: var(--ink);
}

.weather-reading,
.weather-empty {
  color: var(--ink-soft);
}

.masthead-title {
  text-align: center;
  font-family: var(--font-display-zh);
  font-size: clamp(40px, 8vw, 92px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  margin: 12px 0 6px;
  color: var(--ink);
}

.masthead-tagline {
  text-align: center;
  color: var(--accent);
  font-family: var(--font-body-zh);
  font-size: 16px;
  letter-spacing: 0.15em;
  margin-top: 8px;
}

.masthead-tagline .en {
  display: block;
  font-family: var(--font-body-en);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-top: 4px;
  opacity: 0.85;
}

/* ==========================================================================
   CATEGORY TABS
   ========================================================================== */

.tabs-wrap {
  max-width: var(--column-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-wrap::-webkit-scrollbar { display: none; }

.tabs {
  display: flex;
  gap: 40px;
  padding: 20px 0;
  white-space: nowrap;
}

.tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body-zh);
  font-size: 18px;
  color: var(--ink-soft);
  padding: 4px 0;
  position: relative;
  transition: color 0.2s;
}

.tab .count {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: 6px;
  vertical-align: super;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--ink);
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -21px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
}

/* ==========================================================================
   CATEGORY SECTION HEADER
   ========================================================================== */

.category-section {
  max-width: var(--column-max);
  margin: 0 auto;
  padding: 48px var(--gutter) 24px;
}

.category-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-soft);
}

.category-title h2 {
  font-family: var(--font-display-zh);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.category-title .count-label {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
}

/* ==========================================================================
   ARTICLE CARD
   ========================================================================== */

.articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 900px) {
  .articles { grid-template-columns: 1fr 1fr; gap: 36px 44px; }
  .article.is-headline { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .articles { grid-template-columns: 1fr 1fr 1fr; gap: 36px 40px; }
  .article.is-headline { grid-column: 1 / -1; }
}

.article {
  cursor: pointer;
  transition: opacity 0.2s;
}

.article:hover { opacity: 0.75; }

.article-media {
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--rule, #e8e4dc);
}

.article-media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article:hover .article-media img { transform: scale(1.03); }

.article.is-headline .article-media img {
  aspect-ratio: 2 / 1;
}

@media (min-width: 900px) {
  .article.is-headline .article-media img { aspect-ratio: 21 / 9; }
}

.article-pulse {
  margin: 14px 0 4px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 8px 8px 0;
}

.article-pulse .pulse-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.article-pulse p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.85;
}

.article-kicker {
  display: flex;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.article-kicker .kicker-badge {
  color: var(--accent);
  font-weight: 600;
}

.article-title {
  font-family: var(--font-display-zh);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--ink);
}

.article.is-headline .article-title {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
}

.article-title-en {
  font-family: var(--font-display-en);
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 16px;
  line-height: 1.35;
}

.article.is-headline .article-title-en {
  font-size: 22px;
}

.article-lede {
  font-family: var(--font-body-zh);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-style: italic;
}

/* 卡面摘要:只顯示兩行,全文在點進去的 reader 裡 */
.article-summary {
  font-family: var(--font-body-zh);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article.is-headline .article-summary { -webkit-line-clamp: 3; line-clamp: 3; font-size: 16px; }
.article-more {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0.85;
  margin-bottom: 14px;
}
.article:hover .article-more { opacity: 1; }

/* 產業標籤 chip(機器人/金融/製造/零售)*/
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.itag {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid var(--rule-soft, rgba(0, 0, 0, 0.1));
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

/* reader 裡的社群觀點 */
.reader-pulse {
  margin: 24px 0 8px;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 8px 8px 0;
}
.reader-pulse-label {
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 8px;
}
.reader-pulse p {
  font-family: var(--font-body-zh);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
}

.article-bullets {
  list-style: none;
  margin-bottom: 16px;
}

.article-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 16px;
}

.article-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--ink-muted);
}

.article-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
}

.article-source {
  font-weight: 600;
  color: var(--ink-soft);
}

.article-footer .dot { opacity: 0.4; }

.article-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

.article-actions a,
.article-actions button {
  background: none;
  border: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: all 0.15s;
}

.article-actions a:hover,
.article-actions button:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ==========================================================================
   READER OVERLAY
   ========================================================================== */

.reader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 100;
  overflow-y: auto;
  padding: 40px 20px;
}

.reader-overlay.open { display: block; }

.reader-paper {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  padding: 64px 72px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  position: relative;
}

@media (max-width: 640px) {
  .reader-paper { padding: 40px 28px; }
}

.reader-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--ink-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reader-close:hover { color: var(--ink); }

.reader-lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rule);
  margin-bottom: 24px;
  font-family: var(--font-ui);
  font-size: 12px;
}

.reader-lang-toggle button {
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.reader-lang-toggle button.active {
  background: var(--ink);
  color: var(--paper);
}

.reader-kicker {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.reader-title {
  font-family: var(--font-display-zh);
  font-size: 36px;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--ink);
}

.reader-title-en {
  font-family: var(--font-display-en);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-muted);
  margin-bottom: 24px;
  line-height: 1.35;
}

.reader-lede {
  font-family: var(--font-body-zh);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
  font-style: italic;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule-soft);
}

.reader-bullets {
  list-style: none;
  margin-bottom: 32px;
}

.reader-bullets li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.reader-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.reader-source-block {
  background: var(--paper-deep);
  padding: 20px;
  border-left: 3px solid var(--accent);
  margin-top: 32px;
}

.reader-source-block .label {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.reader-source-block a {
  color: var(--ink);
  font-family: var(--font-body-zh);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.reader-source-block a:hover { color: var(--accent); }

/* Language-aware visibility */
.reader-paper[data-lang="zh"] .en-only,
.reader-paper[data-lang="en"] .zh-only { display: none; }

.reader-paper[data-lang="both"] .zh-only,
.reader-paper[data-lang="both"] .en-only { display: block; }

/* ==========================================================================
   ARCHIVE PAGE
   ========================================================================== */

.archive-list {
  max-width: 860px;
  margin: 48px auto;
  padding: 0 var(--gutter);
}

.archive-item {
  display: grid;
  grid-template-columns: 100px 60px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.archive-item:hover { background: var(--paper-deep); }

.archive-date {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
}

.archive-issue-num {
  font-family: var(--font-display-en);
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
}

.archive-headline {
  font-family: var(--font-display-zh);
  font-size: 18px;
  color: var(--ink);
  line-height: 1.4;
}

.archive-headline .en {
  display: block;
  font-family: var(--font-display-en);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  max-width: var(--column-max);
  margin: 80px auto 0;
  padding: 32px var(--gutter);
  border-top: 3px double var(--rule);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  margin: 0 12px;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover { border-bottom-color: var(--accent); }


/* ---------------------------------------------------------------------------
   Article reactions (Phase 1: localStorage)
--------------------------------------------------------------------------- */
.article-reactions {
  display: flex;
  gap: 6px;
  margin-left: 8px;
  position: relative;
}

.reaction-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(0.85) opacity(0.55);
  transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.reaction-btn:hover {
  filter: grayscale(0) opacity(1);
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.12);
}

.reaction-btn.is-active {
  filter: grayscale(0) opacity(1);
  background: var(--accent-soft, rgba(220, 38, 38, 0.12));
  border-color: var(--accent, #dc2626);
}

.reaction-btn[data-reaction="interested"].is-active {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.6);
}
.reaction-btn[data-reaction="to-implement"].is-active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.6);
}
.reaction-btn[data-reaction="fun"].is-active {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.6);
}

/* === Dual-edition switcher (added 2026-04-29) ============================= */
.edition-switcher-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 16px 4px;
}
.edition-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(196, 69, 60, 0.06);
  border: 1px solid rgba(196, 69, 60, 0.18);
  border-radius: 999px;
}
.edition-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-display-zh, 'Noto Serif TC', serif);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  letter-spacing: 0.05em;
}
.edition-tab:hover:not(.disabled) { color: var(--ink); }
.edition-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(196, 69, 60, 0.3);
}
.edition-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === Prose-style lede ===================================================== */
.article-lede.article-lede--prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-top: 8px;
  margin-bottom: 14px;
}
.article.is-headline .article-lede.article-lede--prose {
  font-size: 18px;
  line-height: 1.85;
}

/* === Breaking News section =============================================== */
.breaking-section {
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, rgba(196, 69, 60, 0.05), rgba(196, 69, 60, 0));
  padding: 14px 18px 8px;
  margin-bottom: 28px;
  border-radius: 4px;
}
.breaking-section .breaking-title h2 {
  color: var(--accent);
  letter-spacing: 0.05em;
}
.breaking-section .breaking-title .count-label {
  color: var(--accent-soft, var(--accent));
}
.article.is-breaking {
  border: 1px solid rgba(196, 69, 60, 0.35);
  background: #fffaf9;
  border-radius: 6px;
  padding: 16px;
}
.article.is-breaking .article-kicker .kicker-badge {
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* === Responsive: tablet (≤768px) ========================================= */
@media (max-width: 768px) {
  :root {
    --gutter: 18px;
  }

  body { font-size: 16px; }

  /* Masthead — collapse 3-column meta into stacked single column */
  .masthead {
    padding: 28px var(--gutter) 20px;
  }
  .masthead-meta {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 16px;
    font-size: 12px;
    text-align: center;
  }
  .masthead-meta .issue-number,
  .masthead-meta .date {
    text-align: center;
  }
  .weather-list {
    gap: 6px;
  }
  .weather-chip {
    padding: 3px 8px;
    font-size: 12px;
  }
  .masthead-title {
    margin: 14px 0 8px;
    letter-spacing: 0.04em;
  }
  .masthead-tagline {
    font-size: 13px;
    letter-spacing: 0.08em;
  }
  .masthead-tagline .en {
    font-size: 12px;
  }

  /* Edition switcher */
  .edition-switcher-wrap { padding: 12px 12px 4px; }
  .edition-tab {
    font-size: 13px;
    padding: 6px 14px;
  }

  /* Tabs — keep horizontal scroll, tighter spacing */
  .tabs {
    gap: 22px;
    padding: 14px 0;
  }
  .tab { font-size: 15px; }
  .tab.active::after { bottom: -15px; }

  /* Category sections */
  .category-section {
    padding: 32px var(--gutter) 16px;
  }
  .category-title {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    padding-bottom: 12px;
  }
  .category-title h2 { font-size: 22px; }

  /* Articles — single column, smaller gap */
  .articles { gap: 32px; }

  .article-title { font-size: 20px; }
  .article.is-headline .article-title {
    font-size: clamp(24px, 6vw, 32px);
  }
  .article-title-en { font-size: 14px; }
  .article.is-headline .article-title-en { font-size: 16px; }

  .article-lede { font-size: 15px; line-height: 1.7; }
  .article-lede.article-lede--prose { font-size: 15px; line-height: 1.75; }
  .article.is-headline .article-lede.article-lede--prose { font-size: 16px; }

  .article-bullets li { font-size: 14px; }

  /* Article footer — wrap, allow source/meta to flow naturally */
  .article-footer {
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11px;
    padding-top: 10px;
  }
  .article-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
  }
  .article-actions a,
  .article-actions button {
    font-size: 11px;
    padding: 4px 8px;
  }
  .article-reactions {
    margin-left: auto;
    gap: 4px;
  }
  .reaction-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* Breaking news padding */
  .breaking-section { padding: 12px 14px 6px; }
  .article.is-breaking { padding: 14px; }

  /* Reader overlay — full bleed on mobile */
  .reader-overlay { padding: 16px 8px; }
  .reader-paper { padding: 32px 20px; }
  .reader-title { font-size: 26px; }
  .reader-title-en { font-size: 17px; }
  .reader-lede { font-size: 16px; }
  .reader-bullets li { font-size: 15px; }

  /* Archive */
  .archive-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 18px 0;
  }
  .archive-headline { font-size: 16px; }
}

/* === Responsive: small phones (≤420px) =================================== */
@media (max-width: 420px) {
  :root { --gutter: 14px; }

  .masthead { padding: 22px var(--gutter) 16px; }
  .masthead-title { letter-spacing: 0.02em; }

  .tabs { gap: 18px; }
  .tab { font-size: 14px; }

  .category-title h2 { font-size: 20px; }
  .article-title { font-size: 19px; }
  .article-lede,
  .article-lede.article-lede--prose { font-size: 14.5px; }

  .reader-paper { padding: 28px 16px; }
  .reader-title { font-size: 23px; }
}


/* === Teaching material badge & reader takeaway === */
.teaching-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #78350f;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: middle;
}
.reader-takeaway {
  margin: 22px 0 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
}
.reader-takeaway-label {
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.reader-takeaway-text {
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
  margin: 0;
}
@media (max-width: 420px) {
  .teaching-badge { font-size: 10px; padding: 2px 7px; margin-left: 6px; }
  .reader-takeaway { padding: 13px 14px; }
  .reader-takeaway-text { font-size: 14px; }
}

/* ==========================================================================
   READER UX — dark mode / read markers / overview bar / reader nav
   ========================================================================== */

/* 深色模式:翻轉色票變數,其餘全站自動跟著變 */
:root[data-theme="dark"] {
  --paper: #14120e;
  --paper-deep: #1d1a15;
  --ink: #ece4d2;
  --ink-soft: #b9b0a0;
  --ink-muted: #8a8172;
  --accent: #e0736a;
  --accent-soft: #c85a51;
  --rule: #ece4d2;
  --rule-soft: rgba(236, 228, 210, 0.16);
}
:root[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.02) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.02) 0%, transparent 40%);
}
/* 深色下,寫死的淺色底面補回可見度 */
:root[data-theme="dark"] .itag { background: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .reader-pulse { background: rgba(255,255,255,0.045); }
:root[data-theme="dark"] .weather-chip { background: rgba(255,255,255,0.05); }
:root[data-theme="dark"] .article.is-read::after { color: #14120e; }

/* ① 已讀標記:淡化 + 右上角 ✓ */
.article { position: relative; }
.article.is-read { opacity: 0.5; }
.article.is-read:hover { opacity: 0.85; }
.article.is-read::after {
  content: '✓';
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-family: var(--font-ui); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ② 今日總覽列 */
.overview-bar {
  max-width: var(--column-max);
  margin: 0 auto;
  padding: 11px var(--gutter);
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px;
  font-family: var(--font-ui); font-size: 13px; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.overview-bar b { color: var(--ink); font-weight: 700; }
.ov-sep { opacity: 0.35; }
.ov-breaking { color: var(--accent); font-weight: 600; }
.ov-personalized { color: var(--accent); }
.theme-toggle {
  margin-left: auto;
  background: transparent; border: 1px solid var(--rule-soft);
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
  font-size: 15px; line-height: 1; transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--ink-muted); }

/* ⑥ reader 上一則 / 下一則 */
.reader-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 30px; padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
}
.reader-nav button {
  background: transparent; border: 1px solid var(--rule-soft);
  border-radius: 999px; padding: 8px 20px; cursor: pointer;
  font-family: var(--font-ui); font-size: 14px; color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.reader-nav button:hover:not(:disabled) { border-color: var(--ink-muted); background: var(--paper-deep); }
.reader-nav button:disabled { opacity: 0.28; cursor: default; }
.reader-navpos { font-family: var(--font-ui); font-size: 12px; color: var(--ink-muted); }
