/* ═══════════════════════════════════════════════════════════
   面向精准教学的错题归因与靶向变式智能生成系统 - 样式表
   设计风格: 教育科技感 + 深色主题 + 玻璃拟态
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────── */
:root {
    /* Primary palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Accent */
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.2);

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Surfaces */
    --bg-base: #0f1117;
    --bg-surface: #161822;
    --bg-elevated: #1e2030;
    --bg-card: rgba(30, 32, 48, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Text */
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3b8;
    --text-muted: #64708a;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-active: rgba(99, 102, 241, 0.4);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    --grad-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --grad-cool: linear-gradient(135deg, #06b6d4, #3b82f6);
    --grad-surface: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, transparent 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
    --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px var(--primary-glow);

    /* Sizing */
    --header-h: 68px;
    --max-w: 1280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ── Background Particles ─────────────────────── */
.bg-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(800px circle at 30% 20%, rgba(99,102,241,0.08), transparent 60%),
        radial-gradient(600px circle at 70% 60%, rgba(6,182,212,0.06), transparent 60%),
        radial-gradient(400px circle at 50% 80%, rgba(139,92,246,0.05), transparent 60%);
    animation: bgDrift 30s ease-in-out infinite alternate;
}

@keyframes bgDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-3%, 2%) rotate(1deg); }
    100% { transform: translate(2%, -1%) rotate(-1deg); }
}

/* ── Header ───────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 1000;
    background: rgba(15, 17, 23, 0.8);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(15, 17, 23, 0.95);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 36px;
    height: 36px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 15px;
    font-weight: 700;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link.active {
    color: var(--primary-light);
    background: var(--primary-glow);
}

.nav-icon {
    font-size: 16px;
}

.header-actions {
    flex-shrink: 0;
}

.llm-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.error {
    background: var(--danger);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Hero Section ─────────────────────────────── */
.hero-section {
    position: relative;
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-h) + 60px) 32px 80px;
    max-width: var(--max-w);
    margin: 0 auto;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 640px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 24px;
    background: var(--primary-glow);
    border: 1px solid rgba(99,102,241,0.3);
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-title {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-alt {
    background: linear-gradient(135deg, #06b6d4, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-desc strong {
    color: var(--text-primary);
    font-weight: 600;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.feature-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.feature-badge:hover {
    border-color: var(--border-active);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 18px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-visual {
    position: relative;
    width: 340px;
    height: 360px;
    flex-shrink: 0;
    animation: fadeInRight 0.8s ease 0.3s both;
}

.hero-card {
    position: absolute;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.hero-card:hover {
    transform: translateY(-4px) scale(1.02);
}

.card-float-1 {
    top: 0;
    left: 0;
    width: 180px;
    animation: cardFloat 6s ease-in-out infinite;
}

.card-float-2 {
    top: 40px;
    right: 0;
    width: 180px;
    animation: cardFloat 6s ease-in-out infinite 2s;
}

.card-float-3 {
    bottom: 0;
    left: 60px;
    width: 200px;
    animation: cardFloat 6s ease-in-out infinite 4s;
}

.mini-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 80px;
}

.mini-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px var(--primary-glow));
}

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

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

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(32px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--primary-glow);
    filter: brightness(1.1);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-glass);
}

.btn-lg {
    padding: 14px 30px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Content Section ──────────────────────────── */
.main-content {
    position: relative;
    z-index: 1;
}

.content-section {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 80px 32px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.step-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: var(--primary-glow);
    border: 1px solid rgba(99,102,241,0.3);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

/* ── Upload Area ──────────────────────────────── */
.upload-area {
    max-width: 800px;
    margin: 0 auto;
}

.upload-zone {
    position: relative;
    padding: 60px 40px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.03);
    box-shadow: var(--shadow-glow);
}

.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(6,182,212,0.05);
    transform: scale(1.01);
}

.upload-icon {
    margin-bottom: 20px;
}

.upload-icon svg {
    width: 56px;
    height: 56px;
}

.upload-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.upload-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    text-align: left;
}

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

