/* ============================================================
   style.css — 飯店工程報修系統 v3.1 共用樣式
   ============================================================

   【設計說明】
   本檔案是全系統唯一的樣式來源，四支頁面（index / login /
   dashboard / admin）共用，確保視覺一致。

   【四季配色】
   v3.1 起支援四季主題。PHP 會在 <html> 標籤輸出 data-season 屬性
   （spring／summer／autumn／winter），下方的季節區塊即依此覆寫主色。
   切換方式在「管理後台 → 外觀設定」，可選自動（依月份）或手動指定。

   【重要的設計原則：季節只換主色，不動狀態色】
   報修紅、待修黃、完修綠這些是「語意色」，代表單據的實際狀態。
   若它們隨季節漂移，工程同仁掃視看板時會誤判，那是拿正確性換美觀。
   因此季節區塊只覆寫 brand 系列與頁面底色，狀態色與語意色恆定不變。

   【如何調整整體配色】
   想改基礎色：修改最上方 :root 區塊。
   想改某一季：修改下方對應的 [data-season="..."] 區塊。

   【技術說明】
   CSS 變數（CSS Custom Properties）是瀏覽器原生功能，
   以 var(--名稱) 取用，不需要任何編譯工具或外部套件。

   字型採用系統內建字型堆疊，不引用任何外部字型服務，
   因此 NAS 即使在無對外網路的環境也能正常顯示。
   ============================================================ */

:root {
    /* ---- 主色系（想換整體風格改這裡） ---- */
    --brand:        #1f5673;   /* 主色：深藍灰，工程與專業感 */
    --brand-dark:   #14384a;   /* 主色加深：頂欄、按下狀態 */
    --brand-soft:   #e9f1f5;   /* 主色淡底：選取列、提示區 */
    --accent:       #2b7a78;   /* 輔色：次要動作 */

    /* ---- 中性色 ---- */
    --bg:           #f1f4f6;   /* 頁面底色 */
    --surface:      #ffffff;   /* 卡片底色 */
    --surface-2:    #f7f9fa;   /* 次級底色：表頭、區塊內襯 */
    --text:         #1f2933;   /* 主要文字 */
    --text-2:       #52606d;   /* 次要文字 */
    --muted:        #7b8794;   /* 說明文字 */
    --line:         #dde3e8;   /* 分隔線 */
    --line-strong:  #c3ccd4;   /* 較明顯的分隔線 */

    /* ---- 語意色 ---- */
    --danger:       #c0392b;
    --danger-dark:  #96281b;
    --danger-soft:  #fdecea;
    --warn:         #b9770e;
    --warn-soft:    #fdf4e3;
    --ok:           #1e8449;
    --ok-soft:      #e9f7ef;
    --info:         #2471a3;
    --info-soft:    #eaf2f8;

    /* ---- 報修單狀態色（與看板的色帶一致） ---- */
    --st-new:       #c0392b;   /* 報修 */
    --st-wait:      #b9770e;   /* 待修 */
    --st-done:      #1e8449;   /* 完修 */

    /* ---- 版面尺寸 ---- */
    --radius:       8px;
    --radius-sm:    5px;
    --shadow:       0 1px 3px rgba(31,41,51,.10), 0 1px 2px rgba(31,41,51,.06);
    --shadow-lg:    0 8px 24px rgba(31,41,51,.14);
    --topbar-h:     56px;
}

/* ============================================================
   四季主題
   ============================================================
   每一季只覆寫五個變數：
     --brand       主色（按鈕、連結、選取標籤）
     --brand-dark  深色（頂欄底色、按鈕按下）
     --brand-soft  淡底（選取列、提示區、登入頁漸層起點）
     --accent      輔色（登入頁漸層終點）
     --bg          頁面底色（僅作極淡的季節暈染）

   狀態色（--st-報修／待修／完修）與語意色（danger／ok／warn／info）
   一律不隨季節改變，確保單據狀態的辨識永遠一致。
   ============================================================ */

/* 春　嫩葉綠　三～五月 */
[data-season="spring"] {
    --brand:      #3f7d56;
    --brand-dark: #2a5a3c;
    --brand-soft: #e8f3ea;
    --accent:     #7fa650;
    --bg:         #f1f5f1;
}

/* 夏　海水藍　六～八月 */
[data-season="summer"] {
    --brand:      #1a6f8b;
    --brand-dark: #0f4a5e;
    --brand-soft: #e3f0f5;
    --accent:     #17a2a2;
    --bg:         #eff5f7;
}

/* 秋　楓葉褐　九～十一月 */
[data-season="autumn"] {
    --brand:      #9a5a2b;
    --brand-dark: #6d3c19;
    --brand-soft: #f7ece1;
    --accent:     #c08432;
    --bg:         #f6f2ed;
}

/* 冬　霜雪靛　十二～二月 */
[data-season="winter"] {
    --brand:      #3b5471;
    --brand-dark: #26374d;
    --brand-soft: #eaeef4;
    --accent:     #5a7fa6;
    --bg:         #f1f3f6;
}

/* ============================================================
   外觀設定頁的季節預覽色塊
   ============================================================ */
.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}
.season-opt {
    display: block;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    background: var(--surface);
}
.season-opt:hover { border-color: var(--brand); }
.season-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.season-swatch { height: 62px; display: flex; }
.season-swatch span { flex: 1; }
.season-meta { padding: 11px 14px; display: flex; align-items: center; gap: 9px; }
.season-meta input { width: auto; margin: 0; accent-color: var(--brand); }
.season-meta .nm { font-weight: 700; font-size: 15px; }
.season-meta .ds { font-size: 12px; color: var(--muted); display: block; }
.season-now {
    display: inline-block;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand);
    border-radius: 20px;
    padding: 2px 11px;
    font-size: 12.5px;
    font-weight: 700;
}

/* ============================================================
   可複製的網址欄（RSS 設定頁）
   ============================================================ */
.copybox {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 5px;
}
.copybox input {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    background: var(--surface-2);
}
.copybox .btn { white-space: nowrap; }
code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.9em;
}
pre.codeblock {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 14px;
    color: var(--text-2);
}
.field-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.field-table th { text-align: left; padding: 8px 10px; background: var(--surface-2); border-bottom: 2px solid var(--line-strong); font-size: 12.5px; color: var(--text-2); }
.field-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.field-table td:first-child { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; color: var(--brand-dark); font-weight: 700; }

/* ============================================================
   基礎
   ============================================================ */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC",
                 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; line-height: 1.4; font-weight: 700; }

/* ============================================================
   頂部導覽列
   ============================================================ */
.topbar {
    background: var(--brand-dark);
    color: #fff;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.topbar-brand {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-brand:hover { text-decoration: none; opacity: .9; }

.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-nav a {
    color: rgba(255,255,255,.82);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    white-space: nowrap;
}
.topbar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar-nav a.on { background: var(--brand); color: #fff; font-weight: 700; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
}
.topbar-user .who {
    background: rgba(255,255,255,.15);
    padding: 4px 11px;
    border-radius: 20px;
    font-weight: 700;
    color: #fff;
}
.topbar-user .who.admin { background: #b9770e; }
.topbar-user a { color: rgba(255,255,255,.85); }
.topbar-user a:hover { color: #fff; }

/* ============================================================
   版面容器
   ============================================================ */
.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 16px 60px;
}
.wrap.narrow { max-width: 620px; }

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-head {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-head h2 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }

/* ============================================================
   表單
   ============================================================ */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

label.lbl {
    display: block;
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 6px;
    color: var(--text);
}
.hint {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.6;
}

input[type="text"], input[type="password"], input[type="search"],
input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31,86,115,.14);
}
textarea { resize: vertical; min-height: 92px; }
input[type="file"] {
    width: 100%;
    padding: 9px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 14px;
}

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .row2 { grid-template-columns: 1fr; } }

