body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    background: #f5f6f8;
    margin: 0;
    color: #222;
}
.header {
    background: #15213f;
    color: #fff;
    padding: 18px 28px;
}
.header h1 {
    margin: 0;
    font-size: 22px;
}
.container {
    max-width: 1080px;
    margin: 30px auto;
    padding: 0 20px;
}
.card {
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.login-card {
    max-width: 420px;
    margin: 70px auto;
}
label {
    display: block;
    font-weight: 600;
    margin: 14px 0 6px;
}
input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
}
textarea { resize: vertical; }
button, .button {
    display: inline-block;
    background: #1f5fbf;
    color: #fff;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    margin-top: 16px;
    margin-right: 8px;
}
.button.secondary { background: #5f6b7a; }
.button-pdf { background: #0f766e; }
.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 15px;
}
.alert.error {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #a40000;
}
.alert.success {
    background: #eefaf0;
    border: 1px solid #bee8c3;
    color: #166b24;
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 18px;
}
.metric {
    border: 1px solid #e2e5ea;
    border-radius: 8px;
    padding: 16px;
    background: #fafbfc;
}
.metric .num {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 10px;
}
th, td {
    border-bottom: 1px solid #e5e8ef;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}
.nav { margin-top: 8px; }
.nav a {
    color: #fff;
    margin-right: 16px;
    text-decoration: none;
}
.small {
    color: #687385;
    font-size: 13px;
}

/* Report */
.report-body {
    background: #eef1f5;
    font-size: 14px;
}
.report-toolbar {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 20px;
}
.pdf-hint {
    display: none;
    position: fixed;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 560px;
    background: #fff8e1;
    border: 1px solid #f0c36d;
    color: #5f4300;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    z-index: 9999;
    line-height: 1.7;
}
.pdf-hint strong { color: #2b2200; }
.report-page.a4 {
    width: 794px;
    min-height: 1123px;
    margin: 20px auto 60px;
    background: #fff;
    padding: 42px 48px;
    border: 1px solid #dfe4eb;
    box-shadow: 0 6px 24px rgba(0,0,0,.08);
    box-sizing: border-box;
}
.report-cover {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 4px solid #15213f;
    padding-bottom: 18px;
    margin-bottom: 26px;
}
.brand-mark {
    font-size: 15px;
    font-weight: 700;
    color: #15213f;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.report-cover h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.25;
}
.subtitle {
    margin: 8px 0 0;
    color: #606b7b;
}
.report-meta {
    min-width: 220px;
    background: #f6f8fb;
    border: 1px solid #e2e7ef;
    border-radius: 8px;
    padding: 14px;
    line-height: 1.9;
    font-size: 13px;
}
.report-section {
    margin-bottom: 24px;
    page-break-inside: avoid;
}
.report-section h2 {
    font-size: 19px;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 5px solid #1f5fbf;
}
.section-desc {
    color: #606b7b;
    margin: 0 0 8px;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.report-table th {
    background: #f2f5f9;
    font-weight: 700;
    color: #202938;
}
.report-table th, .report-table td {
    border: 1px solid #dfe5ee;
    padding: 8px 9px;
}
.report-table.compact th, .report-table.compact td {
    padding: 6px 8px;
}
.report-table.two-col th {
    width: 18%;
}
.score-box {
    border: 1px solid #dfe5ee;
    background: #f8fafc;
    border-radius: 10px;
    padding: 18px;
}
.score-layout {
    display: flex;
    align-items: center;
    gap: 28px;
}
.score-label {
    color: #606b7b;
    font-weight: 700;
}
.score-number {
    font-size: 44px;
    font-weight: 800;
    color: #15213f;
    line-height: 1;
}
.score-note {
    line-height: 1.8;
}
.highlight-section {
    background: #fbfcff;
    border: 1px solid #dfe7f5;
    border-radius: 10px;
    padding: 18px;
}
.muted-section {
    opacity: .88;
}
.consultant-section {
    background: #fffdf6;
    border: 1px solid #f0e4b8;
    border-radius: 10px;
    padding: 18px;
}
.notice-section {
    background: #f8f9fb;
    border-radius: 10px;
    padding: 18px;
}
.notice-section ol {
    margin-top: 8px;
    padding-left: 20px;
    line-height: 1.8;
}
.report-footer {
    border-top: 1px solid #dfe5ee;
    margin-top: 24px;
    padding-top: 12px;
    color: #667085;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
@media print {
    @page {
        size: A4;
        margin: 12mm;
    }
    body {
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .no-print, .report-toolbar, .report-toolbar *, .pdf-hint, button, .button {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }
    .header {
        display: none !important;
    }
    .report-page.a4 {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
    .report-section {
        page-break-inside: avoid;
    }
    table {
        page-break-inside: auto;
    }
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    .report-footer {
        page-break-inside: avoid;
    }
}