.meta-item strong {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}

.meta-item p {
    font-size: 11px;
    color: var(--text-muted);
}

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

.param-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.param-group {
    flex: 1;
}

.param-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.param-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239ca3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.param-select:focus {
    outline: none;
    border-color: var(--primary);
}

.param-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ── Upload Progress ──────────────────────────── */
.upload-progress {
    max-width: 800px;
    margin: 20px auto 0;
    text-align: center;
}

.progress-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-elevated);
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: var(--grad-primary);
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Analysis Results ─────────────────────────── */
.analysis-results {
    animation: fadeInUp 0.5s ease;
}

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

.results-header h3 {
    font-size: 22px;
    font-weight: 700;
}

.results-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.format-tag {
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--accent-glow);
    border: 1px solid rgba(6,182,212,0.3);
    font-size: 12px;
    color: var(--accent-light);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.danger {
    background: var(--grad-warm);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-extra {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Chart Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.chart-card:hover {
    border-color: var(--border-hover);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chart-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.chart-body {
    position: relative;
    max-height: 360px;
}

.chart-body canvas {
    width: 100% !important;
}

/* Detail Table */
.detail-table-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.data-table tr:hover td {
    background: var(--bg-glass);
}

.severity-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.severity-high {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

.severity-medium {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

.severity-low {
    background: rgba(16,185,129,0.15);
    color: #34d399;
}

.rate-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-elevated);
    overflow: hidden;
    max-width: 120px;
}

.rate-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.rate-bar-fill.danger {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.rate-bar-fill.good {
    background: linear-gradient(90deg, #10b981, #06b6d4);
}

/* Action Banner */
.action-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.05));
    border: 1px solid rgba(99,102,241,0.2);
    gap: 24px;
}

.action-text h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

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

/* ── Diagnosis Results ────────────────────────── */
.diagnosis-results {
    max-width: 900px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* AI Loading */
.ai-loading {
    text-align: center;
    padding: 80px 20px;
}

.ai-loading-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 28px;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring.delay-1 { animation-delay: 0.6s; }
.pulse-ring.delay-2 { animation-delay: 1.2s; }

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.ai-brain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    animation: brainBounce 1.5s ease-in-out infinite;
}

@keyframes brainBounce {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -55%) scale(1.1); }
}

.ai-loading h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-loading p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Overall Card */
.overall-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.04));
    border: 1px solid rgba(99,102,241,0.2);
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease;
}

.overall-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.overall-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* Diagnosis List */
.diagnosis-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.diagnosis-item {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
    transition: border-color 0.3s;
}

.diagnosis-item:hover {
    border-color: var(--border-hover);
}

.diagnosis-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.diagnosis-item-header h5 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.diagnosis-causes {
    margin-bottom: 14px;
}

.diagnosis-causes h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.cause-tag {
    padding: 5px 14px;
    border-radius: 16px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
    font-size: 13px;
    font-weight: 500;
}

.cause-detail {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    border-left: 3px solid var(--primary);
}

/* Strategy Card */
.strategy-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
}

