@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Noto+Serif+TC:wght@400;500;700;900&family=Cinzel:wght@600;800&display=swap');

:root {
  --paper: #f4ecd8;
  --paper-dark: #e8dfc2;
  --ink: #1a1a1a;
  --ink-soft: #2b2b2b;
  --muted: #6b6257;
  --accent: #8b0000;
  --accent-soft: #b03a2e;
  --rule: #1a1a1a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(139, 0, 0, 0.04) 0, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(0, 0, 0, 0.05) 0, transparent 40%),
    var(--paper);
  color: var(--ink);
  font-family: var(--user-font, "Noto Serif TC"), Georgia, "Times New Roman", serif;
  line-height: var(--body-line-height, 1.65);
  min-height: 100vh;
}

/* ===== Masthead ===== */
.masthead {
  border-bottom: 5px double var(--rule);
  padding: 12px 32px 0;
  text-align: center;
  background: linear-gradient(180deg, var(--paper-dark), var(--paper));
}
.masthead-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  text-transform: uppercase;
}
.masthead-top .today-date { font-weight: 700; color: var(--ink); }
.masthead-top .badge-new {
  background: var(--accent);
  color: var(--paper);
  padding: 2px 10px;
  font-family: "Cinzel", monospace;
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 11px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.06); }
}
.title {
  font-family: "Cinzel", "Playfair Display", "Noto Serif TC", serif;
  font-size: var(--paper-title-size, clamp(30px, 4.8vw, 52px));
  font-weight: 900;
  letter-spacing: 4px;
  margin: 6px 0 6px;
  line-height: 1.05;
}
/* v6.3: two-line title (中文 + 英文) so it doesn't collide with the
   left-floating weather block. Each span is a block-level row. */
.title .title-line { display: block; }
.title .title-en {
  font-size: 0.58em;      /* English row ~58% of main title size */
  letter-spacing: 5px;
  font-style: italic;
  font-weight: 800;
  opacity: 0.88;
  margin-top: 2px;
}
.tagline {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 2px;
}
.nav {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 6px 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  letter-spacing: 1px;
}
.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav a.is-here { color: var(--accent); border-bottom-color: var(--accent); }
/* 2026-10-05 手機:12 個入口擠一排會被壓成一字一行、整頁還能左右滑(實測 390 寬撐到 648)。
   改成「導覽列自己」左右滑:按鈕不縮、不換行,頁面本身不再橫向捲動;
   右緣淡出提示「還有」,目前這頁由 base.html 自動捲到中間。 */
@media (max-width: 780px) {
  .nav {
    position: relative; justify-content: flex-start; flex-wrap: nowrap; gap: 2px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    padding: 6px 4px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 auto; white-space: nowrap; padding: 10px 10px; font-size: 15px; letter-spacing: 0; }
  .nav .update-wrap { flex: 0 0 auto; margin: 0 24px 0 6px; }
  #update-btn { padding: 6px 12px; letter-spacing: 1px; font-size: 13px; }
  .update-wrap .progress-track { width: 80px; }
}
#update-btn {
  background: var(--paper);
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 7px 18px;
  font-family: "Cinzel", inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  cursor: pointer;
  transform: rotate(-1.5deg);
  box-shadow: 2px 2px 0 var(--accent);
  transition: all 0.12s;
}
#update-btn:hover {
  background: var(--accent);
  color: var(--paper);
  transform: rotate(-1.5deg) translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(139, 0, 0, 0.5);
}
#update-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0%, 100% { background: var(--paper); }
  50% { background: var(--paper-dark); }
}

/* Progress under the update button */
.update-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.progress-track {
  width: 120px;
  height: 2px;
  background: rgba(139, 0, 0, 0.12);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 10px,
    var(--accent-soft) 10px 20px
  );
  transition: width 0.4s ease;
  animation: slide 1s linear infinite;
}
.progress-bar.err { background: #666; animation: none; }
@keyframes slide {
  from { background-position: 0 0; }
  to   { background-position: 20px 0; }
}
.progress-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 2px;
  height: 12px;
  min-width: 60px;
  text-align: center;
}

main { max-width: var(--paper-max-width, 1180px); margin: 0 auto; padding: 28px 32px 48px; }

/* ===== Headline ===== */
.headline {
  text-align: center;
  padding-top: 12px;
}
.headline h2 {
  font-family: "Playfair Display", "Noto Serif TC", serif;
  font-size: clamp(28px, 4.5vw, 46px);
  font-weight: 900;
  line-height: 1.2;
  border-top: 3px solid var(--rule);
  border-bottom: 3px solid var(--rule);
  padding: 20px 12px;
  margin: 0;
  position: relative;
}
.headline h2::before,
.headline h2::after {
  content: "✦";
  color: var(--accent);
  margin: 0 16px;
  font-size: 0.7em;
  vertical-align: middle;
}
.headline .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  letter-spacing: 1px;
}

/* ===== Digest ===== */
.digest {
  margin: 32px auto 36px;
  max-width: 1080px;
  padding: 20px 28px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.4);
  position: relative;
}
.digest::before {
  content: "本日社論";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--paper);
  padding: 0 10px;
  font-weight: 800;
  letter-spacing: 4px;
  font-size: 13px;
  color: var(--accent);
}
.digest .markdown {
  font-family: inherit;
  background: transparent;
  margin: 0;
  font-size: 15px;
  line-height: 1.8;
}
.digest h3 {
  font-family: "Playfair Display", "Noto Serif TC", serif;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 18px 0 8px;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 4px;
}
.digest h3:first-child { margin-top: 0; }
/* ⭐ 2026-08-20:社論裡重述一次今日大標題,再接約 200 字內文。
   跟模型輸出的 h3(## 精選)區隔開 —— 這行是題目,不是分節標題。 */
.digest .digest-topic {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0 0 10px;
  font-size: 21px;
  letter-spacing: 1px;
  line-height: 1.4;
  color: var(--ink);
}
.digest h4 {
  margin: 14px 0 6px;
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 1px;
}
.digest ul {
  padding-left: 22px;
  margin: 6px 0 12px;
}
.digest li {
  margin: 4px 0;
  list-style-type: "✦  ";
}
.digest strong { color: var(--accent); }
.commentary strong { color: var(--accent); font-weight: 700; }
.commentary { line-height: 1.75; white-space: pre-line; }
.digest .markdown { white-space: pre-line; }

/* ===== Items / Columns ===== */
.items-title {
  text-align: center;
  font-family: "Cinzel", serif;
  letter-spacing: 6px;
  font-size: 16px;
  margin: 40px 0 20px;
  color: var(--accent);
  position: relative;
}
.items-title::before,
.items-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--rule);
}
.items-title::before { left: 8%; }
.items-title::after { right: 8%; }

/* ⭐ 2026-09-30 改成格子(原本是 CSS 多欄,由上往下流)。
   為了「重要性用大小表現」:大卡要橫跨兩格,多欄排版做不到;
   dense 讓小卡自動補進大卡旁邊的空位。 */
.columns {
  display: grid;
  grid-template-columns: repeat(var(--layout-columns, 3), minmax(0, 1fr));
  column-gap: var(--col-gap, 36px);
  grid-auto-flow: row dense;
  align-items: start;
}
.columns > .item--big { grid-column: span 2; }
/* masonry.js 接手後:列高切 4px 細格、每張卡自己決定佔幾格 → 不再有「一列等最高那張」的空白 */
.columns.masonry { grid-auto-rows: 4px; row-gap: 0; align-items: start; }
@media (max-width: 780px) {
  /* 2026-10-10:1fr 會被最寬的內容撐開(長網址/不換行標籤)→ 整頁比手機寬、要左右滑。一律 minmax(0,1fr) */
  .columns { grid-template-columns: minmax(0, 1fr); }
  .columns > .item { min-width: 0; overflow-wrap: anywhere; }
  .columns > .item--big { grid-column: auto; }
}

/* ===== Category groups (F4) ===== */
.cat-group {
  margin: 30px 0;
  padding-top: 12px;
  border-top: 2px solid var(--group-color, var(--rule));
}
.cat-heading {
  font-family: "Cinzel", "Playfair Display", serif;
  letter-spacing: 6px;
  font-size: 18px;
  color: var(--group-color, var(--accent));
  text-transform: uppercase;
  text-align: center;
  margin: 6px 0 18px;
  position: relative;
}
.cat-heading span {
  background: var(--paper);
  padding: 0 16px;
  position: relative;
  z-index: 1;
}
.cat-heading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--group-color, var(--rule));
  opacity: 0.6;
  z-index: 0;
}
.cat-heading .cat-count {
  font-family: "Cinzel", monospace;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
  background: var(--paper);
  position: relative;
  z-index: 1;
  padding: 0 6px;
}
.cat-group .item h3 { font-size: var(--item-title-size, 19px); }
.cat-group .item { padding: var(--item-padding, 14px) 0; }

body.is-preview { pointer-events: auto; }
body.is-preview main { padding: 16px 24px 40px; }
.paper.preview-mode .headline h2 { font-size: 30px; padding: 14px 8px; }

