/* ============================================================
   台指 X 光 — 全站設計系統（藍調靜心）
   單一來源：所有靜態頁與內容站（chips）共用此檔。
   暖humanist 結構（圓角、柔影、留白、呼吸感）+ 冷藍識別色。
   ============================================================ */

:root {
  --bg: #f4f7fc;
  --ground: #f4f7fc;
  --surface: #ffffff;
  --surface-alt: #eef3fa;
  --surface-tint: #e8eefe;
  --text: #10243d;
  --text-soft: #3a4f68;
  --muted: #6b7a8d;
  --line: #e6edf5;
  --line-soft: #eef3fa;
  --brand: #2563eb;
  --brand-deep: #1d4ed8;
  --brand-soft: #dbeafe;
  --accent: #6366f1;
  --accent-soft: #e8ebfd;
  --ink: #10243d;
  --bull: #dc2626;   /* 台灣：漲紅 */
  --bear: #16a34a;   /* 台灣：跌綠 */
  --neutral: #6b7a8d;
  --radius-sm: 16px;
  --radius: 24px;
  --radius-lg: 32px;
  --shadow-sm: 0 4px 16px rgba(37, 99, 235, 0.08);
  --shadow: 0 12px 32px rgba(37, 99, 235, 0.12);
  --shadow-lg: 0 24px 60px rgba(37, 99, 235, 0.16);
  --hero: radial-gradient(120% 90% at 50% -10%, #eaf1fc 0%, #dde8f8 45%, #d2e1f6 100%);
  --maxw: 1120px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

img {
  max-width: 100%;
}

/* ---------- 容器 ---------- */
.hero-inner,
.page-wrap,
.footer-inner,
.container {
  width: min(var(--maxw), calc(100% - 40px));
  margin: 0 auto;
}

.page-wrap,
.container {
  padding: 56px 0 72px;
}

/* ---------- 內容頁 Hero（淺色平靜帶 + 柔光暈） ---------- */
.hero-shell {
  position: relative;
  overflow: hidden;
  background: var(--hero);
  color: var(--text);
  padding: 72px 24px 64px;
}

.hero-shell::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.26), transparent 70%);
  top: -130px;
  left: -90px;
  filter: blur(8px);
}

.hero-shell::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.24), transparent 70%);
  bottom: -140px;
  right: -70px;
  filter: blur(8px);
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 32px;
  align-items: end;
}

/* kicker 到下一個元素（標題或雙欄 grid）的間距：兩種 hero 結構統一 */
.hero-kicker + .hero-title,
.hero-kicker + .hero-grid {
  margin-top: 22px;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 900;
}

.hero-title em {
  font-style: normal;
  color: var(--brand);
}

/* 日報頁專屬：日期作為小一級副標，主標維持「台指籌碼日報」大字。
   .hero-date 僅出現在日報頁，不影響索引／首頁 hero。
   字級用 clamp + vw 隨螢幕縮放，搭配 nowrap → 各寬度都單行（窄螢幕自動縮小，不換行）。 */
.hero-title .hero-date {
  display: block;
  font-size: clamp(1.45rem, 5.6vw, 2.9rem);
  letter-spacing: 0;
  white-space: nowrap;
  margin-bottom: 6px;
}

.hero-copy {
  max-width: 680px;
  color: var(--text-soft);
  font-size: 1.04rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-panel {
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.hero-panel h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--text);
}

.hero-panel p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.hero-pills,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- 最新交易日快照卡（3D 浮起＋進場動畫，首頁 chips 索引與每日頁共用） ---------- */
.snapshot-card {
  position: relative;
  padding: 26px 26px 22px;
  border-radius: var(--radius-lg, 32px);
  background: linear-gradient(165deg, #ffffff 0%, #f3f7ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 26px 54px rgba(37, 99, 235, 0.2), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
  transform: perspective(1000px) rotateX(4deg) rotateY(-9deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.45s ease;
  animation: snapRise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  will-change: transform;
}

.snapshot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 42%);
  pointer-events: none;
}

.snapshot-card:hover {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-6px);
  box-shadow: 0 34px 74px rgba(37, 99, 235, 0.26), 0 2px 0 rgba(255, 255, 255, 0.9) inset;
}

