/* 基础样式 */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6d9dc5;
    --accent-color: #ff7e5f;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f0f2f5;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
}

header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 年级导航样式 */
.grade-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.grade-tab {
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.grade-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.grade-tab.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
    font-weight: 600;
}

.grade-tab i {
    margin-right: 5px;
}

/* 面板头部样式 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

/* 年级选择器样式 */
.grade-selector {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grade-selector label {
    font-weight: 600;
    color: var(--dark-color);
}

#grade-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: white;
    min-width: 150px;
}

/* 年级标题样式 */
#grade-title {
    color: var(--primary-color);
    font-weight: 600;
}

/* 文件源标记样式 */
.file-source {
    font-size: 0.85rem;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: #f0f7ff;
    color: var(--primary-color);
    border: 1px solid #d1e3ff;
    margin-left: 10px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex: 1;
    padding: 1.5rem;
    gap: 1.5rem;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.menu-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: none;
    background: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.menu-btn:hover {
    background-color: rgba(74, 111, 165, 0.1);
}

.menu-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.stats-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.stats-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stat-item:last-child {
    border-bottom: none;
}

/* 内容区域 */
.content-area {
    flex: 1;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.panel {
    display: none;
    padding: 2rem;
    height: 100%;
}

.panel.active {
    display: block;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.hint {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background-color: #3a5a8a;
    transform: translateY(-2px);
}

.btn.secondary {
    background-color: #e9ecef;
    color: var(--dark-color);
}

.btn.secondary:hover {
    background-color: #dee2e6;
}

/* 预览容器 */
.preview-container {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
}

.preview-container h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#preview-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

/* 文章库样式 */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-item {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}

.article-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.difficulty {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.difficulty.easy {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.difficulty.medium {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.difficulty.hard {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.article-preview {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #555;
}

.article-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn.practice {
    background-color: var(--primary-color);
    color: white;
}

.action-btn.practice:hover {
    background-color: #3a5a8a;
}

.action-btn.delete {
    background-color: #f8d7da;
    color: var(--danger-color);
}

.action-btn.delete:hover {
    background-color: #f1b0b7;
}

/* 练习面板样式 */
.practice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.practice-info h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.meta-info {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.timer {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(74, 111, 165, 0.1);
    padding: 8px 15px;
    border-radius: var(--border-radius);
}

.select-prompt {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.select-prompt p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.practice-content {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.blank-input {
    display: inline-block;
    width: 120px;
    padding: 5px 10px;
    margin: 0 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
    background-color: #fff;
    transition: var(--transition);
}

.blank-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.blank-input.correct {
    border-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.1);
}

.blank-input.incorrect {
    border-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.practice-controls {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* 结果面板样式 */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-results i {
    margin-bottom: 1rem;
    color: #ddd;
}

.result-item {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.result-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat-box {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-value.score {
    color: var(--primary-color);
}

.stat-value.accuracy {
    color: var(--success-color);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

.result-actions {
    display: flex;
    gap: 0.5rem;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

/* 错题解析样式 */
.mistake-item {
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger-color);
    background-color: rgba(220, 53, 69, 0.05);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.correct-answer {
    color: var(--success-color);
    font-weight: 600;
}

.user-answer {
    color: var(--danger-color);
    font-weight: 600;
}

/* 页脚样式 */
footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: #666;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.link-btn:hover {
    color: #3a5a8a;
    text-decoration: underline;
}

/* 年级统计样式 */
.grade-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.grade-stat {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    text-align: center;
}

.grade-stat h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.grade-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* 文件管理样式 */
.file-manager {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.file-item {
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    min-width: 200px;
}

.file-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.file-info {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.file-size {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .menu-section {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .menu-btn {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }
    
    .grade-nav {
        justify-content: center;
    }
    
    .grade-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    header, footer {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .panel {
        padding: 1.5rem 1rem;
    }
    
    .practice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .grade-nav {
        gap: 0.3rem;
    }
    
    .grade-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* 空状态提示 */
.no-articles {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-articles i {
    margin-bottom: 1rem;
    color: #ddd;
    font-size: 3rem;
}

.no-articles p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}
