﻿:root {
    --bg: #f5f5f7;
    --bg-alt: #ffffff;
    --panel: #ffffff;
    --panel-soft: #f9fafb;
    --accent: #2563eb; /* 主藍色 */
    --accent-soft: #e0edff;
    --accent-strong: #1d4ed8;
    --danger: #dc2626;
    --warn: #ea580c;
    --ok: #16a34a;
    --border: #d4d4d8;
    --border-soft: #e4e4e7;
    --text-main: #111827;
    --text-sub: #4b5563;
    --text-muted: #9ca3af;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-pill: 999px;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-subtle: 0 6px 16px rgba(15, 23, 42, 0.05);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #e5e7eb;
}

.topbar-inner {
    width: 100%; /* 確保佔滿 */
    max-width: none; /* 移除 1200px 限制 */
    margin: 0; /* 移除 auto margin */
    padding: 10px 32px; /* 左右間距加大到 32px，視覺較舒適 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #2563eb10;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .brand-mark span {
        font-size: 17px;
        color: #1d4ed8;
        font-weight: 700;
    }

/* =========================================
   修正：品牌標題與連結
   ========================================= */

/* 外層容器 (負責字體大小位置) */
.brand-text-main {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    /* 這裡不用設 color 或 text-decoration，因為會被裡面的 a 覆蓋 */
}

    /* 內層超連結 (負責顏色與底線) */
    .brand-text-main a {
        /* 1. 強制移除底線 */
        text-decoration: none !important;
        border-bottom: none !important;
        /* 2. 強制設定顏色 (深黑) */
        color: #111827 !important;
        cursor: pointer;
        transition: color 0.2s ease;
    }

        /* 滑鼠移過去變色 (Hover) */
        .brand-text-main a:hover {
            color: #2563eb !important; /* TBI 藍 */
            text-decoration: none !important;
        }

        /* 點擊後/Focus 狀態 (防止變紫或出現框線) */
        .brand-text-main a:visited,
        .brand-text-main a:active,
        .brand-text-main a:focus {
            color: #111827 !important;
            text-decoration: none !important;
            outline: none;
        }

.brand-text-sub {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-pill {
    border-radius: var(--radius-pill);
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-sub);
}

    .top-pill span.dot {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #22c55e;
    }

.top-btn {
    border-radius: var(--radius-pill);
    border: 1px solid #d4d4d8;
    background: white;
    font-size: 11px;
    padding: 6px 12px;
    color: var(--text-sub);
    cursor: pointer;
}

    .top-btn:hover {
        border-color: var(--accent);
        color: var(--accent-strong);
    }

main {
    flex: 1;
}

.hero {
    width: 100%; /* 確保佔滿 */
    max-width: none; /* 移除 1200px 限制 */
    margin: 22px 0 0; /* 移除左右 auto */
    padding: 0 32px 16px; /* 左右間距加大到 32px */
    display: grid;
    /* 調整比例，左邊稍微寬一點，讓滿版時輸入區更有空間 */
    grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.5fr);
    gap: 22px;
    align-items: flex-start;
}

.hero-copy-eyebrow {
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-strong);
    margin-bottom: 6px;
}

.hero-title {
    font-size: clamp(28px, 3.1vw, 36px);
    line-height: 1.2;
    margin: 4px 0 10px;
}

    .hero-title span {
        color: var(--accent-strong);
    }