.item {
  break-inside: avoid;
  border-bottom: 1px dashed var(--rule);
  padding: 14px 0 var(--item-gap, 16px);
  display: block;
}
.item:last-child { border-bottom: none; }
.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.score {
  background: var(--score-low, var(--ink));
  color: var(--paper);
  padding: 2px 8px;
  font-weight: 900;
  font-family: "Cinzel", monospace;
  font-size: 12px;
  letter-spacing: 0;
}
.score.mid  { background: var(--score-mid,  #2e5d7a); }
.score.high { background: var(--score-high, var(--accent)); }
/* ⭐ 2026-08-20 分數色階(使用者第二版,10 色對 10 級;第一版他誤丟 16 色作廢)。
   1 白(最不重要)→ 綠 → 藍 → 紫 → 橘 → 10 深紅(最重要)。
   淺底那幾級要換深色字,1 分再補一道內陰影當邊框,否則白字白底會整個消失。 */
.score.s10 { background: #990000; color: #fff; }
.score.s9  { background: #FF3D00; color: #fff; }
.score.s8  { background: #FF6F00; color: #2b1600; }
.score.s7  { background: #AB47BC; color: #fff; }
.score.s6  { background: #8A2BE2; color: #fff; }
.score.s5  { background: #2196F3; color: #fff; }
.score.s4  { background: #4DB6AC; color: #0d2b28; }
.score.s3  { background: #7CB342; color: #12240a; }
.score.s2  { background: #C5E1A5; color: #24330f; }
.score.s1  { background: #FFFFFF; color: #333; box-shadow: inset 0 0 0 1px var(--rule, #c9b896); }
/* 舊的手繪 icon 樣式留著:別的頁面若還引用不會破版(報紙版已不再輸出 img) */
.score-icon {
  width: 26px;
  height: 26px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
}
.source {
  font-weight: var(--source-weight, 700);
  font-size: var(--source-size, 11px);
  color: var(--source-color, var(--ink-soft));
}
.cat {
  border: 1px solid var(--muted);
  padding: 1px 6px;
  font-size: 10px;
}
.item h3 {
  margin: 6px 0;
  font-size: 19px;
  font-family: "Playfair Display", "Noto Serif TC", serif;
  line-height: 1.3;
}
.item-thumb {
  display: block;
  margin: 4px 0 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-dark);
  filter: sepia(0.15) contrast(1.02);
}
.item-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.item-thumb:hover img { transform: scale(1.03); }
.item a {
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat left bottom;
  background-size: 0 2px;
  transition: background-size 0.2s, color 0.2s;
}
.item a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}
.commentary {
  font-size: var(--commentary-size, 14px);
  font-weight: var(--commentary-weight, 400);
  color: var(--commentary-color, var(--ink));
  white-space: pre-wrap;
  margin-top: 6px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}
.commentary strong { color: var(--accent); }
.raw {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

/* ===== Welcome ===== */
.welcome {
  text-align: center;
  padding: 56px 20px;
  max-width: 640px;
  margin: 0 auto;
}
.welcome h2 {
  font-family: "Playfair Display", serif;
  font-size: 42px;
  margin-bottom: 12px;
}
.welcome ul {
  list-style: none;
  padding: 0;
  text-align: left;
  max-width: 560px;
  margin: 24px auto;
}
.welcome li {
  border-bottom: 1px dashed var(--rule);
  padding: 6px 0;
}
.welcome li::before { content: "✦ "; color: var(--accent); }

/* ===== History ===== */
.history-toolbar {
  max-width: 860px;
  margin: 0 auto 16px;
  text-align: right;
}
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 14px;
  font-family: "Cinzel", inherit;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--accent); color: var(--paper); }

.history-list {
  list-style: none;
  padding: 0;
  max-width: 860px;
  margin: 0 auto;
}
.history-list li {
  display: grid;
  grid-template-columns: 140px 1fr auto 28px;
  gap: 18px;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  font-variant-numeric: tabular-nums;
}
.history-list li.empty { opacity: 0.55; }
.history-list .edate {
  font-family: "Cinzel", monospace;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 1px;
}
.history-list .ehead { font-weight: 600; }
.history-list .ecount {
  color: var(--muted);
  font-size: 13px;
  min-width: 60px;
  text-align: right;
}
.history-list a { color: var(--ink); text-decoration: none; }
.history-list a:hover { color: var(--accent); }
.row-del { margin: 0; }
.icon-btn {
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  border-radius: 2px;
  padding: 0;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.live-tag {
  background: var(--accent);
  color: var(--paper);
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 1px;
  margin-left: 8px;
  animation: mn-live-blink 1.3s ease-in-out infinite;
}
@keyframes mn-live-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.empty-day {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-day h2 { font-family: "Playfair Display", serif; }

/* item topics */
.topics { margin-top: 6px; }
.topics .tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 7px;
  margin-right: 4px;
  margin-top: 2px;
  border: 1px solid var(--muted);
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: lowercase;
}

/* ===== Sources ===== */
/* --- 來源健康控制台(2026-08-28)---
   格子 = 那天進了幾則。做成方塊而不是折線,因為要看的是「有沒有掉到零」,
   不是「數字高低」—— 空白格子一眼就跳出來,折線的低點要盯著看才發現。

   ⚠ 2026-08-28 改過一次對比度(使用者留言:「看不清楚,顏色太亮與文字接近」)。
   第一版用了 #fff6f6 白底 + #a00 淡紅字 + opacity —— 那是照「白底網頁」的直覺配的,
   但這份報紙的底色是米黃(--paper: #f4ecd8)。**比紙更白的底 = 整塊發亮**,
   上面再放半透明的字就整片糊掉。
   通則:這個專案的警示色要**比紙深**,不能比紙亮;而且不要用 opacity 調層次,
   要用實色 —— opacity 是疊在背景上的,背景一換就失控。 */
.health-alert {
  border-left: 6px solid var(--accent, #8b0000);
  border-top: 1px solid var(--rule, #1a1a1a);
  border-bottom: 1px solid var(--rule, #1a1a1a);
  background: var(--paper-dark, #e8dfc2);
  color: var(--ink, #1a1a1a);
  padding: 10px 14px; margin: 12px 0; font-size: 14.5px;
}
.health-alert b { color: var(--accent, #8b0000); }
.health-ok {
  border-left: 6px solid var(--rule, #1a1a1a);
  background: var(--paper-dark, #e8dfc2);
  color: var(--ink, #1a1a1a);
  padding: 8px 14px; margin: 12px 0; font-size: 13.5px;
}
.health-legend {
  font-size: 13px; color: var(--ink-soft, #2b2b2b);
  line-height: 1.75; margin: 6px 0 14px;
}
/* 報警列:靠「左邊那條粗紅槓 + 比紙深一階的底」認,不靠淺色底。 */
.sources-table tr.row-alert td { background: var(--paper-dark, #e8dfc2); }
.sources-table tr.row-alert td:first-child {
  box-shadow: inset 5px 0 0 var(--accent, #8b0000);
}
.sources-table tr.row-alert .source-name {
  color: var(--accent, #8b0000); font-weight: 800;
}
.spark-cell { white-space: nowrap; }
.spark { display: inline-flex; gap: 2px; vertical-align: middle; }
.spark i {
  display: block; width: 9px; height: 17px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,.25);
}
/* 0 則那格刻意留空 + 虛線框:空白比任何顏色都好認。 */
.spark i.lv0 { background: transparent; border-style: dotted; }
.spark i.lv1 { background: #b9cfa6; }
.spark i.lv2 { background: #7fa863; }
.spark i.lv3 { background: #4c7a36; }
.spark i.lv4 { background: #2c4f1e; }
.spark-total {
  font-size: 12px; color: var(--ink-soft, #2b2b2b); margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
.diag-cell {
  max-width: 340px; font-size: 12.5px; line-height: 1.65;
  color: var(--ink, #1a1a1a);
}
.diag-death { color: var(--accent, #8b0000); display: block; font-size: 13px; }
.diag-hint { display: block; color: var(--ink, #1a1a1a); }
.diag-url {
  display: block; color: var(--ink-soft, #2b2b2b); word-break: break-all;
  font-size: 11.5px; font-family: ui-monospace, Consolas, monospace;
}
/* 「已退役」= 我把它關掉了,不是它壞了。用中性色 + 明講,不要只給 tooltip。 */
.diag-retired { color: var(--ink-soft, #2b2b2b); display: block; }
.diag-retired b { color: var(--ink, #1a1a1a); }
.diag-revive {
  display: block; color: var(--accent, #8b0000); font-weight: 700;
}
.pool-cell { white-space: nowrap; }
.pool-chip {
  display: inline-block; font-size: 11.5px; padding: 2px 7px; margin: 1px;
  border: 1px solid var(--ink-soft, #2b2b2b); border-radius: 10px;
  color: var(--ink-soft, #2b2b2b); cursor: pointer; user-select: none;
}
.pool-chip.on {
  background: var(--accent, #8b0000); border-color: var(--accent, #8b0000);
  color: var(--paper, #f4ecd8); font-weight: 700;
}
.pool-chip input { margin-right: 3px; vertical-align: -1px; }
/* 名稱後面那個外連箭頭。原本 opacity .4 —— 使用者說看不清楚,改實色。 */
.src-link { text-decoration: none; color: var(--accent, #8b0000); margin-left: 5px; }

.sources-page { max-width: 1200px; margin: 0 auto; }
.sources-page h2 {
  font-family: "Playfair Display", serif;
  text-align: center;
  letter-spacing: 2px;
}
.sources-actions {
  text-align: center;
  margin: 24px 0;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 10px 20px;
  font-family: "Cinzel", inherit;
  letter-spacing: 2px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: var(--accent); }
.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: auto;
}
.sources-table th, .sources-table td {
  border-bottom: 1px solid var(--rule);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;  /* 所有 cell 強制單行,避免狀態/啟用按鈕被擠到下一行 */
}
.sources-table th { background: var(--paper-dark); letter-spacing: 2px; font-size: 12px; }
.sources-table .type-generated { color: var(--accent); font-weight: 700; }
.sources-table .source-name {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
  white-space: nowrap;
}
/* URL cell:過長截斷而非換行,避免整列被撐爆 */
.sources-table td a {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.toggle-form { display: inline; }
.toggle-btn {
  background: transparent;
  border: 1px solid var(--ink);
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}
.toggle-btn.enabled { background: var(--ink); color: var(--paper); }
.toggle-btn:hover { background: var(--accent); color: var(--paper); border-color: var(--accent); }

/* checkbox 樣式的啟用開關(批次儲存模式) */
.toggle-check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.toggle-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-check .toggle-check-label {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid var(--ink);
  font-size: 12px;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  transition: all 0.15s;
}
.toggle-check.is-on .toggle-check-label {
  background: #2e5d7a;       /* 啟用 → 藍底白字(沿用報紙 score-mid 藍) */
  color: var(--paper);
  border-color: #2e5d7a;
}
.toggle-check:hover .toggle-check-label {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
/* 已啟用狀態 hover:保留藍色基底,稍亮表示「再點會關閉」 */
.toggle-check.is-on:hover .toggle-check-label {
  background: #3d7aa0;
  border-color: #3d7aa0;
}

/* 失效來源標記(只剩 emoji,hover 看原因) */
.source-broken {
  display: inline-block;
  font-size: 16px;
  cursor: help;
  white-space: nowrap;
}

/* 底部儲存列 */
.sources-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 14px 8px;
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}
.sources-dirty-hint {
  margin-right: auto;
  color: var(--accent);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 1px;
}
.sources-save-bar .btn-primary[disabled],
.sources-save-bar .btn-secondary[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.btn-secondary:hover:not([disabled]) {
  background: var(--ink);
  color: var(--paper);
}

/* ===== Add Source ===== */
.add-source-form {
  max-width: 640px;
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.4);
}
.add-source-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 1px;
}
.add-source-form input[type="text"],
.add-source-form input[type="url"],
.add-source-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: inherit;
  font-size: 15px;
  margin-bottom: 16px;
}
.add-source-form textarea { min-height: 240px; font-family: "Consolas", monospace; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin-top: -10px; margin-bottom: 16px; }
.code-preview {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  font-family: "Consolas", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-x: auto;
  border-radius: 2px;
  margin: 10px 0;
  max-height: 360px;
  overflow-y: auto;
}
.flash {
  padding: 10px 16px;
  margin: 12px 0;
  border: 1px solid;
}
.flash.ok { border-color: #2e7d32; color: #2e7d32; background: #e8f5e9; }
.flash.err { border-color: var(--accent); color: var(--accent); background: #fff2f0; }

/* ===== Footer ===== */
footer {
  border-top: 3px double var(--rule);
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2px;
  margin-top: 48px;
}

/* ===== Overlay / loading ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(244, 236, 216, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  text-align: center;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spell {
  font-family: "Playfair Display", serif;
  font-size: 34px;
  color: var(--accent);
  letter-spacing: 4px;
  animation: float 2s ease-in-out infinite;
}
.loading-overlay .hint {
  margin-top: 16px;
  max-width: 420px;
}
@keyframes float {
  0%, 100% { transform: translateY(0); opacity: 0.95; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.muted { color: var(--muted); }

/* ===== Settings ===== */
.settings-page { max-width: 860px; margin: 0 auto; }
.settings-form fieldset {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.4);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.settings-form legend {
  padding: 0 12px;
  font-family: "Cinzel", serif;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 3px;
}
.settings-form label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 13px;
}
.settings-form label.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
}
.settings-form select,
.settings-form input[type="text"],
.settings-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: inherit;
  font-size: 14px;
}
.settings-form input[type="color"] {
  width: 64px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: pointer;
}
.color-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.color-row > div { flex: 0 0 auto; }
.settings-form h4 {
  margin: 24px 0 8px;
  letter-spacing: 2px;
  font-family: "Cinzel", serif;
  color: var(--ink-soft);
}
.reco-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}
.reco-table th, .reco-table td {
  border-bottom: 1px dashed var(--rule);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.reco-table th {
  background: var(--paper-dark);
  letter-spacing: 2px;
  font-size: 11px;
}
.reco-table code {
  font-family: "Consolas", monospace;
  font-size: 12px;
}
.copy-cmd {
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 8px;
  display: inline-block;
  user-select: all;
}
.copy-cmd:hover { background: var(--accent); }
.settings-actions {
  text-align: center;
  margin: 32px 0 48px;
}

/* ===== GM Debug ===== */
.gm-page { max-width: 1100px; margin: 0 auto; }
.gm-page h2 {
  font-family: "Playfair Display", serif;
  letter-spacing: 2px;
  text-align: center;
}
.gm-picker {
  text-align: center;
  margin: 16px 0 8px;
}
.gm-picker select {
  padding: 6px 12px;
  font-family: inherit;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-size: 14px;
}
.gm-stats {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.gm-reset-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px dashed var(--accent);
  background: rgba(139, 0, 0, 0.04);
}

.gm-bg-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.45);
  margin: 0 auto 14px;
  max-width: 720px;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.gm-bg-banner.idle {
  border-color: var(--muted);
  opacity: 0.75;
}
.gm-bg-banner.working {
  border-color: var(--accent);
  background: rgba(139, 0, 0, 0.05);
}
.gm-bg-banner .bg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.gm-bg-banner .bg-dot.active {
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.gm-bg-banner .bg-msg { flex: 1; }
.gm-commentary.empty {
  color: var(--muted);
  font-style: italic;
  border-left-color: var(--muted);
  opacity: 0.7;
}
.gm-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.gm-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.35);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.gm-row.is-dup {
  opacity: 0.55;
  background: repeating-linear-gradient(
    45deg,
    rgba(139, 0, 0, 0.04) 0 8px,
    transparent 8px 16px
  );
}
.gm-img {
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gm-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gm-img .muted { font-size: 12px; letter-spacing: 1px; }
.gm-body { min-width: 0; }
.gm-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gm-head .gm-id {
  font-family: "Cinzel", monospace;
  background: var(--ink);
  color: var(--paper);
  padding: 1px 6px;
}
.gm-head .gm-score b { color: var(--accent); }
.gm-head .gm-cat {
  border: 1px solid var(--muted);
  padding: 1px 6px;
}
.gm-head .gm-src { font-weight: 700; color: var(--ink-soft); }
.gm-head .gm-dup-tag {
  background: var(--accent);
  color: var(--paper);
  padding: 1px 6px;
  font-weight: 800;
}
.gm-head .gm-time {
  margin-left: auto;
  font-family: "Cinzel", monospace;
  font-size: 10px;
}
.gm-body h4 {
  font-family: "Playfair Display", "Noto Serif TC", serif;
  margin: 4px 0 4px;
  font-size: 18px;
}
.gm-body h4 a { color: var(--ink); text-decoration: none; }
.gm-body h4 a:hover { color: var(--accent); }
.gm-url {
  font-size: 11px;
  margin-bottom: 6px;
  word-break: break-all;
}
.gm-url a { color: var(--muted); text-decoration: none; }
.gm-url a:hover { color: var(--accent); }
.gm-raw {
  margin: 6px 0;
  font-size: 12px;
}
.gm-raw summary {
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 1px;
  font-size: 11px;
}
.gm-raw pre {
  background: rgba(0, 0, 0, 0.04);
  border-left: 2px solid var(--muted);
  padding: 8px 10px;
  font-family: "Consolas", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  margin: 6px 0;
  max-height: 180px;
  overflow: auto;
}
.gm-commentary {
  font-size: 13px;
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin: 6px 0;
  white-space: pre-line;
}
.gm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--muted);
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost.danger { color: #8b0000; }
.btn-ghost.danger:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.btn-ghost:disabled {
  opacity: 0.5;
  cursor: wait;
}
.gm-status {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}
.gm-status.working { color: var(--accent); animation: pulse 1.6s infinite; }
.gm-status.ok { color: #2e7d32; }
.gm-status.err { color: var(--accent); }
@media (max-width: 760px) {
  .gm-row { grid-template-columns: 1fr; }
  .gm-img { max-width: 240px; }
}

/* ===== Layout editor ===== */
.layout-page {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 8px;
}
.layout-form h2 {
  font-family: "Playfair Display", serif;
  letter-spacing: 2px;
  margin: 0 0 8px;
}
.layout-form fieldset {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.4);
  padding: 14px 18px;
  margin-bottom: 18px;
}
.layout-form legend {
  padding: 0 10px;
  font-family: "Cinzel", serif;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 3px;
  font-size: 13px;
}
.layout-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink);
}
.theme-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.theme-presets button { font-size: 13px; padding: 6px 12px; }
.layout-form .color-row { margin-bottom: 10px; }
.layout-form label.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
}
.layout-form select,
.layout-form input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);            /* 修:深色主題下輸入框曾黑底黑字看不見 */
  font-family: inherit;
  font-size: 14px;
  margin-top: 4px;
}
.layout-form select option { color: #1a1a1a; background: #ffffff; }
/* 版面存檔槽 */
.slot-editor { list-style: none; padding: 0; margin: 8px 0 0; }
.slot-editor li {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.slot-editor li.filled { border-left: 3px solid var(--accent); }
.layout-form input.slot-name {
  flex: 1 1 90px;
  min-width: 0;
  width: auto;
  margin-top: 0;
}
.slot-editor .slot-meta { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.slot-editor button { font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.slot-editor button:disabled { opacity: 0.4; cursor: not-allowed; }
.cat-editor {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.cat-editor li {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--rule);
}
.cat-editor li:last-child { border-bottom: none; }
.cat-editor .move-up,
.cat-editor .move-down {
  background: transparent;
  border: 1px solid var(--muted);
  cursor: pointer;
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.cat-editor .move-up:hover,
.cat-editor .move-down:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.cat-editor input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rule);
  cursor: pointer;
}
.cat-editor input.cat-label {
  flex: 0 0 110px;
  padding: 4px 6px;
  background: var(--paper);
  border: 1px solid var(--rule);
  font-family: inherit;
  font-size: 13px;
}
.cat-editor .cat-key {
  flex: 1;
  font-family: "Consolas", monospace;
  font-size: 11px;
}
.cat-editor .check-inline {
  font-size: 11px;
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
}
.layout-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  flex-wrap: wrap;
}
.layout-actions > .save-indicator {
  margin-right: auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Cinzel", monospace;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
  border: 1px dashed var(--muted);
  border-radius: 3px;
}
.save-indicator.saving { color: var(--accent); border-color: var(--accent); }
.save-indicator.ok { color: #2e7d32; border-color: #2e7d32; }
.save-indicator.err { color: var(--accent); border-color: var(--accent); }

/* v6.3.1 — uniform button sizing within layout action row */
.layout-actions > .btn-primary,
.layout-actions > .btn-secondary,
.layout-actions form > .btn-ghost,
.layout-actions > a {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}
.layout-actions form { display: inline-flex; }
.layout-preview {
  position: sticky;
  top: 12px;
  height: calc(100vh - 30px);
}
#preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  border: 1px dashed var(--rule);
}
@media (max-width: 960px) {
  .layout-page { grid-template-columns: 1fr; }
  .layout-preview { position: static; height: 60vh; }
}

/* ===== Trends ===== */
.trends-page { max-width: 900px; margin: 0 auto; }
.trends-page .sub-title {
  font-family: "Cinzel", serif;
  letter-spacing: 4px;
  color: var(--accent);
  margin: 36px 0 12px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}
.persistent-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.persistent-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  background: rgba(139, 0, 0, 0.06);
}
.persistent-list .days {
  font-family: "Cinzel", monospace;
  color: var(--muted);
  font-size: 12px;
}
.topic-cloud {
  line-height: 2.4;
  padding: 20px 12px;
  text-align: center;
}
.cloud-tag {
  display: inline-block;
  margin: 4px 8px;
  color: var(--ink-soft);
  font-weight: 700;
  font-family: "Playfair Display", "Noto Serif TC", serif;
}
.cloud-tag sub {
  color: var(--accent);
  font-size: 60%;
  margin-left: 2px;
}
.tag.big {
  border: none;
  background: var(--accent);
  color: var(--paper);
  padding: 3px 10px;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: none;
}

/* ===== Auto-update Banner ===== */
.auto-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  color: var(--paper);
  padding: 16px 32px;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
  z-index: 1000;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auto-update-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.auto-update-text {
  font-size: 14px;
  letter-spacing: 1px;
  font-family: "Noto Serif TC", serif;
  flex: 1;
  text-align: center;
}

#auto-update-countdown {
  font-weight: 900;
  font-size: 18px;
  font-family: "Cinzel", monospace;
  display: inline-block;
  min-width: 24px;
  text-align: center;
}

.cancel-auto-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  font-family: "Noto Serif TC", serif;
}

.cancel-auto-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.cancel-auto-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== Commentary Loading Animation ===== */
.commentary-pending {
  color: #999;
  font-style: italic;
  font-size: 0.9em;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.writing-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* New item flash animation when commentary appears */
@keyframes item-flash {
  0% {
    background: transparent;
    box-shadow: none;
  }
  15% {
    background: rgba(255, 240, 100, 0.4);
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
  }
  30% {
    background: rgba(255, 240, 100, 0.2);
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.3);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.item-newly-revealed {
  animation: item-flash 1.5s ease-out;
}

/* ===== Magic Page Reveal Overlay ===== */
.magic-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%,
    rgba(255, 215, 60, 0.92) 0%,
    rgba(190, 80, 0, 0.88) 28%,
    rgba(100, 0, 0, 0.92) 55%,
    rgba(0, 0, 0, 0.97) 100%);
  animation: magic-overlay-life 2.2s ease-out forwards;
}

@keyframes magic-overlay-life {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  65%  { opacity: 1; }
  100% { opacity: 0; }
}

.magic-reveal-core {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.magic-reveal-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 220, 80, 0.8);
  transform: translate(-50%, -50%);
  animation: magic-ring 2.2s ease-out forwards;
  box-shadow: 0 0 40px rgba(255, 180, 0, 0.5), inset 0 0 40px rgba(255, 180, 0, 0.2);
}

@keyframes magic-ring {
  0%   { width: 0; height: 0; opacity: 1; }
  50%  { width: 70vmin; height: 70vmin; opacity: 0.6; }
  100% { width: 130vmin; height: 130vmin; opacity: 0; }
}

.magic-reveal-text {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: magic-text-life 2.2s ease-out forwards;
}

@keyframes magic-text-life {
  0%   { opacity: 0; transform: scale(0.6) translateY(16px); }
  18%  { opacity: 1; transform: scale(1.06) translateY(0); }
  65%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(0.97); }
}

.magic-reveal-title {
  font-family: "Cinzel", serif;
  font-size: clamp(22px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: 5px;
  color: rgba(255, 235, 120, 1);
  text-shadow:
    0 0 15px rgba(255, 200, 0, 1),
    0 0 35px rgba(255, 140, 0, 0.8),
    0 0 70px rgba(200, 60, 0, 0.5);
}

.magic-reveal-sub {
  font-family: "Noto Serif TC", serif;
  font-size: clamp(13px, 2.5vw, 18px);
  letter-spacing: 3px;
  color: rgba(255, 215, 140, 0.9);
  text-shadow: 0 0 12px rgba(255, 160, 0, 0.7);
}

/* ===== View Toggle ===== */
.view-toggle {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.view-toggle .toggle-btn {
  padding: 8px 16px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  font-family: "Noto Serif TC", serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.view-toggle .toggle-btn:hover {
  background: var(--paper-dark);
}

.view-toggle .toggle-btn.active {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  font-weight: 600;
}

/* ===== Source Group View ===== */
.source-group {
  margin-bottom: 36px;
  page-break-inside: avoid;
}

.source-heading {
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin: 24px 0 16px;
  padding: 0;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.source-count {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.source-editorial {
  background: var(--paper-dark);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  margin: 12px 0 18px 0;
  font-size: var(--source-editorial-size, 14px);
  line-height: 1.6;
  color: var(--ink-soft);
  font-style: italic;
}

.source-editorial p { margin: 8px 0; }
.source-editorial p:first-child { margin-top: 0; }
.source-editorial p:last-child { margin-bottom: 0; }

/* ===== 標題① masthead 天氣方塊 ===== */
.masthead { position: relative; }
.masthead-top .issue-no { font-weight: 700; color: var(--ink); }

/* === Prompts editor & tester (v6.0) === */
.prompts-page { max-width: 1400px; margin: 0 auto; padding: 0 20px 60px; }
.prompts-page h2 { font-family: 'Playfair Display', serif; font-size: 32px; text-align: center;
  letter-spacing: 8px; margin: 24px 0; border-bottom: 2px double var(--ink); padding-bottom: 12px; }

.prompts-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--ink); padding-bottom: 0; }
.prompts-tab { display: inline-block; padding: 8px 16px; text-decoration: none;
  color: var(--ink); border: 1px solid var(--ink); border-bottom: none;
  background: transparent; font-size: 14px; transform: translateY(1px); }
.prompts-tab:hover { background: rgba(0,0,0,0.05); }
.prompts-tab.is-active { background: var(--ink); color: var(--paper); font-weight: 700; }

.prompts-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .prompts-layout { grid-template-columns: 1fr; } }

.prompts-editor, .prompts-tester { border: 1px solid var(--ink); padding: 14px; background: var(--paper); }

.prompts-hd { display: flex; justify-content: space-between; align-items: center;
  font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
  margin-bottom: 10px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }

.prompts-file { font-family: 'Courier New', monospace; font-size: 13px; color: var(--muted); font-weight: normal; }
.prompts-saved { color: #2e7d3a; font-size: 13px; font-weight: 700; }

#prompt-text { width: 100%; min-height: 320px; font-family: 'Courier New', monospace;
  font-size: 13px; padding: 10px; border: 1px solid var(--ink); background: #ffffff;
  color: #1a1a1a; resize: vertical; line-height: 1.5;
  caret-color: #1a1a1a; -webkit-text-fill-color: #1a1a1a; }
#prompt-text::placeholder { color: #8a8a8a; }

.prompts-vars { margin: 8px 0; font-size: 12px; color: var(--muted); }
.prompts-vars code { background: #ede8d8; padding: 2px 6px; margin-right: 4px;
  font-family: 'Courier New', monospace; font-size: 12px; border-radius: 2px; }

.prompts-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

.prompts-samples { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.prompts-sample { display: block; padding: 10px 12px; border: 1px solid var(--ink);
  background: #fdfcf6; cursor: pointer; transition: background 0.15s; }
.prompts-sample:hover { background: #f5f0e0; }
.prompts-sample.is-selected { background: #ede8d8; border-width: 2px; padding: 9px 11px; }
.prompts-sample input[type="radio"] { display: none; }
.prompts-sample-label { font-weight: 700; font-size: 13px; color: #8a2f1d; margin-bottom: 4px; }
.prompts-sample-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: #1a1a1a; }
.prompts-sample-meta { font-size: 11px; color: #555555; margin-bottom: 4px; }
.prompts-sample-meta .badge-cat,
.prompts-sample-meta .badge-src,
.prompts-sample-meta .badge-score { display: inline-block; padding: 1px 6px;
  background: rgba(0,0,0,0.05); margin-right: 4px; border-radius: 2px; }
.prompts-sample-summary { font-size: 12px; color: #444444; line-height: 1.4; }

.prompts-run-btn { width: 100%; margin-bottom: 14px; padding: 12px; font-size: 15px; }

.prompts-result-wrap { margin-top: 8px; }
.prompts-stats { font-family: 'Courier New', monospace; font-size: 12px; color: #555555; font-weight: normal; }
.prompts-result { padding: 12px; background: #ffffff; border: 1px solid var(--ink);
  white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New', monospace;
  font-size: 13px; line-height: 1.5; max-height: 400px; overflow-y: auto;
  color: #1a1a1a; -webkit-text-fill-color: #1a1a1a; }

.prompts-rendered { margin-top: 10px; font-size: 12px; }
.prompts-rendered summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.prompts-rendered pre { padding: 10px; background: #f5f0e0; border: 1px dashed var(--muted);
  font-family: 'Courier New', monospace; font-size: 11px; white-space: pre-wrap;
  max-height: 300px; overflow-y: auto; }

/* === Blog pick page (v6.0) === */
.blogpick-page { max-width: 1400px; margin: 0 auto; padding: 0 20px 60px; }
.blogpick-page h2 { font-family: 'Playfair Display', serif; font-size: 32px; text-align: center;
  letter-spacing: 8px; margin: 24px 0 8px; border-bottom: 2px double var(--ink); padding-bottom: 12px; }

.blogpick-controls { display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; margin: 16px 0 18px; padding: 12px; border: 1px solid var(--ink);
  background: rgba(0,0,0,0.02); }
.blogpick-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.blogpick-filter label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.blogpick-filter input { width: 60px; padding: 4px 6px; border: 1px solid var(--ink);
  background: var(--paper); font-family: inherit; }
.blogpick-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.blogpick-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .blogpick-layout { grid-template-columns: 1fr; } }

.blogpick-candidates, .blogpick-result-wrap { border: 1px solid var(--ink);
  padding: 14px; background: var(--paper); }

.blogpick-list { list-style: none; padding: 0; margin: 0; max-height: 600px; overflow-y: auto; }
.blogpick-item { position: relative; display: block; padding: 12px 14px 12px 50px;
  border-bottom: 1px dashed var(--rule); transition: background 0.15s; }
.blogpick-item:hover { background: rgba(0,0,0,0.03); }
.blogpick-item.is-picked { background: rgba(139, 0, 0, 0.08);
  border-left: 4px solid var(--accent); padding-left: 46px; }

.blogpick-idx { position: absolute; left: 12px; top: 14px; font-family: 'Cinzel', serif;
  font-weight: 800; font-size: 18px; color: var(--accent); width: 28px; text-align: center; }

.blogpick-meta { font-size: 11px; color: var(--muted); margin-bottom: 4px;
  display: flex; gap: 6px; flex-wrap: wrap; }
.blogpick-meta .badge-cat,
.blogpick-meta .badge-score,
.blogpick-meta .badge-date { display: inline-block; padding: 1px 6px;
  background: rgba(0,0,0,0.05); border-radius: 2px; }

.blogpick-title { display: block; font-weight: 700; font-size: 15px;
  color: var(--ink); text-decoration: none; margin-bottom: 4px; line-height: 1.4; }
.blogpick-title:hover { color: var(--accent); }

.blogpick-summary { font-size: 12px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.blogpick-result { min-height: 200px; padding: 8px 0; }
.blogpick-result pre { padding: 14px; background: #fdfcf6; border: 1px solid var(--ink);
  font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word; color: var(--ink); }

.blogpick-picked { margin-top: 16px; padding: 14px; border: 2px solid var(--accent);
  background: rgba(139, 0, 0, 0.04); }
.blogpick-picked .blogpick-item { padding-left: 50px; border: none; }

/* === Blog write extension (v6.2) === */
.blogpick-write-actions { display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--rule); }

.blogpick-post-wrap { margin-top: 18px; padding: 14px; border: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.5); }

.blogpick-post-text { width: 100%; min-height: 320px; padding: 14px;
  font-family: 'Noto Serif TC', Georgia, serif; font-size: 15px; line-height: 1.75;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  resize: vertical; white-space: pre-wrap; }

.blogpick-post-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.blogpick-post-actions { display: flex; gap: 10px; align-items: center;
  margin-top: 10px; flex-wrap: wrap; }

/* === v6.4: 候選卡片可點 + 中文解讀 + 心得 meta === */
.blogpick-item.is-clickable { cursor: pointer; user-select: none; }
.blogpick-item.is-clickable:hover { background: rgba(139, 0, 0, 0.06); }
.blogpick-item.is-clickable:focus-visible { outline: 2px solid var(--accent);
  outline-offset: -2px; }
/* 標題連結還是要能點開外部頁,鼠標細微區分 */
.blogpick-item.is-clickable .blogpick-title { cursor: pointer; }
.blogpick-item.is-clickable .blogpick-title:hover { text-decoration: underline; }

.blogpick-commentary { font-size: 13px; color: var(--ink); line-height: 1.6;
  margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; }

.blogpick-post-meta { font-size: 12px; color: var(--muted); padding: 6px 0 10px;
  border-bottom: 1px dashed var(--rule); margin-bottom: 10px; }
.blogpick-post-meta a { color: var(--accent); }

/* === v6.4: 社論頁面 === */
.editorial-page { max-width: 1200px; margin: 0 auto; padding: 12px 0; }
.editorial-page h2 { font-family: 'Cinzel', serif; font-weight: 700;
  letter-spacing: 4px; font-size: 28px; margin: 0 0 8px; }

.editorial-controls { display: flex; justify-content: space-between;
  align-items: center; gap: 14px; flex-wrap: wrap; margin: 14px 0; }
.editorial-filter { display: flex; gap: 14px; align-items: center; }
.editorial-filter label { font-size: 13px; color: var(--muted);
  display: inline-flex; gap: 6px; align-items: center; }
.editorial-filter input { width: 64px; padding: 4px 6px;
  border: 1px solid var(--ink); background: var(--paper); }
.editorial-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.editorial-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px;
  margin-top: 14px; }
@media (max-width: 900px) { .editorial-layout { grid-template-columns: 1fr; } }

.editorial-source { border: 1px solid var(--ink); padding: 14px;
  background: var(--paper); align-self: start; position: sticky; top: 10px; }
.editorial-source-stats { font-size: 13px; line-height: 1.8;
  padding: 10px 0; border-bottom: 1px dashed var(--rule); margin-bottom: 8px; }
.editorial-source-stats strong { color: var(--accent); font-size: 15px; }
.editorial-source-detail { margin-top: 8px; font-size: 12px; }
.editorial-source-detail > summary { cursor: pointer; padding: 4px 0;
  font-weight: 600; color: var(--ink); }
.editorial-pre { font-family: 'Courier New', monospace; font-size: 11px;
  line-height: 1.6; padding: 8px; background: #fdfcf6; border: 1px solid var(--rule);
  max-height: 280px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word;
  color: var(--ink); }

.editorial-result-wrap { border: 2px solid var(--accent); padding: 14px;
  background: rgba(255, 255, 255, 0.55); }
.editorial-text { width: 100%; min-height: 540px; padding: 18px;
  font-family: 'Noto Serif TC', Georgia, serif; font-size: 15px; line-height: 1.85;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  resize: vertical; white-space: pre-wrap; }
.editorial-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.editorial-result-actions { display: flex; gap: 10px; align-items: center;
  margin-top: 10px; flex-wrap: wrap; }

/* ========== v7-reader:雲端讀者互動(來源過濾 / 趨勢實驗室 / VIP 情報官) ========== */

/* 讀者工具列 */
.reader-bar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 14px 16px 0; }
.reader-bar button { cursor: pointer; font-family: inherit; font-size: 14px;
  padding: 8px 18px; border: 1px solid var(--rule); background: var(--paper-dark);
  color: var(--ink); border-radius: 2px; transition: background .15s, transform .1s; }
.reader-bar button:hover { transform: translateY(-1px); }
.reader-vip-btn { background: var(--accent) !important; color: #fff !important;
  border-color: var(--accent) !important; letter-spacing: 1px; font-weight: 700; }
.reader-vip-btn:hover { background: var(--accent-soft) !important; }

/* 遮罩 + 卡片 */
.reader-overlay { position: fixed; inset: 0; z-index: 200; display: flex;
  align-items: flex-start; justify-content: center; padding: 6vh 16px;
  background: rgba(0, 0, 0, 0.45); overflow-y: auto; }
.reader-overlay[hidden] { display: none; }
.reader-card { background: var(--paper); color: var(--ink); width: 100%;
  max-width: 540px; border: 2px solid var(--rule); box-shadow: 0 10px 40px rgba(0,0,0,.3);
  padding: 22px 24px; }
.reader-card-head { display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid var(--rule); padding-bottom: 10px; margin-bottom: 12px; }
.reader-card-head h3 { margin: 0; font-size: 20px; }
.reader-close { cursor: pointer; background: none; border: none; font-size: 20px;
  color: var(--muted); line-height: 1; }
.reader-close:hover { color: var(--accent); }
.reader-card-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.reader-card-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.reader-mini-btn { cursor: pointer; font-family: inherit; font-size: 13px;
  padding: 5px 14px; border: 1px solid var(--rule); background: var(--paper-dark);
  color: var(--ink); border-radius: 2px; }
.reader-mini-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 來源勾選清單 */
.reader-source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  max-height: 50vh; overflow-y: auto; }
.reader-source-item { display: flex; align-items: center; gap: 8px; font-size: 14px;
  padding: 4px 2px; cursor: pointer; }
.reader-source-item input { width: 16px; height: 16px; accent-color: var(--accent); }

/* VIP 情報官 */
.reader-vip-card { max-width: 580px; }
.reader-vip-pitch { font-size: 14.5px; line-height: 1.7; margin: 0 0 12px; }
.reader-vip-pitch strong { color: var(--accent); }
.reader-vip-flow { list-style: none; padding: 0; margin: 0 0 14px;
  border-left: 3px solid var(--accent); }
.reader-vip-flow li { padding: 6px 0 6px 14px; font-size: 14px; color: var(--ink-soft); }
.reader-vip-examples { background: var(--paper-dark); padding: 12px 14px;
  border: 1px dashed var(--rule); }
.reader-vip-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.reader-vip-form label { display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.reader-vip-form input, .reader-vip-form textarea { font-family: inherit; font-size: 14px;
  padding: 9px 11px; border: 1px solid var(--rule); background: #fff; color: #1a1a1a;
  font-weight: 500; resize: vertical; }
.reader-vip-form input::placeholder, .reader-vip-form textarea::placeholder {
  color: #6b6b6b; font-weight: 400; opacity: 1; }
.reader-vip-submit { cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700;
  letter-spacing: 1px; padding: 11px; border: none; background: var(--accent); color: #fff; }
.reader-vip-submit:hover { background: var(--accent-soft); }
/* 幕僚情報:閃爍標題 + 淡入淡出跑馬燈 */
.advisory-title { animation: adv-blink 1.3s ease-in-out infinite; color: var(--accent); }
@keyframes adv-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.advisory-carousel { display: grid; margin: 6px 0 16px; }
.adv-slide { grid-area: 1 / 1; opacity: 0; visibility: hidden;
  transition: opacity .9s ease, visibility .9s; pointer-events: none; }
.adv-slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.adv-line { font-size: 14.5px; line-height: 1.75; margin: 0 0 10px; color: var(--ink); }
.adv-line:last-child { margin-bottom: 0; }
.adv-line strong { color: var(--accent); font-weight: 700; }
/* A 彈窗:情報級決策系統 4 步說明 */
.advisory-lead { font-size: 15px; line-height: 1.7; margin: 2px 0 16px; color: var(--ink); }
.advisory-lead strong { color: var(--accent); }
.advisory-steps { list-style: none; counter-reset: adv; padding: 0; margin: 0 0 6px;
  border-left: 3px solid var(--accent); }
.advisory-steps li { counter-increment: adv; position: relative;
  padding: 9px 0 9px 38px; font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.advisory-steps li::before { content: counter(adv); position: absolute; left: 12px; top: 9px;
  width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px;
  font-weight: 700; color: #fff; background: var(--accent); border-radius: 50%; }
.advisory-steps li strong { color: var(--accent); font-weight: 700; }

/* 送出狀態列(送出中 / 失敗) */
.reader-form-msg { font-size: 13px; text-align: center; margin: 4px 0 0; min-height: 16px; }
.reader-form-msg.is-err { color: #b5544c; }
.reader-form-msg.is-pending { color: var(--muted); }
.reader-vip-receipt { text-align: center; padding: 18px 8px; }
.vip-receipt-title { font-size: 18px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.vip-receipt-body { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 16px; }

/* 趨勢實驗室 */
.trend-lab { max-width: 1180px; margin: 28px auto 0; padding: 22px 20px;
  border-top: 5px double var(--rule); }
.trend-lab-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.trend-lab-head h2 { margin: 0; font-size: 24px; }
.trend-lab-tag { font-size: 11px; letter-spacing: 1.5px; font-weight: 700;
  color: #fff; background: var(--accent); padding: 3px 9px; border-radius: 2px; }
.trend-lab-sub { color: var(--muted); font-size: 13px; margin: 8px 0 18px; }
.trend-lab-block { margin-bottom: 18px; }
.trend-lab-block h3 { font-size: 15px; margin: 0 0 10px; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule); padding-bottom: 5px; }
.trend-persistent { list-style: none; padding: 0; margin: 0; display: flex;
  flex-wrap: wrap; gap: 10px; }
.trend-persistent li { display: flex; align-items: center; gap: 6px; }
.trend-persistent .days { font-size: 12px; color: var(--muted); }

/* v8-trendjobs:趨勢實驗室職業觀點切換 */
.trend-jobs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.trend-job-tab { cursor: pointer; font-family: inherit; font-size: 14px;
  padding: 7px 16px; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper-dark); color: var(--ink-soft); transition: all .15s; }
.trend-job-tab:hover { color: var(--ink); border-color: var(--accent); }
.trend-job-tab.is-active { background: var(--accent); color: #fff;
  border-color: var(--accent); font-weight: 700; }
.trend-job-panels { position: relative; }
.trend-job-panel { display: none; animation: trendFade .25s ease; }
.trend-job-panel.is-active { display: block; }
@keyframes trendFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.trend-job-brief { font-size: 16px; line-height: 1.85; color: var(--ink);
  background: var(--paper-dark); border-left: 3px solid var(--accent);
  padding: 16px 20px; border-radius: 0 3px 3px 0; }
.trend-job-brief p { margin: 0 0 .8em; }
.trend-job-brief p:last-child { margin-bottom: 0; }
.trend-job-meta { font-size: 12px; color: var(--muted); margin: 10px 2px 0; text-align: right; }
.trend-data { margin-top: 20px; }
.trend-data > summary { cursor: pointer; font-size: 14px; color: var(--ink-soft);
  font-weight: 700; padding: 6px 0; border-top: 1px solid var(--rule); }
.trend-data > summary:hover { color: var(--accent); }
.trend-data[open] > summary { margin-bottom: 14px; }

@media (max-width: 600px) {
  .reader-source-list { grid-template-columns: 1fr; }
  .trend-jobs { gap: 6px; }
  .trend-job-tab { font-size: 13px; padding: 6px 12px; }
}


/* ============================================================
   v8-dualview — 雙版切換(AI科技 / 今日世界)2026-05-27
   ============================================================ */

/* 版面切換 tab bar */
.edition-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 0 4px;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 18px;
}
.edition-tab {
  background: none;
  border: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  padding: 7px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: .5px;
  transition: color .15s, border-color .15s;
}
.edition-tab { white-space: nowrap; }   /* 任何寬度都不讓按鈕內的字被拆成兩行 */
.edition-tab .tab-abbr { display: none; }   /* 縮寫版預設藏著,窄螢幕才換上 */
.edition-tab:hover { color: var(--ink); }
.edition-tab.is-active {
  color: var(--ink);
  border-color: var(--rule);
  border-bottom-color: var(--paper);
  background: var(--paper);
  margin-bottom: -2px;
}

/* 版面容器 show/hide */
.edition-view { display: none; }
.edition-view.is-active { display: block; }

/* 各版定位副標(tab 下方、大標題上方的 strap line) */
.view-intro {
  text-align: center;
  font-family: "Noto Serif TC", serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 960px;
  margin: 0 auto;
  padding: 2px 16px 14px;
  letter-spacing: 0.3px;
}
/* 副標多句輪播(N5):同格疊放,opacity 淡入淡出,高度自適應不裁切 */
.view-intro-rotate { display: grid; }
.view-intro-rotate .vi-msg {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.view-intro-rotate .vi-msg.is-active {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 640px) {
  .view-intro { font-size: 13px; padding-bottom: 10px; }
}

/* ─── 世界版清單 ─── */
.world-intro {
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}
.world-intro h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--ink);
}
.world-intro p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.world-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.world-item {
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px 14px;
}
.world-item-head {
  margin-bottom: 5px;
}
.world-source {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}
.world-item h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 7px;
}
.world-item h4 a {
  color: var(--ink);
  text-decoration: none;
}
.world-item h4 a:hover { text-decoration: underline; }
.world-brief {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.world-brief p { margin: 3px 0; }

@media (max-width: 640px) {
  .edition-tab { font-size: 13px; padding: 6px 14px; }
  .world-list { grid-template-columns: 1fr; }
}

/* 手機直立:四個 tab 擠不下「今日AI/今日世界/今日財經/幕僚情報」,
   文字會被折成兩行。560px 以下改用縮寫 AI / 世界 / 財經 / 幕僚。
   只換顯示文字,按鈕的 data-view 與切換邏輯完全不動。 */
@media (max-width: 560px) {
  .edition-tabs { gap: 4px; }
  .edition-tab { padding: 6px 10px; letter-spacing: .02em; }
  .edition-tab .tab-full { display: none; }
  .edition-tab .tab-abbr { display: inline; }
}

/* ============================================================
   v8-dualview-2 — 三版切換修正 + 幕僚情報佔位 2026-05-27
   ============================================================ */

/* 世界版:附圖版型 */
.world-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.world-item-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  overflow: hidden;
  border-radius: 4px;
  display: block;
}
.world-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.world-item-body { flex: 1; min-width: 0; }

/* 世界版評論三行換行 */
.world-brief p { margin: 2px 0; }
.world-brief strong { color: var(--ink); }

/* 世界版大標 */
.world-intro h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
}

/* ─── 幕僚情報 版(財經右側分頁) ─── */
.staff-advisory {
  max-width: 620px;
  margin: 52px auto;
  text-align: center;
  padding: 0 20px;
}
.staff-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 4px 16px;
  margin-bottom: 18px;
}
/* 呼吸感:緩慢、低對比、不廉價 */
.staff-badge-breathe { animation: staff-breathe 4s ease-in-out infinite; }
@keyframes staff-breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,0,0,0); }
  50% { opacity: .62; box-shadow: 0 0 14px -2px var(--accent); }
}
.staff-advisory h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--ink);
}
.staff-lead {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0 0 12px;
}
.staff-sub { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.staff-sub strong { color: var(--ink-soft); }
/* B 的輪播在置中版面下也置中對齊 */
.staff-advisory .advisory-carousel { margin: 22px 0; text-align: left; }
.staff-footer-cta {
  margin: 26px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.staff-footer-cta strong { color: var(--accent); }

@media (max-width: 640px) {
  .world-item-thumb { width: 72px; height: 52px; }
  .staff-advisory h2 { font-size: 20px; }
}

/* ============================================================
   v8-dualview-3 — 世界版卡片改為 AI 版相同版型 2026-05-27
   ============================================================ */

/* 覆寫舊的 flex-row 世界版版型,改成與 AI .item 相同的垂直卡片 */
.world-item {
  display: block;            /* 取消 flex-row */
  background: var(--paper-dark);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}
.world-item-thumb {
  display: block;
  width: 100%;
  height: 180px;
  overflow: hidden;
  flex-shrink: unset;
  border-radius: 0;
}
.world-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.world-item-body {
  padding: 12px 14px 14px;
}
.world-item-head { margin-bottom: 6px; }
.world-source {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}
.world-item h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 8px;
}
.world-item h4 a { color: var(--ink); text-decoration: none; }
.world-item h4 a:hover { text-decoration: underline; }
.world-brief { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.world-brief p { margin: 3px 0; }
.world-brief strong { color: var(--ink); }

/* 世界版用相同欄數 grid */
.world-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

@media (max-width: 640px) {
  .world-list { grid-template-columns: 1fr; }
  .world-item-thumb { height: 140px; }
}

/* ============================================================
   v8-dualview-4 — 提示詞頁三分區側邊欄 2026-05-27
   ============================================================ */
.prompts-page {
  display: grid;
  grid-template-columns: 180px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0 16px;
}
.prompts-page h2 {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}
.prompts-sidebar {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.prompts-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px 4px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4px;
}
.prompts-section { display: flex; flex-direction: column; gap: 2px; }
.prompts-tabs { display: none; }   /* 舊 flat tabs 隱藏 */
.prompts-tab {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .12s, color .12s;
}
.prompts-tab:hover { background: var(--paper-dark); color: var(--ink); }
.prompts-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.prompts-new {
  font-size: 10px;
  color: var(--muted);
  vertical-align: super;
}
.prompts-layout {
  grid-column: 2;
  grid-row: 2;
}
@media (max-width: 800px) {
  .prompts-page { grid-template-columns: 1fr; }
  .prompts-sidebar { grid-row: 2; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .prompts-section { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; }
  .prompts-section-label { border-bottom: none; margin-bottom: 0; }
  .prompts-layout { grid-row: 3; }
}

/* ===== 單則評論的欄位化排版(2026-08-21 立,2026-08-22 擴到三版)=====
   使用者拍板:每則新聞只留兩欄 —— 第一欄「重點」粗體且顏色較亮,
   第二欄(AI/財經=價值、世界=原因)維持原本樣子。
   2026-08-22 追加:**欄位名的文字標題全部拿掉**,靠顏色與字重區分就夠了。
   .commentary = 今日AI;.rn-brief = 今日世界 / 今日財經(共用同一套規則)。
   舊評論的四欄(怎麼用/影響了誰)走 .cm-plain,仍保留標題,不會糊成無頭文字。 */
.commentary .cm-line,
.rn-brief .cm-line { display: block; margin: 0 0 5px; }
.commentary .cm-line:last-child,
.rn-brief .cm-line:last-child { margin-bottom: 0; }
.commentary .cm-label,
.rn-brief .cm-label { margin-right: 6px; }
.commentary .cm-label::after,
.rn-brief .cm-label::after { content: "·"; margin-left: 6px; opacity: .5; }

/* 重點:整段都上強調色並加粗 —— 這是讀者掃過去第一眼要看到的。
   color-mix 把強調色往紙色方向提亮一階,深紅在米黃紙上才不會顯得沉;
   不支援 color-mix 的瀏覽器會落回上一行的 var(--accent),仍然正確。
   ⚠ .rn-brief 本體有 var(--commentary-weight) 與 var(--commentary-color),
   所以這裡必須把 color 與 font-weight 都寫死,否則會被版面設定蓋回去。 */
.commentary .cm-lead,
.commentary .cm-lead .cm-label,
.commentary .cm-lead .cm-text,
.rn-brief .cm-lead,
.rn-brief .cm-lead .cm-label,
.rn-brief .cm-lead .cm-text {
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 82%, var(--paper, #fff) 18%);
  font-weight: 700;
}

/* 第二欄:刻意什麼都不覆寫,維持容器本來的字重與顏色。 */
.commentary .cm-value .cm-text,
.rn-brief .cm-value .cm-text { font-weight: inherit; color: inherit; }
.commentary .cm-value .cm-label,
.commentary .cm-plain .cm-label,
.rn-brief .cm-value .cm-label,
.rn-brief .cm-plain .cm-label { color: var(--accent); font-weight: 700; }

/* ===== 流行 · 娛樂區(今日世界版底部,2026-08-21)=====
   只有中文標題,沒有評論 —— 做成密集標題牆,形狀本身就講出它的份量。 */
.pop-zone {
  max-width: 1140px;
  margin: 26px auto 8px;
  padding: 16px 18px 18px;
  border: 1px solid var(--rule, #c9b896);
  border-radius: 8px;
}
.pop-head {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.pop-head h2 { margin: 0; font-size: 20px; }
.pop-sub { font-size: 13px; color: var(--muted); }
.pop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.pop-card {
  display: flex; gap: 10px; align-items: flex-start;
  text-decoration: none; color: inherit;
  padding: 8px; border-radius: 6px;
  transition: background .15s;
}
.pop-card:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.pop-thumb { flex: 0 0 56px; }
.pop-thumb img {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 4px; display: block;
}
.pop-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pop-title { font-size: 14px; line-height: 1.45; }
.pop-src { font-size: 12px; color: var(--muted); }
/* 2026-10-02 流行區改版:一句話在講什麼、類型小標、主筆頭條(左圖右文,手機直排) */
.pop-gist { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft, var(--muted)); }
.pop-kind { font-weight: 700; color: var(--accent); margin-right: 6px; }
.pop-grid .pop-card { align-items: flex-start; }
.pop-feature {
  display: grid; grid-template-columns: minmax(0, 42%) 1fr; gap: 18px;
  margin: 0 0 16px; padding: 0 0 16px;
  border-bottom: 1px solid var(--rule, #c9b896);
}
.pop-feature-img { display: block; position: relative; min-height: 220px; border-radius: 6px; overflow: hidden; }
.pop-feature-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pop-feature-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pop-feature-eyebrow { font-size: 12px; letter-spacing: 2px; color: var(--accent); font-weight: 700; }
.pop-feature-title { margin: 0; font-size: calc(22px * var(--text-scale, 1)); line-height: 1.35; font-weight: 800; }
.pop-feature-title a { color: inherit; text-decoration: none; }
.pop-feature-text { font-size: calc(15px * var(--text-scale, 1)); line-height: 1.75; }
.pop-feature-text p { margin: 0 0 .5em; }
.pop-feature-more { align-self: flex-start; font-size: 13px; color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor; }
@media (max-width: 720px) {
  .pop-feature { grid-template-columns: 1fr; }
  .pop-feature-img { min-height: 0; aspect-ratio: 16 / 9; }
}

/* 2026-09-29 沒讀到原文的新聞:不寫評論,淡色一行誠實標示 */
.commentary.no-body { opacity: .55; font-size: .85em; font-style: italic; }

/* 大卡:重要新聞與新工具 —— 標題大一號、底色微亮,一眼看得出份量 */
.item--big { padding: 14px 0 var(--item-gap,16px); border-top: 4px solid var(--accent); }
.item--big h3 { font-size: 24px; line-height: 1.35; }
.item--big .item-thumb img { max-height: 260px; }
/* 工具導讀的「用法」:步驟要看得出是步驟 */
.cm-line.cm-guide { background: rgba(139,0,0,.06); border-left: 3px solid var(--accent);
  padding: 6px 10px; margin: 6px 0; }
.cm-line.cm-guide .cm-label { color: var(--accent); margin-right: 6px; }
/* 低分摺疊清單 */
/* 2026-10-01 低分新聞「簡訊欄」:原本只是一串連結,改成小卡網格。
   只用主題變數,深色主題/版面編輯換色時一起跟著走。 */
.fold-list { margin: 12px 0 20px; font-size: 14px; grid-column: 1 / -1; }
.fold-list summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px;
  color: var(--muted); padding: 8px 0; border-top: 1px dashed var(--rule); font-size: 13px; letter-spacing: .03em; }
.fold-list summary::-webkit-details-marker { display: none; }
.fold-list summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.fold-list[open] summary::after { transform: rotate(180deg); }
.fold-list summary:hover { color: var(--accent); }
.fold-label { font: 800 11px "Cinzel", serif; letter-spacing: 2px; color: var(--paper);
  background: var(--ink); padding: 2px 8px; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 8px; }
.brief-card { display: flex; flex-direction: column; gap: 5px; padding: 9px 11px 10px;
  background: var(--paper-dark); border-left: 3px solid var(--rule); color: var(--ink);
  text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.brief-card:hover { transform: translateY(-2px); border-left-color: var(--accent);
  box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.brief-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brief-head .score { font-size: 10px; padding: 1px 6px; }
.brief-fav { width: 14px; height: 14px; border-radius: 2px; flex: none; }
.brief-src { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-title { font-weight: 800; font-size: var(--brief-size, 14px); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brief-snip { font-size: calc(var(--brief-size, 14px) * .86); line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brief-card.is-fresh .brief-title::before { content: "NEW"; font: 800 10px Cinzel, serif; letter-spacing: 1px;
  color: #fff; background: var(--accent); padding: 0 6px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 900px) { .brief-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .brief-grid { grid-template-columns: minmax(0, 1fr); } .brief-card { min-width: 0; } }

/* ===== 2026-09-30 讀者端「新新聞」(static/fresh.js) ===== */
.fresh-bar { text-align: center; font-size: 12px; color: var(--muted); letter-spacing: 1px; margin: 6px 0 2px; }
.fresh-tab-badge { display: inline-block; margin-left: 4px; font: 700 10px Cinzel, serif; background: var(--accent);
  color: #fff; padding: 0 5px; border-radius: 8px; vertical-align: top; }
.is-fresh .item-head::after, .rn-card.is-fresh .rn-title::before, li.is-fresh::before {
  content: "NEW"; font: 800 10px Cinzel, serif; letter-spacing: 1px; color: #fff; background: var(--accent);
  padding: 0 6px; margin: 0 6px 0 0; vertical-align: middle; }
.is-fresh .item-head::after { order: 9; margin: 0 0 0 4px; }
.fresh-hidden { display: none !important; }
.fresh-end { grid-column: 1 / -1; height: 26px; position: relative; }
.seam-before { position: relative; }
.seam-before::before { content: ""; position: absolute; left: -14px; top: 12px; bottom: 12px; width: 3px; z-index: 2;
  background: linear-gradient(#fff, #ffd98a, #fff); box-shadow: 0 0 14px 4px rgba(255,220,140,.9);
  animation: freshBeat 1.4s infinite; }
.seam-before::after { content: attr(data-n); position: absolute; left: -14px; top: -2px; transform: translateX(-50%); z-index: 3;
  font: 700 10px Cinzel, serif; background: #ffd98a; color: #1a1410; padding: 0 5px; border: 1px solid #1a1410; }
.fresh-end.seam-before::before { left: 0; right: 0; top: 12px; bottom: auto; width: auto; height: 3px;
  background: linear-gradient(90deg, transparent, #fff 20%, #ffd98a 50%, #fff 80%, transparent); }
.fresh-end.seam-before::after { left: 50%; }
@keyframes freshBeat { 50% { opacity: .55; } }
.fresh-in { animation: freshFlash 1.8s ease-out; }
.fresh-in > * { opacity: 0; filter: blur(6px); }
.fresh-in.fresh-printed > * { opacity: 1; filter: none; transition: opacity .7s ease, filter .7s ease; }
@keyframes freshFlash { 0% { background: #fffdf5; } 25% { background: #fff; box-shadow: 0 0 40px 12px rgba(255,255,240,.95); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
.fresh-caret::after { content: "▍"; color: var(--accent); animation: freshBeat .6s steps(1) infinite; }
.fresh-toast { position: fixed; left: 50%; top: -140px; transform: translateX(-50%); z-index: 900;
  /* 固定深底亮字,不跟主題走:以前用 --ink/--paper,深色主題下兩者對調 → 米底配米黃字,看不見 */
  background: #1a1410; color: #f3ead8; padding: 12px 18px; border: 2px solid #ffd98a;
  box-shadow: 0 8px 30px rgba(0,0,0,.35); display: flex; gap: 14px; align-items: center;
  transition: top .6s cubic-bezier(.2,1.4,.4,1); max-width: calc(100% - 32px); font-size: 14px; }
.fresh-toast.show { top: 14px; }
.fresh-toast b { font-family: Cinzel, serif; color: #ffd98a; letter-spacing: 2px; }
.fresh-toast button, .fresh-jump { background: #ffd98a; border: 0; font: inherit; font-weight: 700; padding: 4px 12px; cursor: pointer; color: #1a1410; }
.fresh-jump { position: fixed; right: 16px; bottom: 84px; z-index: 900; border: 2px solid #1a1410; /* 讓出右下角留言板鈕 */
  box-shadow: 0 4px 16px rgba(0,0,0,.3); display: none; }
.fresh-jump.show { display: block; }

/* 2026-09-30 重要新聞(≥7 分)沒圖 → 來源縮圖:站台小圖示 + 來源名,填版面也讓人一眼認出是誰家的 */
.item-thumb--src { display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 84px; filter: none;
  background: repeating-linear-gradient(135deg, var(--paper-dark) 0 10px, transparent 10px 20px), var(--paper-dark); }
.item-thumb--src::after { content: attr(data-src); font: 700 15px Cinzel, "Noto Serif TC", serif;
  letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }
.item-thumb--src .src-fav { width: 32px; height: 32px; aspect-ratio: auto; object-fit: contain; border-radius: 6px; }
.item-thumb--src:hover img { transform: none; }
.item--big .item-thumb--src { height: 110px; }

/* 2026-09-30 出刊時刻表(報頭下方):過站實心點、本站紅點紅框閃爍 */
.ed-timeline { text-align: center; margin: 4px 0 14px; }
.ed-tl-row { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 0; }
.ed-tl-stop { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border: 1.5px solid transparent;
  border-radius: 999px; font: 15px "Playfair Display", "Noto Serif TC", serif; color: var(--muted); letter-spacing: .5px;
  font-variant-numeric: lining-nums tabular-nums; }
.ed-tl-stop i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); display: inline-block; }
.ed-tl-rail { width: 34px; height: 1px; background: var(--muted); opacity: .6; margin: 0 6px; }
.ed-tl-stop.is-now { color: #e5533f; font-weight: 700; border-color: #e5533f; animation: edTlFrame 1.6s ease-in-out infinite; }
.ed-tl-stop.is-now i { background: #e5533f; animation: edTlDot 1.2s ease-in-out infinite; }
@keyframes edTlDot { 50% { opacity: .25; transform: scale(.7); } }
@keyframes edTlFrame { 50% { box-shadow: 0 0 0 4px rgba(229,83,63,.28); } }
.ed-tl-cap { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
@media (max-width: 520px) { .ed-tl-rail { width: 14px; margin: 0 2px; } .ed-tl-stop { padding: 2px 8px; font-size: 13px; } }


/* 2026-10-01 「有沒有讀過原文」標記:讀過 = 綠框,只譯標題 = 灰字 */
.read-tag { display: inline-block; width: fit-content; align-self: flex-start; font-size: 11px; letter-spacing: 1px; color: var(--muted); margin: 0 0 4px; }
.read-tag.is-read { color: #3f8f5a; border: 1px solid currentColor; padding: 0 6px; border-radius: 3px; }

/* ===== 2026-10-01 使用者:「整體中文字大 1.5 倍、標題必定粗體」=====
   倍率走版面設定的 --text-scale(預設 1 = 原本大小;使用者試過 1.5 嫌太大,改回 1 但留設定)。放在檔尾才蓋得過前面散落的字級。
   今日世界/財經的卡片字級寫在 newspaper.html 的 <style> 裡,那邊另外乘同一個倍率。 */
.item h3,
.cat-group .item h3 { font-size: calc(var(--item-title-size, 19px) * var(--text-scale, 1)); font-weight: 800; }
.cat-group .item--big h3,
.item--big h3 { font-size: calc(var(--item-title-size, 19px) * 1.3 * var(--text-scale, 1)); }
.commentary { font-size: calc(var(--commentary-size, 14px) * var(--text-scale, 1)); }
.source { font-size: calc(var(--source-size, 11px) * var(--text-scale, 1)); }
.raw { font-size: calc(13px * var(--text-scale, 1)); }
.pop-title { font-size: calc(14px * var(--text-scale, 1)); font-weight: 800; }
.headline h2, .digest-topic, .rn-title, .brief-title { font-weight: 800; }

/* ===== 2026-10-01 重要新聞大卡:左圖、右上標題、右下解說(使用者手繪稿 v2)=====
   兩級:item--wide(≥9 分)橫跨整列、item--big(工具≥7)跨兩欄。
   圖框「方正偏長」= 4:5 直式;右邊字比圖長時圖框跟著拉高(align-self:stretch)。
   圖片本身太大/比例不合 → static/imgfit.js 加 pan-x / pan-y 讓它慢慢平移看全圖;
   圖太小 → 加 is-small,用原尺寸置中,並把左欄縮到圖那麼寬(--img-col),不讓小圖撐大格。
   手機寬度退回直排。 */
.columns > .item--wide { grid-column: 1 / -1; }
@media (min-width: 781px) {
  .item--big:has(> .item-thumb) {
    display: grid;
    grid-template-columns: var(--img-col, 40%) minmax(0, 1fr);
    grid-template-rows: repeat(7, auto) 1fr;
    column-gap: 24px;
    align-items: start;
  }
  .item--wide:has(> .item-thumb) { grid-template-columns: var(--img-col, 30%) minmax(0, 1fr); }
  .item--big:has(> .item-thumb) > * { grid-column: 2; min-width: 0; }
  .item--big:has(> .item-thumb) > .item-thumb {
    grid-column: 1; grid-row: 1 / -1; align-self: stretch;
    margin: 0; width: 100%; box-sizing: border-box; height: auto; min-height: 280px; position: relative;
    /* 高度跟著右邊的字走(至少 280px):字少接近方形、字多變直長,不會像固定 4:5 那樣字少時下面空一大片 */
    /* width 一定要寫死:只給 aspect-ratio + stretch 時,瀏覽器會拿撐高後的高度反推寬度,框衝出左欄(實測 266px 塞進 150px 欄) */
  }
  /* 圖用絕對定位鋪滿框:不讓圖的原始高度參與排版(否則 1000px 高的原圖會把整張卡撐爆) */
  .item--big:has(> .item-thumb) > .item-thumb:not(.is-small):not(.item-thumb--src) img { position: absolute; inset: 0;
    width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; }
  /* 沒新聞圖的「來源字卡」:只是站台小圖示+名字,給一條窄欄就好,不撐成 4:5 大框(小圖示會被放大糊掉) */
  .item--big:has(> .item-thumb--src) { grid-template-columns: 150px minmax(0, 1fr); }
  .item--big:has(> .item-thumb) > .item-thumb--src { flex-direction: column; aspect-ratio: auto; min-height: 150px; }
  .item--big > .item-thumb--src::after { font-size: 12px; letter-spacing: 1px; text-align: center; padding: 0 8px;
    max-width: 100%; box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; }
  .item--big:has(> .item-thumb) > .item-thumb.is-small { aspect-ratio: auto; align-self: start; }
  .item--big:has(> .item-thumb) > h3 { margin: 4px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
}
@media (min-width: 781px) and (max-width: 1050px) {
  .item--wide:has(> .item-thumb) { grid-template-columns: var(--img-col, 36%) minmax(0, 1fr); }
}

/* ===== 2026-10-01 圖片自動適配(static/imgfit.js 判斷後加 class,所有新聞圖共用)===== */
.is-small { display: flex; align-items: center; justify-content: center; background: var(--paper-dark); }
.is-small > img { width: auto !important; height: auto !important; max-width: 100%; max-height: 100%;
  aspect-ratio: auto !important; object-fit: contain !important; }
.pan-x > img, .pan-y > img { animation: imgPan var(--pan-dur, 12s) ease-in-out infinite alternate; }
.pan-x > img { --pan-from: 0% 50%; --pan-to: 100% 50%; }
.pan-y > img { --pan-from: 50% 0%; --pan-to: 50% 100%; }
.pan-x:hover > img, .pan-y:hover > img { animation-play-state: paused; }
@keyframes imgPan { from { object-position: var(--pan-from); } to { object-position: var(--pan-to); } }


/* 2026-10-01 使用者:「讀過摘要」這類標籤不專業 → 不顯示(app._read_tag 也已改回空,這行是重開服務前的保險) */
.read-tag { display: none !important; }

/* ===== 2026-10-01 社論頁籤盒(本日社論 + 每則精選一頁)=====
   長相沿用模擬頁(使用者滿意的那版):粗框、頁籤列、整條軌道左右滑。
   --n = 頁數(模板給)、--i = 目前第幾頁(edtabs.js 給)。 */
.ed-box { border: 2px solid var(--ink); margin: 18px 0 26px; overflow: hidden; }
.ed-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--ink); }
.ed-tab { flex: 1 1 auto; background: none; border: 0; border-bottom: 4px solid transparent; padding: 10px 14px;
  font: inherit; font-weight: 700; letter-spacing: 1px; color: var(--muted); cursor: pointer;
  transition: color .3s, border-color .3s; }
.ed-tab:hover { color: var(--ink); }
.ed-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.ed-viewport { overflow: hidden; transition: height .45s cubic-bezier(.65,0,.35,1); }
.ed-track { display: flex; align-items: flex-start; width: calc(var(--n, 1) * 100%);
  transform: translateX(calc(var(--i, 0) * -100% / var(--n, 1)));
  transition: transform .45s cubic-bezier(.65,0,.35,1); }
.ed-pane { flex: 0 0 calc(100% / var(--n, 1)); box-sizing: border-box; padding: 16px 20px 20px; min-width: 0; }
.ed-pane--daily { border-top: 6px solid var(--accent); }
.ed-kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1px; color: var(--muted); }
.ed-pill { color: #fff; background: var(--accent); padding: 1px 8px; border-radius: 2px; }
.ed-title { font-size: 22px; line-height: 1.35; margin: 10px 0 8px; font-weight: 800; }
.ed-title a { color: var(--ink); text-decoration: none; }
.ed-title a:hover { color: var(--accent); }
.ed-lead { font-size: 15px; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.ed-hint { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.ed-raw { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.ed-raw summary { cursor: pointer; font-weight: 700; }
.ed-raw p { white-space: pre-line; line-height: 1.7; margin: 6px 0 0; max-height: 18em; overflow: auto; }
.ed-more { display: inline-block; margin-top: 14px; padding: 6px 14px; border: 1.5px solid var(--accent);
  color: var(--accent); font-weight: 700; text-decoration: none; letter-spacing: 1px; }
.ed-more:hover { background: var(--accent); color: var(--paper); }
@media (max-width: 560px) { .ed-tab { padding: 8px 10px; font-size: 13px; } .ed-pane { padding: 14px; } }

/* 2026-10-02 週報期別貼在標題旁 */
.trend-lab-period { font-size: 14px; font-weight: 700; letter-spacing: 1px; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 1px 8px; }

/* ═══ 2026-10-02 今日財經觀點:標出「今天讀的這篇」 ═══ */
.trend-job-source { margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed var(--muted); font-size: 13px; color: var(--muted); line-height: 1.6; }
.trend-job-source a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.trend-job-source a:hover { color: var(--accent); }

/* ═══ 2026-10-02 今日世界:大洲橫幅 + 上一洲/下一洲 + 切換列 ═══
   使用者:「要讓使用者知道這是屬於某一大洲的新聞,同時意識到可以選擇其他洲;換洲要有動態感」 */
.region-switcher { max-width: 1140px; margin: 4px auto 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.rs-chip { font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .08em; cursor: pointer;
  padding: 5px 14px; border-radius: 999px; border: 1px solid var(--muted); background: transparent; color: var(--ink);
  transition: background .25s, color .25s, border-color .25s, transform .2s; }
.rs-chip i { font-style: normal; font-size: 11px; margin-left: 6px; opacity: .65; }
.rs-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.rs-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rs-chip.is-empty { opacity: .45; }

.region-banner { display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; gap: 14px; margin: 6px 0 14px; }
.rb-plate { position: relative; text-align: center; padding: 16px 48px 14px; min-width: 300px;
  border-top: 3px double var(--accent); border-bottom: 3px double var(--accent);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 9%, transparent) 25%, color-mix(in srgb, var(--accent) 9%, transparent) 75%, transparent); }
.rb-corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent); }
.rb-corner.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.rb-corner.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.rb-corner.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.rb-corner.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.rb-en { display: block; font-size: 12px; font-weight: 700; letter-spacing: .45em; color: var(--accent); margin-bottom: 2px; padding-left: .45em; }
.rb-name { display: block; font-size: calc(46px * var(--text-scale, 1)); font-weight: 900; line-height: 1.1; letter-spacing: .18em; padding-left: .18em; color: var(--ink); }
.rb-sub { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); letter-spacing: .12em; }
.rb-step { font: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--muted); border-radius: 10px; background: transparent; color: var(--ink);
  transition: border-color .25s, background .25s, transform .25s; }
.rb-prev { justify-self: end; } .rb-next { justify-self: start; }
.rb-step-txt { display: flex; flex-direction: column; line-height: 1.25; }
.rb-prev .rb-step-txt { text-align: right; }
.rb-step-txt small { font-size: 11px; letter-spacing: .15em; color: var(--muted); }
.rb-step-name { font-size: 17px; font-weight: 800; letter-spacing: .08em; }
.rb-arrow { font-size: 30px; line-height: 1; color: var(--accent); transition: transform .25s; }
.rb-step:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rb-next:hover .rb-arrow { transform: translateX(4px); }
.rb-prev:hover .rb-arrow { transform: translateX(-4px); }
.rb-next .rb-arrow { animation: rbNudge 2.4s ease-in-out infinite; }
@keyframes rbNudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateX(5px); } 90% { transform: translateX(0); } }

/* 換洲動畫:橫幅洲名由下往上揭開、角框收攏、底下新聞依方向滑入 */
.region-panel.rp-enter .rb-name { animation: rbReveal .7s cubic-bezier(.2, .8, .2, 1) both; }
.region-panel.rp-enter .rb-en { animation: rbSpread .8s ease-out both; }
.region-panel.rp-enter .rb-corner { animation: rbCorner .6s ease-out both; }
.region-panel.rp-enter .rb-plate { animation: rbPlate .6s ease-out both; }
.region-panel.rp-enter[data-dir="next"] .region-panel-head,
.region-panel.rp-enter[data-dir="next"] .region-news { animation: rpFromRight .65s .12s cubic-bezier(.2, .8, .2, 1) both; }
.region-panel.rp-enter[data-dir="prev"] .region-panel-head,
.region-panel.rp-enter[data-dir="prev"] .region-news { animation: rpFromLeft .65s .12s cubic-bezier(.2, .8, .2, 1) both; }
.region-panel.rp-enter[data-dir="fade"] .region-panel-head,
.region-panel.rp-enter[data-dir="fade"] .region-news { animation: rpFade .5s ease-out both; }
@keyframes rbReveal { from { clip-path: inset(100% 0 0 0); transform: translateY(18px); opacity: 0; } to { clip-path: inset(0); transform: none; opacity: 1; } }
@keyframes rbSpread { from { letter-spacing: 1.2em; opacity: 0; } to { letter-spacing: .45em; opacity: 1; } }
@keyframes rbCorner { from { opacity: 0; transform: scale(2.4); } to { opacity: 1; transform: none; } }
@keyframes rbPlate { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
@keyframes rpFromRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes rpFromLeft { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes rpFade { from { opacity: 0; } to { opacity: 1; } }
.rb-plate { background-repeat: no-repeat; background-position: center; }

/* 地球轉向新洲時,外圈掃一道光環 */
.world-globe-wrap { position: relative; }
.world-globe-wrap.is-travelling::after { content: ""; position: absolute; left: 50%; top: 50%; width: 360px; height: 360px;
  margin: -180px 0 0 -180px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 3px rgba(255, 226, 122, .75), 0 0 40px 8px rgba(255, 226, 122, .35);
  animation: globeRing 1.1s ease-out both; }
@keyframes globeRing { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }

@media (max-width: 700px) {
  .region-banner { grid-template-columns: 1fr 1fr; }
  .rb-plate { grid-column: 1 / -1; grid-row: 1; min-width: 0; padding: 14px 28px 12px; }
  .rb-prev { justify-self: stretch; } .rb-next { justify-self: stretch; justify-content: flex-end; }
  .rb-name { font-size: calc(34px * var(--text-scale, 1)); }
  .world-globe-wrap.is-travelling::after { width: 240px; height: 240px; margin: -120px 0 0 -120px; }
}


/* ═══ 2026-10-03 頭條盡量一行:依字數縮字級,星號固定兩側不落單 ═══ */
.headline { container-type: inline-size; }
.headline h2 { display: flex; align-items: center; justify-content: center; gap: 0;
  font-size: clamp(22px, calc((100cqi - 120px) / (var(--hl-len, 20) * 0.92)), 46px); }
.headline h2::before, .headline h2::after { flex: none; }
.headline h2 .hl-text { min-width: 0; text-wrap: balance; }

/* ═══ 2026-10-03 本期動態跑馬燈(取代「第 N 版 · 出刊」說明行 + 最新更新列 + AI 導言) ═══ */
.ed-ticker { overflow: hidden; white-space: nowrap; margin: 2px auto 12px; max-width: 900px; font-size: 12.5px;
  color: var(--muted); letter-spacing: 1px; border-top: 1px solid color-mix(in srgb, var(--muted) 40%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 40%, transparent); padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ed-ticker-track { display: inline-block; padding-left: 100%; animation: edTicker 38s linear infinite; }
.ed-ticker:hover .ed-ticker-track { animation-play-state: paused; }
.ed-tk-item { display: inline; margin: 0; }
.ed-tk-item + .ed-tk-item::before { content: "◆"; color: var(--accent); margin: 0 18px; font-size: 9px; vertical-align: 2px; }
.ed-tk-cap { color: #e5533f; font-weight: 700; }
.ed-ticker .fresh-bar { display: inline; margin: 0; text-align: left; font-size: inherit; color: var(--ink); }
@keyframes edTicker { from { transform: translateX(0); } to { transform: translateX(-100%); } }


/* AI 週報放進社論頁籤盒:外框交給盒子,週報自己的外框收掉 */
.ed-pane--weekly .trend-lab { margin: 0; border: 0; padding: 0; background: none; box-shadow: none; }
.ed-tab--weekly { color: var(--accent); }

/* ═══ 2026-10-03 週報標題 + 開頭取材說明 ═══ */
.trend-job-title { margin: 4px 0 6px; font-size: calc(24px * var(--text-scale, 1)); font-weight: 800; line-height: 1.35; color: var(--ink); }
.trend-job-lead { margin: 0 0 12px; padding-left: 10px; border-left: 3px solid var(--accent); font-size: 13px; color: var(--muted); letter-spacing: .5px; }

/* 2026-10-03 整區只剩簡訊的區塊排到頁底,標題收小,讀起來是「附錄」不是正文 */
.cat-group.is-brief-only .cat-heading, .source-group.is-brief-only .source-heading { font-size: 15px; opacity: .75; }
.cat-group.is-brief-only .items.columns:empty, .source-group.is-brief-only .items.columns:empty { display: none; }
