﻿/* ========================================
   二次函数AI学习助手 - 全新现代化设计
   灵感来源：Agent Skills Hub 风格
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 - 现代蓝色系 */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: rgba(37, 99, 235, 0.08);
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: linear-gradient(135deg, #e0f2fe 0%, #e0e7ff 50%, #fce7f3 100%);
    --gradient-card: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    
    /* 功能色 */
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --info-color: #3b82f6;
    --info-bg: #dbeafe;
    
    /* 中性色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --bg-color: #f0f9ff;
    --bg-pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    --card-bg: #ffffff;
    
    /* 教学评三色 */
    --teach-color: #8b5cf6;
    --learn-color: #06b6d4;
    --eval-color: #f97316;
    
    /* 尺寸 */
    --sidebar-width: 260px;
    --header-height: 72px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-lg: 24px;
    --border-radius-pill: 50px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(37, 99, 235, 0.15);
    
    /* 动画 */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* 新增：更丰富的渐变和动画 */
    --gradient-shine: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.6) 50%, transparent 70%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
    --shadow-card-hover: 0 20px 60px rgba(99, 102, 241, 0.15), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-float: 0 8px 32px rgba(99, 102, 241, 0.2);
}

/* ========================================
   内联图标样式 - 替代Emoji
   ======================================== */
.inline-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    display: inline-block;
    margin-right: 0.25em;
}

/* 占位图标（placeholder中的大图标） */
.placeholder-icon i,
.weakness-icon i,
.rec-icon i {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

/* ========================================
   全局动画定义
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* 预留滚动条空间，防止内容居中时的水平偏移 */
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 
                 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    background-image: var(--bg-pattern);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   头部导航 - 简洁白色风格
   ======================================== */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.header-content {
    max-width: 100%;
    height: 100%;
    padding: 0 32px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    stroke-width: 2;
}

.subtitle-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 24px;
    border-left: 2px solid var(--border-color);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-settings {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-settings:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: rotate(30deg);
}

/* ========================================
   主容器布局
   ======================================== */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ========================================
   侧边栏导航 - 清新卡片风格
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-section {
    margin-bottom: 28px;
}

.nav-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-title::before {
    content: '';
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    background: transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-normal);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    transition: var(--transition-normal);
}

.nav-item:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active::before {
    height: 60%;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* 教学评标签 */
.nav-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
}

.badge-teach {
    background: rgba(139, 92, 246, 0.1);
    color: var(--teach-color);
}

.badge-learn {
    background: rgba(6, 182, 212, 0.1);
    color: var(--learn-color);
}

.badge-eval {
    background: rgba(249, 115, 22, 0.1);
    color: var(--eval-color);
}

/* 学习进度区域 */
.progress-section {
    margin-top: auto;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.progress-section h5 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.progress-section .progress-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 500;
}

/* ========================================
   内容区域
   ======================================== */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    background: transparent;
}

/* 模块面板 */
.module-panel {
    display: none;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    min-height: calc(100vh - var(--header-height) - 64px);
    overflow: hidden;
}

.module-panel.active {
    display: block;
    /* 使用不含位移的纯淡入动画，避免布局偏移 */
    animation: moduleAppear 0.25s ease;
}

@keyframes moduleAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.panel-header {
    padding: 32px 32px 24px;
    background: var(--gradient-hero);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.panel-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.panel-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

.section-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
    vertical-align: middle;
    margin-right: 6px;
}

.progress-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.panel-header h2 .highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-desc {
    font-size: 15px;
    color: var(--text-secondary);
    position: relative;
}

/* ========================================
   模块1: AI知识讲解
   ======================================== */
.knowledge-container {
    padding: 32px;
}

.quick-topics {
    margin-bottom: 28px;
}

