﻿/* ===== ProcPrep 全站樣式 ===== */

body {
    background: #ffffff;
    font-family: "Microsoft JhengHei", "微軟正黑體", -apple-system, "Segoe UI", sans-serif;
    color: #333;
}

/* 頁首 */
.site-header {
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.site-title {
    color: #1a2a4a;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 2rem;
}

.site-subtitle {
    font-size: 0.95rem;
    letter-spacing: 2px;
}

/* 類別大按鈕（首頁） */
.cat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 96px;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    background: #5cb85c;
    border: 1px solid #4cae4c;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: background-color .15s, transform .05s;
}

.cat-btn:hover {
    background: #449d44;
    border-color: #398439;
    color: #ffffff;
    text-decoration: none;
}

.cat-btn:active {
    transform: translateY(1px);
}

/* ===== 答題頁 / 結果頁共用 ===== */

.quiz-title {
    color: #1a2a4a;
    font-weight: 700;
}

.quiz-card {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.quiz-q-num {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.quiz-q-content {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #212529;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.quiz-opt {
    display: block;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    background: #fafbfc;
    transition: background-color .12s, border-color .12s;
    line-height: 1.55;
}

.quiz-opt:hover {
    background: #eef5ee;
    border-color: #cfe6cf;
}

.quiz-opt.is-revealed {
    background: #fff3cd;
    border-color: #ffe69c;
    color: #664d03;
    font-weight: 600;
}

.quiz-opt.is-revealed:hover {
    background: #ffeeba;
    border-color: #ffdf7a;
}

.quiz-opt input[type="radio"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}

.quiz-opt-letter {
    font-weight: 600;
    color: #495057;
    margin-right: 0.25rem;
}

/* ===== 結果頁 ===== */

.result-header {
    background: #e9ecef;
    padding: 1.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 1.75rem;
}

.result-cat {
    font-size: 1rem;
    letter-spacing: 1px;
}

.result-score {
    font-size: 3rem;
    font-weight: 700;
    color: #1a2a4a;
    line-height: 1.1;
}

.result-pct {
    font-size: 1rem;
    margin-top: 0.5rem;
}

.result-card.is-correct {
    border-left: 4px solid #5cb85c;
}

.result-card.is-wrong {
    border-left: 4px solid #d9534f;
}

.result-options .result-opt {
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.35rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    background: #fafbfc;
    line-height: 1.55;
}

.result-opt.opt-correct {
    background: #d4edda;
    border-color: #b1dfbb;
    color: #155724;
}

.result-opt.opt-correct::before {
    content: "✓ ";
    color: #155724;
    font-weight: 700;
    margin-right: 0.25rem;
}

.result-opt.opt-wrong-selected {
    background: #f8d7da;
    border-color: #f1b0b7;
    color: #721c24;
}

.result-opt.opt-wrong-selected::before {
    content: "✗ ";
    color: #721c24;
    font-weight: 700;
    margin-right: 0.25rem;
}

.result-explanation {
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    padding: 0.75rem 1rem;
    margin-top: 0.85rem;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
}

/* ===== 錯題本 ===== */

.wrongbook-card {
    border-left: 4px solid #d9534f;
}

/* ===== 歷次測驗 ===== */

.history-table thead th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.history-table tbody tr:hover {
    background: #fafbfc;
}

.history-score {
    display: inline-block;
    min-width: 3.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #e9ecef;
    font-weight: 600;
    color: #1a2a4a;
}

/* ===== 手機優化（< 576px）===== */

@media (max-width: 575.98px) {
    /* 頁首縮一點，給內容更多空間 */
    .site-title {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }
    .site-subtitle {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }

    /* 首頁類別按鈕：高度減半，字稍小 */
    .cat-btn {
        min-height: 70px;
        padding: 0.75rem 0.85rem;
        font-size: 0.95rem;
    }

    /* 答題卡片內距縮一點 */
    .quiz-card {
        padding: 1rem 1rem;
    }

    /* 結果頁分數區塊縮小 */
    .result-header {
        padding: 1.25rem 0.75rem;
    }
    .result-score {
        font-size: 2.25rem;
    }

    /* 歷次測驗：表格轉成卡片式 */
    .history-table thead {
        display: none;
    }
    .history-table,
    .history-table tbody,
    .history-table tr,
    .history-table td {
        display: block;
        width: 100%;
    }
    .history-table tbody tr {
        border: 1px solid #dee2e6;
        border-radius: 6px;
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.85rem;
        background: #ffffff;
    }
    .history-table tbody tr:hover {
        background: #fafbfc;
    }
    .history-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.4rem 0;
        border: none;
    }
    .history-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        text-align: left;
        margin-right: 0.5rem;
        flex-shrink: 0;
    }
    .history-table tbody td.action-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        margin-top: 0.5rem;
    }
    .history-table tbody td.action-cell::before {
        margin-bottom: 0.25rem;
    }
    .history-table tbody td.action-cell .btn {
        margin: 0 !important;
        width: 100%;
    }
}
