/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0d7154;
    --primary-dark: #0a5a43;
    --primary-light: #e8f5e9;
    --accent-color: #ffcc00;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    background: linear-gradient(135deg, #e0e5ec 0%, #c8d6e5 100%);
    min-height: 100vh;
    color: var(--text-color);
}

/* 头部样式 */
.header {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.header h1 {
    font-size: 28px;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.header .company-name {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin-top: 8px;
    letter-spacing: 2px;
    font-weight: 500;
}

.header .company-logo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    object-fit: cover;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* 用户信息样式 */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 20px;
}

.user-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.user-btn.login-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.user-btn.login-btn:hover {
    background: rgba(255,255,255,0.3);
}

.user-btn:not(.login-btn) {
    background: rgba(255,255,255,0.15);
    color: white;
}

.user-btn:not(.login-btn):hover {
    background: rgba(255,255,255,0.25);
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 欢迎区域 */
.welcome-section {
    text-align: center;
    margin-bottom: 50px;
}

.badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(13,113,84,0.2);
}

.main-title {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255,255,255,0.9);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* 测试卡片区域 */
.test-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.test-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.test-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-weight: 600;
}

.card-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.card-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.feature-tag {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(13,113,84,0.2);
}

.card-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(13,113,84,0.3);
}

.card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13,113,84,0.4);
}

/* 功能按钮区域 */
.action-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid;
}

.history-btn {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.history-btn:hover {
    background: var(--primary-color);
    color: white;
}

.export-btn {
    background: var(--accent-color);
    color: var(--primary-dark);
    border-color: var(--accent-color);
}

.export-btn:hover {
    background: #ffd633;
    transform: translateY(-2px);
}

/* 页脚样式 */
.footer {
    background: rgba(10,92,68,0.1);
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 14px;
}

.footer-note {
    margin-top: 8px;
    font-size: 12px;
    color: #aaa;
}

.company-footer {
    margin-top: 5px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 测试页面样式 */
.test-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 1000;
    overflow-y: auto;
}

.test-page.active {
    display: block;
}

.test-header {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.test-title {
    color: var(--accent-color);
    font-size: 20px;
    font-weight: 600;
}

.test-progress {
    color: white;
    font-size: 14px;
}

/* 题目样式 */
.question-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 20px;
}

.question-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.question-number {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.question-text {
    font-size: 18px;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 25px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option-item.selected {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.option-letter {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option-text {
    font-size: 16px;
    color: var(--text-color);
}

/* 导航按钮 */
.test-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 0 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.nav-btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid;
}

.prev-btn {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.prev-btn:hover {
    background: var(--primary-color);
    color: white;
}

.next-btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.next-btn:hover {
    background: var(--primary-dark);
}

.submit-btn {
    background: var(--accent-color);
    color: var(--primary-dark);
    border-color: var(--accent-color);
}

.submit-btn:hover {
    background: #ffd633;
}

/* 结果页面 */
.result-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.result-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.result-score {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.result-grade {
    font-size: 24px;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.result-details {
    text-align: left;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-light);
    font-size: 16px;
}

.result-value {
    color: var(--text-color);
    font-weight: 600;
    font-size: 16px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.result-btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.home-btn {
    background: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 历史记录页面 */
.history-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.history-header {
    text-align: center;
    margin-bottom: 30px;
}

.history-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.history-info {
    flex: 1;
}

.history-test-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.history-date {
    font-size: 14px;
    color: var(--text-light);
}

.history-score {
    text-align: right;
}

.history-score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.history-grade {
    font-size: 14px;
    color: var(--accent-color);
}

.empty-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-text {
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .header .company-logo {
        width: 50px;
        height: 50px;
        left: 10px;
    }

    .header .company-name {
        font-size: 14px;
    }

    .main-title {
        font-size: 28px;
    }

    .test-cards {
        grid-template-columns: 1fr;
    }

    .action-section {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 300px;
    }

    .question-text {
        font-size: 16px;
    }

    .test-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .nav-btn {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .result-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* 计时器样式 */
.timer-section {
    background: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
}

.timer-icon {
    font-size: 20px;
}

.timer-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
}

.timer-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 4px;
    transition: width 1s linear;
}

/* 错题解析样式 */
.wrong-answers-section {
    margin-top: 30px;
    text-align: left;
}

.wrong-answers-title {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

.wrong-answers-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wrong-answer-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #dc3545;
}

.wrong-question {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.5;
}

.wrong-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.wrong-option {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    border: 1px solid #e0e0e0;
}

.wrong-option.correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

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

.wrong-explanation {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 14px;
}

.explanation-label {
    color: var(--text-light);
}

.explanation-value {
    font-weight: 600;
    color: #2e7d32;
}

.user-answer {
    color: #c62828;
    font-weight: 500;
}

.analysis-btn {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.analysis-btn:hover {
    background: #138496;
}

/* 答案提示样式 */
.answer-hint {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 8px;
    color: #856404;
    font-size: 15px;
    border: 1px solid #ffc107;
}

.answer-selected {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    font-size: 15px;
    border: 1px solid #28a745;
}

.option-check {
    margin-left: auto;
    font-size: 20px;
    color: var(--primary-color);
    font-weight: bold;
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

.test-card {
    animation: fadeIn 0.5s ease-out;
}

.test-card:nth-child(2) { animation-delay: 0.1s; }
.test-card:nth-child(3) { animation-delay: 0.2s; }
.test-card:nth-child(4) { animation-delay: 0.3s; }
.test-card:nth-child(5) { animation-delay: 0.4s; }
.test-card:nth-child(6) { animation-delay: 0.5s; }
.test-card:nth-child(7) { animation-delay: 0.6s; }

/* 用户信息区域 */
.user-section {
    margin-bottom: 20px;
}

.user-info-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    position: relative;
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-weight: bold;
    color: var(--primary-color);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    display: none;
    min-width: 150px;
    z-index: 100;
}

.user-info-card:hover .user-menu {
    display: block;
}

.user-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.user-menu a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 公告区域 */
.notice-section {
    margin-bottom: 20px;
}

.notice-bar {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #856404;
}

.notice-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #856404;
    padding: 0 5px;
}

/* 内容页面区域 */
.content-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 24px;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
    font-weight: bold;
}

.content-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.content-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.content-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.content-title {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: bold;
}

.content-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.content-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.content-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* 登录按钮样式 */
.login-btn {
    background: linear-gradient(135deg, #ffcc00, #ff9800);
    color: #333;
    border: none;
}

.login-btn:hover {
    background: linear-gradient(135deg, #ffd633, #ffab2e);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-cards {
        grid-template-columns: 1fr;
    }
    
    .user-info-card {
        flex-direction: column;
        text-align: center;
    }
    
    .user-menu {
        position: static;
        box-shadow: none;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
}
