        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            font-family: 'Microsoft JhengHei', Arial, sans-serif;
            padding: 10px;
            padding-bottom: 0;
            min-height: 100vh;
            margin-bottom: 120px;
            overflow-x: hidden;
        }
        
        .main-container {
            background-color: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            margin: 10px auto;
            margin-bottom: 130px;
            max-width: 95%;
            width: 100%;
            backdrop-filter: blur(10px);
            min-height: calc(100vh - 250px);
            padding-bottom: 40px;
        }
        
        .quiz-header {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            border-radius: 20px 20px 0 0;
            padding: 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .quiz-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
            animation: float 20s ease-in-out infinite;
            pointer-events: none;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(180deg); }
        }
        
        .quiz-header h1 {
            font-size: 1.8rem;
            margin-bottom: 0.5rem;
            position: relative;
            z-index: 2;
        }
        
        .quiz-status {
            position: absolute;
            top: 10px;
            right: 20px;
            background: rgba(255, 255, 255, 0.9);
            padding: 5px 15px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: bold;
            z-index: 3;
        }
        
        .quiz-status.active {
            background: #28a745;
            color: white;
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        .database-selector {
            background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
            border-radius: 15px;
            padding: 20px;
            margin: 20px;
            color: white;
            transition: all 0.3s ease;
        }
        
        .database-selector.disabled {
            opacity: 0.5;
            pointer-events: none;
            filter: grayscale(70%);
            position: relative;
        }
        
        .database-selector.disabled::after {
            content: '🔒 測驗進行中，無法切換題庫';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 10px 20px;
            border-radius: 10px;
            font-weight: bold;
            z-index: 10;
        }
        
        .database-card {
            background: rgba(255, 255, 255, 0.2);
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 12px;
            padding: 20px;
            margin: 10px 0;
            cursor: pointer;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            
     /* 🔥 新增:加深字體顏色 */
    color: #ffffff !important;
    font-weight: 500;
}

        /* 🔥 新增:圖示加深 */
.database-card .fa-star,
.database-card .fa-robot {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

        /* 🔥 新增:確保標題與文字清晰可見 */
.database-card h5 {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

        .database-card p,
.database-card small {
    color: #f0f0f0 !important;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}
        
        .database-card:hover:not(.disabled) {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.6);
            transform: translateY(-3px);
        }
        
        .database-card.selected {
            background: rgba(255, 255, 255, 0.4);
            border-color: #fff;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }
        
        .quiz-container {
            background-color: #fff;
            border-radius: 15px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            padding: 25px;
            margin: 20px;
            margin-bottom: 40px;
        }
        
        /* 計時器樣式 - 確保在測驗中顯示 */
        .quiz-timer-display {
            position: fixed;
            top: 80px;
            right: 20px;
            background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
            color: white;
            padding: 15px 20px;
            border-radius: 25px;
            font-size: 1.2rem;
            font-weight: bold;
            z-index: 1050;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
            border: 2px solid rgba(255, 255, 255, 0.2);
            min-width: 200px;
            text-align: center;
        }
        
        .quiz-timer-display.warning {
            background: linear-gradient(135deg, #dc3545, #c82333);
            animation: blink 1s infinite;
            border-color: #dc3545;
        }
        
        .option-label {
            display: block;
            border: 2px solid #e1e8ed;
            border-radius: 12px;
            padding: 15px 20px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.4s ease;
            background: linear-gradient(145deg, #ffffff, #f8f9fa);
            position: relative;
            overflow: hidden;
        }
        
        .option-label::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
            transition: left 0.6s ease;
        }
        
        .option-label:hover {
            background: linear-gradient(145deg, #e3f2fd, #bbdefb);
            border-color: #2196f3;
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.2);
        }
        
        .option-label:hover::before {
            left: 100%;
        }
        
        .option-input:checked + .option-label {
            background: linear-gradient(145deg, #c8e6c9, #a5d6a7);
            border-color: #4caf50;
            color: #2e7d32;
            font-weight: bold;
            transform: scale(1.02);
            box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
        }
        
        .option-input:checked + .option-label::after {
            content: '✓';
            position: absolute;
            top: 50%;
            right: 20px;
            transform: translateY(-50%);
            background: #4caf50;
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.8rem;
            animation: checkmark 0.3s ease-in-out;
        }
        
        @keyframes checkmark {
            0% { transform: translateY(-50%) scale(0); }
            50% { transform: translateY(-50%) scale(1.2); }
            100% { transform: translateY(-50%) scale(1); }
        }
        
        .option-input {
            display: none;
        }
        
        .explanation-box {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-left: 5px solid #007bff;
            padding: 25px;
            margin-top: 20px;
            border-radius: 12px;
            min-height: 150px;
            max-height: 500px;
            overflow-y: auto;
            word-wrap: break-word;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .explanation-box::-webkit-scrollbar {
            width: 8px;
        }
        
        .explanation-box::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 5px;
        }
        
        .explanation-box::-webkit-scrollbar-thumb {
            background: #007bff;
            border-radius: 5px;
        }
        
        .explanation-box::-webkit-scrollbar-thumb:hover {
            background: #0056b3;
        }
        
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 250, 0.98));
            backdrop-filter: blur(20px);
            border-top: 1px solid rgba(0, 0, 0, 0.1);
            z-index: 1040;
            padding: 20px 0;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        }
        
        .btn {
            border-radius: 12px;
            font-weight: 600;
            padding: 12px 8px;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            border: none;
            font-size: 0.85rem;
            min-height: 45px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }
        
        .progress {
            height: 12px;
            margin-bottom: 20px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }
        
        .progress-bar {
            background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
            transition: width 0.5s ease;
        }
        
        .badge-custom {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white;
            font-size: 0.9rem;
            padding: 8px 15px;
            border-radius: 20px;
            margin: 5px;
        }
        
        .timer {
            font-size: 1.2rem;
            font-weight: bold;
            color: #FF5722;
            background: rgba(255, 255, 255, 0.9);
            padding: 10px 15px;
            border-radius: 25px;
        }
        
        .timer.exam-mode {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border: 2px solid #2196f3;
            color: #1976d2;
            animation: pulse-exam 2s infinite;
        }
        
        @keyframes pulse-exam {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.02); }
        }
        
        .timer.warning {
            color: #dc3545;
            animation: blink 1s infinite;
            background: rgba(255, 0, 0, 0.1);
            border: 2px solid #dc3545;
        }
        
        @keyframes blink {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }
        
        .correct {
            color: #198754;
            font-weight: bold;
            font-size: 1.1rem;
        }
        
        .incorrect {
            color: #dc3545;
            font-weight: bold;
            font-size: 1.1rem;
        }
        
        .highlight {
            background: linear-gradient(45deg, #fff3cd, #ffeaa7);
            padding: 15px;
            border-radius: 8px;
            margin: 10px 0;
            font-size: 1rem;
            line-height: 1.6;
            border-left: 4px solid #ffc107;
        }
        
        .nav-brand {
            background: linear-gradient(45deg, #667eea, #764ba2);
            color: white !important;
            font-weight: bold;
            border-radius: 10px;
            padding: 8px 16px !important;
        }
        
        .settings-panel {
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border-radius: 15px;
            padding: 25px;
            margin: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }
        
        .settings-panel.disabled {
            opacity: 0.6;
            pointer-events: none;
        }
        
        .mode-btn {
            background: linear-gradient(145deg, #ffffff, #f8f9fa);
            border: 2px solid #e1e8ed;
            border-radius: 12px;
            padding: 12px 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            margin: 5px;
            font-weight: 600;
        }
        
        .mode-btn:hover {
            border-color: #667eea;
            transform: translateY(-1px);
        }
        
        .mode-btn.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            border-color: #667eea;
            color: white;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
        }
        
        .back-to-selection {
            background: linear-gradient(135deg, #6c757d, #495057);
            color: white;
            border: none;
            border-radius: 10px;
            padding: 8px 16px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 15px;
        }
        
        .back-to-selection:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }
        
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            flex-direction: column;
        }
        
        .loader {
            border: 5px solid rgba(255, 255, 255, 0.3);
            border-top: 5px solid #fff;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .loading-text {
            color: white;
            font-size: 1.2rem;
            font-weight: bold;
        }

        /* 複習模式選擇樣式 */
        .review-modes {
            background: linear-gradient(135deg, #e8f5e8, #f0f8f0);
            border: 2px solid #28a745;
            border-radius: 12px;
            padding: 15px;
            margin: 10px 0;
        }

        .review-mode-item {
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid #28a745;
            border-radius: 8px;
            padding: 10px 15px;
            margin: 5px 0;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .review-mode-item:hover {
            background: rgba(40, 167, 69, 0.1);
            transform: translateX(5px);
        }

        .review-mode-item.selected {
            background: #28a745;
            color: white;
        }
        
        /* 考試規範資訊 */
        .exam-specs {
            background: linear-gradient(135deg, #fff3cd, #ffeaa7);
            border: 2px solid #ffc107;
            border-radius: 10px;
            padding: 15px;
            margin: 10px 0;
            font-size: 0.9rem;
            color: #333333;  /* 👈 新增:深灰色文字 */
            font-weight: 500; /* 👈 新增:讓文字稍微粗一點 */
        }
        }
        
        .exam-specs.ipas {
            background: linear-gradient(135deg, #e3f2fd, #bbdefb);
            border-color: #2196f3;
            color: #1565c0; /* 👈 新增:深藍色文字(配合藍色背景) */
        }
        
        .exam-specs.iii {
            background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
            border-color: #4caf50;
            color: #2e7d32;  /* 👈 新增:深綠色文字(配合綠色背景) */
        }
        /* 新增：標記與修改答案按鈕 */
        .mark-review-btn {
            background-color: #f8f9fa;
            border: 1px solid #dee2e6;
            color: #495057;
        }
        .mark-review-btn.active {
            background-color: #ffc107;
            border-color: #f5b400;
            color: #fff;
            font-weight: bold;
        }
        .modify-answer-btn {
            background-color: #ffc107;
            color: #333;
        }
        
        /* 新增：題號總覽模態框樣式 */
        #overview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
            gap: 10px;
        }
        .overview-q-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            border: 2px solid #dee2e6;
            background-color: #f8f9fa;
            color: #495057;
            font-weight: bold;
            position: relative;
            transition: all 0.2s ease;
        }
        .overview-q-btn.answered {
            background-color: #d1e7dd;
            border-color: #a3cfbb;
            color: #0f5132;
        }
        .overview-q-btn.current {
            border-color: #0d6efd;
            box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
            transform: scale(1.1);
        }
        .overview-q-btn.marked .fa-flag {
            display: block;
        }
        .overview-q-btn .fa-flag {
            position: absolute;
            top: 4px;
            right: 4px;
            color: #ffc107;
            font-size: 0.7em;
            display: none;
        }
        
        
        @media (max-width: 768px) {
            body {
                margin-bottom: 130px;
            }
            
            .main-container {
                margin: 5px auto;
                margin-bottom: 140px;
                border-radius: 15px;
                max-width: 98%;
                padding-bottom: 50px;
            }
            
            .quiz-header {
                padding: 15px;
                border-radius: 15px 15px 0 0;
            }
            
            .database-selector, .quiz-container, .settings-panel {
                margin: 10px;
                padding: 15px;
                margin-bottom: 20px;
            }
            
            .database-card {
                padding: 15px;
                margin: 8px 0;
            }
            
            .quiz-timer-display {
                position: fixed;
                top: 70px;
                right: 10px;
                font-size: 1rem;
                padding: 10px 15px;
                min-width: 160px;
            }
/* 🔥 付費升級功能 CSS START */
.btn-gradient-premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
    transition: all 0.3s;
}

.btn-gradient-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.6);
    color: white;
}

.bg-gradient-premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.badge.paid-member {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.ribbon {
    position: absolute;
    right: -5px;
    top: -5px;
    z-index: 1;
    overflow: hidden;
    width: 75px;
    height: 75px;
    text-align: right;
}

.ribbon span {
    font-size: 10px;
    font-weight: bold;
    color: #FFF;
    text-transform: uppercase;
    text-align: center;
    line-height: 20px;
    transform: rotate(45deg);
    width: 100px;
    display: block;
    background: linear-gradient(#f5576c 0%, #f093fb 100%);
    box-shadow: 0 3px 10px -5px rgba(0, 0, 0, 1);
    position: absolute;
    top: 19px;
    right: -21px;
}

.feature-item {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.price-tag {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    padding: 20px;
    border-radius: 15px;
}

.pricing-card {
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.recommended-card {
    transform: scale(1.05);
    border: 3px solid #f5576c !important;
}

.locked-feature {
    opacity: 0.7;
    position: relative;
    cursor: not-allowed;
}

.locked-feature::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    color: #f5576c;
}
/* 🔥 付費升級功能 CSS END */

            
        }
