/*
 * 星火AI家教错题本 — notebook.css
 * tutor.spark1.cn/notebook.html
 * 暗色主题 + 教育蓝 #3b82f6 + 成长绿 #10b981
 */

@import url('/spark1/subdomain-common.css');

:root {
    --c-primary: #3b82f6;
    --c-secondary: #10b981;
    --c-accent: #f59e0b;
    --c-accent-warm: #ef4444;
    --c-glow: rgba(59, 130, 246, 0.35);
    --grad-text: linear-gradient(135deg, #60a5fa 0%, #34d399 50%, #fbbf24 100%);
    --grad-btn: linear-gradient(135deg, #3b82f6 0%, #10b981 100%);
    --grad-card-border: linear-gradient(135deg, rgba(59,130,246,0.5), rgba(16,185,129,0.5), rgba(245,158,11,0.5));
    --shadow-glow: 0 0 30px var(--c-glow);
    --shadow-btn: 0 4px 15px rgba(59,130,246,0.4);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
}

/* ==================== 导航栏 ==================== */
.subdomain-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 60px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.12);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #e2e8f0;
    font-weight: 700;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.nav-brand:hover { opacity: 0.85; }

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--grad-btn);
    border-radius: 10px;
    font-size: 1.1rem;
    color: white;
}

.nav-title {
    background: linear-gradient(135deg, #93c5fd 0%, #6ee7b7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #e2e8f0;
    background: rgba(59, 130, 246, 0.1);
}

.nav-links a.nav-active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

@media (max-width: 640px) {
    .subdomain-nav {
        flex-direction: column;
        height: auto;
        padding: 0.8rem 1rem;
        gap: 10px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-links a {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}

/* ==================== Hero ==================== */
.notebook-hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.notebook-hero h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f87171 0%, #fb923c 40%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
}

.notebook-hero p {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ==================== 统计卡片 ==================== */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 560px;
    margin: 0 auto;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    min-width: 100px;
    text-align: center;
    transition: border-color 0.3s, transform 0.2s;
}

.stat-card:hover {
    border-color: rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 4px;
}

/* ==================== 筛选区 ==================== */
.filters-section {
    padding: 0 0 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    min-width: 40px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.filter-tab:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.08);
}

.filter-tab.active {
    background: var(--c-primary);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

/* ==================== 错题列表 ==================== */
.notebook-list {
    padding-bottom: 4rem;
}

/* ==================== 错题卡片 ==================== */
.error-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--c-primary);
    transition: border-color 0.3s, transform 0.15s;
}

.error-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* 学科颜色 */
.error-card[data-subject="数学"]   { border-left-color: #3b82f6; }
.error-card[data-subject="英语"]   { border-left-color: #8b5cf6; }
.error-card[data-subject="语文"]   { border-left-color: #f59e0b; }
.error-card[data-subject="物理"]   { border-left-color: #06b6d4; }
.error-card[data-subject="化学"]   { border-left-color: #10b981; }
.error-card[data-subject="生物"]   { border-left-color: #84cc16; }
.error-card[data-subject="历史"]   { border-left-color: #d97706; }
.error-card[data-subject="地理"]   { border-left-color: #0ea5e9; }
.error-card[data-subject="道德与法治"] { border-left-color: #e11d48; }
.error-card[data-subject="编程"]   { border-left-color: #6366f1; }
.error-card[data-subject="科学"]   { border-left-color: #14b8a6; }
.error-card[data-subject="体育"]   { border-left-color: #f97316; }
.error-card[data-subject="艺术"]   { border-left-color: #ec4899; }

.error-card.mastered {
    opacity: 0.65;
}

.error-card.mastered:hover {
    opacity: 0.85;
}

/* 卡片头部 */
.error-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.subject-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.kp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.error-date {
    margin-left: auto;
    font-size: 0.75rem;
    color: #475569;
}

/* 题目 */
.error-question {
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

/* 答案区 */
.error-answers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.answer-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.answer-label {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.answer-label.wrong {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.answer-label.correct {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.answer-text.wrong {
    color: #f87171;
    text-decoration: line-through;
    text-decoration-color: rgba(248, 113, 113, 0.4);
}

.answer-text.correct {
    color: #34d399;
}

/* 解释（可折叠） */
.error-explanation {
    margin-bottom: 10px;
}

.explanation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    background: none;
    border: none;
    color: #60a5fa;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.2s;
}

.explanation-toggle:hover {
    color: #93c5fd;
}

.explanation-toggle .arrow {
    transition: transform 0.25s;
    display: inline-block;
}

.explanation-toggle.open .arrow {
    transform: rotate(90deg);
}

.explanation-body {
    display: none;
    margin-top: 8px;
    padding: 12px 14px;
    background: rgba(59, 130, 246, 0.06);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.7;
    white-space: pre-wrap;
}

.explanation-body.show {
    display: block;
}

/* 要点 */
.error-takeaway {
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
    font-size: 0.85rem;
    color: #fbbf24;
    margin-bottom: 12px;
}

.error-takeaway::before {
    content: "💡 ";
}

/* 操作按钮 */
.error-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 7px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.btn-action:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.08);
}

.btn-action.btn-master {
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-action.btn-master:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-action.btn-master.done {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
    cursor: default;
}

.btn-action.btn-retry {
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.btn-action.btn-retry:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 2rem;
}

.page-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s;
}

.page-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #bfdbfe;
}

.page-btn.active {
    background: var(--c-primary);
    border-color: transparent;
    color: white;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
}

.empty-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #e2e8f0;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.empty-link {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 12px;
    background: var(--grad-btn);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* ==================== 加载状态 ==================== */
.loading-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
    .notebook-hero {
        padding: 1.5rem 0 1.2rem;
    }

    .notebook-hero h1 {
        font-size: 1.4rem;
    }

    .stats-row {
        gap: 8px;
    }

    .stat-card {
        padding: 0.6rem 0.75rem;
        min-width: 70px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .filter-tabs {
        gap: 4px;
    }

    .filter-tab {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .error-card {
        padding: 1rem;
    }

    .error-date {
        margin-left: 0;
        width: 100%;
    }

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

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