/* 章节练习页面样式 */
#chapter-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.chapter-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 章节选择面板 */
.chapter-selection-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
}

.panel-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    margin-bottom: 5px;
}

.selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.form-input {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 250px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 91, 201, 0.1);
}

/* 章节网格 */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.chapter-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.chapter-card:hover {
    border-color: var(--primary-light);
    background: #f0f4ff;
    transform: translateY(-2px);
}

.chapter-card.selected {
    border-color: var(--primary);
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(58, 91, 201, 0.15);
}

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

.chapter-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chapter-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: var(--transition);
}

.chapter-card.selected .chapter-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.chapter-checkbox i {
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
}

.chapter-card.selected .chapter-checkbox i {
    opacity: 1;
}

.chapter-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chapter-progress {
    margin-top: 10px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-chapters {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
}

.loading-chapters .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* 选择摘要 */
.selection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 6px;
}

.summary-item i {
    font-size: 1.2rem;
    color: var(--primary);
}

/* 统计面板 */
.chapter-stats-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 30px;
}

.stats-content {
    margin-top: 20px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.8rem;
}

.stat-info {
    flex: 1;
}

.stat-info h4 {
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.chart-container h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

/* 章节详情表格 */
.chapter-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.chapter-details h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.details-table {
    overflow-x: auto;
}

.details-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.details-table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    padding: 15px;
    text-align: left;
}

.details-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.details-table tr:hover {
    background: #f8f9ff;
}

.details-table .action-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-selection-panel,
    .chapter-stats-panel {
        padding: 15px;
    }
    
    .selection-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-input {
        min-width: 100%;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
        max-height: none;
    }
    
    .stats-overview {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .details-table {
        font-size: 0.9rem;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}