.hero-subtitle {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.7;
    max-width: 520px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.chip {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: var(--text-muted);
}

.chip--accent {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.hero-stat-card {
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 14px 16px;
    box-shadow: var(--shadow-subtle);
}

.hero-stat-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.hero-stat-main {
    font-size: 26px;
    font-weight: 600;
}

    .hero-stat-main span {
        font-size: 12px;
        color: var(--text-sub);
        font-weight: 400;
        margin-left: 6px;
    }

.hero-stat-bar {
    margin-top: 10px;
    height: 7px;
    border-radius: 999px;
    background: #f3f4f6;
}

.hero-stat-bar-inner {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to right, #22c55e, #fbbf24, #f97316);
    width: 70%;
}

.hero-stat-footer {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.main-panel {
    width: 100%; /* 確保佔滿 */
    max-width: none; /* 移除 1200px 限制 */
    margin: 0 0 24px; /* 移除左右 auto */
    padding: 0 32px 24px; /* 左右間距加大到 32px */
}

.panel-grid {
    display: grid;
    /* 這裡使用百分比或 fr 讓左右欄位在大螢幕自動拉伸 */
    grid-template-columns: minmax(0, 60%) minmax(0, 40%);
    gap: 24px; /* 間距稍微加大一點 */
    align-items: flex-start;
}

.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    padding: 16px 18px 14px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.card--results {
    position: relative; /* 只需要這個，當定位基準就好 */
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title-dot {
    width: 8px;
    height: 8px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--accent);
}

.card-subtitle {
    display: block;
    width: calc(100% + 36px); /* + card padding * 2 */
    margin: 0 -18px 16px; /* 向外擴滿卡片寬 */
    padding: 10px 14px;
    background: #fee2e2;
    border: 1px solid #ef4444;
    /* border-radius: 10px;*/
    font-size: 15px;
    font-weight: 600;
    color: #b91c1c;
    text-align: center;
}

    .card-subtitle::before {
        content: "⚠️";
        margin-right: 6px;
    }


.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin-top: 6px;
}

.form-row-full {
    grid-column: 1 / -1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.field-label {
    font-size: 11px;
    color: var(--text-sub);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

    .field-label span.unit {
        font-size: 11px;
        color: var(--text-muted);
    }

.input-shell {
    position: relative;
}

.input-text,
select {
    width: 100%;
    padding: 7px 9px;
    border-radius: var(--radius-md);
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

    .input-text:focus,
    select:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 1px #bfdbfe;
    }

    .input-text::placeholder {
        color: #9ca3af;
    }

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.inline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 10px;
    color: var(--text-muted);
}

.form-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.btn {
    border-radius: var(--radius-pill);
    font-size: 12px;
    padding: 7px 14px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    font-weight: 500;
}

    .btn-primary:hover {
        background: var(--accent-strong);
    }

.btn-ghost {
    background: white;
    border-color: #d4d4d8;
    color: var(--text-sub);
}

    .btn-ghost:hover {
        border-color: var(--accent);
        color: var(--accent-strong);
    }

.results-top {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
    gap: 10px;
}

.result-main {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.result-main-title {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.result-main-value {
    font-size: 22px;
    font-weight: 600;
}

.result-main-unit {
    font-size: 11px;
    color: var(--text-sub);
    margin-left: 4px;
}

.result-main-note {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 2px;
}

.result-chip-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.result-chip {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: white;
    border: 1px solid #d4d4d8;
}

.result-chip--ok {
    border-color: #bbf7d0;
    color: var(--ok);
    background: #f0fdf4;
}

.result-chip--warn {
    border-color: #fed7aa;
    color: var(--warn);
    background: #fff7ed;
}

.result-aside {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 11px;
    color: var(--text-sub);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: var(--radius-pill);
    border: 1px solid #e5e7eb;
    padding: 2px 8px;
    font-size: 10px;
    margin-bottom: 4px;
    background: white;
}

    .badge-pill span.dot {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: var(--ok);
    }

.result-mini-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 11px;
}

.result-mini-item {
    padding: 4px 6px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.result-mini-label {
    color: var(--text-muted);
}

/* =========================================
   修改後：小結果數值 (強調顯示)
   ========================================= */
.result-mini-value {
    /* 1. 顯著放大字體 (原本可能只有 12px) */
    font-size: 20px !important;
    /* 2. 加粗字重 */
    font-weight: 700 !important;
    /* 3. 使用主色調 (TBI 深藍)，讓數據跳出來 */
    color: var(--accent-strong) !important;
    /* 4. 使用等寬字體 (Monospace)，營造「精密儀表」的數字感 */
    font-family: "Consolas", "Monaco", "Courier New", monospace !important;
    /* 5. 微調間距 */
    margin-top: 4px;
    line-height: 1.2;
    letter-spacing: 0.02em;
}

/* 搭配調整：讓上方的標籤文字稍微淡一點，形成對比，凸顯下方的數字 */
.result-mini-label {
    font-size: 11px !important;
    color: #6b7280 !important; /* 灰色 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.life-bar {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.life-bar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.life-bar-track {
    height: 9px;
    border-radius: 999px;
    background: #f3f4f6;
}

.life-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(to right, #22c55e 0%, #fbbf24 60%, #f97316 100%);
    width: 65%;
    position: relative;
}

.life-bar-pointer {
    position: absolute;
    right: 12%;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 12px;
    background: #111827;
}

    .life-bar-pointer::after {
        content: "目前設計";
        position: absolute;
        top: -18px;
        left: -16px;
        font-size: 9px;
        color: var(--text-muted);
        white-space: nowrap;
    }

.checks {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.check-card {
    border-radius: 10px;
    background: var(--panel-soft);
    border: 1px solid var(--border-soft);
    padding: 8px 10px;
    font-size: 11px;
}

.check-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.check-title {
    font-weight: 500;
}

.tag-ok {
    color: var(--ok);
}

.tag-warn {
    color: var(--warn);
}

.tag-bad {
    color: var(--danger);
}

.check-body {
    color: var(--text-sub);
    font-size: 11px;
    line-height: 1.6;
}

.advanced-toggle {
    margin-top: 10px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px dashed #e4e4e7;
    padding: 7px 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-sub);
}

    .advanced-toggle span.label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .advanced-toggle span.bullet {
        width: 7px;
        height: 7px;
        border-radius: 999px;
        background: #dbeafe;
        border: 1px solid #bfdbfe;
    }

    .advanced-toggle .chevron {
        font-size: 12px;
        color: var(--text-muted);
    }

.advanced-body {
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 10px;
    display: none;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
}

.footer {
    width: 100%; /* 確保佔滿 */
    max-width: none; /* 移除 1200px 限制 */
    margin: 0; /* 移除 auto */
    padding: 10px 32px 18px; /* 左右間距加大到 32px */
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px dashed #e5e7eb;
}


.form-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    margin: 12px 0 6px;
}

    .form-section::before,
    .form-section::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #e5e7eb;
    }

    .form-section span {
        margin: 0 8px;
        font-size: 12px;
        color: var(--text-muted);
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

.form-divider {
    grid-column: 1 / -1;
    height: 0.5px;
    background: #6b7280; /* Tailwind 深灰 Gray-500 */
    margin: 14px 0;
    border-radius: 3px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 區塊外框 */
.result-section {
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

/* 區塊標題 */
.result-section-header {
    font-size: 20px;
    font-weight: 700;
    border-left: 4px solid #2563eb;
    padding-left: 10px;
    margin-bottom: 12px;
    color: #1f2937;
}

/* 內部 mini grid 同原本設計對齊 */
.result-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
    margin-top: 10px;
}

.tag-ok,
.tag-bad,
.tag-warn {
    display: inline-flex;
    padding: 4px 18px;
    border-radius: 999px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    min-width: 90px;
    text-align: center;
}

.tag-ok {
    background: #e6f7e9;
    color: #15803d;
    border-color: #22c55e;
}

.tag-bad {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #f97373;
}

.tag-warn {
    background: #fff7ed;
    color: #c05621;
    border-color: #f6ad55;
}
/* 可輸入：黃底 */
.input-editable {
    background: #fff9c4 !important; /* 淡黃 */
    border-color: #f1d96b !important;
}

/* 不可輸入：紅底 */
/* =========================================
   修改後：唯讀欄位 (底線風格)
   ========================================= */
.input-readonly {
    /* 1. 移除背景與四邊框 */
    background: transparent !important;
    border: none !important;
    /* 2. 只保留底線 */
    border-bottom: 1px solid #9ca3af !important; /* 灰色底線 */
    /* 3. 移除圓角與陰影 */
    border-radius: 0 !important;
    box-shadow: none !important;
    /* 4. 文字樣式調整 */
    color: #111827 !important; /* 深黑色文字，方便閱讀 */
    font-weight: 800; /* 稍微加粗，強調這是計算結果 */
    cursor: default !important; /* 游標改回預設箭頭 */
    /* 5. 稍微調整內距，讓文字貼近底線 */
    padding-left: 2px !important;
    padding-right: 2px !important;
}

    /* 唯讀欄位被點擊時，不要出現藍色外框，改為加深底線 */
    .input-readonly:focus {
        outline: none !important;
        box-shadow: none !important;
        border-bottom: 2px solid #4b5563 !important; /* 深灰色加粗底線 */
        background: transparent !important;
    }

/* 保持 focus 邊框正常（避免紅黃太亮） */
input:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    background: #fff !important; /* 讓輸入時保持白色更清楚 */
}


@media (max-width: 960px) {
    .hero {
        grid-template-columns: minmax(0,1fr);
        row-gap: 16px;
    }

    .panel-grid {
        grid-template-columns: minmax(0,1fr);
    }

    .results-top {
        grid-template-columns: minmax(0,1fr);
    }
}

@media (max-width: 720px) {
    .form-grid {
        grid-template-columns: minmax(0,1fr);
    }

    .advanced-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .hero-title {
        font-size: 24px;
    }

    .checks {
        grid-template-columns: minmax(0,1fr);
    }

    .topbar-inner {
        padding-inline: 12px;
    }

    .hero, .main-panel, .footer {
        padding-inline: 12px;
    }

    .missing-fields-box {
        /* 移除原本的 right/bottom/width 設定 */
        /* right: 1rem; */
        /* bottom: 1rem; */
        /* width: 220px; */ /* 這是導致跑版的主因 */
        /* max-height: 180px; */ /* 如果欄位很多，這會導致文字被切掉 */
        /* 改用以下設定 */
        width: 100%; /* 讓它填滿卡片寬度 */
        max-height: none; /* 取消高度限制，讓內容自動撐開 */
        margin-top: 16px; /* 保持上方間距 */
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .advanced-grid {
        grid-template-columns: minmax(0,1fr);
    }
}
/* 你原本大概長這樣 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

/* 三欄版：每欄吃 1/3 寬度，而不是 auto */
.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 小版面時自動掉回 2 欄或 1 欄（可選） */
@media (max-width: 1200px) {
    .form-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .form-grid--three {
        grid-template-columns: minmax(0, 1fr);
    }
}

.check-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
}

.check-label {
    font-size: 14px;
    color: #444;
}

.check-value {
    font-size: 13px;
    color: #555;
}

/* 小標籤本體 */
.check-tag {
    min-width: 56px;
    text-align: center;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    color: #6b7280;
    background-color: #f9fafb;
}

/* 合格：淡綠 */
.check-tag--ok {
    border-color: #22c55e55;
    background-color: #dcfce7;
    color: #15803d;
}

/* 不合格：淡紅 */
.check-tag--bad {
    border-color: #ef444455;
    background-color: #fee2e2;
    color: #b91c1c;
}
/* 手機全部一欄：720px 以下 */
@media (max-width: 720px) {

    /* 所有一般 form-grid → 1 欄 */
    .form-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    /* 三等份 grid → 也變 1 欄 */
    .form-grid--three {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }

    /* 各種內嵌 grid 也強制 1 欄 */
    .advanced-grid,
    .result-mini-grid,
    .checks {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}
/* 右下角漂浮的「重新填寫」按鈕容器 */
.floating-reset {
    position: fixed;
    right: 32px;
    bottom: 32px;
    z-index: 1500;
}

.floating-reset__btn {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px; /* 更大按鈕 */
    height: 64px; /* 更高, 更好點 */
    min-width: 140px; /* 文字長也不擠 */

    border-radius: 999px;
    background: var(--accent-strong); /* 主深藍 */
    border: none;
    color: white;
    font-size: 18px; /* 字體變大 */
    font-weight: 400; /* 不加粗 */
    letter-spacing: 0.4px;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(29, 78, 216, 0.28);
    transition: transform .15s ease, box-shadow .15s ease;
}

    /* Hover */
    .floating-reset__btn:hover {
        background: var(--accent);
        transform: translateY(-3px);
        box-shadow: 0 18px 36px rgba(29, 78, 216, 0.33);
        color: antiquewhite;
    }

    /* Active click */
    .floating-reset__btn:active {
        transform: translateY(1px);
    }

    /* icon */
    .floating-reset__btn::before {
        content: "↺";
        font-size: 21px;
    }




/* 手機時往內縮一點，避免貼太邊 */
@media (max-width: 720px) {
    .floating-reset {
        right: 16px;
        bottom: 16px;
    }

    .floating-reset__btn {
        width: 56px;
        height: 56px;
        font-size: 11px;
    }
}
/* 右下角「未填寫 / 為 0 的欄位」小卡片 */
.missing-fields-box {
    margin-top: 22px;
    padding: 16px 18px;
    background: #e5e7eb; /* 深一階灰色 */
    border-left: 4px solid var(--warn); /* 橘色警示線 */
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.missing-fields-box-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--warn);
    margin-bottom: 6px;
}

.missing-fields-box ul {
    list-style: disc;
    padding-left: 22px;
    margin: 0;
}

.missing-fields-box li.empty {
    list-style: none;
    padding-left: 0;
    color: var(--text-muted);
}





/* 沒有欄位時的灰色提示 */
.missing-fields-box li[style],
.missing-fields-box li.empty {
    color: #9ca3af;
}

/* 新增的群組區塊樣式 */
.form-subgroup {
    grid-column: 1 / -1; /* 讓區塊橫跨整列 */
    background-color: #f8fafc; /* 極淡的灰藍色背景，與白色輸入框形成對比 */
    border: 1px solid #e2e8f0; /* 邊框 */
    border-radius: 8px; /* 圓角 */
    padding: 10px 12px;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* 群組標題 */
.form-subgroup-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b; /* 標題文字顏色 (Slate-500) */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    /* 標題前面的小裝飾點 */
    .form-subgroup-label::before {
        content: "";
        display: block;
        width: 4px;
        height: 4px;
        background-color: var(--accent); /* 使用你的主色變數 */
        border-radius: 50%;
    }






/* =========================================
   Kebab Menu (三點選單) 樣式
   ========================================= */

/* 容器定位 */
.kebab-menu-container {
    position: relative;
    display: inline-block;
}

/* 圖示按鈕 (無邊框，滑鼠移過去有反應) */
.icon-btn {
    background: transparent;
    border: 1px solid transparent; /* 預留邊框位置避免跳動 */
    border-radius: 999px; /* 圓形 */
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280; /* 預設灰色 */
    transition: all 0.2s ease;
}

    .icon-btn:hover,
    .icon-btn.active {
        background-color: #f3f4f6; /* 淺灰背景 */
        color: #111827; /* 深黑圖示 */
    }

/* 下拉選單本體 */
.menu-dropdown {
    display: none; /* 預設隱藏 */
    position: absolute;
    right: 0;
    top: 100%; /* 在按鈕正下方 */
    margin-top: 8px;
    width: 200px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 100; /* 確保浮在最上層 */
    overflow: hidden;
    padding: 6px 0;
}

    /* 顯示狀態 (透過 JS 切換) */
    .menu-dropdown.show {
        display: block;
        animation: menuFadeIn 0.2s ease-out;
    }

/* 選單項目 */
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}

    .menu-item:hover {
        background-color: #f9fafb;
        color: #2563eb; /* TBI 藍 */
    }

    .menu-item span {
        font-size: 14px;
    }

/* 分隔線 */
.menu-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 6px 0;
}

/* 危險選項 (如登出) */
.menu-item.text-danger {
    color: #dc2626;
}

    .menu-item.text-danger:hover {
        background-color: #fef2f2;
    }

/* 簡單的淡入動畫 */
@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* =========================================
   修改後：通用虛線分隔樣式
   ========================================= */

/* 1. 純分隔線 (.form-divider) */
.form-divider {
    grid-column: 1 / -1;
    height: 0 !important; /* 移除原本的高度 */
    background: transparent !important; /* 移除實心背景 */
    /* 設定虛線：1px 寬，顏色為淡淡的灰色 (#d4d4d8) */
    border-top: 1px dashed #d4d4d8 !important;
    margin: 16px 0 !important;
    opacity: 0.6; /* 增加透明度，讓它看起來更「淡淡的」 */
}

/* 2. 帶文字的分隔標題 (.form-section) 左右兩側 */
.form-section::before,
.form-section::after {
    content: "";
    flex: 1;
    height: 0 !important; /* 移除高度 */
    background: transparent !important; /* 移除背景 */
    /* 改為虛線 */
    border-top: 1px dashed #d4d4d8 !important;
    opacity: 0.6;
}

/* 3. 檢查項目的底線 (.check-row) */
.check-row {
    border-bottom: 1px dashed #e5e7eb !important; /* 改為虛線 */
}