/* ============================================================
   按鈕
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--line-strong);
    line-height: 1.5;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-ok:hover { background: #166b3a; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); color: #fff; }
.btn-danger-strong { background: var(--danger-dark); color: #fff; border: 2px solid #6e1e13; }
.btn-danger-strong:hover { background: #6e1e13; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 16px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-icon { padding: 8px 10px; font-size: 16px; }

.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* 分段按鈕（排序、檢視切換） */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg a {
    padding: 7px 14px;
    font-size: 13.5px;
    color: var(--text-2);
    background: #fff;
    border-right: 1px solid var(--line-strong);
}
.seg a:last-child { border-right: none; }
.seg a:hover { background: var(--surface-2); text-decoration: none; }
.seg a.on { background: var(--brand); color: #fff; font-weight: 700; }

/* ============================================================
   提示訊息
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14.5px;
    border: 1px solid transparent;
    line-height: 1.7;
}
.alert-ok   { background: var(--ok-soft);     color: #14612f; border-color: #a9dfbf; }
.alert-err  { background: var(--danger-soft); color: #922b21; border-color: #f1b0a8; }
.alert-warn { background: var(--warn-soft);   color: #8a5a06; border-color: #f0d199; }
.alert-info { background: var(--info-soft);   color: #1a5276; border-color: #a9cce3; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert strong { font-weight: 700; }

/* ============================================================
   徽章與狀態
   ============================================================ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-報修 { background: var(--danger-soft); color: var(--st-new);  border-color: #f1b0a8; }
.badge-待修 { background: var(--warn-soft);   color: var(--st-wait); border-color: #f0d199; }
.badge-完修 { background: var(--ok-soft);     color: var(--st-done); border-color: #a9dfbf; }
.badge-gray { background: var(--surface-2); color: var(--muted); border-color: var(--line-strong); }
.badge-count {
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11.5px;
    font-weight: 700;
    margin-left: 5px;
}

/* ============================================================
   表格
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.tbl th {
    background: var(--surface-2);
    color: var(--text-2);
    text-align: left;
    padding: 11px 13px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    border-bottom: 2px solid var(--line-strong);
    white-space: nowrap;
}
table.tbl td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--brand-soft); }
table.tbl tr.picked { background: var(--brand-soft); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   報修單卡片（看板卡片模式 / 回收桶）
   ============================================================ */
.ticket {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}
.ticket.s-報修 { border-left-color: var(--st-new); }
.ticket.s-待修 { border-left-color: var(--st-wait); }
.ticket.s-完修 { border-left-color: var(--st-done); }
.ticket.s-trash { border-left-color: var(--muted); }

.ticket-head {
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 10px 16px;
    flex-wrap: wrap;
    background: var(--surface-2);
}
.ticket-body { padding: 16px 18px; }

.kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 22px;
    margin-bottom: 14px;
}
.kv div { font-size: 14px; color: var(--text-2); }
.kv b { color: var(--text); font-weight: 700; margin-right: 4px; }

.content-box {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 12px;
    line-height: 1.8;
    word-break: break-word;
}
.reply-box {
    background: var(--info-soft);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 12px;
    line-height: 1.8;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.thumbs img {
    width: 84px; height: 84px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    display: block;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
    font-size: 13px;
    color: var(--text-2);
    height: 84px;
    box-sizing: border-box;
}

/* 摺疊面板 */
details.fold {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    margin-top: 14px;
}
details.fold > summary {
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: var(--brand);
    list-style: none;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; }
details.fold[open] > summary::before { content: "▾ "; }
details.fold .fold-body { padding: 0 14px 16px; border-top: 1px dashed var(--line-strong); padding-top: 14px; }

/* ============================================================
   篩選列
   ============================================================ */
.filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.filter-col { flex: 1; min-width: 210px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13.5px;
    cursor: pointer;
    user-select: none;
}
.chip:hover { border-color: var(--brand); }
.chip input { margin: 0; width: auto; accent-color: var(--brand); }
.chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); font-weight: 700; color: var(--brand-dark); }

/* ============================================================
   分頁列
   ============================================================ */
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 22px; }
.pager a {
    padding: 7px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-2);
    font-size: 14px;
}
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager a.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }

/* ============================================================
   分頁籤（管理後台）
   ============================================================ */
.tabs {
    display: flex;
    gap: 3px;
    border-bottom: 2px solid var(--line-strong);
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    padding: 11px 18px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-2);
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin-bottom: -2px;
    white-space: nowrap;
}
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.on {
    background: var(--surface);
    color: var(--brand-dark);
    border-color: var(--line-strong);
    border-bottom: 2px solid var(--surface);
}

/* ============================================================
   對話框
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31,41,51,.55);
    z-index: 200;
    overflow-y: auto;
    padding: 24px 14px;
}
.modal.open { display: block; }
.modal-box {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 560px;
    margin: 0 auto;
}
.modal-head {
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-head h3 { font-size: 16px; }
.modal-x { cursor: pointer; font-size: 26px; line-height: 1; color: var(--muted); background: none; border: none; padding: 0 4px; }
.modal-body { padding: 20px; }

/* ============================================================
   登入頁
   ============================================================ */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand) 62%, var(--accent) 100%);
}
.login-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.login-head { padding: 28px 28px 20px; text-align: center; border-bottom: 1px solid var(--line); }
.login-head .logo { font-size: 38px; line-height: 1; margin-bottom: 10px; }
.login-head h1 { font-size: 19px; margin-bottom: 4px; }
.login-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.login-body { padding: 24px 28px 28px; }
.login-note {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--line-strong);
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.8;
}

/* ============================================================
   工具類
   ============================================================ */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 14.5px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.upd-none { color: var(--muted); }
.upd-time { color: var(--warn); font-weight: 700; }
.upd-count { color: var(--muted); font-size: 12.5px; margin-left: 3px; font-weight: 400; }

.danger-zone {
    border: 2px solid #f1b0a8;
    background: var(--danger-soft);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.danger-zone h3 { color: var(--danger-dark); font-size: 14.5px; margin-bottom: 8px; }
.danger-zone p { margin: 0 0 12px; font-size: 13.5px; color: #922b21; line-height: 1.75; }

.bulkbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: var(--brand-soft);
    border-bottom: 1px solid var(--line);
}
.bulkbar .cnt { font-weight: 700; color: var(--brand-dark); font-size: 14px; }

/* ============================================================
   手機版調整
   ============================================================ */
@media (max-width: 720px) {
    body { font-size: 14.5px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar-brand { font-size: 14.5px; }
    .topbar-brand .full { display: none; }
    .topbar-nav a { padding: 6px 10px; font-size: 13.5px; }
    .topbar-user { font-size: 12px; gap: 7px; }
    .wrap { padding: 16px 12px 48px; }
    .card-body { padding: 14px; }
    .btn-row .btn { flex: 1 1 auto; }
}

/* ============================================================
   列印
   ============================================================ */
@media print {
    .no-print, .topbar { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .wrap { max-width: 100%; padding: 0; }
    .card, .ticket { box-shadow: none; border: 1px solid #888; page-break-inside: avoid; }
    table.tbl th { background: #e4e4e4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .print-title { display: block !important; text-align: center; font-size: 17pt; margin-bottom: 16px; }
    a { color: #000; text-decoration: none; }
}
.print-title { display: none; }

/* ============================================================
   系統環境分頁（v3.2 新增）
   ------------------------------------------------------------
   php_ini_scanned_files() 在多數主機上會列出數十個設定檔，
   因此以 <details> 收合，避免把整頁撐得過長。
   ============================================================ */
.env-details {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    padding: 0;
    margin: 0 0 14px;
}
.env-details > summary {
    cursor: pointer;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark);
    user-select: none;
}
.env-details > summary:hover { background: var(--brand-soft); }
.env-details[open] > summary { border-bottom: 1px solid var(--line); }
.env-details > *:not(summary) { padding-left: 13px; padding-right: 13px; }
.env-scan-list {
    max-height: 220px;
    overflow-y: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12px;
    line-height: 1.9;
    color: var(--text-2);
    word-break: break-all;
}
.env-details > p { padding-bottom: 11px; }

/* 環境對照表中，被卡住的那一列以警示色標示 */
.field-table tr.env-hit td { background: #fff6e0; }
.field-table tr.env-eff td { background: var(--brand-soft); }
