/* 基本面與新增同業區；保留既有視窗、色票及產業資料。 */
#spModal.fundamentals #spCard{width:min(860px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
.sf-section{margin:0 0 20px;padding:0 0 16px;border-bottom:1px solid var(--line,#d8dfe5)}
.sf-section h4{margin:0 0 10px;font-size:16px;color:var(--txt,#273646)}
.sf-period,.sf-note{font-size:13px;line-height:1.7;color:var(--sub,#647586);overflow-wrap:anywhere}
.sf-period{margin-bottom:10px}
.sf-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.sf-metric{padding:12px;border:1px solid var(--line,#d8dfe5);border-radius:10px;background:var(--card,#fff);min-width:0}
.sf-label{font-size:12px;color:var(--sub,#647586);line-height:1.5}
.sf-help{font-size:12px;color:var(--sub,#647586);line-height:1.7;margin-top:7px;white-space:normal;overflow-wrap:anywhere}
.sf-value{font-size:20px;font-weight:650;margin-top:5px;color:var(--txt,#273646);overflow-wrap:anywhere}
.sf-value.sf-up,.sf-up{color:var(--up,#c73e46)}
.sf-value.sf-down,.sf-down{color:var(--down,#14805e)}
.sf-missing{color:var(--sub,#647586)}
.sf-highlights{margin:0;padding-left:21px;line-height:1.9;font-size:14px}
.sf-table{width:100%;border-collapse:collapse;font-size:13px;margin:12px 0;color:var(--txt,#273646)}
.sf-table th,.sf-table td{padding:9px 7px;border-bottom:1px solid var(--line,#d8dfe5);text-align:right;font-variant-numeric:tabular-nums}
.sf-table th{font-weight:600;cursor:pointer;background:var(--card,#fff);white-space:normal}
.sf-table th:first-child,.sf-table td:first-child{text-align:left}
#sfIndustry .sf-table td,#spModalBody .sf-table td{white-space:normal;overflow-wrap:anywhere}
.sf-table .sf-self{background:rgba(47,108,158,.08);font-weight:650}
.sf-company{line-height:1.5}.sf-company small{display:block;color:var(--sub,#647586);font-weight:400}
.sf-number{display:inline-block;white-space:nowrap;overflow-wrap:normal;word-break:normal}
.sf-table th:focus-visible{outline:2px solid #2f6c9e;outline-offset:-2px}
.sf-source{margin:10px 0;font-size:12px;line-height:1.8;color:var(--sub,#647586)}
.sf-source summary{cursor:pointer}.sf-source a{color:#2f6c9e}.sf-warning{padding:9px 12px;background:rgba(194,91,58,.09);border-radius:8px;font-size:13px;line-height:1.7;color:var(--txt,#273646);margin-bottom:12px}
.sf-refresh{cursor:pointer;border:1px solid var(--line,#d8dfe5);border-radius:16px;background:var(--card,#fff);color:var(--txt,#273646);padding:6px 13px;margin-top:8px;font:inherit}
@media(max-width:760px){.sf-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.sf-value{font-size:17px}.sf-metric{padding:9px}.sf-table{table-layout:fixed;font-size:11px}#sfIndustry .sf-table th,#sfIndustry .sf-table td,#spModalBody .sf-table th,#spModalBody .sf-table td{font-size:11px!important;white-space:normal!important;padding:8px 3px;overflow-wrap:anywhere}.sf-table th:first-child{width:24%}.sf-note,.sf-period{font-size:12px}}

/* 點數字卡的標題或數字開啟說明；數字與日期始終可見。 */
.sf-grid{align-items:start}
.sf-metric-toggle{cursor:pointer;list-style:none;min-height:52px;line-height:1.5}
.sf-metric-toggle::-webkit-details-marker{display:none}
.sf-metric-toggle .sf-label,.sf-metric-toggle .sf-value{display:block}
.sf-click-hint{float:right;margin-left:6px;font-size:11px;color:var(--sub)}
.sf-click-hint::before{content:'▸ ';}.sf-metric[open] .sf-click-hint::before{content:'▾ ';}
.sf-metric-toggle:focus-visible{outline:2px solid var(--accent,#2f6c9e);outline-offset:4px;border-radius:3px}
.sf-metric-explanation{border-top:1px solid var(--line);margin-top:10px;padding-top:3px}
.sf-metric-explanation .sr-reading{grid-template-columns:1fr}
.sf-metric-explanation .sr-reading p{margin:5px 0 0;font-size:12px;line-height:1.75;white-space:normal;overflow-wrap:anywhere}
.sf-metric-explanation .sr-reading b{font-size:12px}

/* 🆕 2026-10-09 用戶指示：「基本面表格都太大 我想要當月營收 後面直接接數字 數字可以小一點」
   ⇒ 卡片改成一列式緊湊版：標籤後面直接接數字、數字縮小、格子變矮；點整列仍可展開原本的說明。 */
.sf-grid{gap:6px}
.sf-metric{padding:6px 9px;border-radius:8px}
.sf-metric-toggle{min-height:0;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.sf-metric-toggle .sf-label,.sf-metric-toggle .sf-value{display:inline}
.sf-label{font-size:12px}
.sf-value{font-size:14.5px;font-weight:700;margin-top:0}
.sf-click-hint{float:none;margin-left:auto;font-size:10.5px}
@media(max-width:760px){.sf-value{font-size:13.5px}.sf-metric{padding:5px 8px}.sf-grid{gap:5px}}

/* 🆕 2026-10-10 用戶指示：「看六年完整歷史與變化解讀 › 移到財報、右邊」
   ⇒ 標題與入口按鈕同一列；同日用戶再指示「靠左 字在隔壁 不要這麼遠」
   ⇒ 按鈕緊貼標題文字右邊（不推到區塊最右緣）。沒有按鈕的區塊外觀與原本完全相同。 */
.sf-head-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 10px}
.sf-head-row>h4{margin:0}
.sf-head-row>.sf-hist-entry{margin:0}
@media(max-width:760px){.sf-head-row{gap:6px}.sf-head-row>.sf-hist-entry{margin-left:0}}
/* ============================================================================
   🆕 2026-10-11（第四批・用戶指示，附手機「產業面」截圖）
   用戶原話：「產業面格式 請優化」。依鐵律第 30 條先問再做，用戶選定 A 案：
   「可左右滑＋公司欄固定」，八個欄位全部保留。
   實測（390px，華新 1605 的同業評比，改前）：
     · 表格被 stock-fundamentals.css 手機段的 `.sf-table{table-layout:fixed}` 壓成固定欄寬，
       公司欄 74 像素、其餘每欄只有 34 像素；
     · 「-2.01%」需要 52 像素、「+14.97%」需要 62 像素 ⇒ 共 12 格內容溢出、數字疊在隔壁格上；
     · 表頭被壓成每欄 131 像素高（成交價／元 … 一個字一行）。
   改法：表格外層加一個 .pf-peers-wrap 橫向捲動框（09-stock.js 一起改），
     手機改成 table-layout:auto ＋ 每格不斷行，公司欄 position:sticky 黏在左邊。
   只改手機（≤760px）；桌機的同業評比表完全不受影響。
   改前備份：備份\bak_20261011_peer_mobile\
   ============================================================================ */
@media(max-width:760px){
  .pf-sec .pf-peers-wrap{
    overflow-x:auto;-webkit-overflow-scrolling:touch;
    margin:12px 0 6px;
    max-width:100%;
  }
  /* 取消固定欄寬，讓每一欄依內容自己決定寬度（不再被壓成 34 像素） */
  .pf-sec .pf-peers-wrap .sf-table.pf-peers{
    table-layout:auto;
    width:auto;
    min-width:100%;
    margin:0;
    font-size:11.5px;
  }
  .pf-sec .pf-peers-wrap .sf-table.pf-peers th,
  .pf-sec .pf-peers-wrap .sf-table.pf-peers td{
    white-space:nowrap;
    overflow-wrap:normal;
    word-break:keep-all;
    padding:8px 8px;
    font-size:11.5px;
  }
  /* 公司欄固定在左邊：左右滑動時還看得到是哪一家 */
  .pf-sec .pf-peers-wrap .sf-table.pf-peers th:first-child,
  .pf-sec .pf-peers-wrap .sf-table.pf-peers td:first-child{
    width:auto;
    position:sticky;
    left:0;
    z-index:2;
    background:#FFFFFF;
    box-shadow:1px 0 0 var(--line,#d8dfe5);
  }
  /* 自己那一列本來有淡藍底，固定欄要用不透明的同色，否則滑動時會透過去 */
  .pf-sec .pf-peers-wrap .sf-table.pf-peers tr.sf-self th:first-child,
  .pf-sec .pf-peers-wrap .sf-table.pf-peers tr.sf-self td:first-child{
    background:#EEF4FA;
  }
  /* 公司名與「代號 市場」分成兩行，公司欄就不用為了擠在一行而變寬 */
  .pf-sec .pf-peers-wrap .sf-table.pf-peers td:first-child small{
    display:block;
    font-size:9.5px;
    color:#7D8A82;
    line-height:1.35;
  }
}

/* 2026-10-11 追加：同業評比表手機版表頭行高收緊。
   實測改後表頭 61 像素（還是比兩行文字需要的高），原因是全站 body 行高 1.65 被繼承進來。 */
@media(max-width:760px){
  .pf-sec .pf-peers-wrap .sf-table.pf-peers th,
  .pf-sec .pf-peers-wrap .sf-table.pf-peers td{
    line-height:1.35;
    padding:7px 8px;
  }
}

/* 2026-10-16：基本面直接顯示月營收、單季及累計財報。 */
#spModal.fundamentals .sf-direct-status{font-size:12px;color:var(--muted,#748381);margin-bottom:8px}
#spModal.fundamentals .sf-direct-scroll{overflow-x:auto;margin:0 0 10px}
#spModal.fundamentals .sf-direct-table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:13px;line-height:1.45}
#spModal.fundamentals .sf-direct-table th,#spModal.fundamentals .sf-direct-table td{border:1px solid var(--border,#cbd5df);padding:6px 10px;text-align:right;white-space:nowrap}
#spModal.fundamentals .sf-direct-table thead th{background:var(--panel2,#edf1fb);font-weight:700;text-align:center;color:var(--text,#243a4d)}
#spModal.fundamentals .sf-direct-table tbody th{font-weight:500;text-align:left;background:var(--panel2,#f1f4fa);color:var(--text,#243a4d)}
#spModal.fundamentals .sf-direct-table tbody tr:nth-child(even) td{background:color-mix(in srgb,var(--panel2,#edf1fb) 45%,transparent)}
#spModal.fundamentals .sf-direct-month td:nth-child(5),#spModal.fundamentals .sf-direct-month th:nth-child(5){border-left-width:2px}
#spModal.fundamentals .sf-direct-table tr:last-child{font-weight:700}
#spModal.fundamentals .sf-section{margin-top:12px;padding-top:14px}
@media(max-width:600px){#spModal.fundamentals .sf-direct-table{font-size:12px}#spModal.fundamentals .sf-direct-table th,#spModal.fundamentals .sf-direct-table td{padding:5px 7px}}

#spModal.fundamentals .sf-direct-table th,#spModal.fundamentals .sf-direct-table td{height:auto!important;min-height:0!important;padding:4px 8px!important;line-height:1.3!important}
#spModal.fundamentals .sf-direct-table tr{height:auto!important}

/* 財務表頭點擊說明；維持原欄位與數字。 */
#spModal.fundamentals .sf-direct-help{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;text-align:inherit}
#spModal.fundamentals .sf-direct-help:hover,#spModal.fundamentals .sf-direct-help[aria-expanded="true"]{text-decoration:underline;text-underline-offset:3px}
#spModal.fundamentals .sf-direct-help:focus-visible{outline:2px solid var(--gold,#ffd166);outline-offset:2px}
#spModal.fundamentals .sf-direct-explanation{padding:10px 12px;margin:0 0 10px;border:1px solid var(--border,#cbd5df);border-radius:6px;background:var(--panel2,#edf1fb);color:var(--text,#243a4d);font-size:13px;line-height:1.7;white-space:normal;overflow-wrap:anywhere}
#spModal.fundamentals .sf-direct-explanation[hidden]{display:none}

.pf-stock-link{font:inherit;cursor:pointer}.pf-stock-link:hover{text-decoration:underline}.pf-stock-link:focus-visible{outline:2px solid var(--gold,#ffd166);outline-offset:2px}.pf-stock-link:disabled{cursor:wait;opacity:.65}
