/* 新聞快訊時間軸專頁樣式。共用 app.css 的變數 / nav / footer /
   notice-banner / toast / btn-ghost 等既有類別，這裡只補本頁特有的元件
   （雙分頁、時間軸、標籤 chips）。比照 dividend.css 的既有結構與命名慣例。

   v15（任務 #194，2026-08-17）新聞頁質感大升級。設計語彙對標同波過關的
   產業泡泡圖 v2 / #186 法說會月曆 / #187 損益日曆：珍珠高光漸層、色底
   膠囊、柔和落影、hover 微上浮、細緻描邊。四件事在本頁的落點：

   ① **新聞條目卡片化**：原本是「時間軸上一行純文字」，改成「時間軸鋼軌
      ＋右側獨立卡片」。卡片 = 雙層漸層（頂部珍珠高光 + 左上品牌藍暈）
      疊 --card-bg，hover 上浮 2px、藍色光暈落影、左緣浮現 2px 品牌漸層
      軌。重大訊息／高相關川普貼文沿用同一張卡，只換成琥珀色系描邊＋左軌
      （原本是 `border-left` 掛在 grid 容器上，還配了 `margin-left:-11px`
      負邊距，實測讓那幾列比同儕寬 11px、右緣參差，一併收掉）。

   ② **來源膠囊**：來源名原本是一串灰字，改成帶語意色點的小膠囊
      （`.news-src-chip`，由 news.js 帶 `data-src`）。TWSE 官方＝琥珀、
      鉅亨＝藍、中央社＝青、Truth Social＝紫、Google News＝中性灰，讓
      「這則是誰說的」在掃視時一眼分得出來。

   ③ **膠囊語彙統一**：分頁改 segmented control（藥丸底＋選中漸層），
      分類 chips、個股/產業/人物/總經 tags、事件雷達的視圖切換全部收斂成
      同一套圓角＋描邊＋選中漸層描邊的語彙。個股 chip 因為可點，額外給
      hover 上浮＋光暈，跟不可點的產業/人物 chip 分得出來。

   ④ **色階代幣**：珍珠高光基色用就地開的 `--nv-gloss-rgb`（深色主題的
      `--surface-tint-rgb` 是白、三個淺色主題被翻成「壓暗用」的深藍
      15,23,42，直接拿來當高光會變髒污，比照 portfolio.css v11 的
      `--cal-gloss-rgb` 處理）。其餘顏色一律吃既有 var(--*)，四主題自動跟。

   另附一件根因級版面修復（不是純美化，但改的是同一段 CSS）：
   `.news-layout` 兩處 `1fr` 改 `minmax(0, 1fr)`。grid item 的
   `min-width:auto` 讓 `1fr` 軌道被撐到內容的 min-content 寬——本頁的
   `.news-category-filter` 是 `flex-wrap:nowrap` 的橫向捲動列，它的
   min-content 就是「11 顆分類 chip 不換行排一排」的 854px，於是整條主欄
   被撐成 854px：390px 手機上實測 documentElement.scrollWidth=866，新聞
   標題全部被切在畫面右緣外（改版前截圖 before_m390_*_list.png 有拍到）；
   1440px 桌機上則是把 600px 側欄整個擠出畫面（before_desk1440_*.png）。
   改成 `minmax(0, 1fr)` 後 scrollWidth 回到 390，橫向捲動列也才真的會捲。 */

/* ---------- 本頁專用代幣（見檔頭 ④） ---------- */

:root {
  /* 珍珠高光基色：深色主題＝白（等同 --surface-tint-rgb），淺色主題覆寫
     回白（淺色主題的 --surface-tint-rgb 是壓暗用的深藍，不能當高光）。 */
  --nv-gloss-rgb: var(--surface-tint-rgb);
  /* 卡片落影強度：淺色主題底色亮、同樣的黑影會顯得髒，需要更淡。 */
  --nv-shadow-a: 0.16;
  --nv-shadow-b: 0.13;
}

:root[data-theme="light-a"],
:root[data-theme="light-b"],
:root[data-theme="light-c"],
:root[data-theme="champagne"] {
  --nv-gloss-rgb: 255, 255, 255;
  --nv-shadow-a: 0.06;
  --nv-shadow-b: 0.05;
}

.news-section {
  margin-bottom: 28px;
  /* grid item 預設 min-width:auto，會把 1fr 軌道撐到 min-content（見檔頭
     的版面修復說明）；這裡明寫 0 當第二道保險。 */
  min-width: 0;
}

/* ---------- 雙分頁（segmented control） ---------- */

.news-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.07), transparent 68%),
    var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(var(--nv-gloss-rgb), 0.06);
}

.news-tab {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 8px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms var(--ease), border-color 180ms var(--ease),
    background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.news-tab:hover {
  color: var(--text);
}

.news-tab.active {
  color: var(--accent-text);
  border-color: rgba(var(--brand-blue-rgb), 0.42);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.10), transparent 70%),
    linear-gradient(135deg, rgba(var(--brand-cyan-rgb), 0.20), rgba(var(--brand-blue-rgb), 0.14));
  box-shadow:
    0 2px 10px rgba(var(--brand-blue-rgb), 0.22),
    inset 0 1px 0 rgba(var(--nv-gloss-rgb), 0.16);
}

/* ---------- 依日分區 ---------- */

.news-day-group {
  margin-bottom: 26px;
}

/* 日期標頭 v15：從一行灰字改成帶品牌立柱的浮起藥丸。
   曾試過再加 `position:sticky` 讓它跟著捲動（聊天軟體的日期浮標那招），
   390px 實拍後撤掉——藥丸是不透明的，吸頂後直接壓在第一張新聞卡的標題
   上，擋字換來的「知道自己在看哪天」不划算（日期分組本來就每天一個，
   捲一小段就會遇到下一顆）。
   同理也不用 backdrop-filter——#184 已證實手機端那是效能與點擊的雷區。 */
.news-day-heading {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 12px;
  padding: 6px 15px 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    var(--card-bg);
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), var(--nv-shadow-a)),
    0 6px 16px rgba(var(--shadow-rgb), var(--nv-shadow-b));
}

.news-day-heading::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-blue));
  box-shadow: 0 0 8px rgba(var(--brand-cyan-rgb), 0.4);
}

/* ---------- 垂直時間線 ---------- */

.news-timeline-line {
  position: relative;
  padding-left: 2px;
}

/* 鋼軌：原本是一條 1px 死灰線，改成上下淡出的品牌漸層，長列表捲動時
   視線有依附但不搶戲。 */
.news-timeline-line::before {
  content: "";
  position: absolute;
  left: 43px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(var(--brand-blue-rgb), 0) 0%,
    rgba(var(--brand-blue-rgb), 0.34) 6%,
    var(--border-strong) 50%,
    rgba(var(--brand-violet-rgb), 0.22) 94%,
    rgba(var(--brand-violet-rgb), 0) 100%
  );
}

.news-entry {
  position: relative;
  display: grid;
  grid-template-columns: 40px 16px minmax(0, 1fr);
  gap: 0 10px;
  padding: 5px 0;
  align-items: start;
}

.news-entry-time {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-align: right;
  padding-top: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* 時間軸節點：品牌漸層珠＋頁底色挖空環＋外圈光暈，坐在鋼軌上。 */
.news-entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-cyan), var(--brand-blue));
  margin-top: 16px;
  justify-self: center;
  box-shadow:
    0 0 0 3.5px var(--bg),
    0 0 0 5px rgba(var(--brand-blue-rgb), 0.28),
    0 0 12px rgba(var(--brand-cyan-rgb), 0.35);
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}

.news-entry:hover .news-entry-dot {
  transform: scale(1.15);
  box-shadow:
    0 0 0 3.5px var(--bg),
    0 0 0 6px rgba(var(--brand-blue-rgb), 0.4),
    0 0 18px rgba(var(--brand-cyan-rgb), 0.55);
}

/* ---------- 新聞卡（見檔頭 ①） ---------- */

.news-entry-body {
  position: relative;
  min-width: 0;
  padding: 12px 14px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.055), transparent 44%),
    linear-gradient(132deg, rgba(var(--brand-blue-rgb), 0.05), transparent 48%),
    var(--card-bg);
  box-shadow:
    0 1px 2px rgba(var(--shadow-rgb), var(--nv-shadow-a)),
    0 6px 18px rgba(var(--shadow-rgb), var(--nv-shadow-b));
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

/* hover 時左緣浮現的品牌漸層軌（不是 border-left，避免推擠內容寬度）。 */
.news-entry-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-violet));
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.news-entry-body:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--brand-blue-rgb), 0.42);
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), var(--nv-shadow-a)),
    0 12px 30px rgba(var(--brand-blue-rgb), 0.18);
}

.news-entry-body:hover::before {
  opacity: 1;
}

.news-entry-title {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.62;
  letter-spacing: 0.004em;
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.news-entry-title:hover {
  color: var(--accent-text);
}

.news-entry-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.news-entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 9px;
}

/* ---------- 來源膠囊（見檔頭 ②） ----------
   `data-src` 由 news.js buildNewsEntry() 帶原始 source key；每個來源只指派
   一組 `--src-rgb`（半透明底/描邊用）與 `--src-fg`（字色，一律用既有的
   「可承載文字」代幣，不自己調色），四主題自動跟著翻。 */

.news-src-chip {
  --src-rgb: var(--text-muted-rgb);
  --src-fg: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 10px 2.5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--src-rgb), 0.3);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    rgba(var(--src-rgb), 0.11);
  color: var(--src-fg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.news-src-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px rgba(var(--src-rgb), 0.7);
}

.news-src-chip[data-src="twse"] {
  --src-rgb: var(--watch-rgb);
  --src-fg: var(--warn-fg);
}

.news-src-chip[data-src="cnyes"] {
  --src-rgb: var(--brand-blue-rgb);
  --src-fg: var(--tag-blue);
}

.news-src-chip[data-src="cna"] {
  --src-rgb: var(--brand-cyan-rgb);
  --src-fg: var(--brand-cyan-text);
}

.news-src-chip[data-src="Truth Social"] {
  --src-rgb: var(--tag-violet-rgb);
  --src-fg: var(--tag-violet);
}

.news-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

/* ---------- 語意 tags（見檔頭 ③） ---------- */

.news-tag {
  --tag-rgb: var(--text-muted-rgb);
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3.5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(var(--tag-rgb), 0.26);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    rgba(var(--tag-rgb), 0.1);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: transform 170ms var(--ease), border-color 170ms var(--ease),
    box-shadow 170ms var(--ease), background 170ms var(--ease);
}

/* 可點的個股 chip：唯一給 hover 上浮＋光暈的 tag，跟純標示用的產業/人物/
   總經 chip 在「可不可以點」這件事上分得出來。 */
.news-tag-stock {
  --tag-rgb: var(--brand-blue-rgb);
  color: var(--accent-text);
  border-color: rgba(var(--brand-blue-rgb), 0.36);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.1), transparent 70%),
    linear-gradient(135deg, rgba(var(--brand-cyan-rgb), 0.16), rgba(var(--brand-blue-rgb), 0.12));
}

.news-tag-stock:hover {
  transform: translateY(-1.5px);
  border-color: rgba(var(--brand-blue-rgb), 0.6);
  box-shadow: 0 4px 12px rgba(var(--brand-blue-rgb), 0.26);
}

.news-tag-industry {
  --tag-rgb: var(--text-muted-rgb);
  color: var(--text-muted);
}

.news-tag-person {
  --tag-rgb: var(--watch-rgb);
  color: var(--warn-fg);
}

/* 川普動態 tag（任務#75 起就有 `news-tag-trump` 這個 class 被寫進 DOM，
   卻從來沒有對應樣式，實測是「透明底裸字」——本波補上紫系膠囊）。 */
.news-tag-trump {
  --tag-rgb: var(--tag-violet-rgb);
  color: var(--tag-violet);
}

/* ---------- 已過濾（非股市相關）新聞條目樣式（配合 #83） ---------- */

.news-entry-filtered {
  opacity: 0.72;
}

.news-entry-filtered .news-entry-body {
  box-shadow: none;
  background: rgba(var(--surface-tint-rgb), 0.02);
  border-style: dashed;
}

.news-entry-filtered-badge {
  background: rgba(var(--text-muted-rgb), 0.14);
  color: var(--text-faint);
}

/* ---------- 已篩選（非股市相關）展開列（追加規格，配合 #83） ---------- */

.news-filtered-toggle {
  display: flex;
  justify-content: center;
  margin: 10px 0 8px;
}

.news-filtered-toggle-btn {
  appearance: none;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  background: rgba(var(--surface-tint-rgb), 0.03);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 16px;
  transition: color 170ms var(--ease), border-color 170ms var(--ease),
    background 170ms var(--ease);
}

.news-filtered-toggle-btn:hover {
  color: var(--text);
  border-color: rgba(var(--brand-blue-rgb), 0.45);
  background: rgba(var(--brand-blue-rgb), 0.07);
}

/* ---------- 空狀態一鍵回「全部」（任務#145新增）：分類/關鍵字過濾條件
   下沒有任何符合的新聞時，除了誠實提示文案，補一顆能一鍵清掉篩選條件的
   按鈕，不讓使用者卡在「不知道為什麼是空的」的死路。 ---------- */

.news-empty-actions {
  display: flex;
  justify-content: center;
  margin: 4px 0 8px;
}

.news-empty-reset-btn {
  min-width: 140px;
}

/* ---------- 載入更多 ---------- */

.news-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.news-load-more {
  min-width: 180px;
  border-radius: 999px;
  border-color: var(--border-strong);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    rgba(var(--surface-tint-rgb), 0.03);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), var(--nv-shadow-a));
  transition: transform 180ms var(--ease), border-color 180ms var(--ease),
    box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.news-load-more:hover:not(:disabled) {
  transform: translateY(-1.5px);
  border-color: rgba(var(--brand-blue-rgb), 0.5);
  box-shadow: 0 6px 18px rgba(var(--brand-blue-rgb), 0.22);
}

/* ---------- 載入骨架（v15 新增） ----------
   原本的載入態是一行置中的「載入中...」，畫面在 API 回來前是空的、高度
   還會塌陷再彈開。改成跟真實條目同版型的骨架列（時間欄＋節點＋卡片），
   資料到位時版面幾乎不跳動。`prefers-reduced-motion` 下停掉掃光。 */

.news-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.news-skel-row {
  display: grid;
  grid-template-columns: 40px 16px minmax(0, 1fr);
  gap: 0 10px;
  align-items: start;
}

.news-skel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 16px;
  justify-self: center;
  background: rgba(var(--text-muted-rgb), 0.28);
}

.news-skel-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.news-skel-bar {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(var(--text-muted-rgb), 0.13) 0%,
    rgba(var(--text-muted-rgb), 0.24) 45%,
    rgba(var(--text-muted-rgb), 0.13) 90%
  );
  background-size: 220% 100%;
  animation: newsSkelSweep 1.5s ease-in-out infinite;
}

.news-skel-bar.w80 { width: 80%; }
.news-skel-bar.w55 { width: 55%; }
.news-skel-bar.w30 { width: 30%; height: 9px; }

@keyframes newsSkelSweep {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* ---------- 空狀態（v15 升級） ---------- */

#news-timeline .empty-state {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.04), transparent 60%),
    rgba(var(--surface-tint-rgb), 0.02);
  padding: 30px 20px;
  min-height: 132px;
  line-height: 1.7;
  font-size: 13.5px;
}

.news-sidecard .sv-empty {
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(var(--surface-tint-rgb), 0.02);
  padding: 22px 14px;
  line-height: 1.7;
}

/* ============================================================
   市場戰情室（#56 任務新增）：戰情條 / 事件雷達 / 分類過濾 /
   與你相關側欄 / 時段分組 / 重大訊息高亮 / 個股代號連結
   ============================================================ */

/* ---------- 戰情條 ---------- */

/* v15：戰情條升級成「儀表板橫幅」——左上品牌藍暈、右上紫暈的雙徑向漸層
   疊 --card-bg，圓角放大到 --radius-lg，市場情緒區另外圈一格內嵌面板，
   把「燈號＋分數」跟右邊的事件 chips 在視覺上分層。 */
.warroom-hero {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 100% at 4% -18%, rgba(var(--brand-blue-rgb), 0.09), transparent 58%),
    radial-gradient(110% 100% at 100% -10%, rgba(var(--brand-violet-rgb), 0.08), transparent 60%),
    var(--card-bg);
}

.warroom-hero-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.warroom-risk {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  padding: 9px 16px 9px 13px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 68%),
    rgba(var(--surface-tint-rgb), 0.035);
  box-shadow: inset 0 1px 0 rgba(var(--nv-gloss-rgb), 0.08);
}

/* 任務#68 M3：全站教學連結佈線——市場情緒風險燈旁的「深入學習 →」連結
   （由 web/static/learn_links.js makeLearnLink() 產生）。 */
.sv-learn-link {
  font-size: 11px;
  color: var(--text-faint);
  text-decoration: none;
}

.sv-learn-link:hover {
  color: var(--brand-cyan-text);
  text-decoration: underline;
}

.warroom-risk-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--tag-slate);
  box-shadow: 0 0 0 4px rgba(var(--text-muted-rgb), 0.18);
  animation: warroomPulse 2.4s ease-in-out infinite;
}

.warroom-risk-dot.warroom-risk-calm {
  background: var(--tag-slate);
  box-shadow: 0 0 0 4px rgba(var(--text-muted-rgb), 0.18);
}

.warroom-risk-dot.warroom-risk-caution {
  background: var(--warn-fg);
  box-shadow: 0 0 0 4px rgba(var(--watch-rgb), 0.2);
}

.warroom-risk-dot.warroom-risk-alert {
  background: var(--tag-violet);
  /* v15 代幣化：本檔原有 4 處「theme-exempt 150,110,255」註記是寫在
     `--badge-violet-rgb`（app.css:295，深色 150,110,255／三個淺色主題
     122,95,176）補齊之前的舊註解，該顆代幣的深色值與這裡的硬碼完全相同、
     淺色值才是正確的色相歸隊，改吃代幣後深色主題零變化、淺色主題修好。 */
  box-shadow: 0 0 0 4px rgba(var(--badge-violet-rgb), 0.24);
}

@keyframes warroomPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.15); }
}

.warroom-risk-text {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.warroom-risk-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.warroom-risk-score {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.warroom-key-events {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1 1 240px;
}

.warroom-key-event-chip {
  /* 主要資訊禁截斷（design_system.md §7 第5點，2026-07-10 追加）：長句
     完整顯示，允許膠囊塊內自然換行，不再用 max-width+ellipsis 切字。 */
  appearance: none;
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.07), transparent 68%),
    rgba(var(--text-muted-rgb), 0.1);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), var(--nv-shadow-b));
  transition: color 180ms var(--ease), border-color 180ms var(--ease),
    background 180ms var(--ease), transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.warroom-key-event-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(var(--shadow-rgb), var(--nv-shadow-a));
}

.warroom-key-event-chip.active {
  color: var(--accent-text);
  border-color: rgba(var(--brand-blue-rgb), 0.55);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.1), transparent 70%),
    linear-gradient(135deg, rgba(var(--brand-cyan-rgb), 0.18), rgba(var(--brand-blue-rgb), 0.13));
  box-shadow: 0 4px 14px rgba(var(--brand-blue-rgb), 0.22);
}

.warroom-industries-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.warroom-industry-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.warroom-industry-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--badge-violet-rgb), 0.3);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    rgba(var(--badge-violet-rgb), 0.13);
  color: var(--tag-violet);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: transform 170ms var(--ease), border-color 170ms var(--ease),
    box-shadow 170ms var(--ease);
}