@keyframes snapRise {
  from { opacity: 0; transform: perspective(1000px) rotateX(4deg) rotateY(-9deg) translateY(22px); }
  to { opacity: 1; transform: perspective(1000px) rotateX(4deg) rotateY(-9deg) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .snapshot-card { animation: none; transform: none; }
  .snapshot-card:hover { transform: translateY(-4px); }
}

.snap-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.snap-head-text { min-width: 0; }
.snap-kicker { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; }
.snap-date { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 1.18rem; font-weight: 900; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.snap-dow { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.snap-badge { flex: none; white-space: nowrap; align-self: center; box-shadow: 0 1px 6px rgba(16, 36, 61, 0.08); }
.panel-metrics { position: relative; display: flex; flex-direction: column; }
.pm-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(16, 36, 61, 0.06); }
.pm-row:last-child { border-bottom: 0; }
.pm-label { flex: none; color: var(--text-soft); font-size: 0.88rem; font-weight: 600; }
.pm-value { font-weight: 800; font-size: 1rem; color: var(--text); text-align: right; }
.hero-panel .panel-foot { position: relative; margin: 16px 0 0; color: var(--muted); font-size: 0.78rem; }

/* ---------- 按鈕（pill） ---------- */
.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn,
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.btn:hover,
.btn-primary:hover {
  background: var(--brand-deep);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--brand-deep);
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--brand-soft);
  box-shadow: var(--shadow);
}

/* 並排 CTA 之間的間距（桌機）；手機改為堆疊間距，見 RWD 區段 */
.content-section .btn + .btn-secondary,
.content-section .btn-secondary + .btn {
  margin-left: 8px;
}

