/* home-daily.css — 首頁「每日的行情，從這裡開始」每日看盤區（跑馬燈／盤前／盤中／盤後／三欄）
   只使用站內既有 CSS 變數；漲＝紅 var(--up)、跌＝綠文字 #047857（var(--down) 只用於線條與色塊）。 */
.hd-wrap{max-width:1280px;margin:0 auto;padding:28px 28px 8px;font-family:'Inter','Noto Sans TC',sans-serif;color:var(--text);}
.hd-wrap *{box-sizing:border-box;}
.hd-wrap .mono,.hd-num{font-family:'JetBrains Mono',monospace;font-feature-settings:"tnum" 1;font-variant-numeric:tabular-nums;}
.hd-wrap button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
.hd-wrap button:focus-visible,.hd-wrap a:focus-visible{outline:3px solid var(--gold);outline-offset:2px;border-radius:6px;}
.hd-up{color:var(--up);}
.hd-dn{color:#047857;}
.hd-flat{color:var(--text-2);}
.hd-updating{color:var(--text-3);font-size:12px;font-weight:500;}
.hd-src{font-size:11px;color:var(--text-3);}

/* ═══ 1. 跑馬燈 ═══ */
.hd-tape{display:flex;align-items:stretch;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);height:52px;}
.hd-tape-live{display:flex;align-items:center;gap:8px;padding:0 20px;background:#0F172A;color:#fff;font-size:13px;font-weight:800;letter-spacing:1px;flex-shrink:0;}
.hd-live-dot{width:8px;height:8px;border-radius:50%;background:#EF4444;box-shadow:0 0 0 3px rgba(239,68,68,.25);animation:hd-blink 1.4s infinite;}
@keyframes hd-blink{0%,100%{opacity:1;}50%{opacity:.25;}}
.hd-tape-viewport{flex:1;overflow:hidden;position:relative;display:flex;align-items:center;}
.hd-tape-track{display:flex;align-items:center;white-space:nowrap;will-change:transform;animation:hd-scroll var(--hd-tape-dur,60s) linear infinite;}
.hd-tape-viewport:hover .hd-tape-track{animation-play-state:paused;}
@keyframes hd-scroll{from{transform:translateX(0);}to{transform:translateX(-50%);}}
.hd-tape-item{display:inline-flex;align-items:baseline;gap:8px;padding:0 22px;border-right:1px solid var(--border);font-size:14px;line-height:52px;}
.hd-tape-name{color:var(--text-2);font-weight:500;}
.hd-tape-price{font-weight:700;font-size:15px;color:var(--text);}
.hd-tape-chg{font-weight:700;font-size:13px;}
.hd-tape-empty{padding:0 22px;color:var(--text-3);font-size:13px;}
@media (prefers-reduced-motion:reduce){
  .hd-live-dot{animation:none;}
  .hd-tape-track{animation:none;}
  .hd-tape-viewport{overflow-x:auto;-webkit-overflow-scrolling:touch;}
  .hd-tape-track .hd-tape-copy{display:none;}
}
.hd-tape.is-static .hd-tape-track{animation:none;}
.hd-tape.is-static .hd-tape-viewport{overflow-x:auto;}
.hd-tape.is-static .hd-tape-copy{display:none;}

/* ═══ 2. 每日看盤卡 ═══ */
.hd-card{margin-top:18px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;box-shadow:var(--shadow-md);}
/* 標題帶：比 --brand 深、彩度低的海軍藍（2026-10-11 使用者：原本太亮藍）；只用在這一塊 */
.hd-head{--hd-head-bg:#14307F;background:linear-gradient(135deg,#102766 0%,#1A3A94 100%);color:#fff;padding:26px 30px 0;position:relative;}
.hd-head-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;}
.hd-title{font-size:28px;font-weight:800;letter-spacing:-0.5px;margin:0 0 6px;line-height:1.25;color:#fff;}
.hd-sub{margin:0;font-size:14px;color:rgba(255,255,255,.82);}
.hd-clock{font-size:13px;color:rgba(255,255,255,.85);white-space:nowrap;padding-top:6px;}
.hd-timeline{display:grid;grid-template-columns:repeat(3,1fr);margin-top:24px;}
.hd-seg{position:relative;text-align:left;padding:0 0 18px;color:rgba(255,255,255,.72);display:block;}
.hd-seg::before{content:'';position:absolute;left:0;right:0;top:9px;height:2px;background:rgba(255,255,255,.28);}
.hd-seg.is-done::before{background:var(--gold);}
.hd-seg.is-active::before{background:linear-gradient(90deg,var(--gold) 0 28%,rgba(255,255,255,.28) 28%);}
.hd-seg-node{position:relative;z-index:1;display:block;width:20px;height:20px;border-radius:50%;border:2px solid rgba(255,255,255,.55);background:var(--hd-head-bg);margin-bottom:14px;}
.hd-seg.is-done .hd-seg-node{border-color:var(--gold);}
.hd-seg.is-active .hd-seg-node{background:var(--gold);border-color:var(--gold);box-shadow:0 0 0 5px rgba(245,158,11,.35);}
.hd-seg-name{display:block;font-size:18px;font-weight:800;color:rgba(255,255,255,.72);margin-bottom:4px;}
.hd-seg.is-active .hd-seg-name{color:#fff;}
.hd-seg-time,.hd-seg-desc{font-size:13px;color:rgba(255,255,255,.65);}
.hd-seg.is-active .hd-seg-time,.hd-seg.is-active .hd-seg-desc{color:rgba(255,255,255,.95);}
.hd-seg::after{content:'';position:absolute;left:0;right:0;bottom:0;height:5px;border-radius:5px 5px 0 0;background:transparent;}
.hd-seg.is-active::after{background:var(--gold);}
.hd-seg:hover .hd-seg-name{color:#fff;}
.hd-body{padding:22px 30px 26px;}
.hd-panel[hidden]{display:none;}
.hd-h3{font-size:18px;font-weight:800;margin:0;letter-spacing:-0.2px;}
.hd-sec-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:14px;flex-wrap:wrap;}
.hd-meta{font-size:13px;color:var(--text-3);}
.hd-link{color:var(--brand);font-weight:700;font-size:13px;white-space:nowrap;}
.hd-link:hover{text-decoration:underline;}
.hd-rule{margin-top:10px;font-size:12px;color:var(--text-3);line-height:1.6;}
/* 三個分頁的條件說明長度不同：預留固定行數，切換分頁時區塊高度不變 */
#hd-watch-rule{min-height:calc(12px * 1.6);}
.hd-empty{padding:28px 10px;text-align:center;color:var(--text-3);font-size:13px;}

/* ── 盤前：見檔案最後「盤前改版」 ── */
.hd-cell-date{font-size:10px;color:var(--text-3);} /* 個股觀察表格也用 */
.hd-tag{display:inline-block;padding:3px 9px;border-radius:6px;font-size:11px;font-weight:700;background:var(--brand-soft);color:var(--brand);white-space:nowrap;}
.hd-tag.is-red{background:var(--up-soft);color:var(--up);}
.hd-tag.is-gold{background:var(--gold-soft);color:#B45309;}
.hd-tag.is-grey{background:var(--surface-2);color:var(--text-2);}
.hd-tag.is-rev{background:var(--brand-soft);color:var(--brand);}
.hd-tag.is-conf{background:var(--gold-soft);color:#B45309;}
.hd-tag.is-fin{background:#F3E8FF;color:#7E22CE;}

/* ── 盤中：市場數據 ── */
.hd-market{margin-bottom:26px;padding-bottom:22px;border-bottom:1px solid var(--border);}
.hd-market-head{display:flex;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap;}
.hd-pill-link{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:var(--radius-pill);background:var(--brand);color:#fff;font-size:12px;font-weight:700;line-height:1;transition:background .15s;white-space:nowrap;}
.hd-pill-link:hover{background:var(--brand-strong);}
.hd-pill-link span{font-size:14px;line-height:1;}
.hd-market-time{margin-left:auto;white-space:nowrap;}
.hd-market-time .hd-only-desktop{display:inline;}
.hd-market-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;}
.hd-mcard{border:1px solid var(--border);border-radius:12px;padding:16px 10px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--surface);min-height:118px;}
.hd-mcard.is-gold{background:var(--gold-soft);border-color:#FDE68A;}
.hd-mcard-label{font-size:13px;color:var(--text-2);font-weight:500;}
.hd-mcard-value{font-size:24px;font-weight:800;letter-spacing:-0.4px;}
.hd-mcard-chg{font-size:13px;font-weight:700;}
.hd-mcard-sub{font-size:12px;color:var(--text-3);}
.hd-breadth-cards{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px;}
.hd-bcard{border:1px solid var(--border);border-radius:12px;padding:14px 16px 16px;background:var(--surface);}
.hd-bcard-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px;}
.hd-bcard-title{font-size:14px;font-weight:800;}
.hd-bcard-total{font-size:12px;color:var(--text-3);}
.hd-bcard-grid{display:grid;grid-template-columns:repeat(3,1fr);text-align:center;}
.hd-bcard-lbl{font-size:12px;color:var(--text-2);}
.hd-bcard-val{font-size:22px;font-weight:800;line-height:1.3;}
.hd-bcard-lim{font-size:11px;color:var(--text-3);margin-top:2px;}
.hd-bcard-lim b{font-weight:700;}
.hd-bcard-bar{display:flex;height:8px;border-radius:4px;overflow:hidden;background:var(--surface-2);margin-top:12px;}
.hd-bcard-bar > span{display:block;height:100%;}
.hd-bcard-bar .u{background:var(--up);}
.hd-bcard-bar .f{background:var(--border-strong);}
.hd-bcard-bar .d{background:var(--down);}
.hd-bcard .hd-updating{display:block;text-align:center;padding:18px 0;}

/* ── 盤中：族群 ── */
.hd-sector-cols{display:grid;grid-template-columns:1fr 1fr;gap:36px;}
.hd-sector-title{font-size:14px;font-weight:800;margin-bottom:10px;}
.hd-sector-title.is-up{color:var(--up);}
.hd-sector-title.is-dn{color:#047857;}
.hd-sector-row{display:grid;grid-template-columns:110px minmax(0,1fr) 44px;align-items:center;gap:14px;padding:11px 0;font-size:15px;}
.hd-sector-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-bar{height:12px;border-radius:6px;background:var(--surface-2);overflow:hidden;}
.hd-bar > span{display:block;height:100%;border-radius:6px;background:var(--up);}
.hd-bar.is-dn > span{background:var(--down);}
.hd-sector-score{text-align:right;font-weight:800;font-size:15px;}
.hd-notice{margin-top:16px;background:var(--brand-soft);border-radius:12px;padding:14px 18px;display:flex;justify-content:space-between;align-items:center;gap:16px;font-size:14px;color:var(--text);flex-wrap:wrap;}
.hd-notice b{font-weight:800;}

/* ── 盤後：籌碼總覽（上下堆疊：三大法人卡 → 四個模組 → 策略訊號 → 個股觀察）── */
.hd-chip-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;}
.hd-chip{border:1px solid var(--border);border-radius:12px;padding:16px 10px 14px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;background:var(--surface);}
/* 外資／投信／自營商標題放大加粗（2026-10-11）；行高收緊，卡片總高度不變 */
.hd-chip-label{font-size:17px;line-height:1.2;color:var(--text);font-weight:800;letter-spacing:0.5px;}
.hd-chip-value{font-size:26px;font-weight:800;letter-spacing:-0.5px;line-height:1.1;}
.hd-chip-value small{font-size:16px;font-weight:800;margin-left:2px;}
.hd-chip-ratio,.hd-chip-sum{font-size:13px;color:var(--text-2);}
.hd-chip-ratio b,.hd-chip-sum b{font-weight:800;color:var(--text);}
.hd-chip-pct{font-size:13px;font-weight:700;color:var(--text);min-height:1.4em;}
/* 分級標籤：賣超綠色系、買超紅色系、常態灰；level 越大顏色越深 */
.hd-grade{display:inline-block;padding:4px 12px;border-radius:999px;font-size:12px;font-weight:800;line-height:1.2;white-space:nowrap;}
.hd-grade.is-normal-0{background:var(--surface-2);color:var(--text-2);}
.hd-grade.is-buy-1{background:var(--up-soft);color:var(--up);}
.hd-grade.is-buy-2{background:var(--up);color:#fff;}
.hd-grade.is-sell-1{background:var(--down-soft);color:#047857;}
.hd-grade.is-sell-2{background:#047857;color:#fff;}
/* 四個模組：電腦版 2×2 */
.hd-mod-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px;}
.hd-mod{border:1px solid var(--border);border-radius:12px;padding:16px 18px;background:var(--surface);display:flex;flex-direction:column;gap:8px;min-width:0;}
.hd-mod-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:2px;}
.hd-mod-title{font-size:15px;font-weight:800;white-space:nowrap;min-width:0;}
.hd-mod-meta{font-size:12px;color:var(--text-2);font-weight:700;white-space:nowrap;}
/* 盤後各區塊更新時間（2026-10-12）：模組標題下一行小字；資料日落後的列／模組標黃色資料日 */
.hd-mod-upd{display:inline;margin-left:8px;font-size:11px;font-weight:500;color:var(--text-3);letter-spacing:0;white-space:nowrap;} /* 更新時間放標題旁，同一行（2026-10-12 使用者） */
.hd-old-date{display:inline-block;font-size:10px;font-weight:700;line-height:1;padding:2px 4px;margin-right:4px;border-radius:4px;background:#FFFBEB;border:1px solid #FDE68A;color:#B45309;vertical-align:1px;}
.hd-sec-right{display:inline-flex;align-items:baseline;gap:12px;}
.hd-mod-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);font-size:14px;}
.hd-mod-row:last-child{border-bottom:none;}
/* 外資選擇權：多空淨額下方一行買權／賣權口數與金額＋分級（2026-10-11） */
.hd-mod-group .hd-mod-row{border-bottom:none;padding-bottom:2px;}
.hd-mod-detail{display:flex;flex-wrap:wrap;gap:2px 14px;font-size:11px;color:var(--text-3);padding:0 0 6px;}
.hd-mod-k .hd-grade{margin-left:6px;vertical-align:middle;}
.hd-mod-k{color:var(--text-2);font-weight:600;white-space:nowrap;}
.hd-mod-v{text-align:right;font-weight:800;font-size:15px;}
.hd-mod-v{white-space:nowrap;}
.hd-mod-v small{display:inline;font-size:11.5px;font-weight:600;color:var(--text-2);margin-right:8px;} /* 較前日與數值同一行 */
.hd-mod-foot{margin-top:auto;padding-top:10px;border-top:1px solid var(--border);font-size:13px;color:var(--text-2);}
.hd-mod-foot b{color:var(--text);font-weight:800;}
.hd-mod .hd-empty{padding:28px 0;}
/* 選擇權未平倉分布：同一刻度線三個標記 */
.hd-opt-rail{position:relative;height:104px;margin:6px 0 4px;}
.hd-opt-line{position:absolute;left:4%;right:4%;top:50%;height:3px;border-radius:2px;background:var(--border-strong);transform:translateY(-50%);}
/* 標記圓點都在線上；賣權／買權的文字在線下方、加權收盤的文字在線上方，數字靠近時不會疊在一起 */
.hd-opt-tick{position:absolute;top:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:2px;width:96px;text-align:center;}
.hd-opt-mark{width:12px;height:12px;border-radius:50%;background:var(--text-3);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--border-strong);margin-top:-6px;margin-bottom:4px;}
.hd-opt-tick.is-put .hd-opt-mark{background:#047857;}
.hd-opt-tick.is-call .hd-opt-mark{background:var(--up);}
.hd-opt-val{font-size:14px;font-weight:800;line-height:1.2;}
.hd-opt-lab{font-size:11px;color:var(--text-2);font-weight:600;white-space:nowrap;line-height:1.2;}
.hd-opt-tick.is-close{top:auto;bottom:50%;flex-direction:column-reverse;}
.hd-opt-tick.is-close .hd-opt-mark{background:var(--brand);width:14px;height:14px;margin-top:4px;margin-bottom:-7px;}
.hd-opt-tick.is-close .hd-opt-val,.hd-opt-tick.is-close .hd-opt-lab{color:var(--brand);}
.hd-opt-dist{display:flex;justify-content:space-between;gap:12px;font-size:13px;color:var(--text-2);flex-wrap:wrap;}
.hd-opt-dist b{font-weight:800;}
/* 法人資金流向族群 */
.hd-flow-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.hd-flow-title{font-size:12px;font-weight:800;margin-bottom:4px;}
.hd-flow-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--border);font-size:14px;}
.hd-flow-row:last-child{border-bottom:none;}
.hd-flow-name{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.hd-flow-row b{font-weight:800;white-space:nowrap;}
.hd-flow-tunit{display:none;font-weight:600;font-size:11px;} /* 窄欄才顯示：單位收進標題，每列只放數字 */
/* 量能 */
.hd-vol-top{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;}
.hd-vol-value{font-size:26px;font-weight:800;letter-spacing:-0.5px;line-height:1.1;}
.hd-vol-value small{font-size:14px;font-weight:800;margin-left:2px;}
.hd-vol-split{font-size:11px;color:var(--text-3);margin-top:2px;white-space:nowrap;} /* 上市／上櫃分開列（合計＝大字） */
.hd-vol-split b{color:var(--text-2);font-weight:700;}
.hd-vol-meta{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:13px;color:var(--text-2);}
.hd-vol-meta b{color:var(--text);font-weight:800;}
.hd-vol-chart{width:100%;height:72px;display:block;margin-top:6px;}
.hd-vol-chart rect{fill:var(--border-strong);}
.hd-vol-chart rect.is-today{fill:var(--brand);}
.hd-vol-avg{stroke:var(--text-2);stroke-width:1;stroke-dasharray:4 3;vector-effect:non-scaling-stroke;}
/* 策略訊號：電腦版一列 5 格（名稱在上、檔數在下，置中） */
.hd-signal-list{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;}
.hd-signal-row{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:16px 8px;border:1px solid var(--border);border-radius:12px;background:var(--surface);text-align:center;}
.hd-signal-name{font-size:14px;font-weight:700;}
.hd-signal-count{color:var(--brand);font-size:24px;font-weight:800;line-height:1;}
.hd-signal-list .hd-empty{grid-column:1/-1;}
.hd-divider{height:1px;background:var(--border);margin:26px 0 22px;}
.hd-tabs{display:inline-flex;background:var(--surface-2);border-radius:var(--radius-pill);padding:4px;gap:2px;}
.hd-tab{padding:9px 26px;border-radius:var(--radius-pill);font-size:14px;font-weight:700;color:var(--text-2);transition:all .15s;}
.hd-tab[aria-pressed="true"]{background:var(--surface);color:var(--brand);box-shadow:var(--shadow-sm);}
.hd-tabs.is-market .hd-tab{padding:8px 22px;}
.hd-watch-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap;}
.hd-watch-cols{display:grid;grid-template-columns:1fr 1fr;gap:28px;}
.hd-col-title{font-size:15px;font-weight:800;margin-bottom:8px;}
.hd-col-title small{font-weight:500;color:var(--text-3);font-size:12px;margin-left:6px;}
.hd-table{width:100%;border-collapse:collapse;font-size:14px;}
.hd-table th{font-weight:500;color:var(--text-3);font-size:12px;text-align:right;padding:6px 8px;border-bottom:1px solid var(--border);white-space:nowrap;}
.hd-table th:nth-child(1),.hd-table th:nth-child(2),.hd-table td:nth-child(1),.hd-table td:nth-child(2){text-align:left;}
.hd-table td{padding:0 8px;height:38px;text-align:right;white-space:nowrap;vertical-align:middle;}
.hd-table tbody tr:nth-child(even){background:var(--surface-2);}
.hd-table .hd-rank{color:var(--text-3);font-size:12px;width:28px;}
.hd-table .hd-stock{font-weight:700;overflow:hidden;text-overflow:ellipsis;max-width:0;width:40%;}
.hd-table .hd-code{color:var(--text-3);font-weight:500;font-size:12px;margin-left:6px;}
.hd-table .hd-fifth{min-width:84px;}
/* 漲跌欄兩行：上漲跌點、下漲跌幅（2026-10-28 使用者要求加漲跌點） */
.hd-table .hd-chg{line-height:1.1;}
.hd-table .hd-chg-pt,.hd-table .hd-chg-pct{display:block;}
.hd-table .hd-chg-pct{font-size:11px;font-weight:600;opacity:.85;}
.hd-table td.is-empty{color:var(--text-3);text-align:center;}
.hd-table .hd-tag{margin-left:4px;}
/* 焦點股（2026-10-11）：收盤、漲跌幅往左收，觀察條件靠左、一列放兩個標籤不換行（後端每檔最多 2 個，config/homepage-watch.json focus.maxTags） */
.hd-table.is-focus{table-layout:fixed;}
.hd-table.is-focus th:nth-child(1),.hd-table.is-focus td:nth-child(1){width:24px;}
.hd-table.is-focus th:nth-child(2),.hd-table.is-focus td:nth-child(2){width:21%;}
.hd-table.is-focus th:nth-child(3),.hd-table.is-focus td:nth-child(3){width:14%;}
.hd-table.is-focus th:nth-child(4),.hd-table.is-focus td:nth-child(4){width:16%;}
.hd-table.is-focus th:nth-child(5),.hd-table.is-focus td.hd-fifth{text-align:left;padding-left:8px;}
.hd-table.is-focus .hd-rank{padding-right:0;}
.hd-table.is-focus td.is-empty{width:auto;}
.hd-table.is-focus .hd-fifth{width:auto;min-width:0;white-space:nowrap;overflow:hidden;line-height:1.2;}
.hd-table.is-focus .hd-tag{font-size:10.5px;padding:2px 5px;margin:0 3px 0 0;border-radius:4px;letter-spacing:-0.2px;}
.hd-table.is-focus .hd-tag:last-child{margin-right:0;}
.hd-table.is-focus td:nth-child(3),.hd-table.is-focus td:nth-child(4){padding-left:0;padding-right:3px;font-size:12.5px;}
@media (max-width:759px){ /* 手機單欄：名稱放寬、觀察條件允許換行 */
  .hd-table.is-focus th:nth-child(2),.hd-table.is-focus td:nth-child(2){width:30%;}
  .hd-table.is-focus th:nth-child(3),.hd-table.is-focus td:nth-child(3){width:16%;}
  .hd-table.is-focus th:nth-child(4),.hd-table.is-focus td:nth-child(4){width:17%;}
  .hd-table.is-focus .hd-fifth{white-space:normal;line-height:1.5;padding-top:3px;padding-bottom:3px;}
  .hd-table.is-focus .hd-tag{margin-bottom:1px;}
}
.hd-table.is-strong .hd-tag{font-size:11px;padding:2px 6px;white-space:nowrap;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;} /* 族群標籤固定一行（2026-10-13） */
.hd-table.is-strong .hd-fifth{white-space:normal;width:30%;}

/* ═══ 3. 三欄 ═══ */
.hd-cols{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin-top:24px;}
.hd-col{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px 24px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;min-width:0;}
.hd-col-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;}
.hd-news-item{padding:12px 0;border-bottom:1px solid var(--border);}
.hd-news-item:last-child{border-bottom:none;}
.hd-news-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-3);margin-bottom:4px;}
.hd-news-cat{color:var(--brand);font-weight:800;}
.hd-news-title{font-size:15px;font-weight:700;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--text);}
.hd-news-title:hover{color:var(--brand);}
.hd-ext{display:inline-block;width:11px;height:11px;vertical-align:-1px;}
.hd-seg2{display:grid;grid-template-columns:1fr 1fr;background:var(--surface-2);border-radius:var(--radius-pill);padding:4px;margin-bottom:6px;}
.hd-seg2.is-3{grid-template-columns:1fr 1fr 1fr;}
.hd-seg2 .hd-tab{padding:8px 10px;text-align:center;}
.hd-seg2.is-3 .hd-tab{padding:8px 4px;font-size:13px;white-space:nowrap;}
.hd-link-btn{background:none;border:0;padding:0;cursor:pointer;font-family:inherit;}
/* ── 財報與營收「看更多」：整頁清單（dialog）── */
.hd-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:flex-start;justify-content:center;padding:40px 16px;background:rgba(15,23,42,.55);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);}
.hd-modal[hidden]{display:none;}
.hd-modal-box{background:var(--surface);color:var(--text);border-radius:var(--radius-lg);width:min(880px,100%);max-height:calc(100vh - 80px);display:flex;flex-direction:column;box-shadow:var(--shadow-lg);overflow:hidden;}
.hd-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px 12px;border-bottom:1px solid var(--border);}
.hd-modal-head .hd-h3{font-size:19px;}
.hd-modal-close{background:var(--surface-2);border:0;border-radius:50%;width:34px;height:34px;font-size:18px;line-height:1;cursor:pointer;color:var(--text-2);}
.hd-modal-close:hover{background:var(--border);}
.hd-modal-tabs{padding:12px 22px 0;}
.hd-modal-tabs .hd-seg2{max-width:360px;margin-bottom:0;}
.hd-modal-note{padding:10px 22px 0;font-size:12px;color:var(--text-3);}
.hd-modal-note:empty{display:none;}
.hd-modal-body{overflow:auto;padding:6px 22px 18px;-webkit-overflow-scrolling:touch;}
.hd-modal-group{position:sticky;top:0;background:var(--surface);padding:12px 0 6px;font-size:13px;font-weight:800;color:var(--brand);border-bottom:1px solid var(--border);z-index:1;}
.hd-modal-group small{font-weight:500;color:var(--text-3);margin-left:8px;}
.hd-modal-body .hd-earn-row{grid-template-columns:56px minmax(0,1fr) auto;padding:10px 0;}
.hd-modal-body .hd-earn-row.is-full{grid-template-columns:minmax(0,1fr) auto;}
.hd-modal-body .hd-earn-val{min-width:120px;}
.hd-modal-foot{padding:10px 22px 16px;font-size:11px;color:var(--text-3);border-top:1px solid var(--border);}
/* 公告全文彈窗（2026-10-28）：主旨、發言時間／事實發生日、說明（保留換行）；底部到公開資訊觀測站的連結 */
.hd-ann-box{width:min(720px,100%);}
.hd-ann-code{margin-left:8px;font-size:14px;font-weight:600;color:var(--text-3);}
.hd-ann-subject{font-size:16px;font-weight:800;line-height:1.5;padding:12px 0 6px;}
.hd-ann-meta{font-size:12px;color:var(--text-3);padding-bottom:10px;border-bottom:1px solid var(--border);margin-bottom:12px;}
.hd-ann-body{font-size:14px;line-height:1.7;white-space:pre-wrap;word-break:break-word;color:var(--text-2);}
.hd-ann-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;}
.hd-ann-link{font-size:13px;font-weight:700;color:var(--brand);white-space:nowrap;}
.hd-ann-link:hover{text-decoration:underline;}
@media (max-width:640px){
  .hd-modal{padding:0;align-items:stretch;}
  .hd-modal-box{width:100%;max-height:100vh;border-radius:0;}
}
.hd-earn-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid var(--border);}
.hd-earn-row:last-child{border-bottom:none;}
.hd-earn-date{font-weight:800;color:var(--brand);font-size:13px;}
.hd-earn-name{font-size:14px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-earn-name .hd-earn-sub{margin-left:6px;font-weight:500;}
.hd-earn-name .hd-tag{margin-left:6px;padding:1px 6px;}
.hd-earn-sub{font-size:12px;color:var(--text-3);}
.hd-earn-val{text-align:right;font-size:13px;font-weight:700;white-space:nowrap;}
.hd-earn-val small{display:inline;margin-left:6px;font-size:11px;color:var(--text-3);font-weight:500;}
.hd-art-item{padding:12px 0;border-bottom:1px solid var(--border);cursor:pointer;}
.hd-art-item:last-child{border-bottom:none;}
.hd-art-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-3);margin-bottom:4px;}
.hd-art-cat{color:var(--brand);font-weight:800;}
.hd-art-title{font-size:15px;font-weight:700;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.hd-art-item:hover .hd-art-title{color:var(--brand);}

/* ═══ 3b. 交易框架（文章教學下方、免責聲明上方）═══ */
.tf{margin-top:40px;padding-top:34px;border-top:1px solid var(--border);}
.tf[hidden]{display:none;}
.tf-head{text-align:center;margin-bottom:26px;}
.tf-title{font-size:26px;font-weight:800;letter-spacing:-0.4px;margin:0 0 8px;}
.tf-sub{margin:0;font-size:15px;color:var(--text-2);}
/* 漏斗：四層由寬到窄；顏色 --brand-strong → --brand → --brand-2 → --gold */
.tf-funnel{display:flex;flex-direction:column;align-items:center;gap:6px;margin:0 auto 30px;max-width:760px;}
.tf .tf-layer{display:flex;align-items:center;justify-content:center;gap:12px;color:#fff;border-radius:10px;height:56px;padding:0 20px;font-size:16px;font-weight:800;transition:transform .15s,box-shadow .15s;}
.tf-layer:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm);}
.tf-layer:nth-child(1){width:100%;}
.tf-layer:nth-child(2){width:86%;}
.tf-layer:nth-child(3){width:72%;}
.tf-layer:nth-child(4){width:58%;}
/* 寫成 .tf .tf-cN 是為了壓過 .hd-wrap button 的 background:none */
.tf .tf-c1{background:var(--brand-strong);}
.tf .tf-c2{background:var(--brand);}
.tf .tf-c3{background:var(--brand-2);}
.tf .tf-c4{background:var(--gold);}
.tf-layer-no{font-size:13px;font-weight:700;opacity:.85;}
.tf-layer-session{font-size:12px;font-weight:700;padding:3px 9px;border-radius:999px;background:rgba(255,255,255,.22);}
/* 說明卡：電腦版 2×2 */
.tf-cards{display:grid;grid-template-columns:1fr 1fr;gap:18px;}
.tf-card{border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:22px 24px;display:flex;flex-direction:column;gap:10px;min-width:0;scroll-margin-top:84px;}
.tf-card-head{display:flex;align-items:center;gap:12px;margin-bottom:4px;}
.tf-num{width:42px;height:42px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:15px;font-weight:800;flex:0 0 auto;}
.tf-card-title{margin:0;font-size:18px;font-weight:800;letter-spacing:-0.2px;}
.tf-card-session{font-size:12px;color:var(--text-2);font-weight:600;margin-top:2px;}
.tf-label{font-size:12px;font-weight:800;color:var(--text-3);letter-spacing:.04em;margin-top:4px;}
.tf-watch{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px;}
.tf-watch li{position:relative;padding-left:16px;font-size:14px;line-height:1.55;}
.tf-watch li::before{content:'';position:absolute;left:2px;top:9px;width:6px;height:6px;border-radius:50%;background:var(--brand);}
.tf-ask{background:var(--gold-soft);border-radius:10px;padding:12px 14px;font-size:14px;font-weight:700;line-height:1.5;}
.tf-ask-label{display:block;font-size:12px;font-weight:800;color:var(--gold);margin-bottom:4px;}
/* 工具按鈕：電腦版同一列不換行（padding 6px 10px 6px 12px、箭頭 10px、間距 6px） */
.tf-tools{display:flex;flex-wrap:nowrap;gap:6px;margin-top:auto;}
.tf .tf-tool{display:inline-flex;align-items:center;gap:4px;padding:6px 10px 6px 12px;border:1px solid var(--border-strong);border-radius:999px;font-size:13px;font-weight:700;color:var(--text);background:var(--surface);white-space:nowrap;line-height:1.2;transition:border-color .15s,color .15s;}
.tf .tf-tool:hover{border-color:var(--brand);color:var(--brand);}
.tf-arrow{width:10px;height:10px;flex:0 0 auto;}
.tf-summary{text-align:center;font-size:16px;font-weight:700;margin:28px 0 22px;line-height:1.6;}
.tf-accent{color:var(--brand);}
/* CTA 橫幅：--brand-strong → --brand-2 漸層 */
.tf-cta{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:28px 32px;border-radius:16px;background:linear-gradient(135deg,var(--brand-strong) 0%,var(--brand-2) 100%);color:#fff;}
.tf-cta[hidden]{display:none;}
.tf-cta-title{font-size:21px;font-weight:800;margin-bottom:6px;letter-spacing:-0.3px;}
.tf-cta-sub{font-size:14px;color:rgba(255,255,255,.85);}
.tf-cta-btns{display:flex;gap:12px;flex:0 0 auto;}
.tf-btn{display:inline-flex;align-items:center;justify-content:center;padding:12px 22px;border-radius:999px;font-size:14px;font-weight:800;white-space:nowrap;transition:transform .15s,background .15s;}
.tf-btn:hover{transform:translateY(-1px);}
.tf-btn-primary{background:var(--gold-2);color:#1F2937;}
.tf-btn-ghost{border:1.5px solid rgba(255,255,255,.85);color:#fff;}
.tf-btn-ghost:hover{background:rgba(255,255,255,.12);}
#hd-panel-pre,#hd-market,#hd-chips-head{scroll-margin-top:84px;}

/* CTA 小標籤：平常只顯示一顆小按鈕，點開才出現兩個選項（往上彈出） */
.tf-cta.is-tag{display:block;position:relative;background:none;padding:0;border-radius:0;color:var(--text);margin-top:18px;text-align:left;}
.tf-cta-toggle{display:inline-flex;align-items:center;gap:8px;padding:10px 16px 10px 14px;border-radius:999px;border:0;font-size:14px;font-weight:800;cursor:pointer;position:relative;overflow:hidden;}
/* 廣告感按鈕（2026-10-11 使用者）：藍色漸層＋金色小星、每隔幾秒一道光掃過、外圈輕微呼吸光暈；減少動態偏好時全部停用 */
.tf .tf-cta-toggle{background:linear-gradient(135deg,var(--brand-strong) 0%,var(--brand-2) 100%);color:#fff;box-shadow:0 6px 18px rgba(15,60,201,.28);animation:tf-glow 2.8s ease-in-out infinite;transition:transform .15s,box-shadow .15s;}
.tf .tf-cta-toggle:hover,.tf .tf-cta-toggle[aria-expanded="true"]{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,60,201,.36);}
.tf-cta-toggle::after{content:'';position:absolute;top:0;left:-60%;width:40%;height:100%;background:linear-gradient(100deg,transparent,rgba(255,255,255,.45),transparent);transform:skewX(-20deg);animation:tf-shine 3.2s ease-in-out infinite;pointer-events:none;}
.tf-cta-spark{width:14px;height:14px;color:var(--gold-2);flex:0 0 auto;animation:tf-twinkle 1.6s ease-in-out infinite;}
@keyframes tf-shine{0%,55%{left:-60%;}85%,100%{left:130%;}}
@keyframes tf-glow{0%,100%{box-shadow:0 6px 18px rgba(15,60,201,.28),0 0 0 0 rgba(30,80,229,.35);}50%{box-shadow:0 6px 18px rgba(15,60,201,.28),0 0 0 6px rgba(30,80,229,0);}}
@keyframes tf-twinkle{0%,100%{opacity:1;transform:scale(1);}50%{opacity:.55;transform:scale(.8);}}
@media (prefers-reduced-motion:reduce){.tf .tf-cta-toggle,.tf-cta-toggle::after,.tf-cta-spark{animation:none;}.tf-cta-toggle::after{display:none;}}
.tf-cta-caret{width:10px;height:10px;transition:transform .15s;}
.tf-cta-toggle[aria-expanded="false"] .tf-cta-caret{transform:rotate(180deg);}
.tf-cta-menu{position:absolute;left:0;bottom:calc(100% + 8px);z-index:20;width:300px;max-width:calc(100vw - 32px);background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-md);padding:12px;display:flex;flex-direction:column;gap:8px;}
.tf-cta-menu[hidden]{display:none;}
.tf-cta-menu .tf-cta-sub{font-size:12px;color:var(--text-2);margin-bottom:2px;}
.tf-cta-menu .tf-btn{width:100%;padding:9px 12px;font-size:13px;}
.tf-cta-menu .tf-btn-primary{background:var(--brand);color:#fff;}
.tf-cta-menu .tf-btn-ghost{border:1px solid var(--border-strong);color:var(--text);}
.tf-cta-menu .tf-btn-ghost:hover{border-color:var(--brand);color:var(--brand);background:var(--surface);}

/* ═══ 4. 免責 ═══ */
.hd-disclaimer{text-align:center;font-size:12px;color:var(--text-3);margin:26px 0 10px;line-height:1.7;}

/* ═══ 桌機（≥901px）：標題帶壓矮、做出層次（2026-10-11 使用者：藍底比例縮小、盤前盤中盤後縮小）═══
   第一層 標題＋副標同一行、時間靠右；第二層 時段列：小圓點＋「盤前」＋時間說明同一行，選中的時段金色底線 */
@media (min-width:901px){
  .hd-head{padding:16px 28px 0;}
  .hd-head-top{align-items:baseline;}
  .hd-head-top>div:first-child{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;}
  .hd-title{font-size:21px;margin:0;}
  .hd-sub{font-size:13px;color:rgba(255,255,255,.7);}
  .hd-clock{font-size:12px;padding-top:0;}
  .hd-timeline{margin-top:12px;}
  /* 時段列改成分頁式：文字一行，進度線移到底部（不再穿過文字） */
  .hd-seg{padding:0 0 10px;display:flex;align-items:center;gap:8px;flex-wrap:nowrap;white-space:nowrap;}
  .hd-seg::before{top:auto;bottom:0;height:3px;}
  .hd-seg::after{height:3px;border-radius:0;}
  .hd-seg-node{width:10px;height:10px;border-width:2px;margin:0;flex:0 0 auto;}
  .hd-seg.is-active .hd-seg-node{box-shadow:0 0 0 3px rgba(245,158,11,.35);}
  .hd-seg-name{font-size:15px;margin:0;}
  .hd-seg-time,.hd-seg-desc{font-size:12px;}
}

/* ═══ 寬螢幕（≥1440px）：把兩側空白收進來，每個時段一個畫面看完 ═══ */
@media (min-width:1440px){
  .hd-wrap{max-width:1720px;padding:20px 32px 8px;}
  .hd-card{margin-top:12px;}
  /* 固定內容區高度（2026-10-11 使用者：切換盤前／盤中／盤後時欄寬欄高固定，只換資訊、不跳版面）；
     高度以最高的盤後為準，盤前、盤中的內容往下撐滿同一個高度 */
  .hd-body{padding:14px 28px 16px;height:var(--hd-body-h,680px);display:flex;flex-direction:column;}
  .hd-body>.hd-panel:not([hidden]){flex:1;min-height:0;}
  /* 三個時段同一個高度（以盤後為準）；盤前、盤中只在格子內部長高、數字稍放大，不再拉出大片空白
     （2026-10-11 使用者：撐開後空白太多、看起來花；盤後 OK，盤前盤中要緊湊） */
  #hd-panel-open:not([hidden]){display:flex;flex-direction:column;}
  /* 盤後：左欄＝籌碼總覽（三大法人卡、四個模組 2×2）；右欄＝今日策略訊號（條列）＋個股觀察，1920×1080 一個畫面看完 */
  #hd-panel-post:not([hidden]){display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:28px;align-items:start;}
  #hd-panel-post>*{grid-column:1 / -1;}
  /* 左右兩欄各自往下排：左＝標題、法人卡（跨 3 列）、模組（跨 4 列）；右＝訊號標題、訊號一列 5 格、個股觀察標題、分頁、表格（跨 3 列）、免責 */
  #hd-panel-post>#hd-chips-head{grid-column:1;grid-row:1;}
  #hd-panel-post>#hd-chip-main{grid-column:1;grid-row:2 / span 3;}
  #hd-panel-post>#hd-chip-mods{grid-column:1;grid-row:5 / span 4;margin-top:12px;}
  #hd-panel-post>#hd-signals-head{grid-column:2;grid-row:1;}
  #hd-panel-post>#hd-signal-list{grid-column:2;grid-row:2;gap:8px;}
  #hd-panel-post>#hd-watch-head{grid-column:2;grid-row:3;margin:12px 0 8px;}
  #hd-panel-post>#hd-watch-bar{grid-column:2;grid-row:4;margin-bottom:0;}
  #hd-panel-post>#hd-watch-cols{grid-column:2;grid-row:5 / span 3;gap:16px;margin-top:10px;}
  #hd-panel-post>#hd-watch-rule{grid-column:2;grid-row:8;}
  #hd-panel-post>.hd-divider{display:none;}
  #hd-signal-list .hd-signal-row{padding:8px 4px;gap:2px;}
  #hd-signal-list .hd-signal-name{font-size:12px;}
  #hd-signal-list .hd-signal-count{font-size:19px;}
  #hd-watch-cols .hd-fifth{line-height:1.05;}
  /* 寬螢幕右欄較窄：代號改放在名稱下一行，名稱完整顯示 */
  #hd-watch-cols .hd-stock{line-height:1.15;}
  #hd-watch-cols .hd-stock .hd-code{display:block;margin-left:0;font-size:10px;line-height:1.1;}
  #hd-watch-cols .hd-table.is-focus .hd-fifth{line-height:1.2;white-space:nowrap;}
  .hd-chip{padding:10px 8px;gap:2px;}
  .hd-chip-label{line-height:1.25;}
  .hd-chip-value{font-size:22px;}
  .hd-mod{padding:12px 14px;gap:4px;}
  .hd-mod-row{padding:5px 0;}
  .hd-opt-rail{height:84px;margin:2px 0;}
  .hd-flow-row{padding:4px 0;}
  .hd-vol-chart{height:56px;}
  #hd-watch-cols .hd-table{font-size:13px;}
  #hd-watch-cols .hd-table td{height:29px;padding:0 5px;}
  #hd-watch-cols .hd-table th{padding:4px 5px;}
  #hd-watch-cols .hd-col-title{margin-bottom:4px;}
  .hd-tab{padding:7px 20px;}
}

@media (min-width:1440px) and (max-width:1799px){ #hd-watch-cols .hd-stock{font-size:12px;letter-spacing:-0.2px;} }
/* 1440–1799：盤後右欄放寬（左右 1.1:1 → 0.86:1.14），焦點股表才放得下「營收年增 52%＋量增 2.6 倍」一行兩個標籤（2026-10-11 使用者選定） */
@media (min-width:1440px) and (max-width:1799px){
  #hd-panel-post:not([hidden]){grid-template-columns:minmax(0,0.86fr) minmax(0,1.14fr);}
  /* 模組較窄：標題列放不下時右側標籤（結算日）換下一行；外資籌碼「較前日＋數值」同一行要放得下 */
  #hd-chip-mods .hd-mod-head{flex-wrap:wrap;row-gap:2px;}
  #hd-chip-mods .hd-mod-row{gap:8px;}
  #hd-chip-mods .hd-mod-k{font-size:13px;}
  #hd-chip-mods .hd-mod-v{font-size:14px;}
  #hd-chip-mods .hd-mod-v small{font-size:10.5px;margin-right:6px;}
  /* 左欄變窄：族群資金流向的「億」收進標題，名稱與金額都完整顯示 */
  .hd-flow-cols{gap:12px;}
  .hd-flow-row{font-size:13px;gap:6px;}
  .hd-flow-unit{display:none;}
  .hd-flow-tunit{display:inline;}
  #hd-watch-cols .hd-table.is-focus td:nth-child(3),#hd-watch-cols .hd-table.is-focus td:nth-child(4){font-size:12px;}
  #hd-watch-cols .hd-table.is-focus td.hd-fifth{padding-right:0;}
}
@media (min-width:1440px) and (max-width:1599px){ .hd-flow-cols{gap:10px;} .hd-flow-row{font-size:12.5px;gap:4px;} } /* 1440：五個字的族群名（權值股混合）也要放得下 */ /* 1440 寬時右欄更窄，五個字的名稱（雷笛克光學）也要放得下 */
/* ═══ 交易框架寬螢幕（≥1440px）：左欄標題＋漏斗＋總結＋CTA、右欄四張說明卡 2×2，整區一個畫面看完（2026-10-11 使用者）═══ */
@media (min-width:1440px){
  .tf{display:grid;grid-template-columns:400px minmax(0,1fr);grid-template-rows:auto auto auto 1fr;column-gap:32px;row-gap:0;align-items:start;align-items:start;margin-top:28px;padding-top:26px;}
  .tf-head{grid-column:1;grid-row:1;text-align:left;margin-bottom:16px;}
  .tf-title{font-size:24px;margin-bottom:6px;}
  .tf-sub{font-size:14px;}
  .tf-funnel{grid-column:1;grid-row:2;margin:0 0 16px;max-width:none;gap:5px;}
  .tf .tf-layer{height:46px;font-size:15px;gap:8px;padding:0 12px;}
  .tf-summary{grid-column:1;grid-row:3;text-align:left;margin:0 0 16px;font-size:15px;}
  .tf-cta.is-tag{grid-column:1;grid-row:4;align-self:end;}
  .tf-cards{grid-column:2;grid-row:1 / span 4;gap:14px;align-self:stretch;}
  .tf-card{padding:16px 20px;gap:7px;}
  .tf-card-head{margin-bottom:0;}
  .tf-num{width:36px;height:36px;font-size:14px;}
  .tf-card-title{font-size:17px;}
  .tf-label{margin-top:2px;}
  .tf-watch{gap:3px;}
  .tf-watch li{font-size:13.5px;line-height:1.5;}
  .tf-ask{padding:9px 12px;font-size:13.5px;}
  .tf-ask-label{margin-bottom:2px;}
}

@media (min-width:1800px){ .hd-body{--hd-body-h:648px;} }

/* ═══ 手機／平板 ═══ */
@media (max-width:900px){
  .tf-cards{grid-template-columns:1fr;}
  .tf-cta{flex-direction:column;align-items:stretch;text-align:center;}
  .tf-cta-btns{justify-content:center;}
  .hd-sector-cols,.hd-watch-cols,.hd-cols,.hd-breadth-cards,.hd-mod-grid{grid-template-columns:1fr;}
  .hd-market-cards{grid-template-columns:1fr 1fr;}
  .hd-signal-list{grid-template-columns:repeat(3,1fr);}
  .hd-watch-cols{gap:18px;}
  .hd-watch-cols .hd-col-b thead{display:none;} /* 單欄堆疊時第二張表的表頭與第一張相同，隱藏 */
}
@media (max-width:640px){
  .hd-wrap{padding:18px 16px 8px;}
  /* 交易框架：隱藏漏斗時段標籤、工具按鈕可換行、CTA 兩顆按鈕上下排列 */
  .tf{margin-top:28px;padding-top:24px;}
  .tf-title{font-size:22px;}
  .tf-sub{font-size:14px;}
  .tf-layer{height:48px;font-size:15px;gap:8px;padding:0 12px;}
  .tf-layer-session{display:none;}
  .tf-card{padding:18px 16px;}
  .tf-tools{flex-wrap:wrap;}
  .tf-cta{padding:22px 18px;}
  .tf-cta-title{font-size:19px;}
  .tf-cta-btns{flex-direction:column;gap:10px;}
  .tf-btn{width:100%;}
  .hd-tape{height:46px;}
  .hd-tape-live{padding:0 14px;font-size:12px;}
  .hd-tape-item{padding:0 14px;font-size:13px;line-height:46px;}
  .hd-head{padding:20px 18px 0;}
  .hd-title{font-size:22px;}
  .hd-sub{font-size:13px;}
  .hd-clock{font-size:12px;padding-top:0;}
  .hd-timeline{margin-top:18px;}
  .hd-seg{padding-bottom:14px;}
  .hd-seg-node{width:16px;height:16px;margin-bottom:10px;}
  .hd-seg::before{top:7px;}
  .hd-seg-name{font-size:16px;margin-bottom:2px;}
  .hd-seg-time{font-size:12px;}
  .hd-seg-desc{display:none;}
  .hd-body{padding:18px 16px 20px;}
  .hd-h3{font-size:17px;}
  .hd-sector-row{grid-template-columns:84px minmax(0,1fr) 36px;gap:10px;font-size:14px;}
  /* 市場數據標題列：第一行標題＋資料時間靠右，第二行標籤；「每 30 秒更新・」隱藏 */
  .hd-market-head{gap:8px 10px;}
  .hd-market-head .hd-h3{order:1;}
  .hd-market-time{order:2;margin-left:auto;font-size:12px;}
  .hd-market-time .hd-only-desktop{display:none;}
  .hd-market-head::after{content:'';order:3;flex-basis:100%;height:0;}
  .hd-pill-link{order:4;flex:0 0 auto;}
  .hd-market-cards{gap:10px;}
  .hd-mcard{padding:14px 6px;min-height:104px;}
  .hd-mcard-value{font-size:20px;}
  .hd-bcard-val{font-size:20px;}
  /* 手機：三大法人卡仍一列三格（字縮小）、模組單欄、策略訊號改條列 */
  .hd-chip-grid{gap:6px;}
  .hd-chip{padding:12px 4px 10px;gap:4px;}
  .hd-chip-value{font-size:19px;}
  .hd-chip-value small{font-size:12px;}
  .hd-chip-label{font-size:15px;line-height:1.4;}
  .hd-chip-ratio,.hd-chip-sum,.hd-chip-pct{font-size:11px;}
  .hd-chip-sum{display:flex;flex-direction:column;gap:1px;} /* 「五日累計」與金額分兩行，避免在數字中間折行 */
  .hd-grade{padding:3px 8px;font-size:11px;}
  .hd-mod{padding:14px 14px;}
  .hd-opt-tick{width:80px;}
  .hd-opt-val{font-size:13px;}
  .hd-signal-list{display:flex;flex-direction:column;gap:0;border:1px solid var(--border);border-radius:12px;overflow:hidden;}
  .hd-signal-row{flex-direction:row;justify-content:space-between;padding:12px 14px;border:none;border-bottom:1px solid var(--border);border-radius:0;text-align:left;}
  .hd-signal-row:last-child{border-bottom:none;}
  .hd-signal-count{font-size:18px;}
  .hd-tabs{width:100%;display:grid;grid-template-columns:repeat(3,1fr);}
  .hd-tabs.is-market{grid-template-columns:1fr 1fr;}
  .hd-tab{padding:9px 6px;text-align:center;font-size:13px;}
  .hd-table{font-size:13px;}
  .hd-table td{padding:0 4px;height:36px;}
  .hd-table th{padding:6px 4px;}
  .hd-table .hd-stock{width:38%;}
  .hd-col{padding:18px 16px;}
  .hd-earn-row{grid-template-columns:48px minmax(0,1fr) auto;gap:8px;}
  .hd-notice{font-size:13px;}
  #hd-watch-rule{min-height:calc(12px * 1.6 * 2);}
}


/* ═══ 盤中（2026-10-11 改版：一個畫面看完）═══
   左＝三張盤中走勢（加權／櫃買／台指期）＋溫度計三格；右側欄＝漲跌家數、台積電貢獻點數、族群強弱（各 5，後 2 霧化）。
   ≥1440 跟著 .hd-body 固定高度撐滿；1100–1439 固定 620px；更窄改單欄往下排。 */
.hd-open{display:flex;flex-direction:column;min-height:0;}
.hd-open-head{display:flex;align-items:center;gap:12px;margin-bottom:10px;flex-wrap:wrap;}
.hd-open-head .hd-market-time{margin-left:auto;white-space:nowrap;}
.hd-open-grid{display:grid;grid-template-columns:minmax(0,1fr) 296px;gap:12px;min-height:0;}
.hd-open-main{display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:12px;min-height:0;min-width:0;}
.hd-ocharts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;min-height:0;}
.hd-thermo{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);gap:12px;min-height:0;}
.hd-open-side{display:flex;flex-direction:column;gap:12px;min-height:0;min-width:0;}

.hd-pn{background:var(--surface);border:1px solid var(--border);border-radius:12px;display:flex;flex-direction:column;min-height:0;min-width:0;}
.hd-pn.is-gold{background:var(--gold-soft);border-color:#FDE68A;}
.hd-pn-grow{flex:1;}
.hd-pn-head{flex:none;display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid #F0F2F6;}
.hd-pn.is-gold .hd-pn-head{border-color:#FBECC0;}
.hd-pn-title{font-size:13px;font-weight:800;display:flex;align-items:center;gap:7px;white-space:nowrap;}
.hd-pn-title::before{content:'';width:3px;height:12px;border-radius:2px;background:#1A3A94;}
.hd-pn.is-gold .hd-pn-title::before{background:var(--gold);}
.hd-pn-meta{margin-left:auto;font-size:11px;color:var(--text-3);white-space:nowrap;}
.hd-pn-meta b{color:var(--text-2);font-weight:700;}
.hd-pn-code{font-size:10px;color:var(--text-3);white-space:nowrap;}
.hd-pn-body{flex:1;min-height:0;padding:9px 12px 10px;display:flex;flex-direction:column;}
.hd-pn-fit{flex:none;}
.hd-pn-wait{margin:auto;padding:20px 0;}
.hd-cv{flex:1;min-height:70px;width:100%;display:block;margin-top:6px;overflow:visible;}
.hd-faint{color:var(--text-3);}
.is-navy{color:#1A3A94;}

/* 走勢卡 */
.hd-q{display:flex;align-items:baseline;gap:6px;flex-wrap:nowrap;min-width:0;}
.hd-q-px{font-size:22px;font-weight:800;letter-spacing:-0.5px;line-height:1;}
.hd-q-ch{font-size:12px;font-weight:600;white-space:nowrap;}
.hd-q>span{flex:none;}
.hd-q>.hd-q-x{flex:0 1 auto;}
.hd-q-pct{font-size:11px;font-weight:700;padding:2px 6px;border-radius:4px;}
.hd-q-x{margin-left:auto;font-size:11px;color:var(--text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;}
.hd-q-x b{color:var(--text-2);font-weight:600;}
.hd-q-pct.is-up{background:var(--up-soft);color:var(--up);}
.hd-q-pct.is-dn{background:var(--down-soft);color:#047857;}
.hd-ohlc{display:flex;justify-content:space-between;gap:6px;margin-top:7px;padding-bottom:6px;border-bottom:1px dashed var(--border);font-size:11px;color:var(--text-3);white-space:nowrap;overflow:hidden;}
.hd-ohlc b{font-weight:600;color:var(--text-2);margin-left:3px;}
.hd-ohlc b.hd-up{color:var(--up);}.hd-ohlc b.hd-dn{color:#047857;}

/* 溫度計：儀表樣式在 /css/thermo-gauge.css（與多維度智能AI頁共用） */
.hd-tkpis{flex:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--border);border-radius:8px;}
.hd-tkpi{padding:6px 8px;text-align:center;min-width:0;}
.hd-tkpi+.hd-tkpi{border-left:1px solid var(--border);}
.hd-tkpi-k{font-size:11px;color:var(--text-2);white-space:nowrap;display:flex;align-items:center;justify-content:center;gap:3px;}
.hd-tkpi:first-child .hd-tip::after{left:-8px;transform:none;}
.hd-tkpi:last-child .hd-tip::after{left:auto;right:-8px;transform:none;}
.hd-tkpi-v{font-size:16px;font-weight:800;line-height:1.35;white-space:nowrap;}
.hd-tmeter{height:3px;border-radius:2px;background:#F0F2F6;margin-top:4px;overflow:hidden;position:relative;}
.hd-tmeter i{position:absolute;top:0;bottom:0;border-radius:2px;transition:all .6s;}
.hd-insight{flex:none;display:flex;gap:7px;align-items:flex-start;margin-top:6px;border-radius:6px;padding:5px 9px;font-size:11.5px;line-height:1.5;color:var(--text-2);background:var(--brand-soft);}
.hd-insight-tag{flex:none;font-size:10px;font-weight:800;padding:1px 6px;border-radius:3px;margin-top:1px;color:#fff;background:#1A3A94;}
.hd-insight.is-warn{background:var(--gold-soft);}
.hd-insight.is-warn .hd-insight-tag{background:#B45309;}
.hd-insight.is-neutral{background:var(--surface-2);}
.hd-insight.is-neutral .hd-insight-tag{background:#64748B;}
.hd-dist-bars{flex:1;min-height:60px;display:grid;grid-template-columns:repeat(9,minmax(0,1fr));align-items:end;gap:3px;}
.hd-dcol{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0;}
.hd-dn-n{font-size:11px;font-weight:700;margin-bottom:3px;}
.hd-dbar{width:16px;max-width:75%;border-radius:3px 3px 0 0;transition:height .6s;}
.hd-dflat{font-size:11px;font-weight:700;color:var(--text-2);background:var(--surface-2);border-radius:5px;padding:4px 0;width:100%;text-align:center;}
.hd-dflat small{display:block;font-size:9px;font-weight:500;color:var(--text-3);font-family:'Noto Sans TC',sans-serif;}
.hd-dist-x{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:3px;border-top:1px solid var(--border);margin-top:4px;padding-top:4px;}
.hd-dist-x span{text-align:center;font-size:9.5px;color:var(--text-2);white-space:nowrap;font-family:'JetBrains Mono',monospace;}
.hd-dist-split{display:flex;height:6px;border-radius:3px;overflow:hidden;margin-top:8px;gap:2px;background:var(--surface-2);}
.hd-dist-split i{transition:flex .6s;}
.hd-dist-foot{display:flex;justify-content:space-between;font-size:10.5px;color:var(--text-2);margin-top:4px;}

/* 右側欄 */
.hd-brow{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:6px;align-items:center;}
.hd-brow+.hd-brow{margin-top:8px;padding-top:8px;border-top:1px dashed var(--border);}
.hd-brow-name{font-size:12px;font-weight:800;color:var(--text-2);grid-row:1 / span 2;}
.hd-brow-n{display:grid;grid-template-columns:repeat(3,1fr);text-align:center;}
.hd-brow-n b{display:block;font-size:19px;font-weight:800;line-height:1.25;}
.hd-brow-n small{font-size:10px;color:var(--text-2);}
.hd-brow-n em{font-style:normal;font-weight:700;}
.hd-brow .hd-bcard-bar{height:5px;margin-top:4px;gap:2px;grid-column:2;}
.hd-tsmc{margin-top:9px;background:var(--gold-soft);border:1px solid #FDE68A;border-radius:8px;padding:7px 10px 8px;}
.hd-tsmc-k{font-size:11px;font-weight:800;color:#92400E;margin-bottom:3px;}
.hd-tsmc-row{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.hd-tsmc-v{font-size:24px;font-weight:800;line-height:1;white-space:nowrap;}
.hd-tsmc-v small{font-size:11px;font-weight:600;color:var(--text-2);margin-left:2px;}
.hd-tsmc-r{display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-size:11px;color:var(--text-2);white-space:nowrap;}
.hd-tsmc-r .mono{font-weight:700;}
.hd-tsmc-r b{color:var(--text);}
.hd-tsmc-s{display:flex;justify-content:space-between;font-size:11px;color:var(--text-2);margin-top:6px;}
.hd-tsmc-s b{color:var(--text);}
.hd-tsmc-bar{height:5px;background:#FDECC8;border-radius:3px;margin-top:5px;overflow:hidden;}
.hd-tsmc-bar i{display:block;height:100%;background:var(--gold);}
.hd-sgrp-title{font-size:11px;font-weight:800;margin:1px 0 2px;}
.hd-sgrp-title.hd-dn{margin-top:8px;}
.hd-srow{display:grid;grid-template-columns:92px minmax(0,1fr) 28px;align-items:center;gap:8px;padding:3px 0;}
.hd-srow-n{font-size:12px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-srow .hd-bar{height:7px;border-radius:4px;}
.hd-srow-s{font-size:12px;font-weight:800;text-align:right;}
.hd-slock{position:relative;display:block;text-decoration:none;color:inherit;border-radius:6px;}
.hd-slock-rows{display:block;filter:blur(3.5px);opacity:.55;user-select:none;pointer-events:none;}
.hd-slock-cta{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:4px;font-size:12px;font-weight:800;color:#14307F;white-space:nowrap;}
.hd-slock-cta::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.75) 30%,rgba(255,255,255,.75) 70%,rgba(255,255,255,0));border-radius:6px;z-index:-1;}
.hd-slock:hover .hd-slock-cta{text-decoration:underline;}
.hd-sector-obs{font-size:11px;line-height:1.55;color:var(--text-2);margin-top:8px;}
.hd-sector-obs b{color:var(--text);}
.hd-sector-more{margin-top:auto;padding-top:8px;border-top:1px solid #F0F2F6;display:flex;justify-content:space-between;font-size:12px;font-weight:800;color:#14307F;text-decoration:none;}
.hd-sector-more:hover{text-decoration:underline;}

@media (min-width:1100px) and (max-width:1599px){
  .hd-q .hd-q-px{font-size:19px;}
}
@media (min-width:1100px) and (max-width:1439px){
  .hd-open-grid{grid-template-columns:minmax(0,1fr) 260px;}
  .hd-ohlc{font-size:10px;}
  .hd-pn-code{display:none;}
}
@media (min-width:1100px){
  .hd-sector-obs{display:none;}
  .hd-brow+.hd-brow{margin-top:6px;padding-top:6px;}
  .hd-brow-n b{font-size:17px;line-height:1.2;}
  .hd-srow{padding:1px 0;}
  .hd-srow .hd-bar{height:6px;}
  .hd-open-side{gap:10px;}
  .hd-sgrp-title.hd-dn{margin-top:5px;}
  .hd-sector-more{display:none;}
}
@media (min-width:1440px){
  #hd-panel-open .hd-open{flex:1;}
  #hd-panel-open .hd-open-grid{flex:1;}
}
@media (min-width:1100px) and (max-width:1439px){
  .hd-open-grid{height:620px;}
}
@media (max-height:780px) and (min-width:1100px){
  .hd-pn-head{padding:6px 12px;}.hd-pn-body{padding:7px 12px 8px;}
  .hd-brow-n b{font-size:16px;}.hd-tsmc-v{font-size:20px;}.hd-srow{padding:2px 0;}
}
@media (max-width:1099px){
  .hd-open-grid{grid-template-columns:1fr;}
  .hd-open-main{grid-template-rows:auto auto;}
  .hd-thermo{grid-template-columns:1fr 1fr;}
  .hd-thermo>.hd-pn:last-child{grid-column:1 / -1;}
  .hd-cv{height:170px;flex:none;}
  .hd-gauge-wrap{height:230px;flex:none;}
  #hd-thermo-line{height:130px;}
  .hd-dist-bars{height:140px;flex:none;}
  .hd-open-side{display:grid;grid-template-columns:1fr 1fr;}
  .hd-open-side>.hd-pn-grow{grid-column:1 / -1;}
}
@media (max-width:760px){
  .hd-ocharts,.hd-thermo,.hd-open-side{grid-template-columns:1fr;}
  .hd-thermo>.hd-pn:last-child,.hd-open-side>.hd-pn-grow{grid-column:auto;}
  .hd-open-head .hd-market-time{margin-left:0;width:100%;}
  .hd-dist-x span{font-size:8px;}
}


/* ═══ 盤前改版（2026-10-11）═══
   左＝國際市場掃描：區塊標題旁一次資料日期（.hd-gdate）；和同區不同日的格子右上角黃色日期標籤（.hd-cell-stale）；
       依漲跌幅的熱力底色（JS 算好放在 --heat）。寬螢幕三排：台股＋美股｜七巨頭＋ASML＋台積電 ADR｜亞股＋資金＋虛擬貨幣，
       三排平均撐滿高度；1100–1599 寬台股、美股各一排（四排），避免一排 11 格擠不下。
   右＝行事曆：深藍今日卡（倒數）→ 5 個交易日日期條 → 類別篩選 → 清單（只有清單捲動）。
   ≥1440 跟著 .hd-body 固定高度；1100–1439 固定 620px；更窄改單欄往下排。 */
.hd-pre{display:flex;flex-direction:column;gap:22px;}
.hd-pre-main,.hd-pre-cal{min-width:0;min-height:0;display:flex;flex-direction:column;}
.hd-grid9{display:flex;flex-direction:column;gap:12px;min-height:0;}
.hd-grow-d{display:flex;flex-direction:column;gap:12px;min-height:0;min-width:0;}
.hd-ggroup{min-width:0;min-height:0;display:flex;flex-direction:column;}
.hd-glabel{display:flex;align-items:baseline;gap:8px;font-size:14px;font-weight:800;color:var(--text);margin:0 0 6px 2px;padding-left:8px;border-left:3px solid #1A3A94;line-height:1.1;}
.hd-gdate{font-size:11px;font-weight:600;color:var(--text-3);}
.hd-gcells{flex:1;min-height:0;display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));grid-auto-rows:1fr;gap:1px;background:var(--border);border:1px solid var(--border);border-radius:12px;overflow:hidden;}
.hd-cell{position:relative;container-type:inline-size;min-width:0;background-color:var(--surface);background-image:linear-gradient(var(--heat,transparent),var(--heat,transparent));padding:10px 4px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;}
.hd-cell:has(.hd-cell-stale),.hd-cell:has(.hd-cell-live){padding-top:16px;}
.hd-cell-label{font-size:12px;font-weight:600;color:var(--text-2);line-height:1.2;}
.hd-cell-code{display:block;font-family:'JetBrains Mono',monospace;font-size:10px;font-weight:500;color:var(--text-3);}
.hd-cell-value{font-size:clamp(12px,19cqi,21px);font-weight:800;color:var(--text);letter-spacing:-0.3px;line-height:1.15;white-space:nowrap;}
.hd-cell-chg{font-size:clamp(11px,11cqi,13px);font-weight:700;white-space:nowrap;display:flex;flex-direction:column;align-items:center;line-height:1.25;} /* 漲跌點、漲跌幅各一行（2026-10-11 使用者要求分行） */
.hd-cell .hd-updating{font-size:11px;}
/* 台股、美股的數字最長（49,313.44 九個字），字級比例小一點避免超出格子 */
[data-g="tw"] .hd-cell-value,[data-g="us"] .hd-cell-value{font-size:clamp(12px,17cqi,21px);}
.hd-cell-live{position:absolute;top:3px;right:3px;font-size:10px;font-weight:700;line-height:1;padding:2px 4px;border-radius:4px;background:#ECFDF5;border:1px solid #A7F3D0;color:#047857;}
.hd-cell-live.is-delayed{background:#F1F5F9;border-color:#CBD5E1;color:#475569;}
.hd-cell-stale{position:absolute;top:3px;right:3px;font-size:10px;font-weight:700;line-height:1;padding:2px 4px;border-radius:4px;background:#FFFBEB;border:1px solid #FDE68A;color:#B45309;}

/* 行事曆 */
.hd-calx{display:flex;flex-direction:column;gap:10px;min-height:0;}
.hd-calhero{flex:none;background:linear-gradient(135deg,#102766 0%,#1A3A94 100%);border-radius:14px;color:#fff;padding:12px 14px 10px;}
.hd-calhero-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}
.hd-calhero-day span,.hd-calhero-cd span{display:block;font-size:11px;font-weight:600;color:rgba(255,255,255,.72);}
.hd-calhero-day b{display:block;font-size:17px;font-weight:800;white-space:nowrap;}
.hd-calhero-cd{text-align:right;min-width:0;}
.hd-calhero-cd b{display:block;font-size:17px;font-weight:800;white-space:nowrap;}
.hd-calhero-cd small{display:block;font-size:11px;color:rgba(255,255,255,.85);max-width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-calhero-cd small:empty{display:none;}
.hd-calhero-list{margin-top:8px;padding-top:4px;border-top:1px solid rgba(255,255,255,.14);max-height:116px;overflow-y:auto;scrollbar-width:thin;}
.hd-ch-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:8px;align-items:center;padding:4px 0;font-size:13px;}
.hd-ch-t{font-size:12px;font-weight:700;color:#FCD34D;white-space:nowrap;}
.hd-ch-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-ch-tag{display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;background:rgba(255,255,255,.12);color:rgba(255,255,255,.92);white-space:nowrap;}
.hd-ch-tag i{width:6px;height:6px;border-radius:50%;}
.hd-calhero-empty{font-size:12px;color:rgba(255,255,255,.72);padding:4px 0;}
.hd-star{color:var(--up);font-weight:800;margin-right:3px;}
.hd-calhero .hd-star{color:#FCA5A5;}
.hd-caldays{flex:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;}
.hd-wrap .hd-cday{display:flex;flex-direction:column;align-items:center;gap:1px;padding:6px 2px 6px;border:1px solid var(--border);border-radius:10px;background:var(--surface);}
.hd-wrap .hd-cday:hover{background:var(--surface-2);}
.hd-cday-w{font-size:11px;font-weight:600;color:var(--text-3);}
.hd-cday.is-first .hd-cday-w{color:#14307F;}
.hd-cday b{font-size:14px;font-weight:800;color:var(--text);}
.hd-cday-dots{display:flex;gap:3px;height:6px;margin-top:3px;}
.hd-cday-dots i{width:6px;height:6px;border-radius:50%;}
.hd-wrap .hd-cday.is-imp{border-color:#FECACA;}
.hd-wrap .hd-cday.is-sel{background:var(--brand-soft);}
.hd-wrap .hd-cday.is-sel:not(.is-imp){border-color:#C7D2FE;}
.hd-calfilters{flex:none;display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;}
.hd-calfilters::-webkit-scrollbar{display:none;}
/* 類別篩選：文字用類別色，選中時底色＝類別色；「全部」選中為海軍藍 */
.hd-wrap .hd-cfil{flex:none;font-size:12px;font-weight:700;padding:4px 8px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--c,var(--text-2));white-space:nowrap;}
.hd-wrap .hd-cfil.is-on{background:var(--c,#14307F);border-color:var(--c,#14307F);color:#fff;}
.hd-callist{min-height:0;}
.hd-cl-day{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;color:var(--text-2);padding:8px 0 4px;}
.hd-cl-day::after{content:'';flex:1;height:1px;background:var(--border);}
.hd-cl-row{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:8px;align-items:center;margin:2px 0;padding:6px 8px 6px 9px;border-left:3px solid var(--c);border-radius:4px;}
.hd-cl-row.is-imp{background:var(--up-soft);}
.hd-cl-t{font-size:12px;font-weight:700;color:#14307F;white-space:nowrap;}
.hd-cl-main{min-width:0;}
.hd-cl-title{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.hd-cl-sub{font-size:10px;color:var(--text-3);margin-top:1px;}
.hd-cl-tag{font-size:10px;font-weight:700;padding:2px 8px;border-radius:999px;color:var(--c);background:var(--surface-2);background:color-mix(in srgb,var(--c) 10%,#fff);white-space:nowrap;}
.hd-callist .hd-empty{padding:18px 8px;}

/* 760–1099：左欄全寬，亞股＋資金＋虛擬貨幣同一排 */
@media (min-width:760px){
  .hd-grow-d{flex-direction:row;gap:14px;}
  .hd-grow-d>.hd-ggroup{flex:var(--n,4) 1 0;}
}
/* 手機（<760）：單欄往下排，格子改多排 */
@media (max-width:759px){
  .hd-ggroup.is-n6 .hd-gcells,.hd-ggroup.is-stocks .hd-gcells{grid-template-columns:repeat(3,minmax(0,1fr));}
  .hd-ggroup.is-n5 .hd-gcells{grid-template-columns:repeat(6,minmax(0,1fr));}
  .hd-ggroup.is-n5 .hd-cell{grid-column:span 2;}
  .hd-ggroup.is-n5 .hd-cell:nth-child(n+4){grid-column:span 3;}
  .hd-cell{padding:8px 3px;min-height:72px;}
  .hd-cell:has(.hd-cell-stale),.hd-cell:has(.hd-cell-live){justify-content:flex-end;padding-top:20px;}
  .hd-cell-label{font-size:11px;}
  .hd-cell-value,[data-g="tw"] .hd-cell-value,[data-g="us"] .hd-cell-value{font-size:clamp(12px,16cqi,17px);}
  .hd-calfilters{flex-wrap:wrap;}
  .hd-callist{max-height:420px;overflow-y:auto;}
}
/* ≥1100：左右兩欄，固定高度 */
@media (min-width:1100px){
  .hd-pre{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:24px;height:620px;}
  .hd-pre-main .hd-grid9{flex:1;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(4,minmax(0,1fr));gap:10px;}
  .hd-pre-cal .hd-calx{flex:1;}
  .hd-callist{flex:1;overflow-y:auto;scrollbar-width:thin;}
  .hd-cell{padding:6px 4px;gap:2px;}
  .hd-cell:has(.hd-cell-stale),.hd-cell:has(.hd-cell-live){padding-top:14px;}
}
@media (min-width:1440px){
  #hd-panel-pre:not([hidden]){display:flex;flex-direction:column;}
  .hd-pre{flex:1;min-height:0;height:auto;grid-template-columns:minmax(0,1fr) 420px;gap:28px;}
}
@media (min-width:1600px){
  .hd-pre-main .hd-grid9{grid-template-columns:minmax(0,5fr) minmax(0,6fr);grid-template-rows:repeat(3,minmax(0,1fr));column-gap:14px;}
  .hd-pre-main .hd-grid9>[data-g="stk"],.hd-pre-main .hd-grid9>.hd-grow-d,.hd-pre-main .hd-grid9>[data-g="rest"]{grid-column:1 / -1;}
}

/* ═══ 盤前格子點開日 K（public/js/home-kline.js；資料 /api/home/kline）═══ */
.hd-cell.is-kline{cursor:pointer;transition:box-shadow .15s;}
.hd-cell.is-kline::after{content:"";position:absolute;right:5px;bottom:5px;width:14px;height:14px;opacity:0;transition:opacity .15s;pointer-events:none;
  background:no-repeat center/14px 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%231A3A94' stroke-width='1.2'%3E%3Cpath d='M3 1.5v11M7 3v8.5M11 1v10'/%3E%3Crect x='1.8' y='4' width='2.4' height='5' fill='%23DC2626' stroke='%23DC2626'/%3E%3Crect x='5.8' y='5' width='2.4' height='3.5' fill='%2310B981' stroke='%2310B981'/%3E%3Crect x='9.8' y='2.5' width='2.4' height='5.5' fill='%23DC2626' stroke='%23DC2626'/%3E%3C/svg%3E");}
.hd-cell.is-kline:hover{box-shadow:inset 0 0 0 2px #1A3A94;}
.hd-cell.is-kline:hover::after{opacity:.55;}
.hd-cell.is-kline:focus{outline:none;}
.hd-cell.is-kline:focus-visible{box-shadow:inset 0 0 0 2px #F59E0B;}
.hd-cell.is-kline:focus-visible::after{opacity:.55;}

.hk-overlay{position:fixed;inset:0;z-index:2000;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;padding:24px;}
.hk-overlay[hidden]{display:none;}
.hk-dialog{width:min(1080px,100%);height:min(640px,calc(100vh - 48px));background:#fff;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 24px 64px rgba(15,23,42,.35);}
.hk-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;background:linear-gradient(135deg,#102766 0%,#1A3A94 100%);color:#fff;}
.hk-title-wrap{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap;}
.hk-title{margin:0;font-size:19px;font-weight:800;color:#fff;display:flex;align-items:baseline;gap:8px;white-space:nowrap;}
.hk-code{font-size:12px;font-weight:500;color:rgba(255,255,255,.7);}
.hk-last,.hk-chg{background:#fff;border-radius:7px;font-weight:800;white-space:nowrap;}
.hk-last{font-size:21px;padding:3px 10px;}
.hk-chg{font-size:13px;padding:4px 9px;}
.hk-last[hidden],.hk-chg[hidden]{display:none;}
.hk-last.is-up,.hk-chg.is-up,.hk-info .is-up{color:#DC2626;}
.hk-last.is-dn,.hk-chg.is-dn,.hk-info .is-dn{color:#047857;}
.hk-last.is-flat,.hk-chg.is-flat{color:#334155;}
.hk-tools{display:flex;align-items:center;gap:12px;flex-shrink:0;}
.hk-ranges{display:flex;gap:2px;padding:3px;border-radius:999px;background:rgba(255,255,255,.14);}
.hk-range{border:0;background:transparent;color:rgba(255,255,255,.85);font:700 12px/1 'JetBrains Mono',ui-monospace,monospace;padding:7px 12px;border-radius:999px;cursor:pointer;}
.hk-range[aria-pressed="true"]{background:#fff;color:#1A3A94;}
.hk-range:focus-visible,.hk-close:focus-visible{outline:2px solid #F59E0B;outline-offset:2px;}
.hk-close{width:32px;height:32px;border-radius:50%;border:0;background:rgba(255,255,255,.16);color:#fff;font-size:20px;line-height:1;cursor:pointer;display:grid;place-items:center;}
.hk-close:hover{background:rgba(255,255,255,.28);}
.hk-info{display:flex;align-items:center;gap:14px;padding:8px 18px;font-size:12px;color:#64748B;border-bottom:1px solid #F1F5F9;min-height:34px;white-space:nowrap;overflow:hidden;}
.hk-info b{color:#0F172A;font-weight:700;margin-left:6px;}
.hk-date{color:#475569;}
.hk-chart-wrap{position:relative;flex:1;min-height:0;padding:4px 6px 0;}
.hk-chart{position:absolute;inset:4px 6px 0;}
.hk-msg{position:absolute;inset:0;display:grid;place-items:center;color:#94A3B8;font-size:13px;background:#fff;}
.hk-msg[hidden]{display:none;}
.hk-foot{padding:6px 18px 10px;font-size:11px;color:#94A3B8;}
@media (max-width:639px){
  .hk-overlay{align-items:flex-end;padding:0;}
  .hk-dialog{width:100%;height:82vh;border-radius:16px 16px 0 0;animation:hk-up .22s ease-out;}
  .hk-head{position:relative;flex-direction:column;align-items:flex-start;gap:8px;padding:12px 14px;}
  .hk-title-wrap{padding-right:40px;}
  .hk-title{font-size:17px;}
  .hk-last{font-size:18px;}
  .hk-close{position:absolute;top:10px;right:10px;}
  .hk-info{gap:9px;padding:7px 12px;font-size:11px;}
  .hk-info b{margin-left:3px;}
  .hk-foot{padding:6px 12px 10px;}
}
@keyframes hk-up{from{transform:translateY(40px);opacity:.6;}to{transform:none;opacity:1;}}
@media (prefers-reduced-motion:reduce){.hk-dialog{animation:none;}}

/* ═══ 盤前儀表板（2026-10-28 改版）═══
   上排 6 張數字卡；下方 4 欄 × 2 排面板（第 4 欄行事曆跨兩排）。桌機（≥1100）整張卡片撐滿首屏（home-daily.js fitPre 設 .hd-body 高度），
   卡片內不出捲軸：名稱 ellipsis、數值與漲跌標籤 flex:none 固定寬；列表在格內截斷。 */
.hd-body.is-pre{display:flex;flex-direction:column;padding:12px 16px;}
.hd-body.is-pre>#hd-panel-pre{flex:1;min-height:0;display:flex;flex-direction:column;}
/* 盤前（2026-10-28 規格）：左欄＝數字卡一列＋3×2 面板；右欄＝行事曆獨立一整欄、撐滿高度；資料說明在最下面跨兩欄 */
.pd{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px;background:#f4f6f9;border-radius:12px;padding:10px;}
.pd-main{min-width:0;min-height:0;display:flex;flex-direction:column;gap:10px;}
.pd>.pd-cal{min-height:0;}
.pd-foot{grid-column:1 / -1;}
.hd-body.is-pre .pd{flex:1;min-height:0;}
.pd .mono{font-family:'JetBrains Mono',ui-monospace,monospace;}
.pd [data-kl],.pd [data-tv]{cursor:pointer;}
.pd [data-kl]:focus-visible,.pd [data-tv]:focus-visible{outline:2px solid #F59E0B;outline-offset:1px;}
.pd .hd-up{color:#dc2626;}
.pd .hd-dn{color:#047857;}
.pd-wait{color:#94a3b8 !important;font-weight:500 !important;font-size:12px !important;}
.pd-empty{margin:auto;color:#94a3b8;font-size:12px;}
.pd-empty.is-inline{margin:0 auto;}

/* 上排數字卡 */
/* 上排：7 張數字卡同一列等寬、不折列不跨格；文字水平垂直置中，數值最大 20px、過長 ellipsis（2026-10-28 規格） */
.pd-cards{flex:none;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;}
.pd-card{min-width:0;min-height:0;background-color:#fff;background-image:linear-gradient(var(--heat,transparent),var(--heat,transparent));border:1px solid #e5e7eb;border-radius:10px;padding:8px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:3px;overflow:hidden;}
.pd-card[data-kl]:hover,.pd-card[data-tv]:hover{border-color:#1a3a94;}
.pd-card.is-out{background-color:#ecfdf5;}
.pd-ck{max-width:100%;display:flex;align-items:baseline;justify-content:center;gap:6px;font-size:12px;font-weight:700;color:#475569;white-space:nowrap;overflow:hidden;}
.pd-ck span{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.pd-ck small{flex:none;font-size:10.5px;font-weight:600;color:#94a3b8;}
.pd-cv{max-width:100%;font-size:20px;font-weight:800;color:#0f172a;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-cc{max-width:100%;font-size:11.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-cmuted{color:#64748b;font-weight:600;}
/* 台灣市場資金：狀態＋三顆訊號燈 */
.pd-cvrow{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;max-width:100%;}
.pd-sig{flex:none;display:inline-flex;gap:5px;padding:4px 6px;border-radius:999px;background:#1f2937;}
.pd-sig i{width:11px;height:11px;border-radius:50%;background:#475569;}
.pd-sig i.is-out{background:#10b981;box-shadow:0 0 6px rgba(16,185,129,.8);}
.pd-sig i.is-in{background:#ef4444;box-shadow:0 0 6px rgba(239,68,68,.8);}
.pd-sig i.is-flat{background:#64748b;}

/* 下方面板 */
.pd-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1fr) minmax(0,1.2fr);grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;} /* 左欄（全球指數、利率）窄、右欄（市場資金動向、全球資金）寬（2026-10-29 規格） */
.pd-a1{grid-column:1;grid-row:1;}
.pd-a2{grid-column:1;grid-row:2;}
.pd-b1{grid-column:2;grid-row:1;}
.pd-b2{grid-column:2;grid-row:2;display:flex;flex-direction:column;gap:10px;min-height:0;min-width:0;}
.pd-c1{grid-column:3;grid-row:1;}
.pd-c2{grid-column:3;grid-row:2;}
.pd-pn{min-width:0;min-height:0;background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;overflow:hidden;}
.pd-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px;}
.pd-title{margin:0;min-width:0;font-size:13.5px;font-weight:800;color:#0f172a;line-height:1.25;padding-left:8px;border-left:3px solid #1a3a94;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-date{flex:none;font-size:10.5px;color:#94a3b8;}

/* 列：名稱｜數值｜漲跌標籤 */
.pd-rows{flex:1;min-height:0;display:flex;flex-direction:column;}
.pd-row{flex:1 1 0;min-height:0;max-height:30px;display:flex;align-items:center;gap:6px;padding:0 4px;border-radius:6px;font-size:12.5px;}
.pd-row[data-kl]:hover,.pd-row[data-tv]:hover{background:#f1f5f9;}
.pd-n{flex:1;min-width:0;display:flex;align-items:center;gap:4px;overflow:hidden;white-space:nowrap;}
.pd-nt{min-width:0;overflow:hidden;text-overflow:ellipsis;color:#334155;font-weight:600;}
.pd-live,.pd-stale{flex:none;font-style:normal;font-size:10px;line-height:1.3;border-radius:4px;padding:0 4px;}
.pd-live{color:#047857;background:#ecfdf5;}
.pd-stale{color:#b45309;background:#fffbeb;border:1px solid #fde68a;}
.pd-v{flex:none;text-align:right;font-weight:700;color:#0f172a;white-space:nowrap;}
.pd-tag{flex:none;min-width:64px;text-align:right;font-size:11.5px;font-weight:700;border-radius:5px;padding:2px 5px;background-color:#f8fafc;background-image:linear-gradient(var(--heat,transparent),var(--heat,transparent));white-space:nowrap;}

/* 3×3 熱力格 */
.pd-heat{flex:1;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:6px;}
.pd-hc{min-width:0;min-height:0;overflow:hidden;border:1px solid #eef0f4;border-radius:8px;background-color:#fff;background-image:linear-gradient(var(--heat,transparent),var(--heat,transparent));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:2px 4px;}
.pd-hc[data-kl]:hover,.pd-hc[data-tv]:hover{border-color:#1a3a94;}
.pd-hn{max-width:100%;font-size:11.5px;font-weight:700;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-hv{font-size:14px;font-weight:800;color:#0f172a;white-space:nowrap;}
.pd-hp{font-size:11px;font-weight:700;white-space:nowrap;display:flex;flex-direction:column;align-items:center;line-height:1.05;} /* 漲跌點、漲跌幅各一行（2026-10-28 使用者要求加漲跌點；單行放不下） */
.pd-hp .pd-pct{font-size:.9em;font-weight:600;}
/* 漲跌點＋漲跌幅：單行時幅度加括號「+939.35 (+2.04%)」（卡片、清單列）；熱力格上下兩行不加 */
.pd-pct::before{content:" (";}
.pd-pct::after{content:")";}
.pd-hp .pd-pct::before,.pd-hp .pd-pct::after{content:none;}

/* 台灣市場資金動向 2×2 ＋ 大波動 */
.pd-tw{flex:1;}
.pd-twgrid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:6px;}
.pd-tb{min-width:0;min-height:0;overflow:hidden;border:1px solid #eef0f4;border-radius:8px;padding:3px 8px;display:flex;flex-direction:column;justify-content:center;gap:0;line-height:1.25;}
.pd-tb[data-kl]:hover{border-color:#1a3a94;}
.pd-tk{font-size:11px;font-weight:700;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-tv{font-size:14px;font-weight:800;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-ts{font-size:10.5px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:4px;}
.pd-ts b{font-weight:700;}
.pd-spark{flex:none;display:inline-flex;align-items:flex-end;gap:2px;height:12px;}
.pd-spark i{display:block;width:4px;border-radius:1px;background:#dc2626;}
.pd-spark i.is-dn{background:#047857;}
.pd-big{flex:none;height:74px;}
.pd-chips{flex:1;min-height:0;display:flex;align-items:stretch;gap:6px;overflow:hidden;}
.pd-chip{flex:1 1 0;min-width:0;max-width:calc(20% - 5px);display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:8px;padding:1px 4px;font-size:11px;line-height:1.25;}
.pd-chip.is-up{background:#fef2f2;color:#dc2626;}
.pd-chip.is-dn{background:#ecfdf5;color:#047857;}
.pd-chip:hover{outline:1px solid currentColor;}
.pd-chn{max-width:100%;color:#334155;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* 市場資金動向（2026-10-29 規格：走勢｜四象限） */
.pd-groups{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:space-between;gap:2px;}
.pd-concl{flex:none;font-size:12px;font-weight:800;color:#1a3a94;background:#eef2ff;border-radius:6px;padding:4px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-gn{font-size:12.5px;font-weight:800;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-gs{flex:none;width:40px;box-sizing:border-box;text-align:center;font-size:10.5px;font-weight:800;border-radius:999px;padding:1px 0;background:#f1f5f9;color:#475569;white-space:nowrap;}
.pd-gs.is-strong{background:#fef2f2;color:#dc2626;}
.pd-gs.is-weak{background:#ecfdf5;color:#047857;}
.pd-gs.is-mixed{background:#fffbeb;color:#b45309;}
.pd-gs.is-none{color:#94a3b8;}
/* 走勢視圖：小字說明列＋四列（組名｜走勢線｜長｜短；第二行成員從走勢線起點下方開始）；每列保證完整高度、不被壓縮 */
.pd-trhead,.pd-tr{flex:none;display:grid;grid-template-columns:62px minmax(0,1fr) 40px 40px;column-gap:6px;align-items:center;min-width:0;}
.pd-trhead{font-size:10.5px;color:#94a3b8;line-height:1.2;}
.pd-trnote{grid-column:1 / 3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-trcols{grid-column:3 / 5;display:grid;grid-template-columns:40px 40px;column-gap:6px;text-align:center;}
.pd-trcols i{font-style:normal;font-weight:700;}
.pd-tr{row-gap:0;line-height:1.25;}
.pd-tline{display:block;width:100%;height:18px;min-width:0;}
.pd-tl-band{fill:#e2e8f0;}
.pd-tl-recent-bg{fill:#eff6ff;}
.pd-tl-zero{stroke:#cbd5e1;stroke-width:1;}
.pd-tl-long{fill:none;stroke:#94a3b8;stroke-width:1;}
.pd-tl-recent{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round;}
.pd-trm{grid-column:2 / 5;display:flex;gap:10px;font-size:11.5px;white-space:nowrap;overflow:hidden;line-height:1.25;}
.pd-gi{display:inline-flex;align-items:baseline;gap:4px;min-width:0;}
.pd-gi[data-tv]:hover .pd-gil,.pd-gi[data-kl]:hover .pd-gil{color:#1a3a94;text-decoration:underline;} /* 只有能點的（站長）才有連結樣式 */
.pd-gil{color:#64748b;overflow:hidden;text-overflow:ellipsis;}
/* 走勢｜四象限 切換鈕（標題列） */
.pd-vt{margin-left:auto;flex:none;display:inline-flex;gap:1px;border:1px solid #e5e7eb;border-radius:6px;padding:1px;}
.pd-vt button{border:0;background:none;font:inherit;font-size:10.5px;font-weight:700;color:#64748b;padding:1px 7px;border-radius:5px;cursor:pointer;line-height:1.4;white-space:nowrap;}
.pd-vt button[aria-pressed="true"]{background:#1a3a94;color:#fff;}
/* 四象限視圖：結論句下方一張正方形圖（依面板高度縮放）、圖下視角切換 */
.pd-groups.is-quad{justify-content:flex-start;gap:4px;}
.pd-quad{flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:4px;}
.pd-qsvg{flex:1;min-height:0;width:100%;display:block;} /* 2026-10-30：撐滿剩餘寬高（像素座標，home-daily.js drawQuad） */
.pd-qbg-haven{fill:#ecfdf5;}
.pd-qbg-risk{fill:#fef2f2;}
.pd-qaxis{stroke:#cbd5e1;stroke-width:1;}
.pd-qzone{fill:#fff;fill-opacity:.35;stroke:#94a3b8;stroke-width:1;stroke-dasharray:3 2;}
.pd-qlab{font-size:10.5px;font-weight:700;fill:#94a3b8;}
.pd-qax{font-size:10px;font-weight:600;fill:#64748b;}
.pd-qlong{fill:none;stroke:#94a3b8;stroke-width:1;stroke-dasharray:3 3;opacity:.8;}
.pd-qstart{fill:#fff;stroke:#64748b;stroke-width:1.2;}
.pd-qseg{stroke:#1a3a94;stroke-width:2.2;stroke-linecap:round;}
.pd-qdot{fill:#1a3a94;}
.pd-qglow{fill:#1a3a94;opacity:.18;}
.pd-qnow{fill:#1a3a94;stroke:#fff;stroke-width:1.5;}
.pd-qv{flex:none;display:inline-flex;gap:1px;border:1px solid #e5e7eb;border-radius:6px;padding:1px;}
.pd-qv button{border:0;background:none;font:inherit;font-size:11px;font-weight:700;color:#64748b;padding:1px 9px;border-radius:5px;cursor:pointer;line-height:1.4;white-space:nowrap;}
.pd-qv button[aria-pressed="true"]{background:#eef2ff;color:#1a3a94;}

/* 全球資金（2026-10-29 規格）：國名｜長期走勢線（近期段加粗）｜長｜短 */
.pd-world{flex:1;min-height:0;display:flex;flex-direction:column;}
.pd-whead,.pd-w{display:grid;grid-template-columns:36px minmax(0,1fr) 52px 52px;align-items:center;column-gap:6px;padding:0 4px;min-width:0;}
.pd-whead{flex:none;font-size:10.5px;color:#94a3b8;line-height:1.3;}
.pd-whead i{font-style:normal;font-weight:700;text-align:right;}
.pd-w{flex:1 1 0;min-height:0;max-height:26px;border-radius:6px;font-size:12px;}
.pd-w[data-kl]:hover,.pd-w[data-tv]:hover{background:#f1f5f9;} /* 印度、歐洲不開圖（TradingView 沒有同一個指數，2026-10-28 使用者決定）：不可點就沒有 hover */
.pd-w.is-tw{background:#eff6ff;}
.pd-wn{font-weight:700;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-wline{display:block;width:100%;height:18px;min-width:0;}
.pd-wl-zero{stroke:#94a3b8;stroke-width:1;stroke-dasharray:2 2;}
.pd-wv{text-align:right;font-size:12px;font-weight:700;white-space:nowrap;overflow:hidden;}
.pd-wv2{font-weight:400;}

/* 行事曆（沿用既有內容，只改成面板；列表在格內截斷，不出捲軸） */
.pd-cal .hd-calx{flex:1;min-height:0;gap:8px;}
.pd-cal .hd-calhero{padding:10px 12px 8px;}
.pd-cal .hd-callist{flex:1;min-height:0;overflow:hidden;max-height:none;}
.pd-cal .hd-calhero-list{overflow:hidden;}
.pd-cal .hd-callist.is-open{overflow-y:auto;scrollbar-width:thin;}
/* 放不下時最後一列「還有 N 項」（home-daily.js clampCal） */
.hd-cal-more{display:block;width:100%;border:none;background:none;cursor:pointer;text-align:left;font:inherit;font-size:12px;font-weight:700;padding:5px 8px;border-radius:6px;color:#1a3a94;}
.hd-cal-more:hover{background:#eef2ff;}
.hd-calhero .hd-cal-more{color:#c7d2fe;padding:4px 0;}
.hd-calhero .hd-cal-more:hover{background:none;color:#fff;text-decoration:underline;}
.pd-cal .hd-calfilters{flex-wrap:wrap;overflow:visible;row-gap:4px;}

/* 資料說明 */
.pd-foot{flex:none;display:flex;justify-content:space-between;gap:12px;font-size:10.5px;color:#94a3b8;white-space:nowrap;overflow:hidden;}
.pd-foot>span{min-width:0;overflow:hidden;text-overflow:ellipsis;}
.pd-foot #hd-pre-update{display:none;}
.pd-demo{margin-left:6px;color:#b45309;background:#fffbeb;border:1px solid #fde68a;border-radius:4px;padding:0 4px;font-weight:700;}

/* ═══ 疏排（2026-10-28 使用者：字體很擠）═══
   高度仍固定一屏，所以不加列高，改從「視覺密度」下手：列表漲跌拿掉底色塊（原本 22px 底色疊在 21px 列上連成一片）、
   細分隔線、字級整體 +0.5～1px、名稱改中字重、面板內距加大 */
.pd-pn{padding:10px 12px;}
.pd-head{margin-bottom:6px;}
.pd-title{font-size:14px;}
.pd-date{font-size:11px;}
.pd-row{font-size:13px;line-height:1.3;border-radius:0;border-bottom:1px solid #f1f5f9;}
.pd-w{line-height:1.3;}
.pd-row:last-child{border-bottom:0;}
.pd-row[data-kl]:hover,.pd-row[data-tv]:hover{border-radius:6px;}
.pd-nt{font-weight:500;}
.pd-v{font-weight:600;min-width:56px;} /* 漲跌標籤多了點數，數值欄縮一點讓名稱不被裁 */
.pd-n{gap:3px;}
.pd-live,.pd-stale{padding:0 3px;}
.pd-tag{min-width:66px;font-size:12.5px;font-weight:600;background:none;padding:0 0 0 6px;border-radius:0;}
.pd-heat{gap:7px;}
.pd-hc{line-height:1.1;gap:0;} /* 置中排版溢出會往上裁掉名稱，行高要收緊（漲跌改兩行後再收緊） */
.pd-hn{font-size:12.5px;font-weight:600;}
.pd-hv{font-size:15px;}
.pd-hp{font-size:12px;}
.pd-twgrid{gap:8px;}
.pd-tb{padding:6px 10px;line-height:1.25;gap:4px;justify-content:center;}
/* 兩行：上排標題＋右側補充（近 5 日柱、匯率、美元計），下排大數字 */
.pd-sub{margin-left:6px;font-size:11px;font-weight:500;color:#94a3b8;}
.pd-tkr{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0;}
.pd-tk{font-size:12px;font-weight:600;min-width:0;}
.pd-ta{flex:none;display:inline-flex;align-items:center;font-size:11px;color:#94a3b8;white-space:nowrap;}
.pd-ta .pd-spark{height:14px;}
.pd-tv{font-size:17px;line-height:1.2;}
/* 台股 vs 全球：短／長 並列 */
.pd-vs{display:inline-flex;align-items:baseline;gap:3px;margin-right:10px;}
.pd-vs:last-child{margin-right:0;}
.pd-vs b{font-size:14px;}
.pd-vs i{font-style:normal;font-family:'Noto Sans TC',sans-serif;font-size:11px;font-weight:600;color:#94a3b8;}
.pd-ts{font-size:11px;gap:2px;}
.pd-ts b.mono{letter-spacing:-.3px;margin-right:2px;}
.pd-chip{font-size:11.5px;line-height:1.15;padding:0 3px;max-width:none;} /* 上下兩行要塞進 28px：行高收緊，否則置中溢出會裁掉名稱上緣 */
.pd-chips.is-few .pd-chip{flex-direction:row;gap:6px;font-size:12.5px;padding:0 8px;}
.pd-chips.is-few .pd-chn{flex:0 1 auto;min-width:0;}
.pd-chip b{flex:none;font-weight:700;}
.pd-concl{font-size:13px;padding:2px 10px;}
.pd-gn{font-size:13px;}
.pd-gs{font-size:11px;}
.pd-trm{font-size:12.5px;gap:14px;}
.pd-gi b{font-weight:600;}
.pd-w{font-size:12.5px;}
.pd-wn{font-weight:600;}
.pd-wv{font-size:12.5px;}
.pd-wv2{font-weight:400;}
.pd-foot{font-size:11px;}
/* 矮或窄的桌機（如 1280×800、1536×864）放不下疏排：退回原本的緊湊字級 */
@media (min-width:1100px) and (max-height:880px), (min-width:1100px) and (max-width:1366px){
  .pd-pn{padding:8px 10px;}
  .pd-heat{gap:6px;}
  .pd-hn{font-size:11.5px;}
  .pd-hv{font-size:14px;}
  /* 格子只有 44px 高放不下兩行漲跌：改回單行小字「點數 幅度」，寬度借用格子內距 */
  .pd-hp{font-size:10px;flex-direction:row;gap:3px;margin:0 -4px;line-height:1.2;}
  .pd-hp .pd-pct{font-size:10px;}
  .pd-card{padding:6px 6px;}
  .pd-ck{font-size:11.5px;}
  .pd-cv{font-size:18px;}
  .pd-cc{font-size:11px;}
  .pd-cc .pd-pct::before{content:" ";} /* 卡片只有 ~100px 寬：漲跌幅不加括號才放得下 */
  .pd-cc .pd-pct::after{content:none;}
  .pd-tag{font-size:10.5px;}
  .pd-live,.pd-stale{font-size:9.5px;}
  .pd-concl{font-size:12px;padding:4px 8px;}
  .pd-gn{font-size:12.5px;}
  .pd-trm{font-size:11.5px;gap:10px;}
  .pd-ts{font-size:10.5px;gap:1px;letter-spacing:-.2px;}
  .pd-ts b.mono{margin-right:0;}
  .pd-tk{font-size:11.5px;}
  .pd-ta{font-size:10.5px;}
  .pd-tv{font-size:16px;}
  .pd-twgrid{gap:6px;}
  .pd-tb{padding:4px 8px;gap:3px;}
  .pd-vs{margin-right:4px;gap:1px;}
  .pd-vs b{font-size:13px;}
  /* 全球指數 10 列在矮螢幕每列只剩 15px：先藏小道瓊期、小那斯達克期（有現貨列），其餘 8 列才有空間 */
  #pd-idx .pd-row[data-key="ym"],#pd-idx .pd-row[data-key="nq"]{display:none;}
  .pd-row{font-size:12.5px;gap:4px;}
  /* 漲跌標籤多了點數：數值欄、標籤字級與間距都收一點，名稱（含夜盤標籤）才不被裁 */
  .pd-v{min-width:46px;}
  .pd-tag{font-size:11px;min-width:60px;}
  .pd-n{gap:3px;}
  .pd-live,.pd-stale{padding:0 3px;}
  /* 矮或窄（1280×800 面板只剩 ~150px）：走勢列線高、成員字級、結論句內距都收一點，四列才放得下 */
  .pd-tline{height:14px;}
  .pd-tr{line-height:1.1;}
  .pd-trm{font-size:10.5px;line-height:1.1;}
  .pd-trhead{font-size:10px;line-height:1.1;}
  .pd-gs{font-size:10px;padding:0;}
  .pd-wline{height:14px;}
  .pd-concl{padding:2px 8px;}
}

/* 矮視窗（≥1100 寬、≤880 高，如 1280×800）：台灣市場資金動向四格只剩 ~36px 高、兩行會疊，改單行：標題左、數字右（近 5 日柱、匯率、美元計藏起來，提示文字仍有） */
@media (min-width:1100px) and (max-height:880px){
  /* 格子約 128×44：仍兩行但字級收小、補充（近期柱、匯率、美元計）藏起來（提示文字仍有） */
  .pd-tb{padding:1px 8px;gap:0;}
  .pd-tk{font-size:10.5px;line-height:1.1;}
  .pd-ta{display:none;}
  .pd-tv{font-size:13px;line-height:1.2;}
  .pd-vs{margin-right:4px;gap:2px;}
  .pd-vs b{font-size:12px;}
}

/* 1100–1240 寬：台灣四格只剩 ~114px，再收一點 */
@media (min-width:1100px) and (max-width:1240px){
  .pd-tb{padding:4px 6px;}
  .pd-tkr{gap:4px;}
  .pd-tv{font-size:15px;}
  .pd-ta.is-note{display:none;} /* 「美元計」放不下，提示文字已有說明 */
  .pd-vs{margin-right:4px;gap:1px;}
  .pd-vs b{font-size:13px;}
}

/* 彈窗來源小標（網站 K 線／TradingView）與 TradingView 容器 */
.hk-src{flex:none;font-size:11px;font-weight:700;color:#1a3a94;background:#fff;border-radius:999px;padding:2px 9px;}
.htv-wrap{padding:0;}
.htv-box,.htv-chart{position:absolute;inset:0;}

/* 平板：兩欄；手機：單欄、數字卡每列 2 張 */
@media (max-width:1099px){
  /* 單欄：7 張卡 4 欄自動折列、行事曆在面板下面滿版 */
  .pd{grid-template-columns:minmax(0,1fr);grid-template-rows:none;}
  .pd-cards{grid-template-columns:repeat(4,minmax(0,1fr));}
  .pd-card{min-height:96px;}
  .pd-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:none;}
  .pd-a1,.pd-a2,.pd-b1,.pd-b2,.pd-c1,.pd-c2{grid-column:auto;grid-row:auto;}
  .pd-row{flex:none;height:30px;}
  .pd-heat{grid-template-rows:repeat(3,62px);}
  .pd-twgrid{grid-template-rows:repeat(2,auto);}
  .pd-tb{min-height:66px;}
  .pd-ts{white-space:normal;flex-wrap:wrap;}
  .pd-w{flex:none;height:26px;}
  .pd-groups{gap:6px;}
  .pd-tr{row-gap:2px;}
  .pd-cal .hd-callist{max-height:360px;}
  .pd-qsvg{flex:none;height:230px;width:100%;} /* 平板／手機：面板高度不固定，圖固定高度、寬度撐滿 */
  .pd-big{height:auto;}
  .pd-chips{height:46px;flex:none;}
  .pd-foot{flex-direction:column;white-space:normal;}
}
@media (max-width:759px){
  .pd{padding:8px;gap:8px;}
  .pd-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .pd-card{min-height:88px;padding:8px 10px;}
  .pd-grid{grid-template-columns:minmax(0,1fr);gap:8px;}
  .pd-cv{font-size:20px;} /* 手機卡 141px 寬：47,035.58 與 +939.35 (+2.04%) 要放得下 */
  .pd-cc{font-size:12px;}
  /* 手機清單列 30px 高：漲跌標籤改點數、幅度上下兩行，名稱（含日期／夜盤標籤）才不會被裁 */
  .pd-tag{display:flex;flex-direction:column;align-items:flex-end;line-height:1.1;min-width:0;}
  .pd-tag .pd-pct{font-size:.9em;font-weight:600;}
  .pd-tag .pd-pct::before,.pd-tag .pd-pct::after{content:none;}
  /* 手機：面板高度不固定，走勢線加高、成員列可換行（不截字） */
  .pd-tline{height:24px;}
  .pd-trm{flex-wrap:wrap;white-space:normal;row-gap:1px;}
  .pd-gil{overflow:visible;}
}

/* ═══ 市場資金動向 → 資金流（2026-10-30）：兩個訊號燈＋四列每日淨申購 ═══ */
.pd-groups.is-ef{justify-content:flex-start;gap:4px;}
.pd-sls{flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;}
.pd-sl{min-width:0;display:flex;align-items:center;gap:6px;border:1px solid #e5e7eb;border-radius:8px;padding:3px 8px;background:#f8fafc;color:#94a3b8;font-size:11.5px;line-height:1.3;}
.pd-sl-dot{flex:none;width:9px;height:9px;border-radius:50%;background:#cbd5e1;}
.pd-sl-n{flex:1;min-width:0;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-sl-s{flex:none;font-weight:700;}
.pd-sl.is-on{border-color:var(--c);background:#fff;color:var(--c);}
.pd-sl.is-on .pd-sl-dot{background:var(--c);box-shadow:0 0 6px var(--c);}
.pd-efhead,.pd-ef{flex:none;display:grid;grid-template-columns:72px minmax(0,1fr) 46px 46px 34px;column-gap:6px;align-items:center;min-width:0;}
.pd-efhead{font-size:10px;color:#94a3b8;line-height:1.2;}
.pd-efhead i{font-style:normal;text-align:right;}
.pd-ef{flex:1 1 0;min-height:0;max-height:44px;border-top:1px solid #f1f5f9;}
.pd-efn{min-width:0;display:flex;flex-direction:column;line-height:1.15;}
.pd-efn b{font-size:12.5px;font-weight:800;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-efn small{font-size:10px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pd-efb{display:block;width:100%;height:26px;min-width:0;}
.pd-efb-recent{fill:#eff6ff;}
.pd-efb-zero{stroke:#cbd5e1;stroke-width:1;}
.pd-efb .is-up{fill:#dc2626;opacity:.45;}
.pd-efb .is-dn{fill:#047857;opacity:.45;}
.pd-efb .is-rec{opacity:1;}
.pd-efb .is-miss{fill:#cbd5e1;}
.pd-efb-hit{fill:transparent;}
.pd-eft,.pd-efr{text-align:right;font-size:12px;font-weight:700;white-space:nowrap;}
.pd-efr{font-weight:600;}
.pd-efl{justify-self:end;width:34px;box-sizing:border-box;text-align:center;font-size:10.5px;font-weight:800;border-radius:999px;padding:1px 0;background:#f1f5f9;color:#64748b;white-space:nowrap;}
.pd-efl.is-same{background:#eef2ff;color:#1a3a94;}
.pd-efl.is-div{background:#fffbeb;color:#b45309;}
.pd-efb.pd-wait{height:auto;grid-column:2 / -1;}
.pd-cc-by{color:inherit;text-decoration:underline;}
@media (max-width:1366px){
  .pd-efhead,.pd-ef{grid-template-columns:60px minmax(0,1fr) 40px 40px 30px;column-gap:4px;}
  .pd-sl{font-size:10.5px;padding:2px 6px;}
  .pd-efl{width:30px;font-size:10px;}
  .pd-eft,.pd-efr{font-size:11px;}
}
@media (max-width:760px){
  .pd-ef{max-height:none;min-height:40px;}
  .pd-sls{grid-template-columns:1fr;}
}
/* 燈號列：兩顆並排在 1600 以下放不下全名 → 收字級與內距 */
@media (max-width:1600px){
  .pd-sls{gap:4px;}
  .pd-sl{gap:4px;padding:2px 5px;font-size:10.5px;}
  .pd-sl-dot{width:8px;height:8px;}
}
/* 四象限：角落標籤、軸名加白色描邊，軌跡經過時文字仍清楚 */
.pd-qlab,.pd-qax{paint-order:stroke;stroke:#fff;stroke-width:3px;stroke-linejoin:round;}