.warroom-industry-chip:hover {
  transform: translateY(-1.5px);
  border-color: rgba(var(--badge-violet-rgb), 0.55);
  box-shadow: 0 4px 12px rgba(var(--badge-violet-rgb), 0.26);
}

.warroom-stale {
  white-space: nowrap;
}

.warroom-hero-empty {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- 總經事件雷達 ---------- */

.warroom-radar-scroll-wrap {
  position: relative;
}

.warroom-radar-scroll-wrap::before,
.warroom-radar-scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  pointer-events: none;
  z-index: 1;
}

.warroom-radar-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--card-bg), transparent);
}

.warroom-radar-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--card-bg), transparent);
}

.warroom-radar-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 4px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.warroom-radar-card {
  flex: 0 0 auto;
  width: 136px;
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.07), transparent 46%),
    var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: default;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), var(--nv-shadow-b));
  transition: transform 190ms var(--ease), border-color 190ms var(--ease),
    box-shadow 190ms var(--ease);
}

.warroom-radar-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 22px rgba(var(--shadow-rgb), var(--nv-shadow-a));
}

.warroom-radar-card.warroom-radar-today {
  border-color: rgba(var(--brand-blue-rgb), 0.5);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.09), transparent 50%),
    linear-gradient(150deg, rgba(var(--brand-cyan-rgb), 0.14), rgba(var(--brand-blue-rgb), 0.09)),
    var(--bg-2);
  box-shadow:
    0 0 0 1px rgba(var(--brand-blue-rgb), 0.16),
    0 6px 20px rgba(var(--brand-blue-rgb), 0.2);
}

.warroom-radar-dday {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 5px;
}

.warroom-radar-today .warroom-radar-dday {
  color: var(--accent-text);
}

.warroom-radar-dday-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: warroomPulse 1.6s ease-in-out infinite;
}

.warroom-radar-name {
  /* 主要資訊禁截斷（design_system.md §7 第5點）：原本 2 行 line-clamp 會
     切掉「FOMC 利率決策會議公布（7/28-29 兩日會議）」這類長事件名，
     改自然換行、卡片高度跟著撐開（卡片是 flex row 內的獨立項目，撐高
     不影響其它卡片版面）。 */
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.warroom-radar-date {
  font-size: 11px;
  color: var(--text-faint);
}

.warroom-radar-cat {
  align-self: flex-start;
  margin-top: 2px;
}

/* ---------- 我的除息日事件卡（#63 任務新增） ---------- */

.warroom-radar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.warroom-radar-card.warroom-radar-mine {
  /* v15 代幣化，見 .warroom-risk-alert 的說明 */
  border-color: rgba(var(--badge-violet-rgb), 0.35);
}

.warroom-radar-mine-badge {
  white-space: nowrap;
}

/* ---------- 事件雷達 D-N 小 chip（總經事件雷達 v2 M1，任務#82新增）----------
   卡片主標改成白話「還有 N 天」，原本的「D-N」降級為小 badge，跟分類
   badge 並列在 badgeRow（見 news.js renderRadarCard()）。 */
.warroom-radar-dchip {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 歷史反應摘要（M2 新增）：卡片底部淡色小字，可換兩行不強制截斷（卡片
   本身寬度已固定 132px，長句自然換行比截斷更誠實）。 */
.warroom-radar-reaction {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.35;
  margin-top: 2px;
}

/* 事件提醒訂閱按鈕（M3 新增）：只出現在有 event_key 的事件卡（靜態總經
   種子事件）。 */
.warroom-reminder-btn {
  appearance: none;
  width: 100%;
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}

.warroom-reminder-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}

.warroom-reminder-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.warroom-reminder-btn.warroom-reminder-btn-set {
  color: var(--accent-text);
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* ============================================================
   總經事件雷達 v2：視圖切換／條列視圖／迷你月曆視圖
   （任務#82新增，條列版式遵循 docs/design_system.md §7 時間軸流列版式）
   ============================================================ */

/* ---------- 視圖切換 tabs ---------- */

.warroom-radar-view-toggle {
  display: flex;
  gap: 3px;
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.07), transparent 68%),
    var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(var(--nv-gloss-rgb), 0.06);
}

.warroom-view-btn {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 15px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 170ms var(--ease), background 170ms var(--ease),
    border-color 170ms var(--ease), box-shadow 170ms var(--ease);
}

.warroom-view-btn:hover {
  color: var(--text);
}

.warroom-view-btn.active {
  color: var(--accent-text);
  border-color: rgba(var(--brand-blue-rgb), 0.4);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.1), transparent 70%),
    linear-gradient(135deg, rgba(var(--brand-cyan-rgb), 0.18), rgba(var(--brand-blue-rgb), 0.12));
  box-shadow: 0 2px 8px rgba(var(--brand-blue-rgb), 0.2);
}

/* ---------- 條列視圖：時間軸流列版式（design_system.md §7） ---------- */

.warroom-radar-list {
  display: flex;
  flex-direction: column;
}

/* `display:flex` beats the UA `[hidden]{display:none}` rule at equal
   specificity (author stylesheet wins the cascade origin tie)——view切換靠
   toggle `hidden` 屬性，這裡補一條覆寫（`.warroom-radar-calendar` 的
   `display:flex` 宣告在本檔案更後面，用 `!important` 確保無論宣告順序
   都蓋得過去，否則卡片/條列/月曆三個視圖容器會同時疊顯示，2026-07-10
   preview 實測抓到）。 */
.warroom-radar-list[hidden],
.warroom-radar-calendar[hidden] {
  display: none !important;
}

.warroom-list-row {
  display: grid;
  /* 5 欄：日期｜還有N天｜事件名｜分類badge｜歷史反應。歷史反應是「輔助
     統計附註欄」（design_system.md §7 第5點），沒有值時整欄不渲染，改用
     `.warroom-list-row-compact` 的 4 欄版型讓事件名吃掉那格空間，見下方
     覆寫規則與 news.js buildRadarListRow()。 */
  grid-template-columns: 76px 68px minmax(0, 1fr) 108px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  padding: 9px 4px;
  min-height: 34px;
  border-bottom: 1px solid var(--border-faint);
  font-size: 12.5px;
}

.warroom-list-row.warroom-list-row-compact {
  grid-template-columns: 76px 68px minmax(0, 1fr) 108px;
}

.warroom-radar-list .warroom-list-row:last-child,
.warroom-cal-day-events-panel .warroom-list-row:last-child {
  border-bottom: none;
}

.warroom-list-row.warroom-list-row-today {
  background: rgba(var(--brand-blue-rgb), 0.06);
  border-radius: 6px;
}

.warroom-list-date {
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  white-space: nowrap;
  padding-top: 1px;
}

