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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-bottom: 60px; /* 为底部导航留出空间 */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 简化的页面头部 */
.simple-header {
    background-color: #4a76a8;
    color: #fff;
    padding: 0.75rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.simple-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

/* 底部导航栏 */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #777;
    text-decoration: none;
    padding: 5px 0;
    width: 20%;
    transition: color 0.3s;
}

.nav-item.active {
    color: #4a76a8;
}

.nav-item-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-item-text {
    font-size: 12px;
}

/* 主要内容区域 */
main {
    padding: 1rem 0;
}

section {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #4a76a8;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* 首页特色区域 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 6px;
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-item h3 {
    color: #4a76a8;
    margin-bottom: 0.5rem;
}

/* 表单样式 */
.form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* 练习说明样式 */
.practice-instructions {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4a76a8;
}

.practice-instructions h3 {
    color: #4a76a8;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.instruction-content {
    font-size: 0.95rem;
}

.instruction-content p {
    margin-bottom: 0.75rem;
}

.instruction-content ol,
.instruction-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.instruction-content li {
    margin-bottom: 0.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #4a76a8;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #4a76a8;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #3a5f8a;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 题目卡片样式 */
.question-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.options-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.option-item {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: block;
    user-select: none;
}

.option-item:hover {
    background-color: #f5f9ff;
    border-color: #a8c4e5;
}

.option-item.selected {
    background-color: #e6f0fa;
    border-color: #4a76a8;
    box-shadow: 0 0 0 2px rgba(74, 118, 168, 0.2);
}

.option-item.correct {
    background-color: #e6ffe6;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.option-item.incorrect {
    background-color: #ffe6e6;
    border-color: #f44336;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.question-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* 科目卡片样式 */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background-color: #ffffff !important;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #d0d0d0 !important;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.subject-card h3 {
    color: #333333;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.subject-info {
    width: 100%;
}

.subject-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.subject-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333333;
}

.stat-label {
    font-size: 0.875rem;
    color: #666666;
}

.subject-action {
    background-color: #f0f0f0 !important;
    padding: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #3f67b5 !important;
    font-weight: 500;
    border: 1px solid #e0e0e0 !important;
}

.btn-icon {
    font-weight: bold;
}

/* 使每个学科有自己的颜色标识 */
.subject-card.history .subject-icon {
    color: #e74c3c;
}

.subject-card.geography .subject-icon {
    color: #3498db;
}

.subject-card.biology .subject-icon {
    color: #2ecc71;
}

.subject-card.politics .subject-icon {
    color: #9b59b6;
}

/* 移动端优化 - 用户信息卡片 */
.user-info-card {
    background-color: #2c4b8e;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    color: white;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.user-level {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    padding: 3px 10px;
    font-size: 12px;
}

.user-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.user-grade {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 15px;
}

.user-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    flex: 1;
    position: relative;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 0 3px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 4px;
    display: block;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: block;
}

/* 移动端优化 - 学习目标进度 */
.learning-goal {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
}

.goal-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.goal-text {
    font-size: 14px;
    color: #666;
}

.goal-count {
    color: #3f67b5;
    font-weight: bold;
}

.progress-percent {
    font-size: 12px;
    color: #666;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background-color: #3f67b5;
    border-radius: 4px;
}

.continue-btn {
    display: block;
    width: 100%;
    background-color: #3f67b5;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
}

/* 移动端优化 - 学科选择 */
.subject-selection {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.subjects-mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.subject-mobile-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subject-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.history-icon {
    background-color: #ffecb3;
    color: #e6a700;
}

.geo-icon {
    background-color: #b3e5fc;
    color: #0288d1;
}

.bio-icon {
    background-color: #c8e6c9;
    color: #4caf50;
}

.law-icon {
    background-color: #e1bee7;
    color: #9c27b0;
}

.subject-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.completion-rate {
    font-size: 12px;
    color: #666;
}

/* 移动端优化 - 学习功能 */
.learning-functions {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.functions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
}

.function-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
}