.quick-topics h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-topics h4::before {
    content: '◇';
    color: var(--primary-color);
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-tag {
    padding: 10px 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 6px;
}

.topic-tag:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.topic-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 聊天容器 */
.chat-container {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(180deg, #fafbfc 0%, #f1f5f9 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(139, 92, 246, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.message-avatar svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
}

.message-content {
    max-width: 75%;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    line-height: 1.7;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message-content li {
    margin-bottom: 6px;
}

.message-content code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

/* 聊天输入区 */
.chat-input-area {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.chat-input-area textarea {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    resize: none;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-color);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.chat-input-area textarea::placeholder {
    color: var(--text-muted);
}

.btn-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-send:active {
    transform: translateY(0);
}

.btn-send .send-icon {
    width: 16px;
    height: 16px;
}

.btn-settings svg {
    width: 20px;
    height: 20px;
}

/* ========================================
   模块2: 图像探索器 - 全新现代布局
   ======================================== */
.explorer-container {
    padding: 20px 24px;
    /* 移除 fadeInUp 动画，改用简单的淡入，避免 translateY 导致的布局偏移 */
    animation: simpleFadeIn 0.3s ease;
}

@keyframes simpleFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 精简顶部标题区 */
.explorer-container .section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.explorer-container .section-header h2 {
    font-size: 1.4rem;
}

.explorer-container .section-header p {
    font-size: 0.9rem;
    margin-top: 4px;
}

.explorer-main {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    margin-bottom: 20px;
    /* 防止布局跳动 - 确保右侧列宽度固定 */
    min-width: 0;
    align-items: stretch; /* 让两列等高 */
}

.explorer-main > * {
    min-width: 0; /* 防止Grid子元素溢出导致布局重计算 */
}

/* 图像绘制区 - 左侧主区域 */
.graph-area {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
}

.graph-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    border-radius: 20px 20px 0 0;
}

/* 画布标题 */
.graph-area .graph-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    align-self: flex-start;
}

.graph-area .graph-title svg {
    width: 16px;
    height: 16px;
    color: #6366f1;
}

/* 画布增强样式 */
#functionCanvas {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    box-shadow: 
        0 0 0 1px rgba(99, 102, 241, 0.1),
        0 4px 16px rgba(99, 102, 241, 0.06),
        inset 0 0 60px rgba(99, 102, 241, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: crosshair;
    max-width: 100%;
    height: auto;
}

#functionCanvas:hover {
    box-shadow: 
        0 0 0 2px rgba(99, 102, 241, 0.2),
        0 8px 32px rgba(99, 102, 241, 0.15),
        0 0 60px rgba(99, 102, 241, 0.08),
        inset 0 0 60px rgba(99, 102, 241, 0.02);
    transform: scale(1.005);
}

/* 函数表达式显示 - 增强版 */
.graph-info {
    margin-top: 20px;
    text-align: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: 14px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.graph-info::before {
    content: 'f(x)';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(99, 102, 241, 0.3);
    font-family: monospace;
}

.formula-display {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.formula-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.formula-value {
    color: #6366f1;
    font-family: 'Times New Roman', Georgia, serif;
    font-style: italic;
    font-size: 1.3em;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* 公式与图像联动提示 */
.formula-visual-hint {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(99, 102, 241, 0.2);
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    transition: all 0.3s ease;
}

.hint-item:hover {
    transform: translateY(-1px);
}

.hint-item.active {
    color: #4f46e5;
    font-weight: 600;
}

.hint-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.hint-text {
    white-space: nowrap;
}

/* Tab导航 */
.controls-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #4f46e5;
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    font-weight: 600;
}

.tab-btn i {
    width: 14px;
    height: 14px;
}

/* Tab内容区 */
.tab-content {
    position: relative;
    min-height: 280px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 极值探究面板优化 */
.extremum-intro {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    padding: 12px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}

.extremum-info {
    margin-top: 16px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 8px;
}

.extremum-info .info-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.extremum-info .info-item i {
    width: 14px;
    height: 14px;
    color: #f59e0b;
    flex-shrink: 0;
    margin-top: 1px;
}

/* 一次函数面板优化 */
.linear-intro {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    padding: 12px;
    background: rgba(234, 88, 12, 0.08);
    border-radius: 8px;
    border-left: 3px solid #ea580c;
}

/* 参数控制区 - 右侧精致面板 */
.controls-area {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 自定义滚动条 */
.controls-area::-webkit-scrollbar {
    width: 4px;
}

.controls-area::-webkit-scrollbar-track {
    background: transparent;
}

.controls-area::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}

.controls-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #06b6d4, #6366f1, #8b5cf6);
}

.controls-area h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: -20px;
    background: white;
    z-index: 1;
    padding-top: 4px;
}

.controls-area h4 .section-icon {
    width: 18px;
    height: 18px;
    color: #6366f1;
}

.controls-area h4::before {
    display: none;
}

/* 参数卡片 - 紧凑设计 */
.param-control {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.param-control:hover {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
    transform: translateX(2px);
}

.param-control:last-of-type {
    margin-bottom: 16px;
}

.param-control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.param-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.param-value {
    font-weight: 800;
    font-size: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 3px 12px;
    border-radius: 8px;
    min-width: 60px;
    text-align: center;
    position: relative;
}

.param-value::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 8px;
    z-index: -1;
}

/* 滑块样式优化 */
.param-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e2e8f0, #e2e8f0);
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.param-control input[type="range"]:hover {
    background: linear-gradient(90deg, #cbd5e1, #cbd5e1);
}

.param-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: grab;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4), 0 0 0 3px rgba(99, 102, 241, 0.1);
    border: 3px solid white;
    transition: all 0.2s ease;
}

.param-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow: 0 5px 16px rgba(99, 102, 241, 0.5), 0 0 0 5px rgba(99, 102, 241, 0.15);
}

