/* ── 2026-09 介面改版（A 清爽白）：全站配色、字體、元件 ── */
:root {
  --ink: #111827; --ink-2: #374151; --muted: #5B6472; --faint: #6B7280;
  --line: #E4E7EC; --line-soft: #F1F3F6; --ground: #F5F6F8; --surface: #FFFFFF; --tint: #F7F8FA;
  --accent: #3355D1; --accent-ink: #2A44B0; --accent-soft: #EEF2FF; --accent-tint: #F0F3FF;
  --teal: #0B8A7A;
  --warn-bg: #FFF4DB; --warn-ink: #8A5300; --danger-bg: #FDECEC; --danger-ink: #B42318;
  --ok-bg: #E6F6EC; --ok-ink: #1F7A3F; --gray-bg: #F0F1F3; --gray-ink: #4B5563;
  --radius: 14px;
  --font: "IBM Plex Sans", -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bs-body-font-family: var(--font);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--ground);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 51, 85, 209;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 51, 85, 209;
  --bs-link-hover-color: var(--accent-ink);
  --bs-link-hover-color-rgb: 42, 68, 176;
  --bs-border-radius: 8px; --bs-border-radius-sm: 6px; --bs-border-radius-lg: 12px;
  --bs-focus-ring-color: rgba(51, 85, 209, .22);
}
body { background: var(--ground); font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; }
.text-muted { color: var(--muted) !important; }
a { text-underline-offset: 2px; }

/* ── 外框：側欄 ── */
.app-shell { min-height: 100vh; }
.sidebar { width: 248px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--line); }
@media (min-width: 768px) {
  .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
  .sidebar.offcanvas-md { background-color: var(--surface) !important; }
  .sidebar .sidebar-body { display: flex !important; flex-direction: column; flex-grow: 1 !important; min-height: 0; padding: 0; overflow: hidden; }
}
.sidebar .sidebar-body { display: flex; flex-direction: column; padding: 0; }
.brand { display: flex; align-items: center; gap: 10px; height: 68px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); text-decoration: none; flex-shrink: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand-erp { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--accent-ink); background: var(--accent-soft); border-radius: 6px; padding: 3px 7px; }
.side-nav { flex-grow: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; user-select: none; }
.side-link::-webkit-details-marker { display: none; }
.side-link > .bi:first-child { font-size: 17px; width: 18px; text-align: center; color: var(--muted); }
.side-link span { flex-grow: 1; }
.side-link:hover { background: var(--tint); color: var(--ink); }
.side-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link.active > .bi, .side-link.has-active > .bi:first-child { color: var(--accent); }
.side-link .chev { font-size: 11px; color: #9AA1AD; transition: transform .15s; }
.side-group[open] > .side-link .chev { transform: rotate(90deg); }
.side-sub { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 40px; }
.side-sublink { display: flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 6px; color: #4B5563; text-decoration: none; font-size: 13.5px; }
.side-sublink:hover { background: var(--tint); color: var(--ink); }
.side-sublink.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-top: 1px solid var(--line-soft); }
.side-user .avatar { width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px; background: #E0E7FF; color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; }
.side-user .who { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user .who b { font-size: 13.5px; font-weight: 600; }
.side-user .btn { white-space: nowrap; }
.side-user .who small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-mobile { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 12px 0 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-mobile .brand { height: 56px; border: 0; }
.topbar-mobile .brand img { height: 32px; }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }

/* ── 外框：上方搜尋列與內容 ── */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 0 32px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.top-search { width: min(460px, 100%); height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; color: var(--faint); }
.top-search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,85,209,.14); }
.top-search input { flex-grow: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--ink); }
.top-search kbd { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface); border: 1px solid #D5D9E0; border-radius: 5px; padding: 1px 6px; box-shadow: none; }
.main { min-width: 0; padding: 24px 32px 40px; }
@media (max-width: 767.98px) { .topbar { padding: 0 12px; height: 56px; gap: 8px; } .main { padding: 16px 12px 32px; } }
.notice-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 18px; background: #FFF8E6; border: 1px solid #F5DFA6; border-radius: 10px; font-size: 13.5px; color: #6B4A00; }
.notice-bar span { flex-grow: 1; }
.notice-bar a { color: #6B4A00; font-weight: 600; white-space: nowrap; }

/* ── 標題 ── */
.page-title { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.page-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); }
h6 { font-weight: 600; }

/* ── 卡片 ── */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; background: var(--surface); }
.card > .table-responsive:first-child, .card > .table-responsive:last-child { border-radius: calc(var(--radius) - 1px); }
.card-header { background: var(--surface); border-bottom: 1px solid var(--line-soft); font-weight: 600; padding: .8rem 1.1rem; }
.card-header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card-body { padding: 1.1rem 1.25rem; }

