@charset "UTF-8";
/* ============================================================================
   holter-ui.css — HolterWeb 共用 UI Style Template
   來源：prototype/codex/HolterDesk_CodexInteractivePrototype_CommandCenter.html
         （Codex B4 · Tabler 定案版）改寫為網頁可套用版本。

   使用方式
   --------
   1) Site.Master 已載入 bootstrap 等舊樣式，為避免類別名稱衝突，
      本檔所有規則都限定在 .hui 容器內，套用時把頁面內容包一層：
          <div class="hui"> ... </div>
   2) 引用（沿用專案慣例加日期參數，確保每天取到最新）：
          <link href="/Content/css/holter-ui.css?v=<%= DateTime.Now.ToString("yyyyMMdd") %>" rel="stylesheet" />
   3) 需要 Tabler 線性圖示時，在頁面內放入 HolterUiIcons.ascx，之後用：
          <svg class="ti"><use href="#ti-check"></use></svg>
   4) 完整元件範例與可複製的 HTML：StyleGuide.html
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Design Tokens
   --------------------------------------------------------------------------- */
:root{
  --page:#F5F7FB;
  --chrome:#FFFFFF;
  --surface:#FFFFFF;
  --surface-2:#F6F7F9;
  --ink:#1A2634;
  --ink-2:#667382;
  --ink-3:#98A2B0;
  --rule:#E6E7E9;
  --rule-2:#F0F1F3;
  --accent:#066FD1;
  --accent-hi:#055EB2;
  --accent-ink:#066FD1;
  --accent-soft:#EAF1FB;
  --on-accent:#FFFFFF;
  --accent-btn:#066FD1;
  --accent-btn-hi:#055EB2;
  --row-odd:#FFFFFF;
  --row-even:#FCFCFD;
  --red:#D63939;   --red-hi:#B92D2D; --red-bg:#FDECEC;
  --amber:#F59F00; --amber-hi:#D98C00; --amber-bg:#FFF4DE;
  --green:#2FB344; --green-hi:#269238; --green-bg:#EAF7EC;
  --blue:#066FD1;  --blue-bg:#EAF1FB;
  --grey:#667382;
  --shadow:0 1px 2px rgba(24,36,51,.04);
  --shadow-lg:0 4px 10px rgba(24,36,51,.08),0 18px 40px rgba(24,36,51,.12);
  --ui:Inter,"Noto Sans TC","Microsoft JhengHei","微軟正黑體",sans-serif;
  --mono:Inter,"Noto Sans TC",Consolas,monospace;
  --s1:4px;--s2:8px;--s3:12px;--s4:16px;--s6:24px;--s8:32px;
  /* 內容區寬度：與 BusinessReconciliation 的 1280px 置中版面一致 */
  --hui-max:1280px;
  /* 字級：對齊 Contract 頁的尺標（內文 14 / 次要 13 / 最小 12）。
     整套版面的字都走這五個變數，要放大或縮小改這裡就好。 */
  --fs-lg:17px;   /* 指標數字 */
  --fs-1:14px;    /* 內文：表格內容、按鈕、輸入框 */
  --fs-2:13px;    /* 次要：表頭、欄位標籤、說明文字 */
  --fs-3:12px;    /* 最小：狀態標籤、列內小按鈕、時間 */
  --fs-4:11px;    /* 極小：麵包屑、計數徽章 */
}

/* 暗色：跟系統走；頁面若標記 data-theme="light" 則不套用 */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --page:#151A21; --chrome:#1E2530; --surface:#1E2530; --surface-2:#242C38;
    --ink:#F1F3F5; --ink-2:#A7B0BC; --ink-3:#748092;
    --rule:#34404E; --rule-2:#293340;
    --accent:#4299E1; --accent-hi:#63ADE8; --accent-ink:#78B9ED; --accent-soft:#1D344B; --on-accent:#FFFFFF;
    --accent-btn:#206BC4; --accent-btn-hi:#4299E1;
    --row-odd:#1E2530; --row-even:#202833;
    --red:#E8796B;   --red-hi:#F09386; --red-bg:#39211E;
    --amber:#E0A64A; --amber-hi:#EDBB6A; --amber-bg:#332913;
    --green:#5CBE86; --green-hi:#7DD1A1; --green-bg:#16301F;
    --blue:#7FB6FF;  --blue-bg:#182739;
    --grey:#8A9698;
    --shadow:0 2px 4px rgba(0,0,0,.45);
    --shadow-lg:0 2px 4px rgba(0,0,0,.45),0 12px 28px rgba(0,0,0,.6);
  }
}
/* 使用者明確切換：優先於系統設定 */
:root[data-theme="dark"]{
  --page:#151A21; --chrome:#1E2530; --surface:#1E2530; --surface-2:#242C38;
  --ink:#F1F3F5; --ink-2:#A7B0BC; --ink-3:#748092;
  --rule:#34404E; --rule-2:#293340;
  --accent:#4299E1; --accent-hi:#63ADE8; --accent-ink:#78B9ED; --accent-soft:#1D344B; --on-accent:#FFFFFF;
  --accent-btn:#206BC4; --accent-btn-hi:#4299E1;
  --row-odd:#1E2530; --row-even:#202833;
  --red:#E8796B;   --red-hi:#F09386; --red-bg:#39211E;
  --amber:#E0A64A; --amber-hi:#EDBB6A; --amber-bg:#332913;
  --green:#5CBE86; --green-hi:#7DD1A1; --green-bg:#16301F;
  --blue:#7FB6FF;  --blue-bg:#182739;
  --grey:#8A9698;
  --shadow:0 2px 4px rgba(0,0,0,.45);
  --shadow-lg:0 2px 4px rgba(0,0,0,.45),0 12px 28px rgba(0,0,0,.6);
}

/* ---------------------------------------------------------------------------
   2. 基準（限定於 .hui 容器內）
   --------------------------------------------------------------------------- */
.hui,.hui *{box-sizing:border-box}
.hui{
  background:var(--page);color:var(--ink);font-family:var(--ui);
  font-size:var(--fs-1);font-weight:400;line-height:1.5;-webkit-font-smoothing:antialiased;
  padding:var(--s3);
  /* 固定寬度並置中，避免寬螢幕下欄位被拉得太散 */
  max-width:var(--hui-max);
  margin-left:auto;margin-right:auto;
}
.hui.wide{--hui-max:1600px}   /* 欄位特別多的清單頁 */
.hui.full{--hui-max:none}     /* 需要吃滿整個工作區時 */
/* bleed：把 --page 底色鋪滿整個視窗，蓋掉 Site.Master 的底圖。
   給元件層改版的頁面用（WebView2 版面），不動 Site.Master、不影響其他頁。 */
.hui.bleed{position:relative}
.hui.bleed::before{content:"";position:fixed;inset:0;background:var(--page);z-index:-1}
.hui :focus-visible{outline:2px solid var(--accent);outline-offset:1px}
@media (prefers-reduced-motion:reduce){.hui *{transition:none!important;animation:none!important}}