.param-control input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Firefox滑块兼容 */
.param-control input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: grab;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
    border: 3px solid white;
}

/* 参数a - 紫色主题 */
.param-control[data-param="a"] .param-name {
    color: #7c3aed;
    font-weight: 700;
}
.param-control[data-param="a"] .param-value {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.param-control[data-param="a"] .param-value::after {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.10) 0%, rgba(109, 40, 217, 0.10) 100%);
}
.param-control[data-param="a"]:hover {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.10);
}
.param-control[data-param="a"] input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), rgba(124, 58, 237, 0.08)) !important;
}
.param-control[data-param="a"] .param-hint::before {
    color: #7c3aed;
}

/* 参数b - 青色主题 */
.param-control[data-param="b"] .param-name {
    color: #0891b2;
    font-weight: 700;
}
.param-control[data-param="b"] .param-value {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.param-control[data-param="b"] .param-value::after {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.10) 0%, rgba(8, 145, 178, 0.10) 100%);
}
.param-control[data-param="b"]:hover {
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.10);
}
.param-control[data-param="b"] input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.4), 0 0 0 3px rgba(6, 182, 212, 0.1);
}
.param-control[data-param="b"] input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 5px 16px rgba(6, 182, 212, 0.5), 0 0 0 5px rgba(6, 182, 212, 0.15);
}
.param-control[data-param="b"] input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.4);
}
.param-control[data-param="b"] input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(6, 182, 212, 0.08)) !important;
}
.param-control[data-param="b"] .param-hint::before {
    color: #0891b2;
}

/* 参数c - 橙色主题 */
.param-control[data-param="c"] .param-name {
    color: #ea580c;
    font-weight: 700;
}
.param-control[data-param="c"] .param-value {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.param-control[data-param="c"] .param-value::after {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.10) 0%, rgba(234, 88, 12, 0.10) 100%);
}
.param-control[data-param="c"]:hover {
    border-color: rgba(249, 115, 22, 0.25);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.10);
}
.param-control[data-param="c"] input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.4), 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.param-control[data-param="c"] input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 5px 16px rgba(249, 115, 22, 0.5), 0 0 0 5px rgba(249, 115, 22, 0.15);
}
.param-control[data-param="c"] input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.4);
}
.param-control[data-param="c"] input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.08)) !important;
}
.param-control[data-param="c"] .param-hint::before {
    color: #ea580c;
}

.param-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    line-height: 1.4;
}

.param-hint::before {
    content: '○';
    font-size: 10px;
    flex-shrink: 0;
    color: var(--primary-color);
}

/* ===== 一次函数对比面板 ===== */
.linear-comparison-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1.5px dashed rgba(249, 115, 22, 0.25);
    position: relative;
}

.linear-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0 8px;
}

.linear-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #ea580c;
}

.linear-toggle-label .section-icon {
    width: 16px;
    height: 16px;
    color: #ea580c;
}

/* 一次函数显示开关（在Tab面板内） */
.linear-display-toggle {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-radius: 10px;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #9a3412;
}

.toggle-text i {
    width: 14px;
    height: 14px;
    color: #f97316;
}

/* Toggle 开关 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.35);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* 一次函数参数面板 - 折叠动画 */
.linear-params-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                margin 0.3s ease;
    margin-top: 0;
}

.linear-params-panel.expanded {
    max-height: 320px;
    opacity: 1;
    margin-top: 8px;
}

/* 一次函数公式显示 */
.linear-formula-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.06) 0%, rgba(234, 88, 12, 0.04) 100%);
    border-radius: 10px;
    border: 1px solid rgba(249, 115, 22, 0.12);
    margin-bottom: 10px;
}

.linear-formula-label {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.linear-formula-value {
    font-size: 14px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #ea580c;
}

/* k 参数 = 粉红主题 */
.param-control[data-param="k"] .param-name {
    color: #db2777;
}

.param-control[data-param="k"] .param-value {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.param-control[data-param="k"]:hover {
    border-color: rgba(219, 39, 119, 0.25);
    box-shadow: 0 4px 16px rgba(219, 39, 119, 0.08);
}

.param-control[data-param="k"] input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.param-control[data-param="k"] input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px rgba(219, 39, 119, 0.15);
}

.param-control[data-param="k"] input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.param-control[data-param="k"] .param-hint::before {
    color: #db2777;
}

/* m 参数 = 绿色主题 */
.param-control[data-param="m"] .param-name {
    color: #16a34a;
}

.param-control[data-param="m"] .param-value {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.param-control[data-param="m"]:hover {
    border-color: rgba(22, 163, 74, 0.25);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.08);
}

.param-control[data-param="m"] input[type="range"]::-webkit-slider-thumb {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.param-control[data-param="m"] input[type="range"]::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.15);
}

.param-control[data-param="m"] input[type="range"]::-moz-range-thumb {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.param-control[data-param="m"] .param-hint::before {
    color: #16a34a;
}

/* 极值探究区域 */
.extremum-explore-section {
    padding: 0;
    background: transparent;
    border: none;
}

/* 在Tab面板中的极值探究不需要额外的标题 */
.extremum-explore-section h5 {
    display: none;
}

.extremum-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.btn-extremum {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: white;
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #92400e;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-extremum:hover {
    background: #f59e0b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-extremum:active {
    transform: translateY(0);
}

.btn-extremum i {
    width: 14px;
    height: 14px;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(99, 102, 241, 0.15);
}

.control-buttons .btn-secondary,
.control-buttons .btn-primary {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.control-buttons .btn-secondary i,
.control-buttons .btn-primary i {
    width: 16px;
    height: 16px;
}

.control-buttons .btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.control-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* 图像特征分析 - 底部卡片 */
.analysis-area {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
}

.analysis-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f97316, #eab308, #10b981);
    border-radius: 20px 20px 0 0;
}

.analysis-area h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.analysis-area h4 .section-icon {
    width: 20px;
    height: 20px;
    color: #f97316;
}

.analysis-area h4::before {
    display: none;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.feature-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 18px 16px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.15);
}

.feature-item:hover::before {
    opacity: 1;
}

.feature-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
    margin-bottom: 6px;
    opacity: 0.7;
    flex-shrink: 0;
}

.feature-item:hover .feature-icon {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.feature-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.feature-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', monospace;
}

.ai-analysis {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: 16px;
    padding: 24px;
    min-height: 120px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    position: relative;
}

.ai-analysis::before {
    content: '◇';
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 16px;
    opacity: 0.4;
    color: var(--primary-color);
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 80px;
}

.placeholder-text::before {
    content: '◎';
    font-size: 28px;
    color: var(--primary-color);
    animation: float 3s ease-in-out infinite;
}

/* AI分析结果弹窗 */
.ai-analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-analysis-modal.show {
    opacity: 1;
    visibility: visible;
}

.ai-analysis-modal-content {
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.ai-analysis-modal.show .ai-analysis-modal-content {
    transform: translateY(0) scale(1);
}

.ai-analysis-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 20px 20px 0 0;
}

.ai-analysis-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-analysis-modal-header h3 i {
    width: 20px;
    height: 20px;
}

.btn-close-analysis {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
}

.btn-close-analysis:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-close-analysis i {
    width: 18px;
    height: 18px;
}

.ai-analysis-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #334155;
}

.ai-analysis-modal-body p {
    margin-bottom: 12px;
}

.ai-analysis-modal-body strong {
    color: #6366f1;
}

.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    color: #64748b;
}

.loading-spinner-small {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   模块3: 学习路径
   ======================================== */
.pathway-container {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.knowledge-map {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--border-radius);
    padding: 28px;
    border: 1px solid var(--border-color);
}

.knowledge-map h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.knowledge-map h4::before {
    content: '◈';
    color: var(--primary-color);
}

.pathway-node {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--card-bg);
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
}

.pathway-node.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, var(--success-bg) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.pathway-node.completed::after {
    content: '✓';
    position: absolute;
    right: 16px;
    width: 24px;
    height: 24px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.pathway-node.current {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-bg) 0%, rgba(37, 99, 235, 0.05) 100%);
    box-shadow: var(--shadow-glow);
}

.pathway-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.pathway-node:hover:not(.locked) {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.node-icon {
    font-size: 28px;
}

.node-content h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.node-content p {
    font-size: 12px;
    color: var(--text-secondary);
}

.pathway-connector {
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, var(--border-color) 0%, transparent 100%);
    margin-left: 48px;
}

.pathway-node.completed + .pathway-connector {
    background: linear-gradient(180deg, var(--success-color) 0%, var(--border-color) 100%);
}

/* 当前课程 */
.current-lesson {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.lesson-header h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-header h4::before {
    content: '▶';
    color: var(--primary-color);
}

.lesson-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mini-progress {
    width: 80px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    overflow: hidden;
}

.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #7c3aed);
    border-radius: 4px;
}

.lesson-content {
    padding: 24px;
}

.lesson-intro {
    margin-bottom: 24px;
}

.lesson-intro h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.lesson-intro ul {
    margin-left: 20px;
}

.lesson-intro li {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

.lesson-intro li::marker {
    color: var(--primary-color);
}

.lesson-actions {
    display: flex;
    gap: 14px;
}

/* ========================================
   模块4: 智能出题 - 现代化设计
   ======================================== */
.quiz-container {
    padding: 24px;
    /* 使用纯淡入动画，避免布局偏移 */
    animation: quizFadeIn 0.3s ease;
}

@keyframes quizFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 测验设置卡片 */
.quiz-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 28px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    margin-bottom: 24px;
    align-items: flex-end;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.quiz-settings::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #f97316);
}

.setting-group {
    min-width: 180px;
    flex: 1;
}

.setting-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-group label::before {
    content: '›';
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
}

.setting-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.setting-group select:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.setting-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.difficulty-selector,
.number-selector {
    display: flex;
    gap: 10px;
}

.diff-btn,
.num-btn {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.diff-btn::before,
.num-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diff-btn:hover,
.num-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.diff-btn.active,
.num-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-generate {
    margin-left: auto;
    padding: 14px 28px !important;
    font-size: 15px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-generate::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.btn-generate:hover::after {
    transform: translateX(100%);
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(99, 102, 241, 0.45);
}

/* 题目区域 */
.quiz-area {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    min-height: 380px;
    padding: 32px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
}

.quiz-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 320px;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.quiz-placeholder p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.quiz-placeholder.error {
    height: auto;
    padding: 48px 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.02));
    border-radius: 16px;
}

.quiz-placeholder .error-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.quiz-placeholder .error-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.quiz-placeholder .retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-placeholder .retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* 出题加载动画 - 升级版 */
.quiz-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 40px 24px;
}

.quiz-loading-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 32px;
}

.quiz-loading-animation .loading-brain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    animation: brainPulse 1.5s ease-in-out infinite;
    z-index: 2;
}