.strategy-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.strategy-item {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.strategy-item h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.strategy-item p,
.strategy-item ul {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.strategy-item li {
    margin-left: 16px;
    margin-bottom: 4px;
}

/* ── Generate Section ─────────────────────────── */
.generate-config {
    max-width: 900px;
    margin: 0 auto 32px;
}

.config-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.config-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.kp-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kp-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.kp-chip:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.kp-chip.selected {
    border-color: var(--primary);
    background: var(--primary-glow);
    color: var(--primary-light);
}

.kp-chip .error-rate {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
}

.kp-chip .error-rate.high {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}

.kp-chip .error-rate.medium {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

.kp-chip .error-rate.low {
    background: rgba(16,185,129,0.15);
    color: #34d399;
}

.config-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.config-item {
    flex: 1;
}

.config-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-hint {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
    text-align: center;
    width: 100%;
}

/* Generated Questions */
.generate-results {
    max-width: 900px;
    margin: 0 auto;
}

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

.question-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
    transition: border-color 0.3s;
}

.question-card:hover {
    border-color: var(--border-hover);
}

.generation-shell {
    padding: 30px;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.preview-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.24);
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

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

.stream-loading {
    color: var(--primary-light);
    animation: pulse 1.5s infinite;
}

.export-preview {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.95;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    word-break: break-word;
}

.export-preview h1,
.export-preview h2,
.export-preview h3 {
    color: #f8fafc;
}

.export-preview h1 {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    font-size: 28px;
    letter-spacing: 0.4px;
}

.export-preview h2 {
    margin: 24px 0 14px;
    padding-left: 14px;
    border-left: 4px solid rgba(96, 165, 250, 0.9);
    font-size: 22px;
}

.export-preview h3 {
    margin: 18px 0 10px;
    font-size: 18px;
}

.export-preview p,
.export-preview li {
    margin-bottom: 12px;
}

.export-preview strong {
    color: #ffffff;
}

.export-preview ul,
.export-preview ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.export-preview blockquote {
    margin: 14px 0;
    padding: 12px 16px;
    border-left: 4px solid rgba(96, 165, 250, 0.7);
    background: rgba(15, 23, 42, 0.45);
    color: #cbd5e1;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.export-preview img {
    display: block;
    max-width: 100%;
    margin: 16px auto;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: #ffffff;
}

.export-preview .geometry-reminder {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(250, 204, 21, 0.08);
    color: #fde68a;
}

.export-preview .doc-meta {
    color: #cbd5e1;
    font-size: 14px;
}

.export-preview .doc-question-title {
    margin: 18px 0 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(14, 165, 233, 0.08));
    border-left: 4px solid #60a5fa;
    font-weight: 700;
}

.export-preview .doc-section-label {
    margin-top: 12px;
    font-weight: 700;
    color: #f8fafc;
}

.export-preview .doc-key-point {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
}

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

.question-number {
    display: flex;
    align-items: center;
    gap: 10px;
}

.q-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
}

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

.difficulty-stars {
    font-size: 16px;
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.question-body {
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.9;
}

.question-section {
    margin-top: 14px;
}

.question-section summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    padding: 8px 0;
    user-select: none;
}

.question-section summary:hover {
    color: var(--primary);
}

.section-content {
    margin-top: 10px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.key-point-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.2);
    color: var(--accent-light);
    font-size: 12px;
    margin-top: 10px;
}

.mistake-warn {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(245,158,11,0.08);
    border-left: 3px solid var(--warning);
    font-size: 12px;
    color: var(--warning);
}

.teaching-tips {
    margin-top: 24px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(6,182,212,0.03));
    border: 1px solid rgba(99,102,241,0.15);
}

.teaching-tips h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.teaching-tips p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ── About Section ────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.about-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.about-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
}

.about-icon {
    font-size: 40px;
    margin-bottom: 16px;
}

.about-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

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

.ai-disclaimer {
    text-align: center;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.15);
    font-size: 12px;
    color: var(--warning);
}

/* ── Footer ───────────────────────────────────── */
.footer {
    text-align: center;
    padding: 40px 32px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-sub {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ═══════════════ 模型设置模态框样式 ═══════════════ */
.settings-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-right: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.settings-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #ffffff;
    width: 480px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    background: #f8fafc;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0; font-size: 16px; color: #1e293b;
}
.close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}
.close-modal:hover { color: #0f172a; }
.modal-body {
    padding: 24px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    text-align: left;
}
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    transition: all 0.2s;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-helper {
    font-size: 12px;
    color: #64748b;
    margin-top: 5px;
    text-align: left;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 900px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding-bottom: 40px;
    }
    
    .hero-visual {
        width: 280px;
        height: 300px;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-features {
        justify-content: center;
    }
    
    .nav-links {
        display: none;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-meta {
        flex-direction: column;
    }
    
    .param-row,
    .config-row {
        flex-direction: column;
    }
    
    .action-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .content-section {
        padding: 40px 16px;
    }
    
    .header-inner {
        padding: 0 16px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .hero-visual {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