/* ---------- 區段 ---------- */
.section {
  margin-bottom: 56px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section-lead {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- 網格 ---------- */
.grid-3,
.grid-2,
.detail-grid,
.signal-grid,
.metric-grid,
.cards {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid {
  grid-template-columns: 2.1fr 1fr;
}

.signal-grid,
.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

/* ---------- 卡片 ---------- */
.card,
.panel,
.article-card,
.signal-card,
.metric-card,
.timeline-card,
.content-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

/* 內容卡共用 hover：所有表面卡統一浮起，集中一處維護（snapshot-card 另有 3D 進場，不納入）。 */
.card,
.article-card,
.panel,
.timeline-card,
.chip-group-card,
.takeaway-card,
.archive-item {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover,
.article-card:hover,
.panel:hover,
.timeline-card:hover,
.chip-group-card:hover,
.takeaway-card:hover,
.archive-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.content-section {
  padding: 30px 32px;
  margin-bottom: 22px;
}

.content-section h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
}

.content-section > :first-child {
  margin-top: 0;
}

.content-section p,
.content-section li {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.content-section ul {
  padding-left: 20px;
  margin: 0;
}

/* 模組卡片 header */
.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.card-icon {
  width: 52px;
  height: 52px;
  background: var(--surface-tint);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon img {
  width: 24px;
  height: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card h3,
.article-card h3,
.panel h3,
.signal-card h3,
.metric-card h3,
.timeline-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.article-card p,
.card p,
.panel p,
.signal-card p,
.metric-card p,
.timeline-card p,
.timeline-card li {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.article-card p + p,
.panel p + p,
.card p + p {
  margin-top: 10px;
}

/* 首頁速覽：截斷解讀後的「閱讀完整解讀 →」接續連結 */
.panel p.commentary-more {
  margin-top: 6px;
  font-weight: 600;
}

/* 今日市場解讀卡：標題列 + 右上免責小字（顏色同綜合傾向警示語、字略小） */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-disclaimer {
  flex: none;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--muted);
}

.article-card a,
.footer-links a,
.inline-link {
  text-decoration: none;
}

.article-card a:hover,
.footer-links a:hover,
.inline-link:hover {
  text-decoration: underline;
}

/* ---------- 標籤 / pill / badge ---------- */
.pill,
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.pill,
.tag {
  background: var(--surface-alt);
  color: var(--text-soft);
}

.badge {
  background: var(--surface-tint);
  color: var(--brand-deep);
  font-weight: 600;
  margin: 3px 2px;
}

/* ---------- 數據樣式 ---------- */
.sentiment-bullish {
  color: var(--bull);
}

.sentiment-bearish {
  color: var(--bear);
}

.sentiment-neutral {
  color: var(--neutral);
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.metric-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.snapshot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.snapshot-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- 表格樣式 ---------- */
.table-like {
  display: grid;
  gap: 10px;
}

.table-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.table-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.table-row:first-child {
  padding-top: 0;
}

.label {
  color: var(--muted);
  font-size: 0.88rem;
}

.value {
  color: var(--text);
  font-weight: 800;
  text-align: right;
}

.list,
.timeline-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.list li + li,
.timeline-card li + li {
  margin-top: 6px;
}

/* ---------- 內容站 archive ---------- */
.archive-group + .archive-group {
  margin-top: 24px;
}

.archive-group h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
}

.archive-list {
  display: grid;
  gap: 12px;
}

.archive-item {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.archive-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.archive-item-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.archive-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.signal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---------- 每日頁籌碼總覽（移植自首頁速覽，全站共用） ---------- */
/* 首頁速覽片段：各區塊間距，讓注入的卡片與單日頁觀感一致 */
.snapshot-fragment > .chips-meta { margin-bottom: 14px; }
.snapshot-fragment > .snap-block { margin-bottom: 16px; }
.snapshot-fragment > .panel { margin-bottom: 16px; }

.chips-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chips-meta a {
  color: var(--brand);
  text-decoration: none;
}

.chips-meta a:hover {
  text-decoration: underline;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.chips-grid-row2 {
  margin-bottom: 0;
}

.chip-group-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 20px;
}

.chip-group-title {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.chip-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 10px;
}

.chip-item:last-child {
  margin-bottom: 0;
}

.chip-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip-item-name {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.chip-item-change {
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.3;
}

.chip-item-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.chip-up {
  color: var(--bull);
}

.chip-dn {
  color: var(--bear);
}

.opt-grid {
  display: grid;
  grid-template-columns: 4.8em 1fr 1fr;
  gap: 0 6px;
  align-items: start;
}

.opt-col-head {
  font-size: 0.73rem;
  color: var(--muted);
  font-weight: 400;
  text-align: right;
  padding-bottom: 6px;
}

.opt-row-label {
  font-size: 0.74rem;
  color: var(--muted);
  padding-top: 4px;
  white-space: nowrap;
}

.opt-cell {
  text-align: right;
  padding: 3px 0;
}

.opt-cell-val {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.opt-cell-chg {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
}

.opt-divider {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line-soft);
  margin: 4px 0;
}

.opt-range-container {
  margin-top: 18px;
  padding: 12px 14px 10px;
  background: var(--surface-alt);
  border-radius: 12px;
  border: 1px dashed var(--line);
}

.opt-range-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 38px;
  text-align: center;
  letter-spacing: 0.03em;
}

.opt-range-bar-wrapper {
  position: relative;
  height: 8px;
  margin: 0 10px;
}

.opt-range-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
}

.opt-range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--brand-soft);
  border: 1px solid #93c5fd;
  box-sizing: border-box;
  border-radius: 4px;
}

.opt-range-limit-pin {
  position: absolute;
  top: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.opt-range-limit-pin.left-pin {
  background: var(--brand);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.4);
}

.opt-range-limit-pin.right-pin {
  background: #ef4444;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}

.opt-range-indicator {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  z-index: 10;
}

.opt-range-pin {
  width: 4px;
  height: 20px;
  background: var(--ink);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.opt-range-tooltip {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.opt-range-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

.opt-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 0.73rem;
  color: var(--muted);
}

.opt-range-label-left strong {
  color: var(--brand);
}

.opt-range-label-right strong {
  color: #ef4444;
}

/* 近期走勢 sparkline */
.trend-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 680px) {
  .trend-grid {
    grid-template-columns: 1fr;
  }
}

/* 窄手機：趨勢卡標題列改上下堆疊，讓右側大數值（nowrap、不縮）取得整卡寬度，避免橫向溢出。 */
@media (max-width: 480px) {
  .spark-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .spark-title {
    white-space: normal;
  }

  /* 成交量列：badge 換到數值下方自成一行（靠左、藥丸維持內容寬度，不被拉滿）。
     選擇器加 .pos-head 提高優先級，確保贏過後方的預設 .pos-break { display:none }。 */
  .pos-head {
    flex-wrap: wrap;
  }

  .pos-head .pos-break {
    display: block;
    flex-basis: 100%;
    height: 0;
  }

  /* badge 換行後靠右，與其描述的數值同側（手機版與桌面並排時一致）。 */
  .pos-head .relvol-badge {
    margin-left: auto;
  }
}

.spark-chart {
  position: relative;
  cursor: crosshair;
}

.spark {
  width: 100%;
  height: 56px;
  display: block;
}

.spark-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed #94a3b8;
  display: none;
  pointer-events: none;
}

.spark-focus,
.spark-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
}

.spark-focus {
  display: none;
  z-index: 6;
}

.spark-mark {
  position: absolute;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.spark-tip {
  position: absolute;
  top: 0;
  display: none;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  z-index: 7;
}

.spark-tip-label {
  opacity: 0.7;
  font-weight: 500;
  margin-right: 6px;
}

.spark-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.spark-title {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spark-head-right {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.spark-sub {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0 0 10px;
}

/* 今日重點：量化訊號摘要帶 + 背離提示 */
.takeaway-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}

.takeaway-card.sentiment-bullish {
  border-left: 4px solid var(--bull);
}

.takeaway-card.sentiment-bearish {
  border-left: 4px solid var(--bear);
}

.takeaway-card.sentiment-neutral {
  border-left: 4px solid var(--neutral);
}

.takeaway-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 14px;
}

.takeaway-verdict {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.takeaway-disclaimer {
  font-size: 0.74rem;
  color: var(--muted);
}

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

.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.signal-pill .signal-dot {
  width: 8px;
  height: 8px;
}

.divergence-note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: 0.88rem;
  color: #2b3a66;
}

.divergence-note strong {
  color: var(--text);
}

/* 今日重點：攤開前幾個訊號的理由 */
.takeaway-notes {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.takeaway-notes li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-soft);
  padding: 4px 0;
}

.takeaway-notes strong {
  color: var(--text);
  margin-right: 4px;
  white-space: nowrap;
}

.takeaway-empty {
  margin: 14px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* 歷史位置：低 ─ 今日 ─ 高 位置條 */
.pos-row {
  margin-bottom: 18px;
}

.pos-row:last-child {
  margin-bottom: 0;
}

.pos-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.pos-label {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* 換行佔位：桌面隱藏（badge 與數值並排）；窄手機撐滿一行，把 badge 擠到下一行靠左。 */
.pos-break {
  display: none;
}

.pos-val {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.pos-bar {
  position: relative;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
}

.pos-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--brand-soft);
  border-radius: 3px;
}

.pos-marker {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
}

/* 相對量條的 1.0× 參考刻度（置中） */
.pos-mid {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--muted);
  opacity: 0.5;
}

.pos-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}

.pos-note {
  margin: 14px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.6;
}

.pos-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.pos-badge.hi {
  background: #fee2e2;
  color: #b91c1c;
}

.pos-badge.lo {
  background: #dcfce7;
  color: #047857;
}

/* 連續性：方向點 + 標籤 + 句子（天數加粗、反轉 chip） */
.streak-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}

.streak-row:last-child {
  border-bottom: none;
}

.streak-label {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  width: 7.5em;
  flex-shrink: 0;
}

.streak-text {
  font-size: 0.9rem;
  color: var(--text-soft);
}

.streak-chip {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 7px;
  border-radius: 999px;
}

.timeline-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.timeline-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--surface-alt);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.timeline-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.notice {
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #2b3a66;
}