/* Emoji版本加载动画 */
.quiz-loading-animation .loading-emoji-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.quiz-loading-animation .loading-emoji {
    display: block;
    font-size: 56px;
    animation: emojiPulse 1.5s ease-in-out infinite;
}

@keyframes emojiPulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
    }
    50% { 
        transform: scale(1.2);
        filter: drop-shadow(0 0 25px rgba(99, 102, 241, 0.7));
    }
}

.quiz-loading-animation .loading-particles-emoji {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: particlesRotate 10s linear infinite;
}

.quiz-loading-animation .loading-particles-emoji .particle {
    position: absolute;
    font-size: 24px;
    animation: particleFloat 2s ease-in-out infinite;
}

.quiz-loading-animation .loading-particles-emoji .particle:nth-child(1) {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.quiz-loading-animation .loading-particles-emoji .particle:nth-child(2) {
    top: 20%;
    right: -5px;
    animation-delay: 0.4s;
}

.quiz-loading-animation .loading-particles-emoji .particle:nth-child(3) {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.8s;
}

.quiz-loading-animation .loading-particles-emoji .particle:nth-child(4) {
    top: 20%;
    left: -5px;
    animation-delay: 1.2s;
}

.quiz-loading-animation .loading-particles-emoji .particle:nth-child(5) {
    bottom: 20%;
    right: 0;
    animation-delay: 1.6s;
}

@keyframes brainPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15);
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.6));
    }
}

.quiz-loading-animation .loading-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: particlesRotate 8s linear infinite;
}

.quiz-loading-animation .loading-particles span {
    position: absolute;
    font-size: 20px;
    opacity: 0.7;
    animation: particleFloat 2s ease-in-out infinite;
}

.quiz-loading-animation .loading-particles span:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.quiz-loading-animation .loading-particles span:nth-child(2) {
    top: 25%;
    right: 0;
    animation-delay: 0.4s;
}

.quiz-loading-animation .loading-particles span:nth-child(3) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.8s;
}

.quiz-loading-animation .loading-particles span:nth-child(4) {
    top: 25%;
    left: 0;
    animation-delay: 1.2s;
}

.quiz-loading-animation .loading-particles span:nth-child(5) {
    bottom: 25%;
    right: 10%;
    animation-delay: 1.6s;
}

@keyframes particlesRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes particleFloat {
    0%, 100% { 
        opacity: 0.5;
        transform: scale(0.9);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}

.quiz-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    min-height: 28px;
    transition: opacity 0.3s ease;
}

.quiz-loading-progress {
    width: 240px;
    height: 6px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}

.quiz-loading-progress .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background-size: 200% 100%;
    animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.quiz-loading-hint {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

/* 答题进度条 - 新增 */
.quiz-progress {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: 14px;
}

.quiz-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-text {
    font-size: 14px;
    font-weight: 700;
    color: #6366f1;
    min-width: 60px;
    text-align: right;
}

/* ========================================
   题目卡片与答题交互样式
   ======================================== */

/* 题目卡片 */
.question-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    animation: questionAppear 0.4s ease forwards;
    opacity: 0;
}

.question-card:nth-child(1) { animation-delay: 0s; }
.question-card:nth-child(2) { animation-delay: 0.1s; }
.question-card:nth-child(3) { animation-delay: 0.2s; }
.question-card:nth-child(4) { animation-delay: 0.3s; }
.question-card:nth-child(5) { animation-delay: 0.4s; }
.question-card:nth-child(6) { animation-delay: 0.5s; }
.question-card:nth-child(7) { animation-delay: 0.6s; }
.question-card:nth-child(8) { animation-delay: 0.7s; }
.question-card:nth-child(9) { animation-delay: 0.8s; }
.question-card:nth-child(10) { animation-delay: 0.9s; }

@keyframes questionAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card:hover {
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

/* 题目头部 */
.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.15);
}

.question-number {
    font-size: 14px;
    font-weight: 700;
    color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
    padding: 6px 14px;
    border-radius: 20px;
}

.question-difficulty {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}

.question-difficulty.easy {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
}

