/* 每日新聞智慧輿情彙整系統 - 報社風格樣式表 (The Grand Broadsheet Gazette) */
:root {
  --primary: #1e3a8a;
  --accent: #991b1b;
  --news-black: #111827;
  --news-ink: #1f2937;
  --news-muted: #4b5563;
  --paper-bg: #fcfbf7; /* 典雅象牙紙質底色 */
  --paper-outer: #f1ede4; /* 報紙外圍襯底色 */
  --paper-border: #111827;
  --paper-border-light: #d1d5db;
  --font-serif: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "Baskerville", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--paper-outer);
  color: var(--news-ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  background-color: #ffffff;
  border-bottom: 2px solid var(--paper-border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-logo {
  font-size: 2rem;
}

.header-title-group h1 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--news-black);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title-group .badge-gov {
  background: var(--accent);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0.05em;
}

.header-subtitle {
  font-size: 0.8rem;
  color: var(--news-muted);
  font-family: var(--font-serif);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #e5e7eb;
  padding: 3px;
  border-radius: 4px;
}

.nav-tab-btn {
  border: none;
  background: transparent;
  padding: 0.55rem 1.2rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--news-muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab-btn:hover {
  color: var(--news-black);
}

.nav-tab-btn.active {
  background: #ffffff;
  color: var(--news-black);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  font-weight: 800;
}

.btn-fetch-now {
  background: var(--news-black);
  color: white;
  border: 1px solid var(--news-black);
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.btn-fetch-now:hover {
  background: #374151;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 1.5rem auto 5rem auto;
  padding: 0 1.5rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--paper-border-light);
  border-top: 3.5px solid var(--news-black);
  border-radius: 2px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--news-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-info .stat-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--news-black);
  font-family: var(--font-serif);
}

.stat-icon {
  font-size: 2rem;
  opacity: 0.8;
}

/* Tab Views */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

/* Filter Toolbar */
.toolbar-card {
  background: #ffffff;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid var(--paper-border-light);
  border-radius: 3px;
  padding: 0.45rem 0.8rem;
  min-width: 280px;
  flex: 1;
}

.search-input-group input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.filter-select {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--paper-border-light);
  border-radius: 3px;
  background: #ffffff;
  font-size: 0.875rem;
  color: var(--news-ink);
  outline: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary {
  background: #f3f4f6;
  border: 1px solid var(--paper-border-light);
  color: #374151;
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.tag-cloud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-pill {
  font-size: 0.775rem;
  padding: 3px 10px;
  border-radius: 2px;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  font-weight: 600;
  transition: all 0.15s;
}

.tag-pill:hover,
.tag-pill.active {
  background: var(--news-black);
  color: #ffffff;
  border-color: var(--news-black);
}

/* News Table */
.table-container {
  background: #ffffff;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.news-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.news-table th {
  background: #f9fafb;
  padding: 0.9rem 1.1rem;
  font-size: 0.825rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--news-muted);
  border-bottom: 2px solid var(--paper-border);
  white-space: nowrap;
}

.news-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
  vertical-align: top;
}

.news-table tbody tr:hover {
  background-color: #fdfbf7;
}

.news-table tr.selected {
  background-color: #f8fafc;
}

.cell-checkbox {
  width: 44px;
  text-align: center;
}

.cell-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--news-black);
}

.cell-source {
  width: 140px;
  white-space: nowrap;
}

.source-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 0.725rem;
  font-weight: 800;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
}

