/* 智能错题本 - 样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4A90D9;
    --primary-dark: #3A7BC8;
    --secondary: #67C23A;
    --warning: #E6A23C;
    --danger: #F56C6C;
    --text-primary: #303133;
    --text-secondary: #606266;
    --text-placeholder: #909399;
    --border-color: #DCDFE6;
    --bg-color: #F5F7FA;
    --white: #FFFFFF;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航 */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--bg-color);
}

.nav-btn.active {
    background: var(--primary);
    color: var(--white);
}

/* 主内容区 */
.main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* 页面 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页 */
.hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary), #66A6FF);
    border-radius: 16px;
    color: var(--white);
    margin-bottom: 30px;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 16px;
    opacity: 0.9;
}

/* 统计卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
}

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

/* 快捷操作 */
.quick-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.action-btn .icon {
    font-size: 24px;
}

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

.action-btn.secondary {
    background: var(--secondary);
    color: var(--white);
}

/* 学科网格 */
.subjects-grid h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.subject-item {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.subject-item:hover {
    transform: translateY(-3px);
}

.subject-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.subject-name {
    font-size: 16px;
    font-weight: 500;
}

/* 错题库页面 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filters select,
.filters input {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.filters input {
    flex: 1;
}

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

.question-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.question-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.question-tags {
    display: flex;
    gap: 8px;
}

.tag {
    padding: 3px 10px;
    background: var(--bg-color);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.question-content {
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-color);
    border-radius: 8px;
}

.question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-placeholder);
    font-size: 13px;
}

.question-actions {
    display: flex;
    gap: 10px;
}

/* 练习页面 */
.practice-config {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-item label {
    font-size: 14px;
    color: var(--text-secondary);
}

.config-item select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 150px;
}

.practice-area {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.practice-progress {
    text-align: center;
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 20px;
}

.practice-question {
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
}

.practice-input {
    display: flex;
    gap: 10px;
}

.practice-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
}

.practice-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
}

.practice-result.correct {
    background: #E8F5E9;
    color: var(--secondary);
}

.practice-result.wrong {
    background: #FFEBEE;
    color: var(--danger);
}

/* 统计页面 */
.stats-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stats-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.progress-bar {
    height: 20px;
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.5s;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.stats-row b {
    color: var(--primary);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

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

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

.btn.secondary {
    background: var(--bg-color);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background: var(--border-color);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-placeholder);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.image-preview {
    max-width: 100%;
    margin-top: 10px;
    border-radius: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }

    .subjects {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        flex-direction: column;
    }

    .practice-config {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-detail {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }
}