.question-difficulty.medium {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.question-difficulty.hard {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

/* 题目文本 */
.question-text {
    font-size: 16px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border-left: 4px solid #6366f1;
}

/* 选项区域 */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 选项项 */
.option-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.option-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.25s ease;
}

.option-item:hover {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.02) 100%);
    transform: translateX(4px);
}

.option-item:hover::before {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

/* 选项标签 (A, B, C, D) */
.option-label {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    font-weight: 700;
    font-size: 15px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

/* 选项文本 */
.option-text {
    flex: 1;
    font-size: 15px;
    color: #334155;
    line-height: 1.6;
}

/* 选中状态 */
.option-item.selected {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.option-item.selected::before {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

.option-item.selected .option-label {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 正确答案 */
.option-item.correct {
    border-color: #22c55e;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(74, 222, 128, 0.06) 100%);
    cursor: default;
}

.option-item.correct::before {
    background: linear-gradient(180deg, #22c55e, #4ade80);
}

.option-item.correct .option-label {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.option-item.correct::after {
    content: '✓';
    position: absolute;
    right: 20px;
    font-size: 20px;
    color: #22c55e;
    font-weight: 700;
}

/* 错误答案 */
.option-item.wrong {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.06) 100%);
    cursor: default;
}

.option-item.wrong::before {
    background: linear-gradient(180deg, #ef4444, #f87171);
}

.option-item.wrong .option-label {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.option-item.wrong::after {
    content: '✗';
    position: absolute;
    right: 20px;
    font-size: 20px;
    color: #ef4444;
    font-weight: 700;
}

/* 题目解析 */
.question-analysis {
    margin-top: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    animation: analysisAppear 0.4s ease;
}

@keyframes analysisAppear {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

.analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-content {
    font-size: 14px;
    color: #1e40af;
    line-height: 1.8;
}

/* 提交按钮区域 */
.quiz-submit-area {
    display: flex;
    justify-content: center;
    padding: 24px 0;
    margin-top: 16px;
}

.btn-submit-quiz {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 48px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-submit-quiz:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.45);
}

.btn-submit-quiz:active {
    transform: translateY(-1px);
}

/* 答题结果 - 现代化设计 */
.quiz-result {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    padding: 32px;
    margin-top: 24px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
    animation: scaleIn 0.5s ease;
    position: relative;
    overflow: hidden;
}

.quiz-result::before {
    content: '★';
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    opacity: 0.3;
    color: var(--primary-color);
}

.result-summary {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 2px dashed rgba(99, 102, 241, 0.15);
}

.result-score {
    text-align: center;
    position: relative;
}

.result-score::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.score-value {
    font-size: 64px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
    animation: countUp 0.8s ease;
}

.score-total {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 600;
}

.result-stats {
    display: flex;
    gap: 36px;
}

.stat-item {
    text-align: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    min-width: 90px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
}

.stat-value.correct {
    color: var(--success-color);
}

.stat-value.wrong {
    color: var(--danger-color);
}

.result-actions {
    display: flex;
    gap: 14px;
}

/* ========================================
   模块5: 智能批改
   ======================================== */
.grading-container {
    padding: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.grading-input {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.input-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-section textarea {
    width: 100%;
    padding: 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition-fast);
    background: var(--bg-color);
    line-height: 1.7;
}

.input-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.btn-grade {
    align-self: flex-start;
}

.grading-result {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--border-radius);
    padding: 28px;
    min-height: 450px;
    border: 1px solid var(--border-color);
}

.grading-result h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.grading-result h4::before {
    content: '◆';
    color: var(--primary-color);
}

.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: var(--text-muted);
}

.result-placeholder::before {
    content: '◉';
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
    color: var(--primary-color);
}

/* ========================================
   模块6: 错题本
   ======================================== */
.mistakes-container {
    padding: 32px;
}

.mistakes-header {
    margin-bottom: 28px;
}

.mistakes-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

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

/* 薄弱点分析 */
.weakness-analysis {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.weakness-analysis h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.weakness-analysis h4::before {
    content: '▲';
    color: var(--primary-color);
}

.weakness-chart {
    margin-bottom: 16px;
}

.weakness-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.weakness-name {
    width: 140px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.weakness-bar {
    flex: 1;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.weakness-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--warning-color), var(--danger-color));
    border-radius: 5px;
    transition: width 0.8s ease;
}

.weakness-percent {
    width: 50px;
    font-size: 14px;
    font-weight: 700;
    color: var(--danger-color);
    text-align: right;
}

/* 错题列表 */
.mistakes-list {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.mistakes-list h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mistakes-list h4::before {
    content: '▣';
    color: var(--error-color);
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   通用按钮样式
   ======================================== */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

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

.btn-danger {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* ========================================
   弹窗样式
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 28px;
}

.setting-item {
    margin-bottom: 24px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 14px;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition-fast);
    background: var(--bg-color);
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.setting-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================
   关于项目弹窗样式
   ======================================== */
.about-modal-content {
    max-width: 560px;
}

.about-body {
    padding: 0 !important;
}

.about-hero {
    background: var(--gradient-hero);
    padding: 32px 28px;
    text-align: center;
}

.about-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--teach-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.about-icon i {
    width: 36px;
    height: 36px;
    color: white;
    stroke-width: 1.5;
}

.about-hero h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-tagline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.about-section {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-color);
}

.about-section:last-child {
    border-bottom: none;
}

.about-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.about-section h4 i {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.about-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.about-features li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.about-features li::before {
    content: '›';
    position: absolute;
    left: 4px;
    color: var(--primary-color);
    font-weight: bold;
}

.about-features li strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

.tech-tag {
    padding: 6px 12px;
    background: var(--primary-bg);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-pill);
}

.about-footer {
    background: var(--bg-color);
    padding: 16px 28px;
    text-align: center;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.about-footer p {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.about-footer i {
    width: 14px;
    height: 14px;
    color: var(--warning-color);
}

/* AI 服务信息显示 */
.ai-provider-info {
    background: var(--bg-light);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 8px;
}

.provider-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.provider-status .provider-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.provider-status .provider-model {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.provider-status .status-badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
}

.provider-status.configured .status-badge {
    color: var(--success-color);
}

.provider-status.not-configured .status-badge {
    color: var(--warning-color);
}

.provider-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.provider-details p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.provider-details strong {
    color: var(--text-primary);
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 错题弹窗样式 */
.modal-mistake-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

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

.modal-mistake-header .mistake-num {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-mistake-header .mistake-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.modal-mistake-question {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.modal-mistake-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.modal-mistake-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.modal-mistake-option.correct {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.4);
}

.modal-mistake-option.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
}

.modal-mistake-option .opt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.modal-mistake-option.correct .opt-letter {
    background: #22c55e;
    color: white;
}

.modal-mistake-option.wrong .opt-letter {
    background: #ef4444;
    color: white;
}

.modal-mistake-option .opt-text {
    flex: 1;
    color: var(--text-secondary);
}

.modal-mistake-option .opt-mark {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #22c55e;
}

.modal-mistake-option .opt-mark.wrong {
    color: #ef4444;
}

.modal-mistake-answer {
    display: flex;
    gap: 20px;
    font-size: 13px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.modal-mistake-answer .user-ans {
    color: var(--text-secondary);
}

.modal-mistake-answer .user-ans.wrong {
    color: #ef4444;
    font-weight: 500;
}

.modal-mistake-answer .correct-ans {
    color: #22c55e;
    font-weight: 500;
}

.modal-mistake-analysis {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 12px 14px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

/* ========================================
   加载动画
   ======================================== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
    .explorer-main {
        grid-template-columns: 1fr;
    }
    
    .controls-area {
        order: -1;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --header-height: 60px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
        padding: 16px;
    }
    
    .header-subtitle {
        display: none;
    }
    
    .panel-header {
        padding: 20px;
    }
    
    .panel-header h2 {
        font-size: 22px;
    }
    
    .knowledge-container,
    .explorer-container,
    .quiz-container,
    .grading-container,
    .mistakes-container,
    .pathway-container {
        padding: 20px;
    }
    
    .topic-tags {
        gap: 8px;
    }
    
    .topic-tag {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .grading-container {
        grid-template-columns: 1fr;
    }
}