.warroom-list-dleft {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 1px;
}

.warroom-list-row-today .warroom-list-dleft {
  color: var(--accent-text);
}

.warroom-list-dleft .warroom-radar-dday-pulse {
  margin-right: 4px;
  vertical-align: 1px;
}

.warroom-list-name {
  /* 主要資訊禁截斷（design_system.md §7 第5點）：事件名稱一律完整顯示，
     欄寬不夠就自然換行撐高這一列，不用 ellipsis 切字。 */
  color: var(--text);
  font-weight: 600;
  white-space: normal;
  line-height: 1.4;
}

.warroom-list-badge {
  /* 分類 badge 屬於 design_system.md §7 第2點的定寬短標籤，允許 ellipsis
     （理論上分類詞條長度固定可控，這裡保留只是防禦性上限）。 */
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warroom-list-reaction {
  /* 歷史反應統計是輔助附註欄，允許 ellipsis+title（design_system.md §7
     第5點的例外情境）。 */
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  padding-top: 1px;
}

@media (max-width: 480px) {
  .warroom-list-row {
    grid-template-columns: 56px 92px minmax(0, 1fr) 52px;
    grid-template-areas:
      "date badge name dleft"
      "reaction reaction reaction reaction";
    row-gap: 3px;
  }
  .warroom-list-row.warroom-list-row-compact {
    grid-template-areas: "date badge name dleft";
  }
  .warroom-list-date { grid-area: date; }
  .warroom-list-badge { grid-area: badge; font-size: 10.5px; }
  .warroom-list-name { grid-area: name; }
  .warroom-list-dleft { grid-area: dleft; }
  .warroom-list-reaction {
    grid-area: reaction;
    white-space: normal;
    line-height: 1.4;
  }
}

/* ---------- 迷你月曆視圖（單月＋左右切換，2026-07-10 使用者回饋修訂：
   原兩月並排太浪費空間，改單月定寬靠左＋右側當月事件清單） ---------- */

/* `flex-wrap:wrap` + 兩欄各自的 `min-width`（非 `min-width:0`）是這裡的
   關鍵：本區塊巢狀在頁面版式裡，實際可用寬度不等於 viewport 寬度（實測
   一般桌面版面下這個 section 只有 ~650-700px 可用，比整個 viewport 窄
   很多），單靠 `@media` viewport 斷點判斷「該不該堆疊」在這種中等寬度
   容器下會抓錯——曾經在 656px 容器寬度下（未達 700px 斷點，維持左右並排）
   把右欄擠壓到 ~200px，栽進 flow-row grid 固定欄寬總和（>270px）比可用
   寬度還寬，`minmax(0,1fr)` 的事件名欄被迫縮成 0，文字整段逐字換行、
   欄位高度暴衝（2026-07-10 preview 實測抓到）。現在改成：兩欄各自設下限
   （不允許縮到比下限更窄），一旦容器窄到兩欄下限相加放不下，flexbox
   原生 wrap 讓右欄自動掉到下一行——永遠準確反映「這個容器」的實際可用
   寬度，不是「這個 viewport」的寬度，也不需要再手動猜一個 viewport 斷點。 */
.warroom-radar-calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.warroom-cal-col-calendar {
  flex: 1 1 320px;
  max-width: 380px;
  min-width: 260px;
}

.warroom-cal-col-list {
  flex: 2 1 300px;
  min-width: 280px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

/* 手機斷點仍保留：純粹處理「堆疊後」的視覺細節（邊框從左變上），不是
   決定要不要堆疊本身（那件事現在交給上面的 flex-wrap 自動處理）。 */
@media (max-width: 480px) {
  .warroom-cal-col-list {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 14px;
  }
}

/* 事件清單在月曆側欄的專用窄版欄寬（比主流條列視圖窄很多，見上方
   flex-wrap 說明的實測教訓）：日期/badge/還有N天收窄，事件名欄拿到的
   `minmax(0,1fr)` 才有實際可用空間；歷史反應統計欄改成獨立一整行
   （area-based，跟手機版兩行制同一手法），不再跟事件名同一行搶版面。 */
.warroom-cal-day-events-panel .warroom-list-row {
  grid-template-columns: 50px 62px minmax(0, 1fr) 50px;
  grid-template-areas:
    "date badge name dleft"
    "reaction reaction reaction reaction";
  column-gap: 6px;
  row-gap: 3px;
  font-size: 11.5px;
}

.warroom-cal-day-events-panel .warroom-list-row.warroom-list-row-compact {
  grid-template-areas: "date badge name dleft";
}

.warroom-cal-day-events-panel .warroom-list-date {
  grid-area: date;
  font-size: 10.5px;
}

.warroom-cal-day-events-panel .warroom-list-badge {
  grid-area: badge;
  font-size: 10px;
  padding: 2px 4px;
}

.warroom-cal-day-events-panel .warroom-list-name {
  grid-area: name;
}

.warroom-cal-day-events-panel .warroom-list-dleft {
  grid-area: dleft;
  font-size: 10.5px;
}

.warroom-cal-day-events-panel .warroom-list-reaction {
  grid-area: reaction;
  white-space: normal;
}

.warroom-cal-month {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--bg-2);
}

/* 月份標題列＋左右切換箭頭（規格：範圍限有事件資料的月份區間，超界
   箭頭 disabled）。 */
.warroom-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.warroom-cal-nav-btn {
  appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}

.warroom-cal-nav-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}

.warroom-cal-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.warroom-cal-nav-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.warroom-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.warroom-cal-weekday {
  font-size: 10.5px;
  color: var(--text-faint);
  text-align: center;
  padding-bottom: 4px;
}

.warroom-cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 11.5px;
  color: var(--text-muted);
  gap: 1px;
}

.warroom-cal-day-empty {
  visibility: hidden;
}

