/* 健保第二大類藥價調整預測（/tools/nhi-cat2/）專用樣式；顏色沿用全站 CSS 變數，深淺色都可讀 */
.nc2 { --red: #b3362c; --yellow: #9a6a00; --green: #2f6b4f; --red-bg: #fbe9e6; --yellow-bg: #fdf3d9; --green-bg: #e6efe9; padding-bottom: 40px; }
:root[data-theme="dark"] .nc2 { --red: #f0938a; --yellow: #e8b85c; --green: #7fbf9c; --red-bg: #3a2320; --yellow-bg: #3a3120; --green-bg: #233129; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nc2 { --red: #f0938a; --yellow: #e8b85c; --green: #7fbf9c; --red-bg: #3a2320; --yellow-bg: #3a3120; --green-bg: #233129; } }
.nc2 .post-head { padding-bottom: 4px; }
.nc2-sub { color: var(--muted); font-size: 15px; line-height: 1.9; margin: 0; }
.fbbtn { display: inline-block; background: #1877f2; color: #fff !important; padding: 2px 12px; border-radius: 999px; font-size: 13.5px; text-decoration: none; white-space: nowrap; vertical-align: 1px; }
.fbbtn:hover { background: #0f63d6; }

.nc2-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.nc2-tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.nc2-tile .lab { color: var(--muted); font-size: 13px; }
.nc2-tile .val { font: 700 22px/1.35 var(--sans); margin: 2px 0; }
.nc2-tile .sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* 分頁：編號圓角按鈕、電腦版固定在上方 */
.nc2-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; background: var(--paper); z-index: 1100; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
@media (min-width: 900px) { .nc2-tabs { position: sticky; top: 0; } }
.nc2-tabs-label { color: var(--muted); font-size: 14px; margin-right: 4px; }
.nc2-tab { border: 1px solid var(--line); background: var(--code); color: var(--ink); border-radius: 999px; padding: 6px 14px; font: 600 15px/1.3 var(--sans); cursor: pointer; white-space: nowrap; }
.nc2-tab b { display: inline-block; min-width: 1.4em; }
.nc2-tab[aria-selected="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.nc2-panel h2 { font: 700 22px/1.4 var(--serif); margin: 8px 0 6px; }
.nc2-panel h3 { font: 700 18px/1.4 var(--serif); margin: 22px 0 6px; }
.nc2-panel p, .nc2-panel li { line-height: 1.85; font-size: 15.5px; }
.nc2 .meta { color: var(--muted); font-size: 14px; }
.nextbar { margin: 22px 0 6px; }

/* 燈號 */
.light { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; border-radius: 999px; padding: 1px 10px 1px 7px; font-size: 14px; }
.light::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: currentColor; }
.light.紅 { color: var(--red); background: var(--red-bg); }
.light.黃 { color: var(--yellow); background: var(--yellow-bg); }
.light.綠 { color: var(--green); background: var(--green-bg); }

/* 篩選列 */
.nc2-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; }
.nc2-filter input[type=search] { flex: 0 1 260px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 15px; }
.nc2-filter label { font-size: 14.5px; white-space: nowrap; cursor: pointer; }
.nc2-filter .count { color: var(--muted); font-size: 14px; margin-left: auto; }

/* 表格：一列一筆；1279px 以下改精簡卡片 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
table.nc2t { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.nc2t th, .nc2t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.55; }
.nc2t thead th { background: var(--code); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.nc2t td.num, .nc2t th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nc2t tr.unit { cursor: pointer; }
.nc2t tr.unit:hover td { background: var(--accent-soft); }
.nc2t tr.unit td:first-child { white-space: nowrap; }
.nc2t .nm { font-weight: 700; }
.nc2t .brand { color: var(--muted); font-size: 13px; display: block; }
.nc2t .why { font-size: 13.5px; color: var(--muted); }
.nc2t .why li { margin: 0; line-height: 1.6; font-size: 13.5px; }
.nc2t .why ul { margin: 0; padding-left: 1.1em; }
.nc2t tr.detail > td { background: var(--paper); padding: 12px 14px 16px; }
.nc2t .tog { color: var(--accent); font-size: 13px; white-space: nowrap; }
.pct-down { color: var(--red); }
.pct-zero { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.ok { border-color: var(--green); color: var(--green); }
.tag.ng { border-color: var(--red); color: var(--red); }
.sub-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 10px; }
.sub-tbl th, .sub-tbl td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sub-tbl th { background: var(--code); white-space: nowrap; }
.sub-tbl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.det-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px 22px; }
.det-grid h4 { margin: 6px 0 2px; font-size: 15px; }
.trend { white-space: nowrap; }
.bar { display: inline-block; height: 9px; background: var(--red); border-radius: 2px; vertical-align: middle; margin-right: 5px; opacity: .75; }
.nc2-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
.nc2-foot li { line-height: 1.75; margin: 4px 0; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
[data-hint] { border-bottom: 1px dotted var(--muted); cursor: help; }

@media (max-width: 1279px) {
  table.nc2t.cards thead { display: none; }
  table.nc2t.cards, .nc2t.cards tbody, .nc2t.cards tr, .nc2t.cards td { display: block; width: 100%; }
  .nc2t.cards tr.unit { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .nc2t.cards tr.unit td { border: 0; padding: 2px 10px; }
  .nc2t.cards td[data-l]::before { content: attr(data-l) "："; color: var(--muted); font-size: 13px; }
  .nc2t.cards td.num { text-align: left; }
}
@media (max-width: 600px) {
  .nc2-tile .val { font-size: 19px; }
  .nc2-tab { padding: 5px 11px; font-size: 14px; }
}
.nc2 [hidden] { display: none !important; }
/* 寬螢幕（20261201 量 1900 寬）：工具頁放寬、理由欄給足寬度、副標用無襯線字 */
.wrap.nc2 { max-width: 1440px; }
.nc2-tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.nc2t .brand { font-family: var(--sans); font-weight: 400; }
@media (min-width: 1280px) { .nc2t td.why { min-width: 300px; } }

/* v1.1（115/12/01）：字級放大、重點警示、原廠品項、圖表 */
.nc2 { --c-s1: #2a78d6; --c-red: #d03b3b; --c-yel: #fab219; --c-grn: #0ca30c; }
:root[data-theme="dark"] .nc2 { --c-s1: #3987e5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nc2 { --c-s1: #3987e5; } }
table.nc2t { font-size: 16px; }
.nc2t th { font-size: 14.5px; }
.nc2t .nm { font-size: 18px; display: block; margin-bottom: 2px; }
.nc2t .why, .nc2t .why li { font-size: 15px; color: var(--ink); }
.nc2t .why li:first-child { font-weight: 700; }
.nc2t td.num { font-size: 16px; }
.light { font-size: 15px; }
.orig { display: block; font-size: 14.5px; line-height: 1.6; }
.orig code, .ac-zh code { font: 600 13.5px/1.4 ui-monospace, Consolas, monospace; background: var(--code); border-radius: 4px; padding: 0 5px; color: var(--ink); }
.lead { font-size: 17px; line-height: 2; }
.lead .light { margin: 0 2px; }
.alerts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.alerts-h { grid-column: 1 / -1; font: 700 18px/1.5 var(--sans); color: var(--red); }
.alert-card { text-align: left; display: flex; flex-direction: column; gap: 3px; background: var(--red-bg); border: 2px solid var(--red); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--ink); font: inherit; }
.alert-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.alert-card .light { align-self: flex-start; background: var(--card); }
.ac-name { font: 700 21px/1.35 var(--sans); }
.ac-zh { font-size: 15px; }
.ac-why { font-size: 15.5px; font-weight: 700; color: var(--red); line-height: 1.5; }
.ac-meta { font-size: 13.5px; color: var(--muted); }
.nc2-filter.big input[type=search] { flex: 1 1 340px; font-size: 17px; padding: 10px 14px; border-width: 2px; }
.nc2-filter.big label { font-size: 16px; }
tr.unit.flash td { background: var(--accent-soft); transition: background .3s; }

.fig { margin: 22px 0 30px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.fig figcaption { font: 700 19px/1.5 var(--serif); margin-bottom: 8px; }
.fig-text { font-size: 16px !important; line-height: 1.9 !important; margin: 10px 0 4px; }
.chart-wrap { width: 100%; overflow-x: auto; }
svg.chart { width: 100%; min-width: 520px; height: auto; display: block; font-family: var(--sans); }
svg.chart .lab { font-size: 14px; fill: var(--ink); }
svg.chart .lab.sub { font-size: 12px; fill: var(--muted); }
svg.chart .val { font-size: 13.5px; font-weight: 700; fill: var(--ink); }
svg.chart .seg { font-size: 13px; font-weight: 700; fill: #fff; }
svg.chart .axis { stroke: var(--muted); stroke-width: 1; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
svg.chart .ref-t { font-size: 12px; fill: var(--muted); }
svg.chart .hit { fill: transparent; }
svg.chart .mk:hover .hit { fill: var(--accent-soft); }
svg.chart .c-s1 { fill: var(--c-s1); }
svg.chart .c-red { fill: var(--c-red); }
svg.chart .c-yel { fill: var(--c-yel); }
svg.chart .c-grn { fill: var(--c-grn); }
svg.chart .faint { opacity: .45; }
svg.chart .db { stroke: var(--muted); stroke-width: 2; }
svg.chart .dot-a { fill: var(--card); stroke: var(--c-s1); stroke-width: 2; }
svg.chart .dot-b { fill: var(--c-s1); stroke: var(--card); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin: 0 0 6px; }
.legend .sw { display: inline-block; width: 13px; height: 13px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .sw.c-red { background: var(--c-red); } .legend .sw.c-yel { background: var(--c-yel); } .legend .sw.c-grn { background: var(--c-grn); }
.legend .sw.dot-a { border-radius: 50%; border: 2px solid var(--c-s1); background: var(--card); }
.legend .sw.dot-b { border-radius: 50%; background: var(--c-s1); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.two svg.chart { min-width: 300px; }
.mini-t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
details.dt summary { cursor: pointer; color: var(--accent); font-size: 14.5px; }
@media (max-width: 600px) { .ac-name { font-size: 19px; } .nc2t .nm { font-size: 17px; } }
/* 網站預設深色，只有 data-theme="light" 時是淺色（v1.1 修正：深色為預設值） */
.nc2 { --red: #f0938a; --yellow: #e8b85c; --green: #7fbf9c; --red-bg: #3a2320; --yellow-bg: #3a3120; --green-bg: #233129; --c-s1: #3987e5; }
:root[data-theme="light"] .nc2 { --red: #b3362c; --yellow: #9a6a00; --green: #2f6b4f; --red-bg: #fbe9e6; --yellow-bg: #fdf3d9; --green-bg: #e6efe9; --c-s1: #2a78d6; }
.nc2t td.num.intl { white-space: normal; min-width: 86px; max-width: 128px; font-size: 14.5px; }
@media (min-width: 1280px) { .nc2t td.why { min-width: 230px; } }

/* v1.2（115/12/01）：手機版重排 */
svg.chart { min-width: 0 !important; }
.two svg.chart { min-width: 0 !important; }
svg.chart .lab.xs { font-size: 11px; }
.ac-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-top .ac-name { font: 700 23px/1.3 var(--sans); }
.ac-go { margin-left: auto; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.alert-card { gap: 6px; padding: 11px 14px; }
.ac-why { font-size: 15.5px; }
.nc2t.compact td, .nc2t.compact th { padding: 7px 9px; }
.nowrap { white-space: nowrap; }
.sub-tbl .k-name code { font: 600 13px/1.4 ui-monospace, Consolas, monospace; background: var(--code); border-radius: 4px; padding: 0 5px; }
@media (max-width: 1279px) {
  .nc2t.cards .sub-tbl thead { display: none; }
  .nc2t.cards .sub-tbl, .nc2t.cards .sub-tbl tbody { display: block; width: 100%; }
  .nc2t.cards .sub-tbl tr { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
  .nc2t.cards .sub-tbl td { display: inline-block; width: auto; border: 0; padding: 0; font-size: 14.5px; text-align: left; }
  .nc2t.cards .sub-tbl td.k-name { flex-basis: 100%; font-weight: 700; font-size: 15.5px; }
  .nc2t.cards .sub-tbl td.k-en { flex-basis: 100%; color: var(--muted); font-size: 13px; }
  .nc2t.cards .sub-tbl td[data-l]::before { content: attr(data-l) "："; color: var(--muted); font-size: 13px; }
}
@media (max-width: 600px) {
  .alerts { gap: 8px; }
  .ac-top .ac-name { font-size: 21px; }
  .fig { padding: 12px 10px; }
  .nc2t.compact { font-size: 14px; }
}
.nc2t.compact thead th { white-space: normal; }
.orig-en { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin: 0 0 3px 0; }

/* v1.4（115/12/01）：手機卡片的欄位一律撐滿整列、可換行（國外參考價格原本被電腦版的 128px 上限卡住，右側露出深色方塊） */
@media (max-width: 1279px) {
  .nc2t.cards td { box-sizing: border-box; }
  .nc2t.cards td.num, .nc2t.cards td.num.intl { white-space: normal; min-width: 0; max-width: none; font-size: 16px; }
  .nc2t.cards td.num .trend { display: inline-block; }
}
/* 觸控螢幕點一下不留滑鼠移上的底色 */
@media (hover: none) { .nc2t tr.unit:hover td { background: transparent; } }

/* v1.5（115/12/01）：手機卡片精簡——燈號與藥名同一排、短欄位並排、拿掉多餘標題 */
.card-light { display: none; }
@media (max-width: 1279px) {
  .nc2t.cards tr.unit { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding: 10px 12px; }
  .nc2t.cards tr.unit > td { width: auto; padding: 0; flex: 0 1 auto; }
  .nc2t.cards tr.unit > td:first-child, .nc2t.cards tr.unit > td.full, .nc2t.cards tr.unit > td.c-name,
  .nc2t.cards tr.unit > td.c-gen, .nc2t.cards tr.unit > td.why { flex-basis: 100%; }
  .nc2t.cards tr.unit > td.c-light { display: none; }
  .nc2t.cards td.c-name::before, .nc2t.cards td.why::before { content: none; }
  .nc2t.cards .card-light { display: inline-block; }
  .nc2t.cards .nm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 4px; }
  .nc2t.cards .nm-row .nm { display: inline; margin: 0; font-size: 19px; }
  .nc2t.cards .dbr { display: none; }
  .nc2t.cards .dbr + * { margin-left: 6px; }
  .nc2t.cards td.c-gen .brand { display: inline; margin-left: 8px; }
  .nc2t.cards td.why ul { display: inline; padding: 0; }
  .nc2t.cards td.why li { display: inline; }
  .nc2t.cards td.why li + li::before { content: "；"; }
  .nc2t.cards td.why .tog { margin-left: 8px; }
}

/* v1.6（115/12/02）：紅燈卡片撐滿整列、明細固定位置；手機學名藥占比一行 */
.alerts { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
@media (max-width: 1099px) { .alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .alerts { grid-template-columns: 1fr; } }
.alert-card { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; grid-template-areas: "top" "why" "go"; gap: 6px; align-items: start; }
.alert-card .ac-top { grid-area: top; }
.alert-card .ac-why { grid-area: why; }
.alert-card .ac-go { grid-area: go; justify-self: end; margin: 0; }
@media (max-width: 600px) {
  .alert-card { grid-template-columns: 1fr auto; grid-template-rows: auto auto; grid-template-areas: "top go" "why why"; }
  .alert-card .ac-go { align-self: center; }
}
@media (max-width: 1279px) {
  .nc2t.cards td.c-gen .brand { display: inline-block; white-space: nowrap; margin-left: 0; }
  .nc2t.cards td.c-gen .trend { margin-right: 10px; }
}

/* v1.8（115/12/02）：方法頁來源清單的長檔名、網址可斷行（手機 375 寬不橫向捲動） */
#tab-method li, #tab-method p { overflow-wrap: anywhere; }

/* v1.9（115/12/02）：滑鼠提示框、頁首訂閱欄 */
.nc2-tip { position: absolute; z-index: 3000; background: #1f2a24; color: #fff; font: 14px/1.55 var(--sans); padding: 7px 11px; border-radius: 7px; box-shadow: 0 4px 14px rgba(0,0,0,.25); pointer-events: none; }
.nc2-subtop { border: 2px solid var(--accent); background: var(--card); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.nc2-subtop-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.nc2-subtop-h b { font-size: 18px; color: var(--accent); }
.nc2-subtop-h span { font-size: 15px; color: var(--muted); }
.nc2-subtop .line { display: flex; gap: 8px; flex-wrap: wrap; }
.nc2-subtop input[type=email] { flex: 1 1 220px; min-width: 0; font-size: 16px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.nc2-subtop .agree small { font-size: 13px; color: var(--muted); }
.nc2-subtop .msg { font-size: 14px; color: var(--accent); min-height: 0; }
.nc2-subtop .msg:empty { display: none; }

/* v1.10（115/12/02）：列表簡化，可能降幅大字 */
.nc2t.simple td.c-cut { white-space: nowrap; }
.cut { font: 800 22px/1.25 var(--sans); }
.cut-r { color: var(--red); } .cut-y { color: #b7791f; } .cut-g { color: var(--muted); }
.cut-sub { display: block; font-size: 12.5px; color: var(--muted); }
.nc2t.simple td.why .why1 { display: block; font-size: 15px; line-height: 1.5; }
.nc2t.simple td.why .tog { display: inline-block; margin-top: 2px; }
ul.basis { margin: 0 0 6px; padding-left: 1.1em; font-size: 14.5px; line-height: 1.6; }
.ac-why b { font-size: 18px; }
@media (max-width: 1279px) {
  .nc2t.cards.simple tr.unit > td.c-cut { flex-basis: auto; }
  .nc2t.cards.simple td.c-cut .cut-sub { display: inline; margin-left: 8px; }
  .nc2t.cards.simple td.c-cut::before { font-size: 14px; }
}

/* v1.11（115/12/02）：電腦版欄寬重新分配（藥品欄原本吃掉剩餘寬度，中右側大片留白） */
@media (min-width: 1280px) {
  .nc2t.simple { table-layout: fixed; }
  .nc2t.simple th.c-light { width: 96px; }
  .nc2t.simple th.c-name { width: 36%; }
  .nc2t.simple th.c-rev { width: 150px; }
  .nc2t.simple th.c-cut { width: 220px; }
  .nc2t.simple th.c-cut, .nc2t.simple td.c-cut { text-align: left; padding-left: 18px; }
  .nc2t.simple td.c-cut { white-space: normal; }
  .nc2t.simple td.c-name .orig { overflow-wrap: anywhere; }
  .nc2t.simple td.why .why1 { font-size: 15.5px; }
}

/* v1.12（115/12/02）：下一批搜尋時提示其他批次 */
.nc2-other { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 8px 0 12px; font-size: 15px; }
.nc2-olink { border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 999px; padding: 4px 12px; font: 600 14.5px/1.4 var(--sans); cursor: pointer; }
.nc2-olink:hover { background: var(--accent); color: #fff; }