/* ---------- 散文 ---------- */
.prose p + p {
  margin-top: 12px;
}

.prose h2,
.prose h3 {
  margin-top: 0;
}

.inline-stats {
  display: grid;
  gap: 10px;
}

/* ---------- FAQ accordion ---------- */
.faq-list {
  display: grid;
  gap: 12px;
}

details.faq-q {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

details.faq-q[open] {
  box-shadow: var(--shadow);
}

details.faq-q > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 26px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

details.faq-q > summary::-webkit-details-marker {
  display: none;
}

details.faq-q > summary::after {
  content: "+";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

details.faq-q[open] > summary::after {
  content: "\2212";
  transform: rotate(180deg);
}

details.faq-q > summary:hover {
  color: var(--brand-deep);
}

.faq-a {
  padding: 0 26px 22px;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.9;
}

.faq-a strong {
  color: var(--text);
}

/* ---------- 頁尾 ---------- */
.footer-shell {
  background: var(--ink);
  color: #c4d3e6;
}

.footer-inner {
  padding: 40px 0;
  text-align: center;
}

.footer-inner > p {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.9;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  margin-top: 16px;
}

.footer-links a {
  color: #c4d3e6;
  font-size: 0.88rem;
}

/* ---------- RWD ---------- */
@media (max-width: 960px) {
  .hero-grid,
  .snapshot-shell,
  .detail-grid,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-shell {
    padding: 56px 20px 48px;
  }

  .hero-title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .hero-copy {
    font-size: 0.96rem;
  }

  .page-wrap,
  .container {
    padding: 36px 0 56px;
  }

  .card,
  .panel,
  .article-card,
  .signal-card,
  .metric-card,
  .timeline-card {
    padding: 22px;
  }

  .content-section {
    padding: 24px 22px;
  }

  /* 手機：閱讀區塊的 CTA 改滿版，對齊上方滿版內容、放大點擊區（桌機維持靠左） */
  .content-section .btn,
  .content-section .btn-secondary {
    display: flex;
    width: 100%;
  }

  /* 並排 CTA 在手機改為上下堆疊：清掉左間距，改用上間距 */
  .content-section .btn + .btn-secondary,
  .content-section .btn-secondary + .btn {
    margin-left: 0;
    margin-top: 10px;
  }

  /* 手機：訊號 pill 改單欄滿版、名稱靠左／方向靠右，消除鋸齒、好掃讀（桌機維持流式） */
  .takeaway-pills {
    flex-direction: column;
  }

  .takeaway-pills .signal-pill {
    width: 100%;
  }

  .takeaway-pills .signal-pill-name {
    margin-right: auto;
  }

}