.warroom-cal-day-has-events {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.warroom-cal-day-has-events:hover {
  background: var(--card-bg-hover);
}

.warroom-cal-day-today {
  border-color: rgba(var(--brand-blue-rgb), 0.5);
}

.warroom-cal-day-selected {
  background: var(--accent-bg);
}

.warroom-cal-day-pulse {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: warroomPulse 1.6s ease-in-out infinite;
}

/* 事件微型類別標（2026-07-10 使用者回饋：匿名圓點改帶主題文字，
   「法說／FED／數據」一眼看出類型）。色系跟 sv-badge-blue/violet/slate
   完全對齊（RADAR_CATEGORY_META 單一常數來源，見 news.js），desktop
   顯示 2-3 字短標籤，同日多事件顯示第一個類別標＋「+N」。手機格子太小
   放不下字，靠 media query 收斂成純色小圓點＋圖例（規格「退回分色圓點」）。 */
.warroom-cal-day-tags {
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  overflow: hidden;
}

.warroom-cal-tag {
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  padding: 0 3px;
  border-radius: 4px;
  white-space: nowrap;
}

.warroom-cal-tag-blue { background: rgba(var(--brand-blue-rgb), 0.14); color: var(--tag-blue); }
.warroom-cal-tag-violet { background: rgba(var(--badge-violet-rgb), 0.16) /* v15 代幣化，見 .warroom-risk-alert 的說明 */; color: var(--tag-violet); }
.warroom-cal-tag-slate { background: rgba(var(--text-muted-rgb), 0.14); color: var(--tag-slate); }

.warroom-cal-tag-plus {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
}

@media (max-width: 480px) {
  /* 行動版格子太小放不下文字標籤，退回純色圓點＋下方圖例對照。 */
  .warroom-cal-tag {
    width: 5px;
    height: 5px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    overflow: hidden;
  }
  .warroom-cal-tag-plus {
    display: none;
  }
}

/* 圖例：月曆下緣小字列出目前資料集內出現過的分類色，desktop 輔助說明
   標籤含意、手機版是唯一能分辨顏色代表什麼的地方。 */
.warroom-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-faint);
}

.warroom-cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.warroom-cal-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.warroom-cal-legend-dot.blue { background: var(--tag-blue); }
.warroom-cal-legend-dot.violet { background: var(--tag-violet); }
.warroom-cal-legend-dot.slate { background: var(--tag-slate); }

.warroom-cal-day-events-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.warroom-cal-day-events-empty {
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ---------- 免責句（M2 歷史反應統計啟用時顯示） ---------- */

.warroom-radar-disclaimer {
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--text-faint);
}

/* ---------- 主體排版：新聞流 + 與你相關側欄 ---------- */

/* `minmax(0, 1fr)` 不是 `1fr`：見檔頭最後一段的版面根因修復說明。 */
.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

/* [#177] 2026-08-16：`top: 14px` 是「距離視窗頂端 14px」，不是「距離 nav 下緣
   14px」——但這張側欄跟著 document 捲動、z-index auto，吸頂後整片鑽進 sticky
   nav（z-index 20）底下，實測 1280/1600px 下卡片頂端 41px 被吃掉（navH=55、
   elTop=14）。原意顯然是「貼在 nav 下方留 14px 空隙」，改吃 nav.js 發布的
   `--sv-nav-h`，空隙維持 14px。/news 沒有錨點頁籤，nav 下緣就是唯一參考線。 */
.news-relevant-panel {
  position: sticky;
  top: calc(var(--sv-nav-h, 62px) + 14px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  /* v15：側欄要有「側欄感」，跟主列表的白卡拉開層次——底色改成青紫雙暈
     疊 --card-bg，圓角放大，並在左緣掛一條品牌漸層細軌當書脊。 */
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(var(--brand-violet-rgb), 0.1), transparent 62%),
    radial-gradient(110% 70% at 0% 0%, rgba(var(--brand-cyan-rgb), 0.07), transparent 60%),
    var(--card-bg);
  overflow: hidden;
}

.news-relevant-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-violet));
  opacity: 0.55;
}

/* 「川普動態」／「與你相關」共用卡片外殼（任務#145新增）：預設（<1440px
   堆疊）是兩個 flex column 區塊依 DOM 順序（與你相關在前）垂直排列在同一
   張 `.news-relevant-panel` 卡片內，靠 `.news-sidecard + .news-sidecard`
   的分隔線區分；≥1440px 時整個 `.news-relevant-panel` 改 2 欄 grid 並排，
   每個 `.news-sidecard` 自己長成獨立等高卡（見下方 min-width:1440px
   media query），header 用 flex:0 0 auto 固定不縮、body 用 flex:1 1 auto
   +overflow-y:auto 內部滾動。 */
.news-sidecard {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.news-sidecard + .news-sidecard {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.news-sidecard-head {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

/* v15：區塊標題前掛一小段品牌漸層立柱（側欄兩張卡 ＋ 總經事件雷達共用），
   讓「這是一個獨立區塊」在掃視時先被眼睛抓到。 */
.news-sidecard-head .sv-section-title,
.warroom-radar .sv-section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 800;
}

.news-sidecard-head .sv-section-title::before,
.warroom-radar .sv-section-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-violet));
  box-shadow: 0 0 8px rgba(var(--brand-cyan-rgb), 0.35);
}

.news-sidecard-body {
  min-height: 0;
}

#news-relevant-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* v15：側欄條目從「靠底線分隔的裸文字」改成可 hover 的軟卡列——hover 時
   淡底＋左緣品牌軌＋右移 2px，讓「這是可點的一則新聞」不用底線也講得清楚
   （底線在小字級上很吵，卡片語言比較安靜）。 */
.news-relevant-item {
  position: relative;
  display: block;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 180ms var(--ease), background 180ms var(--ease),
    border-color 180ms var(--ease);
}

.news-relevant-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--brand-cyan), var(--brand-violet));
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.news-relevant-item + .news-relevant-item {
  margin-top: 2px;
}

.news-relevant-item:hover {
  transform: translateX(2px);
  background: rgba(var(--surface-tint-rgb), 0.05);
  border-color: var(--border);
}

.news-relevant-item:hover::before {
  opacity: 1;
}

.news-relevant-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 7px;
  transition: color 160ms var(--ease);
}

.news-relevant-item:hover .news-relevant-title {
  color: var(--accent-text);
}

.news-relevant-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.news-relevant-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- 分類過濾列 ---------- */

/* #63 任務擴充：分類從 6 類增為 11 類，一列容易放不下——改橫向滾動
   （overflow-x:auto）取代原本的 flex-wrap，避免 chips 換行擠壓版面。
   chips 本身 flex:0 0 auto + white-space:nowrap 確保不被壓窄/斷字。 */
.news-category-filter {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  /* 上方 9px 是給「川普動態」chip 的未讀計數 badge（`top:-6px` 絕對定位）
     的活動空間：`overflow-x:auto` 在瀏覽器實作上連 y 軸一起變成捲動容器，
     沒有這段 padding 的話 badge 會被切掉上緣（改版前即如此）。 */
  padding: 9px 0 8px;
  margin-bottom: 14px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  /* 右緣淡出＝「還有更多分類，可以往右滑」的無字提示（左緣留 2px 不遮，
     免得第一顆 chip 的描邊被啃掉）。遮罩貼在元素框上、不隨內容捲動。 */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 34px), transparent 100%);
}

.news-category-filter::-webkit-scrollbar {
  height: 5px;
}

.news-category-filter::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--text-muted-rgb), 0.28);
}