/* ── 表格 ── */
.table { --bs-table-color: var(--ink); --bs-table-border-color: var(--line-soft); --bs-table-hover-bg: #F7F9FF; margin-bottom: 0; font-size: 14px; }
.table > thead th, .table-light th, thead.table-light th { background: #FAFBFC !important; color: var(--muted) !important; font-size: 12.5px; font-weight: 500; border-bottom: 1px solid var(--line) !important; white-space: nowrap; }
.table td, .table th { vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .5rem .75rem; }
.card .table > :not(caption) > * > *:first-child { padding-left: 1.1rem; }
.card .table > :not(caption) > * > *:last-child { padding-right: 1.1rem; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono, .doc-no { font-family: var(--mono); font-size: .93em; }

/* ── 狀態標籤：柔和底色＋深色字 ── */
.badge { font-weight: 500; font-size: 12px; border-radius: 999px; padding: .32em .7em; }
.badge.bg-primary { background: #E8EEFF !important; color: var(--accent-ink) !important; }
.badge.bg-info { background: #E3F4FA !important; color: #0B5F7A !important; }
.badge.bg-success { background: var(--ok-bg) !important; color: var(--ok-ink) !important; }
.badge.bg-warning { background: var(--warn-bg) !important; color: var(--warn-ink) !important; }
.badge.bg-danger { background: var(--danger-bg) !important; color: var(--danger-ink) !important; }
.badge.bg-secondary { background: var(--gray-bg) !important; color: var(--gray-ink) !important; }
.badge.bg-dark { background: #E5E7EB !important; color: #1F2937 !important; }
.badge.bg-light { background: var(--tint) !important; color: var(--ink-2) !important; }

/* ── 按鈕 ── */
.btn { font-weight: 500; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent-ink); --bs-btn-hover-border-color: var(--accent-ink); --bs-btn-active-bg: #24399A; --bs-btn-active-border-color: #24399A; --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: #B9C6F2; --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-color: var(--accent-ink); --bs-btn-hover-border-color: #9DB0EE; --bs-btn-active-bg: #E0E7FF; --bs-btn-active-color: var(--accent-ink); --bs-btn-active-border-color: #9DB0EE; }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: #D5D9E0; --bs-btn-hover-bg: var(--tint); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #C3C8D0; --bs-btn-active-bg: #EEF0F3; --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: #C3C8D0; background: var(--surface); }
.btn-sm { border-radius: 7px; }
.topbar .btn { height: 40px; border-radius: 10px; padding: 0 16px; font-weight: 600; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(17,24,39,.10); padding: 6px; font-size: 14px; }
.dropdown-item { border-radius: 7px; padding: .45rem .75rem; }
.dropdown-item:active { background: var(--accent); }

/* ── 表單 ── */
.form-control, .form-select { border-color: #D5D9E0; border-radius: 8px; }
.form-control-sm, .form-select-sm { border-radius: 7px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,85,209,.14); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.ts-wrapper.single .ts-control, .ts-wrapper.multi .ts-control { border-color: #D5D9E0; border-radius: 7px; }
.ts-wrapper.focus .ts-control { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,85,209,.14); }

/* ── 提示框 ── */
.alert { border-radius: 10px; font-size: 14px; }
.alert-success { background: var(--ok-bg); border-color: #BFE5CC; color: #17613A; }
.alert-danger { background: var(--danger-bg); border-color: #F6C9C5; color: #8F1D13; }
.alert-warning { background: #FFF8E6; border-color: #F5DFA6; color: #6B4A00; }
.alert-info { background: #EAF2FF; border-color: #C9D8FB; color: #1F3C8F; }
.alert-secondary { background: var(--tint); border-color: var(--line); color: var(--ink-2); }

/* ── 分頁 ── */
.pagination { --bs-pagination-color: var(--ink-2); --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--tint); }

/* ── 原有元件 ── */
.lines-table input, .lines-table select { min-width: 70px; }
.lines-table .col-product { min-width: 260px; }
.col-product-wide { min-width: 320px; }
.lines-table .col-desc { min-width: 200px; }
.badge-status { font-weight: 500; }
.legacy-banner { background: #FFF8E6; border: 1px solid #F5DFA6; padding: .6rem .9rem; border-radius: 10px; margin-bottom: 1rem; color: #6B4A00; }
.kv dt { color: var(--muted); font-weight: normal; font-size: .85rem; }
.kv dd { margin-bottom: .6rem; }
.warn-cell { background: #FFF8E6 !important; }
.dropzone { border: 2px dashed #C3C8D0; border-radius: 12px; padding: 2rem; text-align: center; color: var(--muted); background: var(--surface); cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }

/* ── 舊版樣式的單據畫面（報價單、採購單：明細頁與新增／修改頁） ── */
.doc-sheet .card-header { background: #FAFBFC; border-bottom: 1px solid var(--line); font-weight: 600; padding: .65rem 1rem; }
.doc-sheet .card-header i { margin-right: .35rem; color: var(--accent); }
.doc-sheet .card { border: 1px solid var(--line); box-shadow: none; }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #212529; padding-bottom: .75rem; margin-bottom: 1rem; }
.doc-head img { max-height: 56px; }
.doc-head .doc-co { font-size: 1.35rem; font-weight: 700; margin: 0; }
.doc-head .doc-en { font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; margin: .15rem 0 0; color: #495057; }
.doc-head .doc-zh { font-size: 1.1rem; margin: 0; letter-spacing: .3em; }
.doc-head.center { justify-content: center; text-align: center; }
.doc-head.center .doc-en { text-decoration: underline; text-transform: none; letter-spacing: .04em; }
.doc-info { background: var(--tint); border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.doc-info h6, .doc-sec-title { font-size: .9rem; font-weight: 700; color: #343a40; margin: 0 0 .4rem; }
.info-table { width: 100%; margin-bottom: 0; }
.info-table th { width: 32%; font-weight: 600; color: #495057; padding: .3rem .5rem .3rem 0; vertical-align: top; white-space: nowrap; font-size: .9rem; }
.info-table td { padding: .3rem 0; vertical-align: top; font-size: .92rem; }
.form-table th { width: 32%; font-weight: 600; color: #495057; padding: .35rem .6rem .35rem 0; vertical-align: middle; font-size: .88rem; white-space: nowrap; }
.form-table td { padding: .3rem 0; }
.form-table .req { color: #dc3545; }
.items-table { border: 1px solid #dee2e6; }
.items-table th { background: #f1f3f5 !important; text-align: center; white-space: nowrap; font-size: .88rem; color: #343a40 !important; }
.items-table td, .items-table th { border: 1px solid #dee2e6 !important; padding: .4rem .5rem; }
.items-table tr.empty-row td { height: 2rem; }
.total-table th { background: #f8f9fa; text-align: right; width: 60%; }
.total-table tr.grand th, .total-table tr.grand td { background: #fff3cd; font-weight: 700; }
.sign-row { display: flex; justify-content: space-between; gap: 3rem; margin-top: .5rem; }
.sign-row > div { flex: 1; }
.sign-line { border-bottom: 1px solid #6c757d; height: 56px; margin-top: .5rem; }
.status-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }

/* ── 首頁 ── */
.home-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.home-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.home-head .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.kpi:hover { border-color: #C9D3F5; box-shadow: 0 2px 10px rgba(51,85,209,.06); color: var(--ink); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: #4B5563; font-weight: 500; }
.kpi .kpi-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.kpi .kpi-val { font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .kpi-sub.bad { color: var(--danger-ink); }
.sec-title { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 12px; }
.sec-title h2 { font-size: 16px; font-weight: 700; margin: 0; }
.sec-title span { font-size: 13px; color: var(--muted); }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-card .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 20px; }
.panel-card .panel-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.panel-card .panel-head a { font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.panel-card .table { font-size: 14px; }
.panel-card .table td { height: 46px; }
.overdue { color: var(--danger-ink); font-weight: 600; }
.cur-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--tint); border-radius: 10px; }
.cur-row b { font-size: 13px; }
.cur-row small { display: block; font-size: 12px; color: var(--muted); }
.cur-row .v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inbox-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.inbox-row:hover { background: #F7F9FF; color: var(--ink); }
.inbox-row .src { width: 48px; height: 24px; flex-shrink: 0; border-radius: 6px; background: var(--accent-tint); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.inbox-row .t { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-row .t b { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row .t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 首頁：大小導線箱 ── */
.duct-tile { width: 100%; display: flex; align-items: center; gap: 18px; min-height: 104px; padding: 14px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.duct-tile:hover { border-color: #C9D3F5; }
.duct-tile[aria-expanded="true"] { background: #FAFBFF; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(51,85,209,.14); }
.duct-tile:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(51,85,209,.3); }
.duct-tile .ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: 11px; background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.duct-tile .body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.duct-tile .nm { font-size: 15px; font-weight: 700; }
.duct-tile .nm small { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.duct-tile .stk { font-size: 28px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.duct-tile .stk small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.cover { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ok-ink); }
.cover.low { color: var(--warn-ink); }
.duct-tile .spark { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.duct-tile .bars { display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.duct-tile .bars i { display: block; width: 8px; border-radius: 2px 2px 0 0; background: #C9D3F5; }
.duct-tile .bars i.now { background: var(--accent); }
.duct-tile .spark small { font-size: 11.5px; color: var(--muted); }
.duct-tile .chev { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--ground); color: #4B5563; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.duct-tile[aria-expanded="true"] .chev { transform: rotate(180deg); }
.duct-wrap { container-type: inline-size; }
.duct-tile .nm, .duct-tile .stk { white-space: nowrap; }
@container (max-width: 470px) { .duct-tile .spark { display: none; } }
@container (max-width: 330px) { .duct-tile .ic, .duct-tile .chev { display: none; } .duct-tile { padding: 14px 16px; } }
.duct-panel { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.duct-panel .dp-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.duct-panel .dp-head h3 { font-size: 18px; font-weight: 700; margin: 0; }
.duct-panel .dp-head .code { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-left: 8px; }
.duct-panel .dp-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 18px; }
@media (max-width: 991.98px) { .dp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dp-stat { padding: 12px 14px; background: var(--tint); border-radius: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dp-stat.low { background: #FFF8E6; }
.dp-stat .l { font-size: 12px; color: var(--muted); }
.dp-stat .v { font-size: 24px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dp-stat.low .v { color: var(--warn-ink); }
.dp-stat .v small { font-size: 13px; font-weight: 500; color: var(--muted); }
.dp-stat .s { font-size: 12px; color: var(--muted); }
.chart-cap { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #4B5563; font-weight: 500; margin-bottom: 4px; }
.chart-cap .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.chart-cap .ln { width: 14px; height: 2px; border-radius: 2px; background: var(--teal); }
.chart-cap em { font-style: normal; color: var(--faint); font-weight: 400; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap svg text { font-family: var(--font); fill: var(--faint); font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) { .duct-panel { padding: 16px 14px; } }
.chart-wrap svg .val { fill: var(--ink-2); font-weight: 600; }
.chart-wrap svg .min-lab { fill: var(--danger-ink); font-weight: 600; }
.chart-wrap svg .xl { fill: #4B5563; }
.chart-wrap svg .hit { fill: transparent; cursor: default; }
.chart-wrap svg .hl { fill: var(--accent-soft); opacity: 0; }
.chart-wrap svg .hl.on { opacity: 1; }
.chart-wrap svg .hd { opacity: 0; pointer-events: none; }
.chart-wrap svg .hd.on { opacity: 1; }
.chart-wrap svg .halo { paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.chart-wrap svg .stk { fill: var(--ink-2); }
.chart-wrap svg .stk-now { fill: var(--ink); font-weight: 700; }
.chart-wrap svg .stk-min { fill: var(--danger-ink); font-weight: 700; }
.chart-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px 6px; }
.chart-scroll svg { max-width: none; }
.chart-cap { flex-wrap: wrap; row-gap: 4px; }
.chart-cap .key { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.chart-tip { position: absolute; top: 0; width: 190px; padding: 10px 12px; background: #111827; color: #F9FAFB; border-radius: 10px; box-shadow: 0 6px 16px rgba(17,24,39,.18); font-size: 12.5px; pointer-events: none; display: none; z-index: 5; }
.chart-tip.on { display: block; }
.chart-tip b { display: block; font-size: 13px; margin-bottom: 4px; }
.chart-tip div { display: flex; justify-content: space-between; gap: 8px; }
.chart-tip div span:first-child { color: #C7CCD6; }
.chart-tip div span:last-child { font-variant-numeric: tabular-nums; }

/* ── 搜尋結果 ── */
.search-group h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; padding: 12px 20px 8px; }
.search-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.search-row:hover { background: #F7F9FF; color: var(--ink); }
.search-row .m { font-weight: 500; min-width: 170px; }
.search-row .s { flex-grow: 1; color: var(--muted); font-size: 13px; }
@media (max-width: 575.98px) {
  .search-row { flex-wrap: wrap; gap: 4px 10px; }
  .search-row .m { min-width: 0; flex-grow: 1; }
  .search-row .s { flex-basis: 100%; order: 3; }
}

@media print {
  .sidebar, .no-print, nav.navbar, .topbar, .topbar-mobile { display: none !important; }
  .main { padding: 0 !important; }
  body { background: #fff; }
  .card { border-color: #dee2e6; }
}