.function-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.function-name {
    font-size: 12px;
    color: #666;
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    
    .simple-header {
        padding: 10px 0;
    }
    
    .simple-header h1 {
        font-size: 18px;
    }
    
    main {
        padding: 12px 0;
    }
    
    /* 科目卡片移动端优化 */
    .subjects-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .subject-card {
        padding: 12px 8px;
        border-radius: 10px;
    }
    
    .subject-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .subject-icon {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .subject-stats {
        margin-bottom: 8px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .subject-action {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    /* 综合练习区域移动端优化 */
    .combined-practice-section {
        padding: 12px;
        margin-top: 12px;
    }
    
    .combined-practice-section h2 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }
    
    .practice-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .practice-option {
        padding: 10px;
    }
    
    .option-icon {
        font-size: 20px;
        margin-right: 10px;
    }
    
    .option-info h3 {
        font-size: 14px;
    }
    
    .option-info p {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .option-badge {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    /* 底部导航优化 */
    .mobile-bottom-nav {
        padding: 6px 0 4px;
    }
    
    .nav-item-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .nav-item-text {
        font-size: 10px;
    }
    
    /* 用户信息摘要优化 */
    .user-info-summary {
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    /* 缩小页脚 */
    footer {
        padding: 10px 0;
        margin-bottom: 50px;
        font-size: 10px;
    }
    
    body {
        padding-bottom: 50px;
    }
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 解释样式 */
#question-explanation h3 {
    margin-top: 20px;
    color: #3a5f8a;
}

#question-explanation h3:first-child {
    margin-top: 0;
}

/* 章节页面 */
.chapter-title {
    font-size: 22px;
    color: #3a5f8a;
    margin-bottom: 20px;
    text-align: center;
}

.chapter-container {
    margin-top: 20px;
}

.chapter-unit {
    margin-bottom: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.unit-title {
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.unit-title i {
    transition: transform 0.3s;
}

.lesson-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lesson-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.lesson-title {
    flex: 1;
}

.locked-icon {
    color: #ffc107;
    margin-left: 10px;
}

.practice-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.practice-btn:hover {
    background-color: #f57c00;
}

/* 顶部选择器样式 */
.chapter-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.selector-label {
    font-weight: bold;
    margin-right: 5px;
}

.selector {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chapter-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chapter-selector > div {
        display: flex;
        align-items: center;
    }
    
    .selector-label {
        width: 80px;
    }
    
    .selector {
        flex: 1;
    }
    
    .unit-title {
        padding: 12px;
        font-size: 15px;
    }
    
    .lesson-item {
        padding: 12px;
        font-size: 14px;
    }
    
    .practice-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
}

.admin-link {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
}

.admin-link a {
    color: #6c757d;
    text-decoration: none;
}

.admin-link a:hover {
    text-decoration: underline;
}

/* 从错题本移除按钮 */
.remove-wrong-btn {
    background-color: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
}

.remove-wrong-btn i {
    margin-right: 5px;
}

/* 底部导航栏适配暗色模式 */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background-color: #222;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .nav-item {
        color: #aaa;
    }
    
    .nav-item.active {
        color: #77a7e0;
    }
}

/* 增强统计卡片的文字显示（最高优先级） */
body .user-info-card .stat-item .stat-value,
.user-info-card .stat-value {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    margin-bottom: 4px !important;
    display: block !important;
}

body .user-info-card .stat-item .stat-label,
.user-info-card .stat-label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
    display: block !important;
}

/* 综合练习区域样式 */
.combined-practice-section {
    margin-top: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.combined-practice-section h2 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.practice-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.practice-option {
    background-color: #ffffff !important;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333 !important;
    border: 1px solid #d0d0d0 !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
}

.practice-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.option-info {
    flex: 1;
}

.option-info h3 {
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.option-info p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.option-badge {
    display: inline-block;
    background-color: #3f67b5;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* 为每个练习选项添加特定颜色 */
.practice-option.mixed .option-icon {
    color: #f39c12;
}

.practice-option.daily .option-icon {
    color: #3498db;
}

.practice-option.error-review .option-icon {
    color: #e74c3c;
}

.practice-option.exam .option-icon {
    color: #2ecc71;
}

/* 用户信息摘要样式 */
.user-info-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: #f0f4f8;
    border-radius: 6px;
}

.user-grade {
    font-weight: 500;
    color: #333;
}

.change-link a {
    color: #3f67b5;
    text-decoration: none;
    font-size: 0.9rem;
}

/* subjects.php页面样式覆盖 */
.subjects-grid .stat-value {
    color: #333333 !important;
    text-shadow: none !important;
}

.subjects-grid .stat-label {
    color: #666666 !important;
    text-shadow: none !important;
}

.subjects-grid .subject-card h3 {
    color: #333333 !important;
}

.practice-option h3 {
    color: #333333 !important;
}

.practice-option p {
    color: #666666 !important;
}

.combined-practice-section h2 {
    color: #333333 !important;
}

/* 根页面文字颜色保护 */
.user-info-card .stat-value {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

.user-info-card .stat-label {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6) !important;
}

/* 页脚调整，为底部导航腾出空间 */
footer {
    margin-bottom: 60px;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

/* 当屏幕较小时隐藏桌面版内容 */
@media (max-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }
    
    /* 当有底部导航栏时调整页面内容 */
    body {
        padding-bottom: 56px;
    }
    
    footer {
        margin-bottom: 56px;
        padding: 10px 0;
        font-size: 10px;
    }
    
    /* 减小页脚的上边距 */
    .admin-link {
        margin-top: 10px;
    }
    
    /* 卡片样式更加紧凑 */
    .user-info-card {
        padding: 12px 10px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .user-level {
        top: 10px;
        right: 10px;
        padding: 2px 8px;
        font-size: 10px;
    }
    
    .user-name {
        font-size: 15px;
        margin-bottom: 3px;
    }
    
    .user-grade {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .user-stats {
        margin-top: 10px;
    }
    
    .stat-item {
        padding: 3px;
        border-radius: 6px;
    }
    
    .learning-goal, .subject-selection {
        padding: 12px 10px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .section-title {
        font-size: 15px;
        margin-bottom: 10px;
    }
    
    .goal-text {
        font-size: 12px;
    }
    
    .progress-bar-container {
        height: 6px;
        margin-bottom: 10px;
    }
    
    .continue-btn {
        padding: 10px;
        font-size: 14px;
        border-radius: 5px;
    }
    
    .subjects-mobile-grid {
        gap: 10px;
    }
}