body {
            font-family: "Microsoft JhengHei", Arial, sans-serif;
            margin: 0;
            background: #f5f6fa;
            color: #222;
        }
        .wrap {
            max-width: 1500px;
            margin: 0 auto;
            padding: 24px;
        }
        h1 {
            margin: 0 0 16px;
        }
        .nav {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .nav a, .nav-button, button {
            padding: 9px 12px;
            border-radius: 8px;
            border: 1px solid #2563eb;
            background: #2563eb;
            color: white;
            text-decoration: none;
            font-size: 14px;
            cursor: pointer;
        }
        .nav a.gray {
            background: #6b7280;
            border-color: #6b7280;
        }
        .nav a.red {
            background: #dc2626;
            border-color: #dc2626;
        }
        form.filter {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 18px;
        }
        select, input {
            padding: 9px 12px;
            border: 1px solid #ccc;
            border-radius: 8px;
            background: white;
            font-size: 14px;
        }
        .cards {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 14px;
            margin-bottom: 20px;
        }
        .card {
            background: white;
            border-radius: 14px;
            padding: 16px;
            box-shadow: 0 2px 10px rgba(0,0,0,.07);
        }
        .card .label {
            color: #666;
            font-size: 13px;
            margin-bottom: 8px;
        }
        .card .num {
            font-size: 30px;
            font-weight: bold;
        }
        .low {
            color: #dc2626;
            font-weight: bold;
        }
        .box {
            background: white;
            border-radius: 14px;
            padding: 16px;
            margin-bottom: 18px;
            box-shadow: 0 2px 10px rgba(0,0,0,.07);
            overflow-x: auto;
        }
        table {
            border-collapse: collapse;
            width: 100%;
            min-width: 1300px;
            font-size: 13px;
        }
        th, td {
            border-bottom: 1px solid #e5e7eb;
            padding: 9px;
            text-align: left;
            vertical-align: top;
        }
        th {
            background: #f1f5f9;
            white-space: nowrap;
        }
        tr:hover td {
            background: #f9fafb;
        }
        tr.clickable-row {
            cursor: pointer;
        }
        tr.clickable-row:hover td {
            background: #eef6ff;
        }
        tr.clickable-row:active td {
            background: #dbeafe;
        }
        .muted {
            color: #777;
            font-size: 13px;
            line-height: 1.7;
        }
        .comment {
            max-width: 360px;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .id-link {
            color: #2563eb;
            font-weight: bold;
            text-decoration: none;
        }
        .id-link:hover {
            text-decoration: underline;
        }
        .detail-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }
        .detail-item {
            background: #f8fafc;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 12px;
        }
        .detail-item .k {
            color: #64748b;
            font-size: 12px;
            margin-bottom: 6px;
        }
        .detail-item .v {
            font-size: 16px;
            font-weight: bold;
            word-break: break-word;
        }
        .score-table {
            min-width: 0;
        }
        .score-table th, .score-table td {
            text-align: center;
        }
        .score-table th:first-child, .score-table td:first-child {
            text-align: left;
        }
        .text-block {
            white-space: pre-wrap;
            word-break: break-word;
            line-height: 1.8;
            background: #f8fafc;
            border: 1px solid #e5e7eb;
            border-radius: 12px;
            padding: 12px;
        }

        .modal-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, .58);
            z-index: 9999;
            padding: 24px;
            box-sizing: border-box;
        }
        .modal-backdrop.show {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .modal-card {
            width: min(1180px, 96vw);
            max-height: 92vh;
            background: #f5f6fa;
            border-radius: 18px;
            box-shadow: 0 24px 80px rgba(0,0,0,.28);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 14px 18px;
            background: white;
            border-bottom: 1px solid #e5e7eb;
        }
        .modal-head strong {
            font-size: 18px;
        }
        .modal-close {
            border: 1px solid #cbd5e1;
            background: #f8fafc;
            color: #334155;
            border-radius: 10px;
            padding: 8px 12px;
            cursor: pointer;
        }
        .modal-body {
            padding: 18px;
            overflow: auto;
        }
        .modal-loading {
            padding: 30px;
            color: #64748b;
        }
        .modal-detail h1 {
            margin-top: 0;
        }
        .modal-detail .nav {
            display: none;
        }
        .error {
            color: #dc2626;
            font-weight: bold;
        }
        .badge {
            display: inline-block;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: bold;
            white-space: nowrap;
        }
        .badge.normal {
            background: #e5e7eb;
            color: #374151;
        }
        .badge.unjudged {
            background: #f3f4f6;
            color: #6b7280;
        }
        .badge.notice {
            background: #fef3c7;
            color: #92400e;
        }
        .badge.important {
            background: #fee2e2;
            color: #b91c1c;
        }
        .badge.urgent {
            background: #7f1d1d;
            color: white;
        }
        @media (max-width: 900px) {
            .cards {
                grid-template-columns: repeat(2, 1fr);
            }
            .wrap {
                padding: 14px;
            }
            .detail-grid {
                grid-template-columns: repeat(1, 1fr);
            }
            .modal-backdrop {
                padding: 8px;
            }
            .modal-card {
                width: 100vw;
                max-height: 96vh;
                border-radius: 14px;
            }
            .modal-body {
                padding: 12px;
            }
        }
.user-pill, .pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    border: 1px solid #c7d2fe;
}
.toast-container {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 3000;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none;
}
.toast-message {
    background: #111827;
    color: white;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .28);
    font-size: 14px;
    line-height: 1.5;
    animation: toastIn .18s ease-out;
}
.toast-message.hide {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: min(420px, 96vw);
    background: white;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 16px 60px rgba(15, 23, 42, .16);
}
.login-card form, .user-form, .process-form {
    display: grid;
    gap: 10px;
}
.login-card label, .user-form label, .process-form label {
    font-weight: bold;
    font-size: 13px;
    color: #334155;
}
textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}
.small-note {
    margin-top: 14px;
}
.small-btn {
    padding: 6px 10px;
    font-size: 12px;
}
.gray-btn {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}
.yellow-text {
    color: #b45309;
}
.note-item {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
}
.note-meta {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 8px;
}
.note-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}
.process-form {
    margin-top: 14px;
}
@media (max-width: 900px) {
    .user-pill { width: 100%; justify-content: center; }
}
.user-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.action-cell {
    white-space: nowrap;
}
.user-modal-card {
    width: min(640px, 96vw);
}
select[multiple] {
    min-height: 170px;
    padding: 8px 10px;
}
select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}
.check-row input[type="checkbox"] {
    width: auto;
}
.nav-button.gray {
    background: #6b7280;
    border-color: #6b7280;
}


