/* ============================================================
   股市研究室 — 共用樣式
   金融深色主題 · 台灣慣例「紅漲綠跌」(--up 紅 / --down 綠)
   ============================================================ */
/* [claude code] 2026-07-21 加 .shelf-banner(下架文章的站主預覽提示條) */
:root {
  --bg-0: #0b0f18;
  --bg-1: #111726;
  --bg-2: #161d2e;
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #eaf0fb;
  --muted: #93a1bd;
  --muted-2: #6b7896;
  --gold: #f4c04a;
  --up: #ff5a5f;      /* 漲 / 賺 = 紅 (台灣慣例) */
  --up-soft: rgba(255, 90, 95, 0.14);
  --down: #35c46b;    /* 跌 / 賠 = 綠 (台灣慣例) */
  --down-soft: rgba(53, 196, 107, 0.14);
  --brand: #ff5a5f;
  --brand-2: #ffb347;
  --econ: #4aa3ff;    /* 世界經濟分類色 */
  --econ-soft: rgba(74, 163, 255, 0.14);
  --stock: #ff5a5f;   /* 個股分類色 */
  --stock-soft: rgba(255, 90, 95, 0.14);
  --ind: #b389ff;     /* 產業分析分類色 */
  --ind-soft: rgba(179, 137, 255, 0.14);
  /* 多維度標籤:4 維度各一色(避開紅/綠,不與漲跌語意衝突)*/
  --dim-dna: #7c9cff;       --dim-dna-soft: rgba(124, 156, 255, 0.14);
  --dim-niche: #f4c04a;     --dim-niche-soft: rgba(244, 192, 74, 0.14);
  --dim-catalyst: #ff8a4a;  --dim-catalyst-soft: rgba(255, 138, 74, 0.14);
  --dim-strategy: #35c2a5;  --dim-strategy-soft: rgba(53, 194, 165, 0.14);
  --radius: 18px;
  --shadow: 0 16px 46px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(140% 60% at 15% -5%, #1b2338 0%, transparent 55%),
    radial-gradient(120% 60% at 100% 0%, #241826 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 940px; margin: 0 auto; padding: 0 18px; }

/* ---------- 頂部品牌列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 15, 24, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 12px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 18px rgba(255, 90, 95, 0.35), inset 0 1px 3px rgba(255,255,255,0.4);
}
.brand b { font-size: 17px; letter-spacing: 0.5px; }
.brand .en { font-size: 11px; color: var(--muted-2); letter-spacing: 1.5px; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .cnt { font-size: 12px; color: var(--muted); }
.topbar .tb-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.35; }
.topbar .ver { font-size: 10.5px; color: var(--muted-2); opacity: 0.62;
  font-variant-numeric: tabular-nums; letter-spacing: 0.3px; white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 46px 0 26px; }
.hero h1 { font-size: 30px; letter-spacing: 1px; margin-bottom: 10px; }
.hero h1 .accent { color: var(--gold); }
.hero p { color: var(--muted); font-size: 14.5px; max-width: 560px; margin: 0 auto; }

/* ---------- 控制列(分類 tab + 搜尋) ---------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 22px 0 26px;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease; display: flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--card-hover); color: var(--text); }
.tab.active { background: var(--text); color: var(--bg-0); border-color: var(--text); }
.tab .n { font-size: 11px; opacity: 0.7; }
.search {
  flex: 1; min-width: 180px; position: relative;
}
.search input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; padding: 10px 14px 10px 38px;
  border-radius: 12px; outline: none; font-family: inherit;
  transition: border-color .15s ease;
}
.search input:focus { border-color: var(--gold); }
.search input::placeholder { color: var(--muted-2); }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 15px; }
/* 卡片 / 清單 檢視切換 */
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.view-toggle .vt {
  border: none; background: transparent; color: var(--muted); font-family: inherit;
  font-size: 12.5px; font-weight: 600; padding: 8px 14px; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.view-toggle .vt:hover { color: var(--text); }
.view-toggle .vt.on { background: var(--text); color: var(--bg-0); }

/* ---------- 卡片牆 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-bottom: 50px;
}
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

/* ---------- 置頂區(📌 精選研究)—— 整區用金色面板框起來,和下方一般清單明顯分成兩塊 ---------- */
.pinned {
  margin: 2px 0 34px;
  padding: 15px 17px 17px;
  background: linear-gradient(180deg, rgba(244, 192, 74, 0.09), rgba(244, 192, 74, 0.02));
  border: 1px solid rgba(244, 192, 74, 0.32);
  border-radius: 16px;
  box-shadow: 0 10px 34px -20px rgba(244, 192, 74, 0.55);
}
/* 下架文章的站主預覽提示條(只有後台已登入的本人會看到這頁,訪客看到的是「已下架」) */
.shelf-banner {
  margin: 0 0 14px; padding: 9px 13px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.6; font-weight: 600;
  color: #ffd8d8; background: rgba(228, 74, 74, 0.12);
  border: 1px dashed rgba(228, 74, 74, 0.55);
}

.pinned-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 11px; padding-left: 2px;
  border-bottom: 1px dashed rgba(244, 192, 74, 0.30);
}
.pinned-title { font-size: 15.5px; font-weight: 800; color: var(--gold); letter-spacing: .5px; }
.pinned-sub { font-size: 12px; color: var(--muted-2); }
.pinned-grid { padding-bottom: 0; }
/* 面板內的卡片 / 列:維持深色底(和金色面板對比)+ 金色描邊 + 📌 角標 */
.pinned-grid .card, .pinned-grid .row {
  border-color: rgba(244, 192, 74, 0.45);
}
.pinned-grid .row { border-left: 3px solid var(--gold); }
.pinned-grid .card:hover, .pinned-grid .row:hover { border-color: rgba(244, 192, 74, 0.75); }
/* 📌 角標(蓋在縮圖左上角,清單 / 卡片都適用)*/
.pinned-grid .row-cover { position: relative; }
.pinned-grid .card .cover::after, .pinned-grid .row-cover::after {
  content: "📌"; position: absolute; top: 3px; left: 3px; z-index: 2;
  font-size: 11px; line-height: 1; padding: 3px 4px;
  background: rgba(11, 15, 24, 0.78); border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.pinned-grid .card .cover::after { top: 7px; left: 7px; font-size: 13px; padding: 4px 6px; }

/* ---------- 清單模式(一行一篇 / 一組)---------- */
.grid.as-list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 9px 13px 9px 9px; text-decoration: none; color: inherit;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.row:hover { border-color: rgba(255,255,255,0.22); background: var(--card-hover); transform: translateX(2px); }
.row-cover {
  flex: 0 0 auto; width: 74px; height: 48px; border-radius: 8px; overflow: hidden;
  background: var(--bg-2); display: flex; align-items: center; justify-content: center;
}
.row-cover img { width: 100%; height: 100%; object-fit: cover; }
.row-cover .ph { font-size: 22px; opacity: 0.5; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.row-top .code { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-title {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 清單模式:個股 4 維度標籤(標題下一行) */
.row-dims { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.row-meta { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row-meta .date { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-meta .views { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.row-meta .views:empty { display: none; }
@media (max-width: 520px) {
  .row-cover { width: 52px; height: 40px; }
  .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* ---------- 分頁列(每頁筆數 + 頁碼切換)---------- */
.pager { padding: 4px 0 54px; }
.pager-inner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; }
.pg-size { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.pg-size select {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; cursor: pointer; outline: none;
}
.pg-size select:focus { border-color: var(--gold); }
.pg-nav { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600; border-radius: 8px;
  cursor: pointer; transition: all .14s ease;
}
.pg-btn:hover:not(:disabled) { background: var(--card-hover); color: var(--text); }
.pg-btn:disabled { opacity: 0.35; cursor: default; }
.pg-btn.on { background: var(--text); color: var(--bg-0); border-color: var(--text); }
.pg-gap { color: var(--muted-2); padding: 0 2px; }
.pg-info { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.22); background: var(--card-hover); }
.card .cover {
  aspect-ratio: 16 / 9; background: var(--bg-2);
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .cover .ph { font-size: 42px; opacity: 0.5; }
.card .body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card .meta-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; letter-spacing: 0.3px;
}
.badge.stock { color: var(--stock); background: var(--stock-soft); }
.badge.economy { color: var(--econ); background: var(--econ-soft); }
.badge.industry { color: var(--ind); background: var(--ind-soft); }
.card .code { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card h3 { font-size: 16.5px; line-height: 1.45; }
.card .summary { font-size: 13px; color: var(--muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.card .date { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.card .views { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .views:empty { display: none; }
.card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.card .tag { font-size: 10.5px; color: var(--muted-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

.empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 54px 24px; font-size: 14px;
}

/* ---------- 文章頁 ---------- */
.article-head { padding: 34px 0 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  text-decoration: none; font-size: 13.5px; margin-bottom: 20px; transition: color .15s ease; }
.back:hover { color: var(--text); }
.article-head .meta-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.article-head h1 { font-size: 27px; line-height: 1.4; letter-spacing: 0.3px; }
.article-head .sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; color: var(--muted); font-size: 13px; }
.article-head .sub .dot { color: var(--muted-2); }
.article-head .sub .views:empty { display: none; }
.article-head .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.article-head .tag { font-size: 12px; color: var(--muted); background: var(--card);
  border: 1px solid var(--line); padding: 4px 11px; border-radius: 999px; }
.hr { height: 1px; background: var(--line-soft); margin: 22px 0 4px; }

/* ---------- 多維度標籤(矩陣 + 篩選面板 + chips)---------- */
.dim-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.dim-label { flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 3px 10px; border-radius: 8px; white-space: nowrap; }
.dim-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dim-chip { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  cursor: pointer; text-decoration: none; transition: transform .12s, filter .12s; line-height: 1.5; }
.dim-chip:hover { transform: translateY(-1px); filter: brightness(1.15); }
/* 4 維度配色(label 底色 + chip 邊框/文字/選中底)*/
.dim-label.d-dna      { color: var(--dim-dna);      background: var(--dim-dna-soft); }
.dim-label.d-niche    { color: var(--dim-niche);    background: var(--dim-niche-soft); }
.dim-label.d-catalyst { color: var(--dim-catalyst); background: var(--dim-catalyst-soft); }
.dim-label.d-strategy { color: var(--dim-strategy); background: var(--dim-strategy-soft); }
.dim-chip.d-dna      { color: var(--dim-dna);      border-color: var(--dim-dna-soft); }
.dim-chip.d-niche    { color: var(--dim-niche);    border-color: var(--dim-niche-soft); }
.dim-chip.d-catalyst { color: var(--dim-catalyst); border-color: var(--dim-catalyst-soft); }
.dim-chip.d-strategy { color: var(--dim-strategy); border-color: var(--dim-strategy-soft); }
.dim-chip.on { color: var(--bg-0); font-weight: 700; }
.dim-chip.d-dna.on      { background: var(--dim-dna);      border-color: var(--dim-dna); }
.dim-chip.d-niche.on    { background: var(--dim-niche);    border-color: var(--dim-niche); }
.dim-chip.d-catalyst.on { background: var(--dim-catalyst); border-color: var(--dim-catalyst); }
.dim-chip.d-strategy.on { background: var(--dim-strategy); border-color: var(--dim-strategy); }
/* 文章頁矩陣容器 */
.dim-matrix { margin-top: 16px; padding: 14px 15px; border: 1px solid var(--line-soft);
  border-radius: 14px; background: var(--card); }
.dim-matrix .dim-row:first-child { margin-top: 0; }
.dim-matrix .dim-chip { cursor: pointer; }
/* 首頁篩選面板 */
.dim-filter { margin: 4px 0 20px; padding: 14px 16px; border: 1px solid var(--line-soft);
  border-radius: 16px; background: var(--card); }
.dim-filter-top { display: flex; align-items: center; gap: 10px; }
.dim-filter-toggle { display: inline-flex; align-items: center; gap: 7px; background: transparent;
  border: none; padding: 0; cursor: pointer; font-family: inherit; }
.dim-caret { color: var(--muted-2); font-size: 11px; width: 10px; text-align: center; }
.dim-filter-hint { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.dim-filter-toggle:hover .dim-filter-hint { color: var(--text); }
.dim-active { font-size: 12px; color: var(--muted); }
.dim-active b { color: var(--gold); font-weight: 700; }
.dim-clear { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--brand); background: var(--up-soft);
  border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.dim-clear:hover { filter: brightness(1.15); }
.dim-rows { margin-top: 11px; }

/* 「❓ 四維度標籤說明」面板 */
.dim-help { margin: 4px 0 14px; padding: 12px 16px; border: 1px solid var(--line-soft);
  border-radius: 16px; background: var(--card); }
.dim-help-toggle { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  background: transparent; border: none; padding: 0; cursor: pointer; font-family: inherit; width: 100%; text-align: left; }
.dim-help-title { font-size: 13px; font-weight: 700; color: var(--muted); }
.dim-help-toggle:hover .dim-help-title { color: var(--text); }
.dim-help-sub { font-size: 11.5px; color: var(--muted-2); }
.dim-help-body { margin-top: 12px; border-top: 1px dashed var(--line-soft); padding-top: 12px; }
.dh-intro { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.dh-intro b { color: var(--text); }
.dh-dim { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.dh-dim:first-of-type { border-top: none; padding-top: 0; }
.dh-dim-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.dh-dim-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.dh-tags { list-style: none; display: flex; flex-direction: column; gap: 7px; padding-left: 2px; }
.dh-tag { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dh-tag .cdim { flex: 0 0 auto; }
.dh-tag-desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; flex: 1; min-width: 180px; }
.dh-foot { margin-top: 13px; font-size: 12px; color: var(--muted-2); line-height: 1.7; }
/* 首頁卡片上的 4 維度標籤(獨立一行,顯示用)*/
.card-dims { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px;
  padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.cdim { font-size: 10.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }
.cdim.d-dna      { color: var(--dim-dna);      border-color: var(--dim-dna-soft);      background: var(--dim-dna-soft); }
.cdim.d-niche    { color: var(--dim-niche);    border-color: var(--dim-niche-soft);    background: var(--dim-niche-soft); }
.cdim.d-catalyst { color: var(--dim-catalyst); border-color: var(--dim-catalyst-soft); background: var(--dim-catalyst-soft); }
.cdim.d-strategy { color: var(--dim-strategy); border-color: var(--dim-strategy-soft); background: var(--dim-strategy-soft); }

/* ---------- 個股星等(成長 / 穩定,支援半星)---------- */
.ratings { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 9px 0 2px; }
.rate { display: inline-flex; align-items: center; gap: 6px; }
.rate-label { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stars { position: relative; display: inline-block; line-height: 1;
  font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.stars-bg { color: var(--line); }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--gold); }
/* 文章頁星等放大一點 */
.article-head .ratings { margin: 14px 0 2px; gap: 8px 22px; }
.article-head .rate-label { font-size: 13px; }
.article-head .stars { font-size: 16px; }

/* ---------- Markdown 內文排版 ---------- */
.md { padding: 8px 0 60px; font-size: 15.5px; }
.md h1 { display: none; }  /* 標題已在 article-head 顯示,隱藏內文重複的 h1 */

/* 「一分鐘看懂」白話摘要框(放每篇最上面,給不熟的人一眼抓重點) */
.md .tldr {
  background: linear-gradient(180deg, rgba(244,192,74,0.09), rgba(244,192,74,0.03));
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 14px; padding: 18px 20px 16px; margin: 4px 0 30px;
}
.md .tldr .tldr-title { font-size: 15px; font-weight: 700; color: var(--gold);
  margin: 0 0 10px; letter-spacing: 0.3px; }
.md .tldr ul { margin: 0; padding-left: 20px; }
.md .tldr li { margin: 7px 0; font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.md .tldr li b { color: var(--text); font-weight: 600; }
.md .tldr .tldr-punch { margin-top: 13px; padding-top: 11px;
  border-top: 1px dashed var(--line); font-weight: 600; color: var(--gold); font-size: 14.5px; }
.md h2 {
  font-size: 21px; margin: 40px 0 14px; padding-left: 14px;
  border-left: 4px solid var(--brand); line-height: 1.4;
}
.md h3 { font-size: 17.5px; margin: 26px 0 10px; color: var(--gold); }
.md h4 { font-size: 15.5px; margin: 20px 0 8px; color: var(--text); }
.md p { margin: 12px 0; color: #dbe3f2; }
.md ul, .md ol { margin: 12px 0 12px 4px; padding-left: 22px; }
.md li { margin: 7px 0; color: #dbe3f2; }
.md li::marker { color: var(--brand-2); }
.md strong { color: #fff; font-weight: 700; }
.md a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.md hr { border: none; height: 1px; background: var(--line-soft); margin: 30px 0; }

.md blockquote {
  margin: 18px 0; padding: 14px 18px;
  background: var(--up-soft); border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0; color: #f0e6d8;
}
.md blockquote p { margin: 6px 0; color: inherit; }
.md blockquote strong { color: var(--gold); }

.md figure, .md p > img { margin: 26px 0; }
.md img {
  width: 100%; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: var(--shadow); background: #fff;
}
.md figure figcaption, .md .imgcap {
  text-align: center; font-size: 12.5px; color: var(--muted-2); margin-top: 9px;
}

.md table {
  width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.md thead th { background: rgba(255,255,255,0.05); color: var(--text); font-weight: 700; }
.md th, .md td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.md tbody tr:last-child td { border-bottom: none; }
.md tbody tr:hover { background: rgba(255,255,255,0.03); }
.md td strong { color: var(--gold); }

.md code {
  background: rgba(255,255,255,0.08); color: #ffd6a5;
  padding: 2px 7px; border-radius: 6px; font-size: 0.9em;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.md pre { background: #0d1220; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; overflow-x: auto; margin: 18px 0; }
.md pre code { background: none; color: #e0e6f2; padding: 0; }

/* 漲跌語意色(內文可用 <span class="up">/<span class="down">) */
.up { color: var(--up); font-weight: 700; }
.down { color: var(--down); font-weight: 700; }

/* ---------- 文章頁:同檔其他研究 ---------- */
#siblings { padding: 4px 0 50px; }
#siblings:empty { display: none; }
.sib-head { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px;
  padding-left: 12px; border-left: 4px solid var(--brand); display: flex; align-items: center; flex-wrap: wrap; }
.sib-cnt { font-size: 12px; font-weight: 600; color: var(--muted-2); }
.sib-list { display: flex; flex-direction: column; gap: 8px; }
.sib {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 15px; text-decoration: none; color: inherit;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.sib:hover { background: var(--card-hover); border-color: rgba(255,255,255,0.22); transform: translateX(3px); }
.sib-date { font-size: 12.5px; color: var(--gold); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.sib-title { font-size: 14px; color: var(--text); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sib-arrow { color: var(--muted-2); flex: 0 0 auto; }
.sib-all { display: inline-block; margin-top: 14px; color: var(--muted); font-size: 13px;
  text-decoration: none; transition: color .15s ease; }
.sib-all:hover { color: var(--gold); }

/* ---------- 文章頁:讚 + 留言(互動區) ---------- */
.engage { margin-top: 34px; padding: 26px 0 56px; border-top: 1px solid var(--line-soft); }
.engage[hidden] { display: none; }

/* 讚:置中的大圓鈕 + 提示 */
.like-row {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  margin-bottom: 34px;
}
.like-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  font-size: 17px; font-weight: 800; padding: 13px 30px; border-radius: 999px;
  cursor: pointer; font-family: inherit; transition: all .16s ease;
  font-variant-numeric: tabular-nums; box-shadow: var(--shadow);
}
.like-btn:hover { border-color: var(--brand); transform: translateY(-2px); }
.like-btn:active { transform: translateY(0); }
.like-btn.on { background: var(--up-soft); border-color: var(--brand); color: var(--brand); }
.like-btn.on::after { content: "已讚"; font-size: 12px; font-weight: 600; opacity: .8; }
.like-hint { font-size: 13px; color: var(--muted-2); }

/* 留言 */
.cmt-title { font-size: 17px; margin: 0 0 16px; padding-left: 12px; border-left: 4px solid var(--brand); }
.cmt-cnt { font-size: 14px; color: var(--muted-2); font-weight: 400; }
.cmt-form {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
}
.cmt-nick, .cmt-body {
  background: var(--bg-1); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 14.5px; padding: 11px 14px; border-radius: 11px; outline: none;
  transition: border-color .15s ease; width: 100%;
}
.cmt-nick:focus, .cmt-body:focus { border-color: var(--gold); }
.cmt-nick { max-width: 280px; }
.cmt-body { resize: vertical; line-height: 1.65; min-height: 58px; }
.cmt-nick::placeholder, .cmt-body::placeholder { color: var(--muted-2); }
.cmt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cmt-row { display: flex; align-items: center; gap: 12px; }
.cmt-msg { font-size: 13px; color: var(--muted); flex: 1; min-height: 18px; }
.cmt-send {
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #2a1700; border: none; font-weight: 700; font-size: 14.5px;
  padding: 10px 28px; border-radius: 11px; cursor: pointer; font-family: inherit;
  transition: filter .12s ease, transform .12s ease;
}
.cmt-send:hover { filter: brightness(1.06); }
.cmt-send:active { transform: translateY(1px); }

.cmt-list { display: flex; flex-direction: column; gap: 10px; }
.cmt {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 12px 16px; border-left: 3px solid var(--line);
}
.cmt-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.cmt-who { font-weight: 700; color: var(--gold); font-size: 14px; }
.cmt-time { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.cmt-text { color: #dbe3f2; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.cmt-empty {
  color: var(--muted-2); font-size: 14px; text-align: center;
  padding: 26px 4px; border: 1px dashed var(--line); border-radius: 12px;
}

/* ---------- 頁尾 ---------- */
footer.site {
  border-top: 1px solid var(--line-soft); padding: 24px 0 40px;
  text-align: center; color: var(--muted-2); font-size: 12px;
}
footer.site .disc { margin-top: 6px; color: var(--muted-2); }
footer.site .ver { margin-top: 8px; font-size: 11px; color: var(--muted-2);
  opacity: 0.6; font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }

.loading { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }
