/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    
    min-height: 100vh;
}

/* 分享面板样式 */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.share-panel-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.share-panel h3 {
    text-align: center;
    margin-top: 0;
    color: #e74c3c;
    font-size: 20px;
}

.share-preview {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.share-btn-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn-platform i {
    margin-right: 8px;
    font-size: 20px;
}

.share-btn-platform:nth-child(1) {
    background-color: #07C160;
    color: white;
}

.share-btn-platform:nth-child(1):hover {
    background-color: #06b057;
    transform: translateY(-2px);
}

.share-btn-platform:nth-child(2) {
    background-color: #12B7F5;
    color: white;
}

.share-btn-platform:nth-child(2):hover {
    background-color: #0e9cd6;
    transform: translateY(-2px);
}

.share-btn-platform:nth-child(3) {
    background-color: #6c757d;
    color: white;
}

.share-btn-platform:nth-child(3):hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.share-btn-platform:nth-child(4) {
    background-color: #17a2b8;
    color: white;
}

.share-btn-platform:nth-child(4):hover {
    background-color: #138496;
    transform: translateY(-2px);
}

.share-close-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-color: #f8f9fa;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-close-btn:hover {
    background-color: #e9ecef;
}

/* 二维码容器样式 */
.qr-code-container {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.qr-code {
    margin-bottom: 15px;
}

.qr-code img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

.qr-code p {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.close-qr-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.close-qr-btn:hover {
    background-color: #5a6268;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-panel-content {
        width: 95%;
        margin: 10px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 30px 0;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 主要内容样式 */
.main-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

/* 页面通用样式 */
.page {
    display: none;
    padding: 40px;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 开始页面样式 */
.start-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.start-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.start-image:hover {
    transform: scale(1.02);
}

.start-content h2 {
    font-size: 2em;
    color: #c0392b;
    margin-bottom: 20px;
}

.intro-text {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #555;
}

/* 难度选择样式 */
.difficulty-selection {
    margin-bottom: 40px;
}

.difficulty-selection h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 15px 30px;
    border: 2px solid #ddd;
    background: white;
    color: #555;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.difficulty-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    transform: translateY(-3px);
}

.difficulty-btn.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* 按钮样式 */
.primary-button {
    padding: 15px 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.primary-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-button {
    padding: 15px 40px;
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.secondary-button:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-3px);
}

.secondary-button:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 答题页面样式 */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.progress-container {
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.question-counter {
    font-size: 1.1em;
    color: #666;
}

.score-container {
    text-align: right;
}

.score {
    font-size: 1.3em;
    font-weight: bold;
    color: #27ae60;
}

.question-container {
    margin-bottom: 40px;
}

.question-text {
    font-size: 1.5em;
    margin-bottom: 30px;
    color: #333;
    line-height: 1.4;
}

.options-container {
    display: grid;
    gap: 15px;
    max-width: 800px;
}

.option-btn {
    padding: 20px;
    text-align: left;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 50px;
}

.option-btn:hover:not(.selected):not(:disabled) {
    border-color: #e74c3c;
    background: #f9f9f9;
}

.option-btn.selected {
    border-color: #e74c3c;
    background: #ffeaea;
}

.option-btn.correct {
    border-color: #27ae60;
    background: #eafaf1;
}

.option-btn.incorrect {
    border-color: #e74c3c;
    background: #ffeaea;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn::before {
    content: attr(data-option);
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #666;
}

.option-btn.selected::before {
    background: #e74c3c;
    color: white;
}

.option-btn.correct::before {
    background: #27ae60;
    color: white;
    content: '✓';
}

.option-btn.incorrect::before {
    background: #e74c3c;
    color: white;
    content: '✗';
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

/* 结果页面样式 */
.result-content {
    max-width: 800px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h2 {
    font-size: 2.2em;
    color: #c0392b;
    margin-bottom: 30px;
}

.final-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 20px;
}

.score-value {
    font-size: 5em;
    font-weight: bold;
    color: #e74c3c;
    margin-right: 10px;
}

.score-label {
    font-size: 2em;
    color: #666;
}

.result-message {
    font-size: 1.3em;
    color: #666;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: white;
}

.correct-icon {
    background: #27ae60;
}

.incorrect-icon {
    background: #e74c3c;
}

.time-icon {
    background: #3498db;
}

.stat-info {
    text-align: left;
}

.stat-label {
    display: block;
    font-size: 1.1em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

.chart-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 40px;
    height: 300px;
}

.review-section {
    margin-bottom: 40px;
}

.review-section h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
}

.answers-review {
    max-height: 300px;
    overflow-y: auto;
}

.review-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.review-item:last-child {
    border-bottom: none;
}

.review-question {
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-question.correct {
    color: #27ae60;
}

.review-question.incorrect {
    color: #e74c3c;
}

.review-answer {
    margin-left: 30px;
    color: #666;
}

/* 错误答案样式 */
.incorrect-answer {
    background-color: #ffeaea;
    color: #c0392b;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    background: #333;
    color: white;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .page {
        padding: 20px;
    }
    
    .quiz-header,
    .quiz-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    
    .score-container {
        text-align: center;
    }
    
    .options-container {
        gap: 10px;
    }
    
    .option-btn {
        padding: 15px 15px 15px 45px;
        font-size: 1em;
    }
    
    .result-stats {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .stat-item {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .score-value {
        font-size: 4em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .question-text {
        font-size: 1.3em;
    }
    
    .start-content h2 {
        font-size: 1.6em;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}