.news-cat-chip {
  appearance: none;
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.06), transparent 70%),
    rgba(var(--surface-tint-rgb), 0.025);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 6.5px 15px;
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  position: relative; /* 任務#80 M3.3：未讀計數 badge 絕對定位錨點 */
  transition: color 180ms var(--ease), border-color 180ms var(--ease),
    background 180ms var(--ease), transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.news-cat-chip:hover {
  color: var(--text);
  transform: translateY(-1.5px);
  border-color: rgba(var(--brand-blue-rgb), 0.4);
  box-shadow: 0 4px 12px rgba(var(--shadow-rgb), var(--nv-shadow-a));
}

.news-cat-chip.active {
  color: var(--accent-text);
  border-color: rgba(var(--brand-blue-rgb), 0.6);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.1), transparent 70%),
    linear-gradient(135deg, rgba(var(--brand-cyan-rgb), 0.2), rgba(var(--brand-blue-rgb), 0.13));
  box-shadow:
    0 3px 12px rgba(var(--brand-blue-rgb), 0.24),
    inset 0 1px 0 rgba(var(--nv-gloss-rgb), 0.16);
}

/* ---------- 時段小節（今天內盤前/盤中/盤後） ---------- */

.news-day-subheading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 10px 0 8px 56px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--surface-tint-rgb), 0.035);
}

/* ---------- 重大訊息高亮 ----------
   v15：原本是 `border-left:3px` ＋ `margin-left:-11px` 掛在 grid 容器上，
   那個負邊距讓重大訊息列比同儕整整寬 11px（實測 863 vs 852），右緣參差、
   時間欄也被推歪。改成「卡片自己換色」：琥珀描邊＋琥珀左軌＋極淡琥珀底，
   語意更強而版面完全對齊。 */

.news-entry-major .news-entry-body {
  border-color: rgba(var(--watch-rgb), 0.4);
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.05), transparent 44%),
    linear-gradient(132deg, rgba(var(--watch-rgb), 0.09), transparent 52%),
    var(--card-bg);
}

.news-entry-major .news-entry-body::before {
  background: linear-gradient(180deg, var(--warn-fg), rgba(var(--watch-rgb), 0.35));
  opacity: 1;
}

.news-entry-major .news-entry-body:hover {
  border-color: rgba(var(--watch-rgb), 0.65);
  box-shadow:
    0 2px 4px rgba(var(--shadow-rgb), var(--nv-shadow-a)),
    0 12px 30px rgba(var(--watch-rgb), 0.2);
}

.news-entry-major .news-entry-dot {
  background: linear-gradient(145deg, var(--warn-fg), rgba(var(--watch-rgb), 0.7));
  box-shadow:
    0 0 0 3.5px var(--bg),
    0 0 0 5px rgba(var(--watch-rgb), 0.3),
    0 0 12px rgba(var(--watch-rgb), 0.4);
}

.news-entry-major-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 2.5px 9px;
  border-radius: 999px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-fg);
  white-space: nowrap;
}

/* ---------- 川普動態（任務#75新增）：AI 台股影響研判／機器翻譯 ---------- */

.news-entry-trump-meta {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.news-entry-trump-translation {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.news-entry-trump-mt-badge {
  margin-right: 4px;
  vertical-align: 1px;
}

/* v15：AI 研判從「斜體灰字」升級成 callout 方塊——紫系左軌＋極淡紫底，
   跟原文摘要／免責小字在視覺上分層，一眼看得出「這段是 AI 加的」。 */
.news-entry-trump-note {
  align-self: stretch;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.65;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--badge-violet-rgb), 0.22);
  border-left: 2px solid rgba(var(--badge-violet-rgb), 0.55);
  background: rgba(var(--badge-violet-rgb), 0.07);
}

.news-entry-trump-disclaimer {
  font-size: 10.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ---------- 川普動態：英文原文摺疊（任務#80 M2.2新增） ----------
   <details>/<summary> 原生可摺疊元件，不需要額外 JS 事件綁定。 */

.news-entry-trump-original {
  font-size: 12px;
}

.news-entry-trump-original summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-entry-trump-original summary::-webkit-details-marker {
  display: none;
}

.news-entry-trump-original summary:hover {
  color: var(--text);
}

.news-entry-trump-original-text {
  margin-top: 7px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--border-strong);
  background: rgba(var(--surface-tint-rgb), 0.03);
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ---------- 川普動態：影響關鍵詞 chips／高亮（任務#80 M3.1新增） ---------- */

.news-trump-keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.news-trump-keyword-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(var(--nv-gloss-rgb), 0.08), transparent 70%),
    var(--warn-bg);
  color: var(--warn-fg);
  border: 1px solid var(--warn-border);
  white-space: nowrap;
}