.small-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.small-btn:disabled {
    opacity: .65;
    cursor: wait;
}
.judge-test-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 14px;
}


/* === 紅黃綠燈明確化 === */
.badge.traffic-green, .badge.normal { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge.traffic-yellow, .badge.important { background: #fef08a; color: #854d0e; border: 1px solid #facc15; }
.badge.traffic-red, .badge.urgent { background: #dc2626; color: #fff; border: 1px solid #991b1b; }
.badge.traffic-notice, .badge.notice { background: #fed7aa; color: #9a3412; border: 1px solid #fb923c; }
.traffic-light-display { margin: 8px 0 14px; font-size: 18px; }
.traffic-light-display .badge { font-size: 18px; padding: 8px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.clickable-row.row-level-urgent td { border-left: 4px solid #dc2626; }
.clickable-row.row-level-important td { border-left: 4px solid #facc15; }
.clickable-row.row-level-normal td { border-left: 4px solid #22c55e; }
.clickable-row.row-level-notice td { border-left: 4px solid #fb923c; }
.clickable-row.row-level-unjudged td { border-left: 4px solid #cbd5e1; }
.process-chip { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.process-chip.done { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.process-chip.empty { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.process-summary { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-weight: bold; }
.process-note-done { border-left: 4px solid #2563eb; }
.admin-actions { white-space: nowrap; }
.admin-actions .small-btn { margin-right: 6px; margin-bottom: 4px; }
.small-btn.outline { background: white; color: #2563eb; }
.mail-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.mail-status.sent { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.mail-status.queued { background: #fef3c7; color: #92400e; border: 1px solid #fbbf24; }
.mail-status.failed { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.mail-log-item { border-left: 4px solid #94a3b8; }

/* === 視覺收斂版：降低花俏感，主畫面只保留重點 === */
:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --line: #e2e8f0;
    --text: #1f2937;
    --muted: #64748b;
    --brand: #2563eb;
    --soft: #f1f5f9;
}
body {
    background: var(--bg);
    color: var(--text);
}
.wrap {
    max-width: 1360px;
    padding: 20px;
}
.nav {
    align-items: center;
    background: rgba(255,255,255,.82);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    box-shadow: none;
}
.nav a, .nav-button, button {
    border-radius: 10px;
    box-shadow: none;
}
.user-pill, .pill {
    background: #f8fafc;
    color: #334155;
    border-color: var(--line);
    margin-left: auto;
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 18px 0 14px;
}
.page-head h1 {
    font-size: 26px;
    margin-bottom: 8px;
    letter-spacing: .02em;
}
.summary-note {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}
.summary-note span {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
}
.compact-filter {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px !important;
}
.cards {
    gap: 10px;
    margin-bottom: 14px;
}
.card {
    border: 1px solid var(--line);
    box-shadow: none;
    border-radius: 14px;
    padding: 14px;
}
.card .label {
    color: var(--muted);
    margin-bottom: 6px;
}
.card .num {
    font-size: 25px;
    line-height: 1.1;
}
.box {
    border: 1px solid var(--line);
    box-shadow: none;
    border-radius: 16px;
    padding: 14px;
}
.box h2 {
    margin-top: 0;
    font-size: 18px;
}
table {
    min-width: 1060px;
    font-size: 13px;
}
th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
}
th, td {
    padding: 10px 9px;
}
tr.clickable-row:hover td {
    background: #f8fafc;
}
.clickable-row.row-level-urgent td,
.clickable-row.row-level-important td,
.clickable-row.row-level-normal td,
.clickable-row.row-level-notice td,
.clickable-row.row-level-unjudged td {
    border-left: none;
}
.clickable-row td:first-child {
    border-left: 4px solid #cbd5e1;
}
.clickable-row.row-level-urgent td:first-child { border-left-color: #dc2626; }
.clickable-row.row-level-important td:first-child { border-left-color: #eab308; }
.clickable-row.row-level-normal td:first-child { border-left-color: #16a34a; }
.clickable-row.row-level-notice td:first-child { border-left-color: #f97316; }
.badge {
    padding: 5px 9px;
    box-shadow: none !important;
}
.badge.traffic-green, .badge.normal { background: #e8f7ee; color: #166534; border: 1px solid #bbf7d0; }
.badge.traffic-yellow, .badge.important { background: #fef7c3; color: #854d0e; border: 1px solid #fde68a; }
.badge.traffic-red, .badge.urgent { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge.traffic-notice, .badge.notice { background: #ffedd5; color: #9a3412; border: 1px solid #fed7aa; }
.compact-comment {
    max-width: 300px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}
.admin-actions .small-btn {
    display: block;
    margin: 0 0 6px 0;
}
.modal-card {
    background: var(--bg);
    box-shadow: 0 18px 60px rgba(15,23,42,.22);
}
.modal-head {
    background: #fff;
}
.detail-grid {
    grid-template-columns: repeat(3, 1fr);
}
.detail-item, .text-block, .note-item {
    background: #fff;
    border-color: var(--line);
}
.score-table {
    min-width: 0;
}
.traffic-light-display .badge {
    font-size: 16px;
    padding: 7px 12px;
}
@media (max-width: 900px) {
    .page-head { display: block; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .summary-note { display: grid; }
}

/* === 舒服版 UI：資訊完整，但用層次整理，不砍欄位 === */
body {
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 32%),
        linear-gradient(180deg, #f6f8fc 0%, #eef2f7 100%);
}
.wrap {
    max-width: 1520px;
    padding: 24px;
}
.nav {
    position: sticky;
    top: 12px;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.9);
    box-shadow: 0 10px 35px rgba(15,23,42,.06);
}
.nav a, .nav-button, button {
    border: 0;
    background: #2563eb;
    box-shadow: 0 8px 20px rgba(37,99,235,.14);
}
.nav a.gray, .nav-button.gray, .gray-btn {
    background: #475569;
    border: 0;
}
.page-head {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe6f5;
    border-radius: 22px;
    padding: 20px 22px;
    box-shadow: 0 12px 34px rgba(15,23,42,.06);
}
.page-head h1 {
    font-size: 30px;
    margin-bottom: 10px;
}
.summary-note span {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.compact-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.92);
    border: 1px solid #dbe6f5;
    box-shadow: 0 8px 26px rgba(15,23,42,.05);
}
.compact-filter select,
.compact-filter input {
    min-width: 170px;
}
.cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #dbe6f5;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #2563eb;
    opacity: .55;
}
.card:nth-child(4)::before { background: #dc2626; opacity: .85; }
.card:nth-child(5)::before { background: #eab308; opacity: .9; }
.card:nth-child(6)::before { background: #16a34a; opacity: .8; }
.card .label {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
}
.card .num {
    font-size: 32px;
    margin-top: 4px;
}
.box {
    border: 1px solid #dbe6f5;
    box-shadow: 0 12px 34px rgba(15,23,42,.06);
    border-radius: 20px;
    background: rgba(255,255,255,.96);
}
.box h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    margin-bottom: 14px;
}
table {
    min-width: 1420px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
th {
    position: sticky;
    top: 74px;
    z-index: 2;
    background: #f8fafc;
    color: #334155;
    border-bottom: 1px solid #dbe6f5;
}
td {
    background: #fff;
    border-bottom: 1px solid #edf2f7;
}
tr.clickable-row:hover td {
    background: #f6faff;
}
.clickable-row td:first-child {
    border-left-width: 5px;
}
.primary-text {
    font-weight: 700;
    color: #1e293b;
    line-height: 1.45;
}
.sub-text {
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
    margin-top: 3px;
}
.branch-pill {
    display: inline-flex;
    max-width: 130px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    font-weight: 700;
    white-space: nowrap;
}
.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 34px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 800;
    font-size: 18px;
}
.score-pill.low {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}
.judge-cell {
    min-width: 210px;
}
.reason-preview {
    color: #475569;
    font-size: 12px;
    line-height: 1.55;
    margin-top: 6px;
    max-width: 260px;
}
.nice-comment {
    max-width: 330px;
    line-height: 1.6;
    color: #334155;
}
.mail-chip,
.process-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.mail-chip.empty,
.process-chip.empty {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
}
.mail-chip.sent {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.mail-chip.queued {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}
.mail-chip.failed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
}
.badge.traffic-red, .badge.urgent {
    background: #dc2626;
    color: white;
    border-color: #b91c1c;
}
.badge.traffic-yellow, .badge.important {
    background: #facc15;
    color: #713f12;
    border-color: #eab308;
}
.badge.traffic-green, .badge.normal {
    background: #22c55e;
    color: white;
    border-color: #16a34a;
}
.badge.traffic-notice, .badge.notice {
    background: #fb923c;
    color: white;
    border-color: #f97316;
}
.badge.unjudged {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.admin-actions {
    min-width: 96px;
}
.admin-actions .small-btn {
    display: inline-flex;
    margin: 0 0 6px 0;
    width: 86px;
    justify-content: center;
}
.modal-card {
    width: min(1240px, 96vw);
    border-radius: 22px;
    background: #f6f8fc;
}
.modal-head {
    padding: 16px 20px;
}
.modal-body {
    padding: 22px;
}
.detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.detail-item {
    border-radius: 14px;
    background: #ffffff;
}
.text-block {
    background: #ffffff;
}
.score-table {
    min-width: 420px;
}
@media (max-width: 1100px) {
    .cards { grid-template-columns: repeat(3, 1fr); }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
    .wrap { padding: 14px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .page-head { padding: 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    th { top: 0; }
}

/* === 問卷詳細 modal 舒適排版：拉開間距、分區清楚、不擠成一坨 === */
.modal-card {
    width: min(1320px, 96vw);
    max-height: 94vh;
}
.modal-body {
    padding: 26px;
}
.response-detail-shell {
    display: grid;
    gap: 22px;
}
.response-detail-shell h1,
.response-detail-shell h2,
.response-detail-shell h3 {
    margin: 0;
}
.detail-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: stretch;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid #dbe6f5;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 36px rgba(15, 23, 42, .07);
    position: relative;
    overflow: hidden;
}
.detail-hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 7px;
    background: #cbd5e1;
}
.detail-hero.level-urgent::before { background: #dc2626; }
.detail-hero.level-important::before { background: #facc15; }
.detail-hero.level-notice::before { background: #fb923c; }
.detail-hero.level-normal::before { background: #22c55e; }
.hero-main {
    min-width: 0;
}
.hero-main h1 {
    margin-top: 6px;
    font-size: 28px;
    color: #0f172a;
}
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}
.hero-meta span,
.score-section-note {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}
.hero-status {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.hero-score {
    min-width: 112px;
    padding: 13px 16px;
    border-radius: 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    text-align: center;
    color: #1d4ed8;
}
.hero-score.low {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}
.hero-score span {
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}
.hero-score strong {
    display: block;
    font-size: 34px;
    line-height: 1;
}
.detail-card {
    background: rgba(255,255,255,.96);
    border: 1px solid #dbe6f5;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}
.section-title h2 {
    margin-top: 4px;
    font-size: 21px;
    color: #0f172a;
}
.relaxed-grid.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.relaxed-grid .detail-item,
.judge-info-grid .detail-item {
    padding: 14px 15px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.detail-item .k {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}
.detail-item .v {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.55;
    word-break: break-word;
}
.score-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}
.detail-score-table {
    min-width: 0;
    width: 100%;
    font-size: 15px;
}
.detail-score-table th,
.detail-score-table td {
    padding: 15px 18px;
}
.detail-score-table th:last-child,
.detail-score-table td:last-child {
    width: 120px;
    text-align: center;
    font-weight: 900;
}
.detail-score-table tr.score-row-main td {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 900;
}
.detail-two-column {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 22px;
    align-items: start;
}
.judge-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.judge-info-grid .detail-item:last-child {
    grid-column: 1 / -1;
}
.sub-section {
    margin-top: 18px;
}
.sub-section h3,
.feedback-card h3 {
    color: #334155;
    font-size: 15px;
    margin-bottom: 10px;
}
.feedback-grid {
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
    gap: 18px;
}
.roomy-text {
    min-height: 72px;
    padding: 16px;
    line-height: 1.9;
    border-radius: 16px;
    background: #f8fafc;
}
.notes-list {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}
.note-item {
    padding: 15px 16px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.note-meta {
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}
.note-content {
    line-height: 1.85;
    color: #0f172a;
    white-space: pre-wrap;
}
.empty-state {
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    text-align: center;
}
.spacious-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
.spacious-form label {
    font-weight: 900;
    color: #334155;
}
.spacious-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    resize: vertical;
    line-height: 1.75;
}
.form-footer-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.judge-test-row {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
@media (max-width: 1100px) {
    .detail-hero,
    .hero-status,
    .section-title {
        align-items: flex-start;
    }
    .detail-hero {
        flex-direction: column;
    }
    .hero-status {
        width: 100%;
        justify-content: space-between;
    }
    .relaxed-grid.detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .detail-two-column,
    .feedback-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 760px) {
    .modal-body {
        padding: 16px;
    }
    .detail-card,
    .detail-hero {
        padding: 18px;
        border-radius: 18px;
    }
    .hero-main h1 {
        font-size: 23px;
    }
    .relaxed-grid.detail-grid,
    .judge-info-grid {
        grid-template-columns: 1fr;
    }
    .hero-status {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-score {
        width: auto;
    }
}


/* === 修正最近 50 筆問卷第一列被切到 ===
   表格的水平捲動改交給內層 table-scroll，外層卡片正常撐開；
   同時取消 sticky 表頭，避免表頭覆蓋第一筆資料。 */
.response-list-box {
    overflow: visible !important;
    padding: 20px !important;
}
.response-list-box h2 {
    margin: 0 0 16px 0 !important;
    line-height: 1.4;
}
.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 2px;
    border-radius: 14px;
}
.response-table {
    margin-top: 0 !important;
}
.response-table th {
    position: static !important;
    top: auto !important;
}
.response-table tbody tr:first-child td {
    border-top: 1px solid #edf2f7;
}
.response-table th,
.response-table td {
    vertical-align: top;
}


/* === 問卷詳細評分區塊：拿掉題組字樣、改成不裁切的卡片列 === */
.score-card {
    overflow: visible !important;
}
.score-card .section-title {
    margin-bottom: 16px;
}
.detail-score-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 12px;
    width: 100%;
    overflow: visible;
}
.detail-score-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    min-width: 0;
}
.detail-score-row .score-label {
    min-width: 0;
    color: #334155;
    font-weight: 800;
    line-height: 1.5;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.detail-score-row .score-value {
    min-width: 54px;
    padding: 7px 12px;
    border-radius: 999px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #dbe6f5;
    color: #0f172a;
    font-size: 17px;
    font-weight: 950;
}
.detail-score-row.score-row-main {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.detail-score-row.score-row-main .score-label,
.detail-score-row.score-row-main .score-value {
    color: #1e3a8a;
}
@media (max-width: 900px) {
    .detail-score-list {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 520px) {
    .detail-score-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .detail-score-row .score-value {
        justify-self: start;
    }
}

/* === 使用者管理：帳號清單不裁切、表格獨立橫向捲動 === */
.user-list-box {
    overflow: visible !important;
    padding: 20px !important;
}
.user-list-box h2 {
    margin: 0 0 16px 0 !important;
    line-height: 1.4;
}
.user-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 2px;
    border-radius: 14px;
}
.user-table {
    min-width: 980px;
    margin-top: 0 !important;
}
.user-table th {
    position: static !important;
    top: auto !important;
}
.user-table tbody tr:first-child td {
    border-top: 1px solid #edf2f7;
}
.user-table th,
.user-table td {
    vertical-align: middle;
}
.user-table .action-cell {
    min-width: 92px;
    text-align: center;
}
.user-table .branch-pill {
    max-width: none;
    margin: 2px 4px 2px 0;
}
.user-table td:nth-child(4) {
    min-width: 220px;
    white-space: normal;
}
.user-table td:nth-child(5) {
    min-width: 220px;
    word-break: break-word;
}
.user-table td:nth-child(7) {
    min-width: 92px;
}
.user-modal-card {
    max-height: 92vh;
}
.user-modal-card .modal-body {
    overflow: auto;
}

.break-cell { word-break: break-all; max-width: 260px; }

/* LINE 通知對象刪除按鈕 */
.small-btn.danger-btn {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.small-btn.danger-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}