.source-badge.udn { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.source-badge.ithome { border-color: #86efac; background: #f0fdf4; color: #166534; }
.source-badge.infosec { border-color: #fdba74; background: #fff7ed; color: #9a3412; }
.source-badge.cna { border-color: #a5b4fc; background: #eef2ff; color: #3730a3; }

.news-table-thumb {
  width: 90px;
  height: 64px;
  object-fit: cover;
  border: 1px solid #111827;
  border-radius: 2px;
  float: right;
  margin-left: 0.85rem;
  margin-bottom: 0.25rem;
}

.news-title-link {
  color: var(--news-black);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.4;
  display: block;
  margin-bottom: 0.35rem;
}

.news-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.news-snippet {
  color: #4b5563;
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 0.45rem;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.kw-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 2px;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  font-weight: 600;
}

.cell-time {
  width: 120px;
  white-space: nowrap;
  font-size: 0.775rem;
  color: var(--news-muted);
}

.cell-action {
  width: 70px;
  text-align: center;
}

.btn-open-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.btn-open-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* Floating Bottom Bar */
.bottom-floating-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 2px solid var(--paper-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  padding: 0.9rem 1.5rem;
  z-index: 30;
}

.bottom-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.selection-info {
  font-size: 0.95rem;
  color: #1f2937;
  font-weight: 700;
}

.selection-count-pill {
  background: #fee2e2;
  color: var(--accent);
  padding: 3px 11px;
  border-radius: 3px;
  font-weight: 900;
  margin: 0 4px;
}

.btn-summarize-gemini {
  background: var(--news-black);
  color: #ffffff;
  border: 1px solid var(--news-black);
  padding: 0.75rem 1.85rem;
  font-size: 0.975rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
}

.btn-summarize-gemini:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.btn-summarize-gemini:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================
   📰 頂級大報風格輿情報導 (The Grand Broadsheet Gazette)
   ========================================================== */
.newspaper-wrapper {
  background: var(--paper-bg);
  border: 2px solid var(--paper-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 3.5rem 4rem;
  margin-bottom: 3.5rem;
  color: #111827;
}

/* 報頭區 (Masthead) */
.newspaper-masthead {
  text-align: center;
  margin-bottom: 1.25rem;
}

.masthead-top-rule {
  border-top: 4px solid var(--paper-border);
  border-bottom: 1.5px solid var(--paper-border);
  height: 6px;
  margin-bottom: 0.75rem;
}

.masthead-pre-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #4b5563;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.masthead-main-title {
  font-family: var(--font-serif);
  font-size: 3.25rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #000000;
  margin: 0.25rem 0;
  line-height: 1.15;
}

.masthead-latin-sub {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  letter-spacing: 0.25em;
  color: #4b5563;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* 刊頭資訊欄 (Meta Bar) */
.newspaper-meta-bar {
  border-top: 1.5px solid var(--paper-border);
  border-bottom: 2.5px solid var(--paper-border);
  padding: 0.45rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.825rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}

/* 今日社論導讀 (Editorial Lead) */
.newspaper-editorial-box {
  background: #ffffff;
  border: 1.5px solid #000000;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.75rem;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.editorial-header-flag {
  position: absolute;
  top: -12px;
  left: 24px;
  background: #000000;
  color: #ffffff;
  font-size: 0.775rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 3px 12px;
  text-transform: uppercase;
}

.editorial-body-text {
  font-family: var(--font-serif);
  font-size: 1.075rem;
  line-height: 1.85;
  color: #1f2937;
  text-align: justify;
}

.editorial-body-text::first-letter {
  font-size: 2.85rem;
  font-weight: 900;
  float: left;
  line-height: 1;
  margin-right: 0.6rem;
  margin-top: 0.15rem;
  color: #000000;
}

/* ==========================================
   ★ 今日頭版頭條特稿 (Lead Headline Feature)
   ========================================== */
.lead-headline-feature {
  background: #ffffff;
  border: 2px solid #000000;
  padding: 2rem 2.25rem;
  margin-bottom: 3.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* 長官與業務同仁 30 秒速讀懶人包 (消除開 20 個分頁的痛苦) */
.executive-quick-summary-box {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-left: 5px solid #d97706;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.35rem;
  border-radius: 2px;
}

.exec-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px dashed #fcd34d;
  padding-bottom: 0.35rem;
}

.exec-icon {
  font-size: 1rem;
}

.exec-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 0.95rem;
  color: #92400e;
  flex: 1;
}

.exec-dept-badge {
  background: #78350f;
  color: #ffffff;
  font-size: 0.725rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.exec-summary-content {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #1f2937;
}

.exec-point {
  margin-bottom: 0.25rem;
}

.exec-point strong {
  color: #78350f;
}

.lead-flag-pill {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.headline-lead {
  font-family: var(--font-serif);
  font-size: 2.35rem !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  color: #000000 !important;
  margin-bottom: 0.6rem !important;
}

.deck-lead {
  font-family: var(--font-serif);
  font-size: 1.15rem !important;
  font-style: italic;
  color: #4b5563;
  margin-bottom: 1.5rem !important;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #d1d5db;
}

.lead-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.figure-lead-large {
  border: 1.5px solid #000000 !important;
  padding: 6px !important;
  margin-bottom: 1.25rem !important;
}

.figure-lead-large .newspaper-img {
  max-height: 380px !important;
  object-fit: cover;
}

/* 雙欄式流水排版 (Two-Column Flow) */
.columns-2 {
  column-count: 2;
  column-gap: 2rem;
  column-rule: 1px solid #e5e7eb;
}

@media (max-width: 900px) {
  .columns-2 {
    column-count: 1;
  }
}

.lead-first-p::first-letter {
  font-size: 3rem;
  font-weight: 900;
  float: left;
  line-height: 1;
  margin-right: 0.5rem;
  margin-top: 0.15rem;
  color: #000000;
}

/* 報紙版面分區 (Newspaper Sections) */
.news-section-block {
  margin-bottom: 3.5rem;
}

.news-section-banner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 3px solid var(--paper-border);
  padding-bottom: 0.4rem;
  margin-bottom: 2rem;
}

.section-title-large {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 900;
  color: #000000;
  letter-spacing: -0.01em;
}

.section-badge-pill {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 900;
  background: #000000;
  color: #ffffff;
  padding: 3px 10px;
  margin-left: 0.6rem;
}

.section-count-tag {
  font-size: 0.825rem;
  font-weight: 700;
  color: #6b7280;
}

/* 新聞文章排版 (Editorial Article) */
.editorial-article {
  margin-bottom: 2.75rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px dashed #9ca3af;
}

.editorial-article:last-child {
  border-bottom: none;
}

.article-headline {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.35;
  color: #000000;
  margin-bottom: 0.45rem;
}

.article-deck {
  font-family: var(--font-serif);
  font-size: 1.025rem;
  font-style: italic;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.article-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.article-grid-layout.has-media {
  grid-template-columns: 3fr 2fr;
}

@media (max-width: 900px) {
  .article-grid-layout.has-media {
    grid-template-columns: 1fr;
  }
}

.article-prose {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.85;
  color: #1f2937;
  text-align: justify;
}

.article-prose p {
  margin-bottom: 1rem;
  text-indent: 2.2em; /* 報紙標準首行縮排 */
}

/* 新聞照片組件 (Newspaper Photo Figure) */
.newspaper-figure {
  margin: 0 0 1.25rem 0;
  background: #ffffff;
  border: 1px solid #111827;
  padding: 5px;
}

.newspaper-img {
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  display: block;
}

.newspaper-figcaption {
  font-size: 0.8rem;
  color: #374151;
  padding: 7px 5px 3px 5px;
  line-height: 1.45;
  border-top: 1px solid #e5e7eb;
  margin-top: 5px;
  font-weight: 600;
}

.newspaper-figcaption .photo-credit {
  display: block;
  font-size: 0.725rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 3px;
}

/* 報社新聞數據情報表格 (Editorial Data Table) */
.newspaper-table-box {
  margin: 1.35rem 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 1rem;
}

.table-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 900;
  color: #000000;
  margin-bottom: 0.6rem;
  border-left: 3.5px solid #000000;
  padding-left: 0.6rem;
}

.editorial-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.editorial-data-table th {
  border-top: 2.5px solid #000000;
  border-bottom: 1px solid #000000;
  padding: 7px 9px;
  font-weight: 900;
  text-align: left;
  background: #f9fafb;
}

.editorial-data-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 7px 9px;
  vertical-align: top;
  line-height: 1.45;
}

.editorial-data-table tr:last-child td {
  border-bottom: 2.5px solid #000000;
}

/* 原始報導出處條 (Sources Footnote) */
.article-sources-footnote {
  background: #f9fafb;
  border-left: 3.5px solid #111827;
  padding: 0.75rem 1.1rem;
  margin-top: 1.25rem;
  font-size: 0.825rem;
}

.sources-footnote-title {
  font-weight: 900;
  color: #111827;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.source-item-link {
  display: inline-block;
  color: #1d4ed8;
  text-decoration: underline;
  margin-right: 1.25rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.source-item-link:hover {
  color: var(--accent);
}

/* 報尾版權與公務聲明 (Colophon) */
.newspaper-colophon {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 3px double var(--paper-border);
  text-align: center;
  font-family: var(--font-serif);
}

.colophon-ornament {
  font-size: 1.1rem;
  letter-spacing: 0.5em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}

/* Settings View */
.settings-section {
  background: #ffffff;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  border-bottom: 2px solid var(--paper-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h3 {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--news-black);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  font-size: 0.825rem;
  color: var(--news-muted);
  margin-top: 0.15rem;
}

.source-config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  margin-bottom: 0.6rem;
  background: #ffffff;
}

.source-name-row {
  font-weight: 800;
  font-size: 0.9rem;
}

.source-url-text {
  font-size: 0.775rem;
  color: var(--news-muted);
  word-break: break-all;
}

.source-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--news-black);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.keyword-chips-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f9fafb;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  min-height: 80px;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.65rem;
  border-radius: 2px;
  font-size: 0.825rem;
  font-weight: 800;
  color: #1f2937;
}

.chip-delete-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
}

.chip-delete-btn:hover {
  color: #ef4444;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.form-input {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  font-size: 0.875rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--news-black);
}

.category-config-card {
  border: 1px solid var(--paper-border-light);
  border-radius: 2px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
}

.category-config-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.category-config-desc {
  font-size: 0.825rem;
  color: #4b5563;
  line-height: 1.5;
}

/* Modal / Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.active {
  display: flex;
}

.loading-box {
  background: #ffffff;
  padding: 2.5rem 3rem;
  border-radius: 4px;
  border: 2px solid #000000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 440px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 1.25rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
  color: #000000;
}

.loading-desc {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.55;
}

/* ==========================================================
   🖨️ 列印與可點擊 PDF 匯出專用樣式 (A4 Newspaper Print)
   ========================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm 12mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-header,
  .bottom-floating-bar,
  .report-actions,
  .toolbar-card,
  .stats-grid,
  .nav-tab-btn,
  .header-nav,
  #toast-notification,
  .modal-overlay {
    display: none !important;
  }

  .main-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .newspaper-wrapper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
  }

  .editorial-article {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    border-bottom: 1px solid #000000 !important;
    padding-bottom: 12pt !important;
    margin-bottom: 14pt !important;
  }

  .article-headline {
    font-size: 14pt !important;
    color: #000000 !important;
  }

  .article-prose {
    font-size: 9.5pt !important;
    line-height: 1.65 !important;
  }

  .newspaper-img {
    max-height: 180px !important;
  }

  .source-item-link {
    color: #0033aa !important;
    text-decoration: underline !important;
  }
}