mark.news-trump-keyword-hl {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------- 川普動態：純圖片／影音貼文佔位標示（追加規格） ---------- */

.news-trump-media-placeholder {
  color: var(--text-faint);
  font-style: italic;
  font-weight: 500;
}

/* ---------- 川普動態：台北時區＋日期／盤中標記（任務#80 M3.2新增） ---------- */

/* meta 列 v15 起是 `display:flex` + `gap:6px`，這兩顆原本各自的
   `margin-left:6px` 會跟 gap 疊成 12px，改由 gap 統一控距。 */
.news-entry-trump-time-badge {
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.news-entry-trump-intraday-badge {
  font-weight: 700;
}

/* ---------- 戰情室「川普動態」小欄（任務#75新增 M3.2，任務#80擴充） ---------- */

/* 分隔線改由通用 `.news-sidecard + .news-sidecard` 規則處理（任務#145：
   「與你相關」排到「川普動態」前面，divider 不再綁死在川普卡本身）。 */

.news-trump-highlights-stats {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 有內容才長成膠囊（`:empty` 時 padding/border 會變成一顆空藥丸）。 */
.news-trump-highlights-stats:not(:empty) {
  padding: 2.5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(var(--surface-tint-rgb), 0.04);
}

.news-trump-highlight-item .news-entry-trump-note {
  margin-bottom: 6px;
}

/* ---------- 分類過濾列：未讀計數 badge（任務#80 M3.3新增） ---------- */

.news-cat-chip-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn-fg);
  /* theme-exempt: 缺 token --on-warn（琥珀底上的深字；--on-brand #06222b 是
     青底專用、--on-accent #fff 方向相反，皆不可代用） */
  color: #1a1206;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

/* ---------- 新聞列宏觀分類 chip ---------- */

/* 總經分類 tag：底色維持中性灰、只把字改成 --tag-blue。
   走過兩次彎路才落在這個做法，寫下來免得後人再繞：
   ① 先改 `--brand-blue-rgb` 滿版藍——深色主題下跟「可點的個股 chip」撞色
      （390px 實拍確認）。
   ② 再改 `--brand-cyan-rgb`——深色主題可以，但三個淺色主題把
      --brand-cyan/--brand-blue 一起翻成該主題的暖色系（甲・暖陽兩顆都是
      橘），青藍區隔在淺色主題直接蒸發，又變回跟個股 chip 同色。
   `--tag-blue` 是少數「四主題都真的是藍」的代幣（#6fc2ff／#2a72b8），
   只染字不染底就不會跟任何一種 tint 打架。 */
.news-tag-macro {
  --tag-rgb: var(--text-muted-rgb);
  color: var(--tag-blue);
}

/* ---------- 標題內個股代號連結 ---------- */

.news-title-stock-link {
  color: var(--accent-text);
  text-decoration: none;
  padding: 0 3px;
  margin: 0 -1px;
  border-radius: 5px;
  background: rgba(var(--brand-blue-rgb), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.18);
  font-variant-numeric: tabular-nums;
  transition: background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.news-title-stock-link:hover {
  background: rgba(var(--brand-blue-rgb), 0.24);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-blue-rgb), 0.42);
}

/* ---------- 進場動畫（v15 新增） ----------
   只在「重新載入／換分頁／換分類」那一次渲染掛 `.is-anim`（見 news.js
   renderTimeline()）：「載入更多」是把整份 items 重繪一次，每次都放動畫
   會變成整頁閃爍。逐卡 stagger 上限 12 格（`--nv-i` 由 JS 寫入），再多的
   延遲使用者也感覺不到，只會讓最後幾則遲遲不出現。 */

.news-timeline-line.is-anim .news-entry-body {
  animation: newsCardIn 340ms var(--ease) both;
  animation-delay: calc(var(--nv-i, 0) * 26ms);
}

@keyframes newsCardIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .news-timeline-line.is-anim .news-entry-body {
    animation: none;
  }

  .news-skel-bar {
    animation: none;
  }

  .news-entry-body,
  .news-entry-dot,
  .news-relevant-item,
  .news-cat-chip,
  .news-tag,
  .warroom-radar-card,
  .warroom-key-event-chip,
  .warroom-industry-chip,
  .news-load-more {
    transition: none;
  }

  .news-entry-body:hover,
  .news-relevant-item:hover,
  .news-cat-chip:hover,
  .news-tag-stock:hover,
  .warroom-radar-card:hover,
  .warroom-key-event-chip:hover,
  .warroom-industry-chip:hover,
  .news-load-more:hover:not(:disabled) {
    transform: none;
  }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .news-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* `relative` 而不是 `static`：側欄的書脊軌（`::before`）是絕對定位，
     一旦外殼變成 static 就會往上找到 #app/body 當定位基準，整條軌跡跑到
     視窗最左緣變成一根莫名其妙的直線（390px 實拍抓到）。
     `top: auto` 必須跟著寫：桌機版的 `top: calc(--sv-nav-h + 14px)` 是給
     sticky 用的吸附線，換成 relative 之後同一個 `top` 會變成「相對位移」，
     把整張側欄往下推 76~91px——上面憑空多一塊白、下面壓到新聞列表
     （390px 實測 panel 1147~1801、news-section 從 1746 就開始）。 */
  .news-relevant-panel {
    position: relative;
    top: auto;
    order: -1;
  }

  .warroom-industries-wrap {
    margin-left: 0;
  }
}

/* 手機（390 優先）：主要是把「時間欄＋節點」這條左側落雨槽收窄，把省下來
   的 20px 全部還給新聞卡的可讀寬度；卡片內距、字級、節奏同步縮一階。 */
@media (max-width: 480px) {
  /* 骨架跟真實條目共用同一組欄寬，否則資料到位時整排卡片會橫向跳一下。 */
  .news-entry,
  .news-skel-row {
    grid-template-columns: 34px 12px minmax(0, 1fr);
    gap: 0 7px;
  }

  .news-entry {
    padding: 4px 0;
  }

  .news-timeline-line::before {
    left: 37px;
  }

  .news-entry-time {
    font-size: 10.5px;
    padding-top: 13px;
  }

  .news-entry-dot {
    width: 9px;
    height: 9px;
    margin-top: 15px;
  }

  .news-entry-body {
    padding: 11px 12px 12px;
    border-radius: 13px;
  }

  .news-entry-title {
    font-size: 14.5px;
    line-height: 1.6;
  }

  .news-day-heading {
    font-size: 13px;
  }

  .news-day-subheading {
    margin-left: 46px;
  }

  .news-tabs {
    display: flex;
  }

  .news-tab {
    flex: 1 1 0;
    padding: 8px 10px;
    text-align: center;
  }

  .warroom-hero {
    padding: 14px 14px 15px;
  }

  .warroom-risk {
    width: 100%;
    box-sizing: border-box;
  }

  .warroom-radar-card {
    width: 124px;
  }
}

/* ---------- 寬螢幕：「川普動態」×「與你相關」並排兩欄等高卡
   （任務#145新增）：≥1440px 才有足夠寬度讓主欄＋兩張側欄卡並存不擠壓
   （main 容器 max-width:1600px，扣掉左右 padding 後在 1440px viewport
   實測可用寬度僅約 1376px，600px 側欄+1fr 主欄仍留給主欄 ~750px 可讀
   寬度；低於這個斷點維持 <1440px 的堆疊卡＋各自自然高度，不強制截斷／
   內部捲動，避免窄螢幕上巢狀捲動的操作體驗變差）。 ---------- */
@media (min-width: 1440px) {
  .news-layout {
    grid-template-columns: minmax(0, 1fr) 600px;
  }

  .news-relevant-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    /* 兩欄並排時外殼消失、每張 sidecard 自己是一張卡，外殼的書脊軌與
       圓角裁切要一起退場，否則會在兩張卡左邊多出一條孤立的漸層線。 */
    border-radius: 0;
    overflow: visible;
  }

  .news-relevant-panel::before {
    display: none;
  }

  .news-sidecard {
    background:
      radial-gradient(120% 80% at 100% 0%, rgba(var(--brand-violet-rgb), 0.09), transparent 62%),
      radial-gradient(110% 70% at 0% 0%, rgba(var(--brand-cyan-rgb), 0.06), transparent 60%),
      var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 16px 18px;
    max-height: 70vh;
    overflow: hidden;
  }

  /* 兩欄並排時每張卡自己有完整邊框，取消堆疊版用的分隔線樣式。 */
  .news-sidecard + .news-sidecard {
    margin-top: 0;
    padding-top: 16px;
    border-top: none;
  }

  .news-sidecard-body {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
}
