* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.progress-info {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background-color: #e0e0e0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #2196F3);
    width: 0%;
    transition: width 0.3s ease;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 20px;
}

.question-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.question-number {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 罗马数字选项 */
.roman-options {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.roman-option {
    margin-bottom: 8px;
    font-size: 1rem;
    color: #555;
}

/* 答题选项 */
.answer-options {
    display: grid;
    gap: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.option-btn:hover {
    border-color: #2196F3;
    background: #f0f8ff;
    transform: translateY(-1px);
}

.option-btn:active {
    transform: translateY(0);
}

.option-btn.selected {
    border-color: #2196F3;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.option-btn.correct {
    border-color: #4CAF50;
    background: #e8f5e8;
    color: #2e7d32;
}

.option-btn.wrong {
    border-color: #f44336;
    background: #fde8e8;
    color: #c62828;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* 反馈区域 */
.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-result {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feedback.correct {
    background: #e8f5e8;
    border: 1px solid #4CAF50;
    color: #2e7d32;
}

.feedback.wrong {
    background: #fde8e8;
    border: 1px solid #f44336;
    color: #c62828;
}

.correct-answer {
    font-size: 1rem;
    margin-bottom: 8px;
}

.explanation {
    font-size: 0.95rem;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 15px;
    padding: 0 20px 20px;
}

.btn {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1976D2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-outline {
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* 统计信息 */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.stat-item {
    text-align: center;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 重置按钮区域 */
.reset-section {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    margin-bottom: 25px;
    color: #6c757d;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }
    
    .container {
        border-radius: 15px;
        min-height: calc(100vh - 10px);
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .question-card {
        padding: 15px;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .controls {
        padding: 0 15px 15px;
        gap: 10px;
    }
    
    .btn {
        padding: 12px;
        font-size: 0.95rem;
        min-height: 45px;
    }
    
    .stats {
        padding: 15px;
        gap: 10px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .reset-section {
        padding: 15px;
    }
}

@media (max-width: 400px) {
    .header h1 {
        font-size: 1.2rem;
    }
    
    .question-text {
        font-size: 0.95rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .stat-label {
        margin-bottom: 0;
    }
}

/* 触摸友好 */
@media (hover: none) and (pointer: coarse) {
    .option-btn:hover {
        border-color: #e9ecef;
        background: white;
        transform: none;
    }
    
    .option-btn:active {
        border-color: #2196F3;
        background: #f0f8ff;
    }
    
    .btn:hover:not(:disabled) {
        box-shadow: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

/* 动画增强 */
.option-btn {
    transform: translateZ(0);
    will-change: transform;
}

.progress-fill {
    will-change: width;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}