/* Tabler 線性圖示 */
.hui .ti{width:16px;height:16px;display:inline-block;flex:none;vertical-align:-3px;
  fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hui .ti.sm{width:14px;height:14px}
.hui .ti.lg{width:18px;height:18px}

/* ---------------------------------------------------------------------------
   3. 版面：頁首、卡片、工具列、狀態列
   --------------------------------------------------------------------------- */
/* 頁首：麵包屑 + 標題 + 右側指標（原型 .workspace-head） */
.hui .page-head{
  display:flex;align-items:center;gap:var(--s4);padding:var(--s3) var(--s4);
  background:var(--surface);border:1px solid var(--rule);border-radius:6px;
  box-shadow:var(--shadow);min-height:72px;margin-bottom:var(--s3);
}
.hui .page-copy{min-width:210px;display:flex;flex-direction:column;gap:var(--s1)}
.hui .page-copy .crumb{font:var(--fs-4) var(--mono);letter-spacing:.05em;color:var(--ink-3)}
.hui .page-copy h2{margin:0;font-size:19px;line-height:1.3;font-weight:700}
.hui .page-copy p{margin:0;color:var(--ink-2);font-size:var(--fs-2)}
.hui .metrics{display:flex;align-items:stretch;gap:var(--s2);margin-left:auto;overflow-x:auto}
.hui .metric{
  min-width:96px;padding:var(--s2) var(--s3);border:1px solid var(--rule);border-radius:6px;
  background:var(--surface);display:flex;flex-direction:column;gap:2px;box-shadow:var(--shadow);
}
.hui .metric b{font:600 var(--fs-lg) var(--mono);color:var(--ink)}
.hui .metric span{font-size:var(--fs-3);color:var(--ink-3);white-space:nowrap}
.hui .metric.ok b{color:var(--green)}
.hui .metric.warn b{color:var(--amber)}
.hui .metric.stop b{color:var(--red)}

/* 卡片：一般內容容器 */
.hui .card{
  background:var(--surface);border:1px solid var(--rule);border-radius:6px;
  box-shadow:var(--shadow);padding:var(--s4);margin-bottom:var(--s3);
  display:flex;flex-direction:column;gap:var(--s3);
}
.hui .card.flush{padding:0}

/* 區塊標題列（原型 .grpbar） */
.hui .grpbar{
  display:flex;align-items:center;gap:var(--s2);font-weight:600;font-size:var(--fs-1);
  min-height:32px;padding:var(--s1) 2px var(--s2);border-bottom:1px solid var(--rule);
}
.hui .grpbar .n{font-family:var(--mono);font-weight:400;color:var(--ink-3);font-size:var(--fs-2)}
.hui .grpbar .right{margin-left:auto;display:flex;gap:var(--s1);align-items:center}
.hui .scroll-hint{font:var(--fs-4) var(--mono);font-weight:400;color:var(--ink-3)}

/* 工具列：查詢條件 / 動作按鈕 */
.hui .toolbar{
  display:flex;align-items:center;gap:var(--s1);flex-wrap:wrap;
  padding:var(--s2);background:var(--surface);
  border:1px solid var(--rule);border-radius:6px;margin-bottom:var(--s3);
}
.hui .tsep{width:1px;align-self:stretch;background:var(--rule);margin:0 var(--s1)}
.hui .toolbar .push{margin-left:auto}

/* 頁尾狀態列 */
.hui .statusbar{
  display:flex;align-items:center;gap:var(--s4);flex-wrap:wrap;padding:var(--s1) var(--s3);
  background:var(--chrome);border:1px solid var(--rule);border-radius:6px;
  font-family:var(--mono);font-size:var(--fs-2);color:var(--ink-2);
}
.hui .statusbar .ok{color:var(--green)}
.hui .statusbar .warn{color:var(--amber)}
.hui .statusbar .stop{color:var(--red)}
.hui .statusbar .push{margin-left:auto}

/* ---------------------------------------------------------------------------
   4. 按鈕
   --------------------------------------------------------------------------- */
.hui .b,.hui input[type=button].b,.hui input[type=submit].b,.hui a.b{
  font:inherit;font-size:var(--fs-1);font-weight:500;border:1px solid var(--rule);
  background:var(--surface);color:var(--ink);min-height:34px;border-radius:4px;
  padding:.4rem .8rem;cursor:pointer;white-space:nowrap;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);
  box-shadow:var(--shadow);transition:background-color .13s,border-color .13s,color .13s;
}
.hui .b:hover:not(:disabled){background:var(--accent-soft);border-color:var(--accent);color:var(--accent-ink)}
.hui .b.pri,.hui .b.danger,.hui .b.okb,.hui .b.warnb{color:#fff;border-color:transparent;font-weight:600}
.hui .b.pri{background:var(--accent-btn)}
.hui .b.pri:hover:not(:disabled){background:var(--accent-btn-hi);color:#fff}
.hui .b.danger{background:var(--red)}
.hui .b.danger:hover:not(:disabled){background:var(--red-hi);color:#fff}
.hui .b.okb{background:var(--green)}
.hui .b.okb:hover:not(:disabled){background:var(--green-hi);color:#fff}
.hui .b.warnb{background:var(--amber)}
.hui .b.warnb:hover:not(:disabled){background:var(--amber-hi);color:#fff}
.hui .b:disabled,.hui .b.aspNetDisabled{
  color:var(--ink-3);background:var(--surface-2);border-color:var(--rule-2);
  cursor:not-allowed;box-shadow:none;
}
.hui .b.block{width:100%}

/* 列內小按鈕（對應每一列的 input type=button） */
.hui .mini,.hui input[type=button].mini{
  font:inherit;font-size:var(--fs-3);line-height:1.5;border:1px solid var(--rule);
  background:var(--surface);color:var(--ink-2);border-radius:4px;padding:.22rem .5rem;
  cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:var(--s1);
  transition:all .12s ease-in-out;
}
.hui .mini:hover:not(:disabled){background:var(--accent-soft);border-color:var(--accent-btn)}
.hui .mini.done{color:var(--blue);border-color:var(--blue);background:var(--blue-bg)}
.hui .mini.ok{color:#fff;background:var(--green);border-color:var(--green)}
.hui .mini.bad{color:#fff;background:var(--red);border-color:var(--red)}
.hui .mini.warn{color:#fff;background:var(--amber);border-color:var(--amber)}
.hui .mini:disabled,.hui .mini.aspNetDisabled{
  color:var(--ink-3);background:var(--surface-2);border-color:var(--rule-2);cursor:not-allowed;
}

/* 文字連結鈕 */
.hui .linkbtn{
  font:inherit;font-size:var(--fs-2);background:none;border:0;color:var(--accent-ink);
  cursor:pointer;text-decoration:underline;padding:0;
  display:inline-flex;align-items:center;gap:var(--s1);
}

/* ---------------------------------------------------------------------------
   5. 表單
   --------------------------------------------------------------------------- */
/* 橫列容器：故意不叫 .row，避免蓋掉 bootstrap 的格線 .row */
.hui .frow{display:flex;gap:var(--s2);align-items:center;flex-wrap:wrap}
.hui .inp,.hui input[type=text].inp,.hui input[type=number].inp,
.hui input[type=date].inp,.hui input[type=password].inp,
.hui select.inp,.hui textarea.inp{
  border:1px solid var(--rule);background:var(--surface-2);border-radius:4px;
  padding:.35rem .6rem;font:inherit;font-size:var(--fs-1);color:var(--ink);min-height:34px;
}
.hui .inp:focus{background:var(--surface);border-color:var(--accent);outline:0}
.hui .inp::placeholder{color:var(--ink-3)}
.hui textarea.inp{min-height:64px;line-height:1.6;resize:vertical}
.hui .inp[readonly],.hui .inp:disabled{background:var(--surface-2);color:var(--ink-3);cursor:not-allowed}
.hui .lbl{font-size:var(--fs-2);color:var(--ink-2);white-space:nowrap}
.hui .field-help{font-size:var(--fs-2);color:var(--ink-3)}
.hui .field-help.stop{color:var(--red)}
.hui .field-help.ok{color:var(--green)}
.hui label.ck{display:flex;align-items:center;gap:.45rem;font-size:var(--fs-1);color:var(--ink-2);cursor:pointer;user-select:none}
.hui label.ck input{width:14px;height:14px;accent-color:var(--accent);cursor:pointer}
/* 表單格線：label 靠右、欄位靠左 */
.hui .fgrid{display:grid;grid-template-columns:110px minmax(0,1fr);gap:var(--s2) var(--s3);align-items:center}
.hui .fgrid > label{text-align:right;font-size:var(--fs-2);color:var(--ink-2)}
.hui .fgrid.wide{grid-template-columns:110px minmax(0,1fr) 110px minmax(0,1fr)}

/* ---------------------------------------------------------------------------
   6. 表格（三頁主要沿用這組）
   --------------------------------------------------------------------------- */
.hui .tblwrap{
  overflow:auto;border:1px solid var(--rule);border-radius:6px;background:var(--surface);
  box-shadow:var(--shadow);scrollbar-color:var(--rule) transparent;scrollbar-width:thin;
}
.hui .tblwrap::-webkit-scrollbar{width:9px;height:9px}
.hui .tblwrap::-webkit-scrollbar-thumb{background:var(--rule);border-radius:5px}
.hui .tblwrap::-webkit-scrollbar-thumb:hover{background:var(--ink-3)}
.hui .tblwrap::-webkit-scrollbar-track{background:transparent}

.hui table.g{width:100%;border-collapse:collapse;font-size:var(--fs-1)}
.hui table.g th{
  text-align:left;font-weight:600;font-size:var(--fs-2);color:var(--ink-2);background:var(--surface-2);
  border-bottom:1px solid var(--rule);padding:.5rem .6rem;white-space:nowrap;
}
.hui table.g td{padding:.55rem .6rem;border-bottom:1px solid var(--rule-2);white-space:nowrap}
.hui table.g tbody tr:nth-child(odd) td{background:var(--row-odd)}
.hui table.g tbody tr:nth-child(even) td{background:var(--row-even)}
.hui table.g tbody tr:hover td{background:var(--accent-soft)}
.hui table.g tbody tr.sel td{background:var(--accent-soft)}
/* 整列標記：hl 一般強調、hl-warn 待處理、hl-stop 異常 */
.hui table.g tbody tr.hl td{background:var(--accent-soft)}
.hui table.g tbody tr.hl-warn td{background:var(--amber-bg)}
.hui table.g tbody tr.hl-stop td{background:var(--red-bg)}
.hui table.g tbody tr.sel td:first-child{box-shadow:inset 3px 0 0 var(--accent)}
.hui table.g.pick tbody tr{cursor:pointer}
/* 表頭釘住：需要 .tblwrap 有固定高度才會作用 */
.hui table.g.sticky thead th{position:sticky;top:0;z-index:3;box-shadow:0 1px 0 var(--rule)}
/* dense 只收緊留白，字級與一般表格相同，維持與 Contract 頁一致的可讀性 */
.hui table.g.dense th,.hui table.g.dense td{padding:.35rem .45rem;font-size:var(--fs-1);line-height:1.4}
.hui table.g.dense th{font-size:var(--fs-2)}
/* fit：欄位很多的清單頁專用，讓表格剛好塞滿容器、不出現橫向捲軸。
   table-layout:fixed —— 欄寬照 <th style="width:..."> 的舊版設定走，
   沒指定寬度的欄位平分剩餘空間，總寬固定為容器寬。 */
.hui table.g.fit{width:100%;table-layout:fixed}
.hui table.g.fit th,
.hui table.g.fit td{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.hui table.g.fit td.wrap{max-width:none;min-width:0}
/* 識別碼（病歷號、上傳碼、時間）不要從中間斷行，整段保持完整 */
.hui table.g.fit td.m,
.hui table.g.fit td.num{white-space:nowrap;overflow-wrap:normal;word-break:normal}
/* 但 .m.wrap 是刻意組合：等寬字型 + 允許換行（電話、路徑這種長識別碼） */
.hui table.g.fit td.m.wrap{white-space:normal;overflow-wrap:anywhere}
/* 舊版儲存格裡常有寫死的 min-width/width（例如 label style="min-width:180px"），
   在固定欄寬下會撐出格子、疊到隔壁欄，這裡一律壓回欄寬之內 */
.hui table.g.fit td > *{max-width:100%!important;min-width:0!important}
/* 功能欄常常一格塞好幾顆按鈕：讓按鈕自己換行、不撐開欄寬 */
.hui table.g.fit td .mini,
.hui table.g.fit td .b{max-width:100%;overflow:hidden;text-overflow:ellipsis;margin:1px 0}
.hui table.g.fit td .inp{max-width:100%}

/* 儲存格修飾 */
.hui table.g td.wrap{white-space:normal;min-width:120px;max-width:180px}
.hui table.g .m{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:var(--fs-1)}
.hui table.g td.num{text-align:right;font-family:var(--mono);font-variant-numeric:tabular-nums}
.hui table.g th.num{text-align:right}
.hui table.g .dim{color:var(--ink-3)}
.hui table.g .alert{color:var(--red)}
.hui table.g tfoot td{background:var(--surface-2);font-weight:600;border-top:1px solid var(--rule)}
.hui .empty{padding:1.6rem .5rem;text-align:center;color:var(--ink-3);font-size:var(--fs-1)}

/* 明細用直式表（key/value 兩欄） */
.hui table.c{width:100%;border-collapse:collapse;font-size:var(--fs-1)}
.hui table.c th{text-align:left;font-size:var(--fs-2);font-weight:600;color:var(--ink-2);
  background:var(--surface-2);border-bottom:1px solid var(--rule);padding:.3rem .5rem}
.hui table.c td{padding:.3rem .5rem;border-bottom:1px solid var(--rule-2);vertical-align:top}
.hui table.c td.v{font-family:var(--mono);font-size:var(--fs-1)}
.hui table.c tr.bad td{background:var(--red-bg)}
.hui table.c tr.good td{background:var(--green-bg)}


/* ---------------------------------------------------------------------------
   欄位優先級：窄畫面自動收欄，不出現橫向捲軸
   ---------------------------------------------------------------------------
   在 th 與 td 上標同一個 p2/p3/p4，容器變窄時依序收起。
   沒標的欄位一律保留 —— 基本資料（姓名、病歷號、上傳碼）與功能按鈕屬於這一類。
   收的順序：p4（最先）→ p3 → p2。對應殼的三段寬度：滿版留全部、中收兩級、小收三級。
   斷點用 iframe／視窗自己的寬度，所以殼切小／中／滿版、或收合功能表時都會跟著變。
   --------------------------------------------------------------------------- */
@media (max-width:1560px){ .hui table.g th.p4,.hui table.g td.p4{display:none} }
@media (max-width:1220px){ .hui table.g th.p3,.hui table.g td.p3{display:none} }
@media (max-width:1000px){ .hui table.g th.p2,.hui table.g td.p2{display:none} }

/* 收欄之後，剩下的欄位要把寬度吃滿，右邊不留空。
   固定欄寬（table-layout:fixed + th 的 width）只在寬畫面有意義——那時欄位多，
   需要照舊版的欄寬排。一旦開始收欄，欄位剩不到一半，就改回自動配寬，
   由內容決定比例並撐滿容器；不要依賴 fixed 版面「把剩餘空間分給誰」的實作差異。 */
@media (max-width:1220px){
  .hui table.g.fit{table-layout:auto}
  .hui table.g.fit th,
  .hui table.g.fit td{width:auto!important}
}

/* ---------------------------------------------------------------------------
   7. 狀態標籤 / 燈號 / 進度
   --------------------------------------------------------------------------- */
.hui .pill{
  display:inline-block;font-family:var(--mono);font-size:var(--fs-3);line-height:1.55;
  border-radius:9px;padding:1px .5rem;border:1px solid transparent;white-space:nowrap;
}
.hui .p-red{background:var(--red-bg);color:var(--red);border-color:var(--red)}
.hui .p-amb{background:var(--amber-bg);color:var(--amber);border-color:var(--amber)}
.hui .p-grn{background:var(--green-bg);color:var(--green);border-color:var(--green)}
.hui .p-blu{background:var(--blue-bg);color:var(--blue);border-color:var(--blue)}
.hui .p-mut{background:var(--surface-2);color:var(--ink-3);border-color:var(--rule)}

.hui .mk{font-family:var(--mono);font-weight:700}
.hui .mk.g{color:var(--green)}
.hui .mk.r{color:var(--red)}
.hui .mk.y{color:var(--amber)}
.hui .mk.lg{font-size:1.6em;line-height:1;vertical-align:-2px}
.hui .dot{width:7px;height:7px;border-radius:50%;background:var(--accent);display:inline-block}

.hui .bar{height:6px;border-radius:3px;background:var(--rule-2);overflow:hidden}
.hui .bar i{display:block;height:100%;width:0;background:var(--accent);border-radius:3px;transition:width .35s ease}
.hui .progress{width:96px;height:5px;border-radius:3px;background:var(--rule);overflow:hidden}
.hui .progress i{display:block;height:100%;background:var(--accent);transition:width .2s ease}

/* ---------------------------------------------------------------------------
   8. 頁籤
   --------------------------------------------------------------------------- */
.hui .tabs{display:flex;gap:var(--s1);overflow-x:auto;padding:var(--s2) 0;scrollbar-width:thin}
.hui .tab{
  appearance:none;border:1px solid transparent;border-radius:999px;background:transparent;
  color:var(--ink-2);padding:6px var(--s3);font:600 var(--fs-2) var(--ui);cursor:pointer;white-space:nowrap;
}
.hui .tab:hover{color:var(--accent-ink);background:var(--accent-soft)}
.hui .tab.on{color:var(--accent-ink);background:var(--accent-soft)}
.hui .tab .cnt{
  display:inline-block;margin-left:var(--s1);padding:0 var(--s2);border-radius:9px;
  background:var(--surface-2);color:var(--ink-3);font:var(--fs-4) var(--mono);
}
.hui .tab.on .cnt{background:var(--accent-btn);color:var(--on-accent)}

/* 底線式頁籤 */
.hui .utabs{display:flex;gap:var(--s1);border-bottom:1px solid var(--rule)}
.hui .utab{
  border:0;border-bottom:2px solid transparent;background:none;color:var(--ink-2);
  padding:var(--s2) var(--s3);font:inherit;font-size:var(--fs-2);cursor:pointer;
}
.hui .utab.on{border-bottom-color:var(--accent);color:var(--accent-ink);font-weight:600}

/* ---------------------------------------------------------------------------
   9. 訊息：提示條、守門提示、Toast
   --------------------------------------------------------------------------- */
.hui .msg{
  border-left:3px solid var(--accent);background:var(--accent-soft);color:var(--accent-ink);
  padding:.55rem .75rem;border-radius:0 4px 4px 0;font-size:var(--fs-1);
}
.hui .msg.ok{border-left-color:var(--green);background:var(--green-bg);color:var(--green)}
.hui .msg.warn{border-left-color:var(--amber);background:var(--amber-bg);color:var(--amber)}
.hui .msg.stop{border-left-color:var(--red);background:var(--red-bg);color:var(--red)}
.hui .msg b{font-weight:700}

.hui .guard{
  border:1px solid var(--rule);border-left-width:4px;border-radius:5px;padding:var(--s2) var(--s3);
  display:flex;flex-direction:column;gap:2px;background:var(--surface);font-size:var(--fs-2);
}
.hui .guard b{font-size:var(--fs-2)}
.hui .guard span{color:var(--ink-2)}
.hui .guard.neutral{border-left-color:var(--ink-3)}
.hui .guard.good{border-left-color:var(--green);background:var(--green-bg)}
.hui .guard.warn{border-left-color:var(--amber);background:var(--amber-bg)}
.hui .guard.stop{border-left-color:var(--red);background:var(--red-bg)}

#huiToasts{position:fixed;right:1rem;bottom:1rem;display:flex;flex-direction:column;gap:.5rem;z-index:1090;max-width:330px}
#huiToasts .toast{
  background:var(--surface);border:1px solid var(--rule);border-left:3px solid var(--accent);
  border-radius:5px;box-shadow:var(--shadow);padding:.55rem .75rem;font-size:var(--fs-1);
  font-family:var(--ui);color:var(--ink);animation:hui-tin .22s ease-out;
}
#huiToasts .toast.ok{border-left-color:var(--green)}
#huiToasts .toast.warn{border-left-color:var(--amber)}
#huiToasts .toast.stop{border-left-color:var(--red)}
#huiToasts .toast b{display:block;font-weight:600;margin-bottom:.1rem}
#huiToasts .toast span{color:var(--ink-2)}
@keyframes hui-tin{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:none}}

/* ---------------------------------------------------------------------------
   10. 對話框
   --------------------------------------------------------------------------- */
.hui-overlay{
  position:fixed;inset:0;background:rgba(10,20,18,.42);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;padding:1.5rem;z-index:1080;
  font-family:var(--ui);color:var(--ink);
}
.hui-overlay .dlg{
  background:var(--surface);border:1px solid var(--rule);border-radius:5px;box-shadow:var(--shadow-lg);
  width:100%;max-width:600px;max-height:90vh;overflow:auto;
}
.hui-overlay .dlg.wide{max-width:840px}
.hui-overlay .dt{
  display:flex;align-items:center;gap:var(--s2);padding:.5rem .8rem;background:var(--chrome);
  border-bottom:1px solid var(--rule);font-weight:600;font-size:var(--fs-1);
}
.hui-overlay .dt .x{margin-left:auto;background:none;border:0;color:var(--ink-3);font-size:16px;
  cursor:pointer;line-height:1;padding:.1rem .3rem}
.hui-overlay .dt .x:hover{color:var(--ink)}
.hui-overlay .dc{padding:.9rem 1rem;display:flex;flex-direction:column;gap:.7rem;font-size:var(--fs-1)}
.hui-overlay .df{
  display:flex;gap:var(--s2);justify-content:flex-end;padding:.7rem 1rem;
  border-top:1px solid var(--rule-2);background:var(--surface-2);flex-wrap:wrap;
}

/* ---------------------------------------------------------------------------
   11. 結果卡、鍵值清單、流程時間軸
   --------------------------------------------------------------------------- */
.hui .result-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--s2)}
.hui .result-card{
  border:1px solid var(--rule);border-radius:6px;background:var(--surface);
  padding:var(--s3);display:flex;flex-direction:column;gap:var(--s1);
}
.hui .result-card span{font-size:var(--fs-3);color:var(--ink-3)}
.hui .result-card b{font-size:var(--fs-2);color:var(--ink);overflow-wrap:anywhere}

.hui .kv{display:grid;grid-template-columns:84px minmax(0,1fr);gap:var(--s1) var(--s2);font-size:var(--fs-2)}
.hui .kv span:nth-child(odd){color:var(--ink-3)}
.hui .kv span:nth-child(even){font-family:var(--mono);overflow-wrap:anywhere}

.hui .flow{display:flex;flex-direction:column;gap:0}
.hui .flowstep{position:relative;padding:0 0 var(--s3) 24px;font-size:var(--fs-2);color:var(--ink-3)}
.hui .flowstep::before{content:"";position:absolute;left:6px;top:3px;width:9px;height:9px;
  border:2px solid var(--rule);border-radius:50%;background:var(--surface)}
.hui .flowstep::after{content:"";position:absolute;left:11px;top:14px;bottom:0;border-left:1px solid var(--rule)}
.hui .flowstep:last-child{padding-bottom:0}
.hui .flowstep:last-child::after{display:none}
.hui .flowstep.done{color:var(--green)}
.hui .flowstep.done::before{border-color:var(--green);background:var(--green)}
.hui .flowstep.now{color:var(--accent-ink);font-weight:600}
.hui .flowstep.now::before{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}

.hui pre.file{
  font-family:var(--mono);font-size:var(--fs-2);line-height:1.7;background:var(--surface-2);
  border:1px solid var(--rule);border-radius:5px;padding:.7rem .85rem;margin:0;
  overflow-x:auto;white-space:pre;max-height:270px;color:var(--ink);
}
.hui pre.file .hi{color:var(--accent-ink);font-weight:500}
.hui pre.file .dim{color:var(--ink-3)}

/* ---------------------------------------------------------------------------
   12. 通知清單（複審小幫手 / 系統通知）
   --------------------------------------------------------------------------- */
.hui .notice-list{display:flex;flex-direction:column;border:1px solid var(--rule);border-radius:6px;overflow:hidden}
.hui .notice-item{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:var(--s3);align-items:start;
  width:100%;padding:var(--s3);border:0;border-bottom:1px solid var(--rule-2);
  background:var(--surface);color:var(--ink);text-align:left;font:inherit;cursor:pointer;
}
.hui .notice-item:last-child{border-bottom:0}
.hui .notice-item:hover{background:var(--accent-soft)}
.hui .notice-item.read{opacity:.68}
.hui .notice-icon{
  width:38px;height:38px;border-radius:8px;display:grid;place-items:center;
  background:var(--accent-soft);color:var(--accent-ink);flex:none;
}
.hui .notice-icon.review{background:var(--amber-bg);color:var(--amber)}
.hui .notice-icon.stop{background:var(--red-bg);color:var(--red)}
.hui .notice-copy b{display:flex;align-items:center;gap:var(--s2);font-size:var(--fs-1)}
.hui .notice-copy p{margin:3px 0 0;color:var(--ink-2);font-size:var(--fs-2);line-height:1.5}
.hui .notice-time{color:var(--ink-3);font:var(--fs-3)/1.4 var(--mono);white-space:nowrap}
.hui .notice-empty{text-align:center;color:var(--ink-3);font-size:var(--fs-2);padding:var(--s6)}
.hui .badge{
  min-width:17px;height:17px;padding:0 var(--s1);border-radius:999px;background:var(--red);
  color:var(--on-accent);display:inline-grid;place-items:center;font:700 var(--fs-4)/1 var(--ui);
}

/* ---------------------------------------------------------------------------
   13. 小工具
   --------------------------------------------------------------------------- */
.hui .mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.hui .muted{color:var(--ink-3)}
.hui .strong{font-weight:600}
.hui .right{margin-left:auto}
.hui .nowrap{white-space:nowrap}
.hui .sim{border:1px dashed var(--amber);color:var(--amber);background:var(--amber-bg);
  border-radius:4px;padding:.1rem .4rem;font-family:var(--mono);font-size:var(--fs-4)}

/* ---------------------------------------------------------------------------
   14. 桌面原型元件
       HolterDesk B4（案件指揮中心）與醫師心專字號原型用到、前面幾節沒有的元件。
       命名跟原型一致，原型的 HTML 可以直接貼進來套。
   --------------------------------------------------------------------------- */
/* ---- 左側功能表（原型 .nav） ---- */
.hui .navpane{
  padding:var(--s3) var(--s2);background:var(--surface);
  border:1px solid var(--rule);border-radius:6px;
}
.hui .nav-title{
  padding:var(--s3) var(--s3) var(--s2);font-size:var(--fs-4);font-weight:700;
  letter-spacing:.09em;color:var(--ink-3);
}
.hui .nav-item{
  display:flex;align-items:center;gap:var(--s2);padding:9px var(--s3);
  border-radius:6px;color:var(--ink-2);margin-bottom:2px;
  font-size:var(--fs-1);text-decoration:none;cursor:pointer;
}
.hui .nav-item:hover{background:var(--surface-2);color:var(--ink)}
.hui .nav-item.on{background:var(--accent-soft);color:var(--accent-ink);font-weight:600}
.hui .nav-item small{margin-left:auto;color:var(--ink-3);font-size:var(--fs-4)}
.hui .nav-item.sub{padding-left:var(--s6)}

/* ---- 橫幅提示（原型 .notice）：比 .msg 大一階，帶圖示與說明 ---- */
.hui .notice{
  display:flex;gap:var(--s3);align-items:flex-start;
  padding:var(--s3) var(--s4);border:1px solid var(--rule);
  border-left:4px solid var(--accent);border-radius:6px;
  background:var(--surface);margin-bottom:var(--s3);font-size:var(--fs-1);
}
.hui .notice > .ti{margin-top:2px;color:var(--accent)}
.hui .notice b{display:block;margin-bottom:2px}
.hui .notice span{color:var(--ink-2);font-size:var(--fs-2)}
.hui .notice.ok{border-left-color:var(--green);background:var(--green-bg)}
.hui .notice.ok > .ti{color:var(--green)}
.hui .notice.warn{border-left-color:var(--amber);background:var(--amber-bg)}
.hui .notice.warn > .ti{color:var(--amber)}
.hui .notice.stop{border-left-color:var(--red);background:var(--red-bg)}
.hui .notice.stop > .ti{color:var(--red)}

/* ---- 開關（原型 .toggle）：用 button 或 input[type=checkbox] 都可以 ---- */
.hui .toggle{
  width:34px;height:19px;border-radius:999px;border:0;padding:0;flex:none;
  background:var(--rule);position:relative;cursor:pointer;
  transition:background-color .15s;appearance:none;
}
.hui .toggle::after{
  content:"";position:absolute;width:15px;height:15px;left:2px;top:2px;
  border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:left .15s;
}
.hui .toggle.on,.hui .toggle:checked{background:var(--green)}
.hui .toggle.on::after,.hui .toggle:checked::after{left:17px}
.hui .toggle:disabled{opacity:.5;cursor:not-allowed}

/* ---- 方形圖示鈕（原型 .icon-btn） ---- */
.hui .icon-btn{
  width:30px;height:30px;flex:none;border:1px solid var(--rule);border-radius:4px;
  background:var(--surface);color:var(--ink-2);cursor:pointer;padding:0;
  display:inline-grid;place-items:center;transition:color .13s,border-color .13s;
}
.hui .icon-btn:hover:not(:disabled){color:var(--accent-ink);border-color:var(--accent)}
.hui .icon-btn:disabled{color:var(--ink-3);background:var(--surface-2);cursor:not-allowed}

/* ---- 小標籤（原型 .eyebrow）：卡片上方的分類字 ---- */
.hui .eyebrow{
  font-size:var(--fs-4);letter-spacing:.08em;text-transform:uppercase;
  color:var(--ink-3);font-weight:600;
}

/* ---- 徽章（原型 .tag）：標示「WebView2 畫面」「原生功能」這類來源 ---- */
.hui .tag{
  display:inline-flex;align-items:center;gap:var(--s1);padding:2px 8px;border-radius:999px;
  background:var(--accent-soft);color:var(--accent-ink);font-size:var(--fs-4);font-weight:600;
  white-space:nowrap;
}
.hui .tag.mut{background:var(--surface-2);color:var(--ink-3)}
.hui .tag.ok{background:var(--green-bg);color:var(--green)}
.hui .tag.warn{background:var(--amber-bg);color:var(--amber)}

/* ---- 對話框表單（原型 .form-grid / .field）：跟 .fgrid 不同，label 在欄位上方 ---- */
.hui .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--s3)}
.hui .field{display:flex;flex-direction:column;gap:var(--s1);min-width:0}
.hui .field.full{grid-column:1/-1}
.hui .field > label{font-size:var(--fs-2);font-weight:600;color:var(--ink)}
.hui .field-error{font-size:var(--fs-3);color:var(--red);display:none}
.hui .field-error.show{display:block}

/* ---- 等寬預覽區塊（原型 .pat）：PAT.001、JSON、路徑這類要逐字看的內容 ---- */
.hui .pat{
  font:var(--fs-4)/1.65 var(--mono);border:1px solid var(--rule);border-radius:5px;
  background:var(--surface-2);color:var(--ink);padding:var(--s3);
  white-space:pre-wrap;overflow-wrap:anywhere;margin:0;
}

/* ---- 分段控制（原型 .role-switch）：兩三個互斥選項 ---- */
.hui .seg{
  display:inline-flex;gap:2px;padding:2px;flex:none;
  border:1px solid var(--rule);border-radius:6px;background:var(--surface-2);
}
.hui .seg button{
  border:0;border-radius:4px;padding:5px 10px;background:transparent;
  color:var(--ink-2);font:inherit;font-size:var(--fs-3);cursor:pointer;white-space:nowrap;
}
.hui .seg button:hover:not(.on){color:var(--ink)}
.hui .seg button.on{background:var(--accent-btn);color:var(--on-accent)}

/* ---- 主／側雙欄工作區（原型 .workspace + .side） ---- */
.hui .workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:var(--s3);align-items:start}
.hui .workspace.narrow{grid-template-columns:minmax(0,1fr) 260px}
.hui .side{display:flex;flex-direction:column;gap:var(--s3);min-width:0}
.hui .side h3{font-size:16px;margin:var(--s1) 0 var(--s3)}

/* ---- 別名：原型與樣式表的命名對齊，兩種寫法都吃得到 ---- */
.hui .table-wrap{
  overflow:auto;border:1px solid var(--rule);border-radius:6px;background:var(--surface);
}
.hui .dialog{width:min(680px,100%)}

/* ---- WebView2 殼：頁面被 WebViewShell 的 iframe 嵌入時（網址帶 shell=1） ----
   把本站自己的頂端 nav、頁首橫幅與外距收掉，只留內容區，
   避免殼的功能表跟網頁的功能表疊成兩層。 */
body.in-shell #topNav,
body.in-shell .top-area,
body.in-shell #complianceWarningBanner,
body.in-shell footer,
body.in-shell .sub-footer{display:none!important}
body.in-shell{background:var(--page)!important}
body.in-shell #wrapper{padding-top:0!important;margin-top:0!important}
/* 被殼載入時，頁面自己的工作區標題、工具列與示範說明由殼提供，這裡藏起來，
   避免兩層標題與兩排按鈕。單獨開啟該頁（不帶 shell=1）時完全不受影響。 */
body.in-shell .hui > .page-head,
body.in-shell .hui > .toolbar,
body.in-shell .hui > .msg{display:none}
body.in-shell .hui{padding-top:var(--s2)}
body.in-shell .hui.bleed::before{display:none}

/* ---- 殼本身 ---- */
.hui-shell{
  position:fixed;inset:0;display:flex;flex-direction:column;
  background:var(--page);color:var(--ink);font-family:var(--ui);font-size:var(--fs-1);
  margin:0 auto;transition:max-width .16s ease,inset .16s ease;
}
/* 視窗寬度：小／中／滿版。
   小與中會縮成置中的「視窗」，用來預覽窄螢幕與筆電上的排版；
   滿版就是實際 WebView2 在桌面視窗裡的樣子（預設）。 */
.hui-shell.sz-s,.hui-shell.sz-m{
  inset:14px;border:1px solid var(--rule);border-radius:8px;
  overflow:hidden;box-shadow:var(--shadow-lg);
}
.hui-shell.sz-s{max-width:1120px}
.hui-shell.sz-m{max-width:1440px}
.hui-shell.sz-f{max-width:none;inset:0;border:0;border-radius:0;box-shadow:none}
/* 縮小時後面露出的底色，讓視窗邊界看得出來（class 由殼的 JS 掛上） */
body.shell-windowed{background:var(--surface-2)}
.hui-shell .szseg{margin-left:var(--s2)}
.hui-shell .titlebar{
  display:flex;align-items:center;gap:var(--s2);height:38px;padding:0 var(--s3);
  background:var(--chrome);border-bottom:1px solid var(--rule);flex:none;
}
.hui-shell .titlebar .mark{
  width:22px;height:22px;border-radius:5px;background:var(--accent-btn);color:#fff;
  display:grid;place-items:center;flex:none;
}
.hui-shell .titlebar b{font-weight:700}
.hui-shell .titlebar .winbtns{margin-left:auto;display:flex;gap:2px;color:var(--ink-3)}
.hui-shell .titlebar .winbtns span{width:30px;height:24px;display:grid;place-items:center;border-radius:4px;cursor:default}
.hui-shell .titlebar .winbtns span:hover{background:var(--surface-2);color:var(--ink)}
.hui-shell .menubar{
  display:flex;align-items:center;gap:1.1rem;padding:.32rem var(--s3);font-size:var(--fs-2);
  color:var(--ink-2);background:var(--surface);border-bottom:1px solid var(--rule-2);flex:none;
}
.hui-shell .menubar > span{cursor:default}
.hui-shell .menubar > span:hover{color:var(--ink)}
.hui-shell .menubar .spacer{margin-left:auto}
.hui-shell .shellbody{display:flex;min-height:0;flex:1}
.hui-shell .shellnav{
  width:212px;flex:none;overflow:auto;padding:var(--s2);
  background:var(--chrome);border-right:1px solid var(--rule);
}
.hui-shell .navi{
  min-height:34px;padding:.4rem .65rem;border-radius:6px;color:var(--ink-2);
  display:flex;align-items:center;justify-content:space-between;gap:.4rem;
  cursor:pointer;font-size:var(--fs-2);border:0;background:none;width:100%;text-align:left;font-family:inherit;
}
.hui-shell .navi .navlabel{display:flex;align-items:center;gap:var(--s2);min-width:0}
.hui-shell .navi:hover{background:var(--accent-soft);color:var(--accent-ink)}
.hui-shell .navi.on{background:var(--accent-soft);color:var(--accent-ink);font-weight:600}
.hui-shell .navi .web{
  font-family:var(--mono);font-size:9px;color:var(--ink-3);
  border:1px solid var(--rule);border-radius:6px;padding:0 .3rem;flex:none;
}
.hui-shell .navi.on .web{color:var(--accent-ink);border-color:var(--accent)}
.hui-shell .navi .web.nat{color:var(--amber);border-color:var(--amber)}
.hui-shell .navi .web.tpl{color:var(--green);border-color:var(--green)}
.hui-shell .navgrp{
  font-size:var(--fs-4);font-weight:600;letter-spacing:.09em;text-transform:uppercase;
  color:var(--ink-3);padding:.7rem .65rem .3rem;
}
.hui-shell .stage{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--page)}
.hui-shell .addrbar{
  display:flex;align-items:center;gap:var(--s2);padding:var(--s1) var(--s2);flex:none;
  background:var(--surface);border-bottom:1px solid var(--rule-2);
}
.hui-shell .addr{
  flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-3);color:var(--ink-3);
  background:var(--surface-2);border:1px solid var(--rule);border-radius:999px;
  padding:.18rem .7rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.hui-shell iframe{flex:1;width:100%;border:0;background:var(--page)}

/* ---- 殼的 chrome：工具列、工作區標題、右側摘要欄 ----
   對齊 codex 原型 CommandCenter：這幾塊在桌面版屬於原生 UI（WinForms），
   所以由殼提供，不是由 WebView2 裡的網頁提供。
   網頁被殼載入時（shell=1）會把自己那一份藏起來，見上面的 body.in-shell。 */
.hui-shell .shelltoolbar{
  display:flex;align-items:center;gap:var(--s1);flex-wrap:wrap;flex:none;
  padding:var(--s2) var(--s3);background:var(--chrome);border-bottom:1px solid var(--rule);
}
.hui-shell .shellhead{
  display:flex;align-items:center;gap:var(--s4);flex:none;
  padding:var(--s2) var(--s3);background:var(--chrome);border-bottom:1px solid var(--rule);
}
.hui-shell .shellhead .page-copy{min-width:220px;display:flex;flex-direction:column;gap:2px}
.hui-shell .shellhead .metrics{margin-left:auto}
.hui-shell .shellhead .headbtns{display:flex;align-items:center;gap:var(--s2);flex:none}
.hui-shell .shellinspector{
  width:316px;flex:none;overflow:auto;padding:var(--s3);
  background:var(--chrome);border-left:1px solid var(--rule);
  display:flex;flex-direction:column;gap:var(--s3);
}
.hui-shell.inspector-off .shellinspector{display:none}
.hui-shell .shellinspector .card{margin-bottom:0}
.hui-shell .shellinspector h3{font-size:15px;margin:2px 0 var(--s2)}

/* 通知鈴鐺 */
.hui-shell .bell{
  position:relative;display:inline-flex;align-items:center;gap:var(--s1);
  border:0;background:none;color:var(--ink-2);font:inherit;font-size:var(--fs-2);cursor:pointer;
}
.hui-shell .bell:hover{color:var(--accent-ink)}
.hui-shell .bell .badge{
  min-width:16px;height:16px;padding:0 4px;border-radius:9px;background:var(--red);color:#fff;
  font:600 var(--fs-4)/16px var(--mono);text-align:center;
}
@media (max-width:1180px){
  .hui-shell .shellinspector{display:none}
  .hui-shell .shellhead{flex-wrap:wrap}
  .hui-shell .shellhead .metrics{margin-left:0;width:100%;overflow-x:auto}
}

.hui-shell .statusbar{border:0;border-top:1px solid var(--rule);border-radius:0;flex:none}

/* ---- 左側導覽收合：只留圖示，把寬度讓給內容 ---- */
.hui-shell .shellnav{transition:width .16s ease}
.hui-shell.nav-collapsed .shellnav{width:52px;padding:var(--s2) 6px}
.hui-shell.nav-collapsed .navi{justify-content:center;padding:.4rem 0}
.hui-shell.nav-collapsed .navi .navlabel span,
.hui-shell.nav-collapsed .navi .web,
.hui-shell.nav-collapsed .navgrp{display:none}
.hui-shell .navtoggle{
  display:flex;align-items:center;gap:var(--s2);width:100%;margin-bottom:var(--s1);
  border:1px solid var(--rule);background:var(--surface);color:var(--ink-2);
  border-radius:6px;padding:.3rem .5rem;cursor:pointer;font:inherit;font-size:var(--fs-3);
}
.hui-shell .navtoggle:hover{border-color:var(--accent);color:var(--accent-ink)}
.hui-shell.nav-collapsed .navtoggle{justify-content:center;padding:.3rem 0}
.hui-shell.nav-collapsed .navtoggle span{display:none}
.hui-shell.nav-collapsed .navtoggle .ti{transform:rotate(180deg)}

@media (max-width:820px){
  .hui-shell .shellnav{width:56px}
  .hui-shell .navi .navlabel span{display:none}
  .hui-shell .navi .web,.hui-shell .navgrp{display:none}
}

/* ---------------------------------------------------------------------------
   15. 舊元件相容（沿用專案既有 plugin 的頁面，不必每頁再寫一次）
   --------------------------------------------------------------------------- */
/* 舊分頁元件（bootstrap .pagination）放進 .statusbar 時的尺寸 */
.hui .pagination{margin:0}
.hui .pagination > li > a,
.hui .pagination > li > span{padding:2px 8px;font-size:var(--fs-2)}

/* chosen 下拉：字級與對齊跟著 .inp */
.hui .chosen-container{font-size:var(--fs-1);text-align:left}

/* 明細頁的檢視／編輯切換：唯讀文字與輸入欄位共用同一格
   （jQuery .toggle() 還原時 display 會回到這裡的值） */
.hui .fgrid .original,
.hui .fgrid .changeNew{display:inline-block}

/* ---------------------------------------------------------------------------
   16. .hui.skin —— 舊頁面「只換皮」相容層
       用途：現有頁面完全不改版面，只在最外層加 class="hui skin"，
       就把舊的 tblResult / tdTitle / myth / btn-* / 寫死的 lightblue、whitesmoke
       換成這份樣式表的配色、框線、字型與按鈕外觀。
       版面（欄位排列、欄寬、區塊位置）一律沿用頁面原本的 markup，這裡不碰。
       清單頁請多加 compact（字級 13px，與舊版 font-size:small 相同）；
       表單／明細頁維持 14px。
   --------------------------------------------------------------------------- */
.hui.skin{
  /* 不套用 .hui 的容器版面，避免改到既有排版 */
  max-width:none;margin:0;padding:0;background:transparent;
  color:var(--ink);font-family:var(--ui);font-size:var(--fs-1);line-height:1.5;
}
.hui.compact{--fs-1:13px;--fs-2:12px;--fs-3:11px;--fs-4:10px}

/* ---- 表格：保留原本的欄寬與欄位排列，只換框線與配色 ---- */
.hui.skin table{border-collapse:collapse;font-size:var(--fs-1);color:var(--ink);border-color:var(--rule-2)}
/* 舊頁面常寫 table,tr,td,th{border:1px solid black}，tr 和 table 本身也要一起換色 */
.hui.skin table tr{border-color:var(--rule-2)}
.hui.skin table th,
.hui.skin table td{
  border:1px solid var(--rule-2);padding:.38rem .5rem;
  font-weight:400;color:var(--ink);font-size:var(--fs-1);
}
.hui.skin thead th,
.hui.skin thead td,
.hui.skin tr.myth th,
.hui.skin tr.title th,
.hui.skin tr.title td,
.hui.skin tr.myth td{
  background:var(--surface-2);color:var(--ink-2);
  font-weight:600;font-size:var(--fs-2);border-bottom:1px solid var(--rule);
}
.hui.skin .tblResult{background:var(--surface)}
.hui.skin .tdTitle,
.hui.skin .tdLabel{font-weight:600;color:var(--ink)}
.hui.skin label{color:inherit;font-weight:400}

/* 舊 markup 把底色寫死在 style 屬性上，改成走 token（暗色模式才跟得動） */
.hui.skin [style*="lightblue"]{background-color:var(--accent-soft)!important;color:var(--ink)!important}
.hui.skin [style*="whitesmoke"]{background-color:var(--surface)!important}
.hui.skin [style*="solid black"]{border-color:var(--rule)!important}

/* 整列 hover：必須放在上面 [style*="whitesmoke"] 之後，而且同樣要 !important。
   舊 markup 幾乎每個 <td> 都寫死 style="background-color: whitesmoke"，
   inline style 蓋過一般規則，所以那條覆寫用了 !important；hover 若不比照，
   就只有「沒寫 inline 底色」的欄位（例如 Case 最後的刪除欄）會變色。
   兩條都是 !important 時比權重：這條 (0,3,3) > 那條 (0,3,0)，hover 才吃得到。 */
.hui.skin tbody tr:hover > td{background-color:var(--accent-soft)!important}
.hui.skin [style*="color: black"],
.hui.skin [style*="color:black"]{color:var(--ink)!important}

/* ---- 表單控制項 ---- */
.hui.skin input[type=text],
.hui.skin input[type=number],
.hui.skin input[type=date],
.hui.skin input[type=time],
.hui.skin input[type=password],
.hui.skin input[type=email],
.hui.skin input[type=tel],
.hui.skin input[type=search],
.hui.skin input[type=file],
.hui.skin select,
.hui.skin textarea{
  border:1px solid var(--rule);background:var(--surface-2);border-radius:4px;
  padding:.28rem .5rem;font-family:var(--ui);font-size:var(--fs-1);color:var(--ink);
}
.hui.skin input[type=text]:focus,
.hui.skin select:focus,
.hui.skin textarea:focus{background:var(--surface);border-color:var(--accent);outline:0}
.hui.skin input[type=checkbox],
.hui.skin input[type=radio]{accent-color:var(--accent);cursor:pointer}

/* ---- 按鈕：沿用原本的 btn-* class，只換外觀 ----
   基底規則用 :where() 讓權重歸零（整條只算 .hui.skin 的 0,2,0），
   下面的 .btn-* 才是 0,3,0，才蓋得過去。若寫成
   `.hui.skin input[type=button]`（0,3,1）會反過來壓掉 .btn-primary，
   藍色按鈕就會變成白底深字、看不出是主要按鈕。 */
.hui.skin :where(input[type=button],input[type=submit],input[type=reset],button){
  font-family:var(--ui);font-size:var(--fs-2);font-weight:500;
  border:1px solid var(--rule);background:var(--surface);color:var(--ink);
  border-radius:4px;padding:.24rem .6rem;cursor:pointer;white-space:nowrap;
  text-shadow:none;text-transform:none;letter-spacing:0;
  box-shadow:var(--shadow);transition:background-color .13s,border-color .13s,color .13s;
}
.hui.skin :where(input[type=button],input[type=submit],input[type=reset],button):hover:not(:disabled){
  background:var(--accent-soft);border-color:var(--accent);color:var(--accent-ink);
}

/* 有色按鈕：底色與字色都在同一組規則裡指定，hover 也一併寫死，
   避免上面的 :where() hover 把字色換回深色。
   底色挑過對比：藍 #066FD1／綠 #269238／紅 #D63939 配白字都在 4.5:1 以上；
   琥珀色配白字只有 2 點多，所以 .btn-warning 走深色字。 */
.hui.skin .btn-primary,
.hui.skin .btn-info,
.hui.skin .btn-success,
.hui.skin .btn-danger,
.hui.skin .btn-primary:hover:not(:disabled),
.hui.skin .btn-info:hover:not(:disabled),
.hui.skin .btn-success:hover:not(:disabled),
.hui.skin .btn-danger:hover:not(:disabled){
  color:var(--on-accent);border-color:transparent;font-weight:600;
  text-shadow:none;text-transform:none;letter-spacing:0;
}
.hui.skin .btn-primary{background:var(--accent-btn)}
.hui.skin .btn-primary:hover:not(:disabled){background:var(--accent-btn-hi)}
.hui.skin .btn-info{background:var(--blue)}
.hui.skin .btn-info:hover:not(:disabled){background:var(--accent-btn-hi)}
.hui.skin .btn-success{background:var(--green-hi)}
.hui.skin .btn-success:hover:not(:disabled){background:var(--green)}
.hui.skin .btn-danger{background:var(--red)}
.hui.skin .btn-danger:hover:not(:disabled){background:var(--red-hi)}
.hui.skin .btn-warning,
.hui.skin .btn-warning:hover:not(:disabled){
  color:#1A2634;border-color:transparent;font-weight:600;
  text-shadow:none;text-transform:none;letter-spacing:0;
}
.hui.skin .btn-warning{background:var(--amber)}
.hui.skin .btn-warning:hover:not(:disabled){background:var(--amber-hi)}
/* .btn-default / 沒帶 btn-* 的按鈕：白底深字，框線加重，跟表格底色拉開 */
.hui.skin .btn-default,
.hui.skin .btn-default:hover:not(:disabled){color:var(--ink);background:var(--surface);border-color:var(--ink-3)}
.hui.skin .btn-xs{font-size:var(--fs-3);padding:.14rem .42rem;box-shadow:none}
.hui.skin input:disabled,
.hui.skin button:disabled,
.hui.skin .aspNetDisabled{
  color:var(--ink-3);background:var(--surface-2);border-color:var(--rule-2);
  cursor:not-allowed;box-shadow:none;
}

/* ---- 舊分頁元件 ---- */
.hui.skin .pagination > li > a,
.hui.skin .pagination > li > span{
  padding:2px 8px;font-size:var(--fs-2);color:var(--accent-ink);
  border:1px solid var(--rule);background:var(--surface);text-decoration:none;
}
.hui.skin .pagination > li.active > a{background:var(--accent-btn);border-color:var(--accent-btn);color:#fff}
.hui.skin .input-group-addon{
  font-size:var(--fs-2);color:var(--ink-2);background:var(--surface-2);
  border:1px solid var(--rule);
}
.hui.skin .form-control{
  font-size:var(--fs-1);color:var(--ink);background:var(--surface-2);
  border:1px solid var(--rule);border-radius:4px;
}
.hui.skin .chosen-container{font-size:var(--fs-1);text-align:left}

/* ---------------------------------------------------------------------------
   17. 響應式 / 列印
   --------------------------------------------------------------------------- */
@media (max-width:1180px){
  .hui .page-head{align-items:flex-start;flex-wrap:wrap}
  .hui .metrics{order:3;width:100%;margin-left:0}
  .hui .workspace,.hui .workspace.narrow{grid-template-columns:minmax(0,1fr)}
  .hui .side{display:grid;grid-template-columns:1fr 1fr}
}
@media (max-width:680px){
  .hui{padding:var(--s2)}
  .hui .result-grid{grid-template-columns:1fr}
  .hui .fgrid,.hui .fgrid.wide{grid-template-columns:1fr}
  .hui .fgrid > label{text-align:left}
  .hui .notice-item{grid-template-columns:auto minmax(0,1fr)}
  .hui .notice-time{grid-column:2}
  .hui .form-grid{grid-template-columns:1fr}
  .hui .field.full{grid-column:auto}
  .hui .side{display:flex}
}
@media print{
  .hui{background:#fff;padding:0}
  .hui .toolbar,.hui .b,.hui .mini,.hui .tabs,.hui .statusbar{display:none!important}
  .hui .card,.hui .page-head,.hui .tblwrap{box-shadow:none;border-color:#ccc}
  .hui table.g{font-size:var(--fs-3)}
  .hui table.g tbody tr:hover td{background:inherit}
}
