/* ===== Python AI辅助教学平台yys — 清新教育风主样式 ===== */

/* === 基础重置 === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* 品牌色 */
    --primary: #2563eb;
    --primary-hover: #3b82f6;
    --primary-soft: #dbeafe;
    --primary-dark: #1d4ed8;

    /* 辅助色 */
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --info: #06b6d4;
    --info-soft: #cffafe;
    --purple: #8b5cf6;
    --purple-soft: #ede9fe;
    --orange: #f97316;
    --orange-soft: #ffedd5;

    /* 文字 */
    --text: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* 背景 */
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --bg-elevated: #ffffff;
    --card-bg: #ffffff;

    /* 边框 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* 圆角 */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 6px 12px -2px rgba(15, 23, 42, 0.06), 0 3px 6px -3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-colored: 0 10px 25px -5px rgba(37, 99, 235, 0.2);

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;

    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(circle at 10% 0%, rgba(37, 99, 235, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 90% 0%, rgba(16, 185, 129, 0.03) 0%, transparent 30%);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button, a { transition: all 0.2s ease; }

/* === 动画关键帧 === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-soft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }
.animate-slide-down { animation: slideDown 0.35s ease-out forwards; }

/* === 导航栏 === */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}
/* 学生端/教师端导航：浅蓝渐变底色 */
body.student-page .navbar,
body.teacher-page .navbar {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 45%, #eff6ff 100%);
    border-bottom: 1px solid rgba(147, 197, 253, 0.65);
}
/* 学生端/教师端导航字体放大 */
body.student-page .nav-link,
body.teacher-page .nav-link { font-size: 15.5px; padding: 8px 11px; }
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    gap: var(--space-3);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-brand .brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.nav-brand .brand-text {
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -0.2px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.nav-link:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.nav-link.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    font-weight: 700;
}
.nav-link .ico { margin-right: 0; }
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
    padding-left: var(--space-2);
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}
.user-info {
    font-size: 15px;
    color: var(--text);
    font-weight: 700;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.user-info small {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.user-menu { position: relative; }
.nav-avatar,
.nav-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.nav-avatar {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
.user-info-btn {
    display: flex; align-items: center; gap: 8px;
    background: transparent; border: none; cursor: pointer;
    padding: 4px 8px; font: inherit;
    border-radius: var(--radius-sm);
    transition: background .2s;
}
.user-info-btn:hover { background: var(--bg-soft); }
.user-dropdown {
    display: none;
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 140px;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: 1100;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.user-dropdown-item:hover { background: var(--bg-soft); }
.user-dropdown-item.logout { color: var(--danger) !important; }
.user-dropdown-item.logout:hover { background: var(--danger-soft) !important; }
.logout {
    color: var(--danger) !important;
}
.logout:hover {
    background: var(--danger-soft) !important;
}
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--bg-soft);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Flash 消息 === */
.flash-container {
    position: fixed;
    top: 80px;
    right: var(--space-5);
    z-index: 1100;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    pointer-events: none;
}
.flash-message {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.35s ease-out, fadeIn 0.35s ease-out;
    pointer-events: auto;
    border-left: 4px solid transparent;
    backdrop-filter: blur(8px);
}
.flash-message span { flex: 1; line-height: 1.5; }
.flash-success { background: rgba(255, 255, 255, 0.95); border-color: var(--success); color: #047857; }
.flash-danger { background: rgba(255, 255, 255, 0.95); border-color: var(--danger); color: #b91c1c; }
.flash-warning { background: rgba(255, 255, 255, 0.95); border-color: var(--warning); color: #b45309; }
.flash-info { background: rgba(255, 255, 255, 0.95); border-color: var(--info); color: #0e7490; }
.flash-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: inherit; opacity: 0.5;
    line-height: 1; padding: 0;
    margin: -2px -4px 0 0;
}
.flash-close:hover { opacity: 1; }

/* === 主内容 === */
/* 全站宽度与内容管理页(/teacher/manage/*)保持一致：min(1400px, 95vw) */
.main-content {
    max-width: min(1400px, 95vw);
    margin: 28px auto;
    padding: 76px var(--space-5) 0;
    min-height: calc(100vh - 180px);
    animation: fadeInUp 0.4s ease-out;
}

/* === 页脚 === */
.footer {
    text-align: center;
    padding: var(--space-6) var(--space-5);
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    margin-top: var(--space-8);
}
.footer p { margin-bottom: var(--space-2); }
.footer .footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
}
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--primary); }

/* === 学习路线 === */
.learning-paths-page .lp-hero {
    background: linear-gradient(135deg, var(--primary-soft) 0%, rgba(6, 182, 212, 0.08) 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.08);
}
.learning-paths-page .lp-hero::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}
.learning-paths-page .lp-hero h1 {
    font-size: 28px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}
.learning-paths-page .lp-hero p {
    color: var(--text-secondary);
    font-size: 15px;
    max-width: 600px;
    margin: 0;
    position: relative;
    z-index: 1;
}

.lp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.lp-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 26px;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}
.lp-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.lp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #06b6d4 100%);
}
.lp-card.completed::before {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.lp-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.lp-card.completed .lp-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.lp-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.lp-desc {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

.lp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.lp-meta span {
    background: var(--bg-soft);
    padding: 5px 10px;
    border-radius: 20px;
}

.lp-progress-bar {
    height: 8px;
    background: var(--bg-soft);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.lp-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #06b6d4 100%);
    transition: width 0.6s ease;
}
.lp-card.completed .lp-progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}
.lp-progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}
.lp-btn {
    width: 100%;
    margin-top: auto;
}

.lp-section-title {
    margin: 32px 0 18px;
}
.lp-section-title h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.lp-section-title p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.lp-card-personalized::before {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}
.lp-card-personalized .lp-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.lp-resource-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.lp-chip {
    font-size: 12px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
}

.lp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.lp-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-soft);
    color: var(--text-secondary);
}
.lp-tag.weak {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.lp-wrong-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* === 学习路线详情页 === */
.learning-path-detail .lp-progress-large {
    margin: 20px 0 28px;
}
.learning-path-detail .lp-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.learning-path-detail .lp-progress-bar {
    height: 12px;
    background: var(--bg-soft);
    border-radius: 6px;
    overflow: hidden;
}
.learning-path-detail .lp-progress-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, #06b6d4 100%);
}

.lp-timeline {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
}
.lp-timeline-item {
    display: flex;
    gap: 16px;
    padding: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-left: 4px solid #dee2e6;
    opacity: 0.9;
}
.lp-timeline-item.completed {
    border-left-color: #10b981;
    opacity: 0.85;
}
.lp-timeline-item.current {
    border-left-color: var(--primary);
    opacity: 1;
    box-shadow: var(--shadow-md);
}
.lp-timeline-badge {
    min-width: 64px;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lp-badge-check {
    font-size: 12px;
    color: #10b981;
}
.lp-timeline-body {
    flex: 1;
}
.lp-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.lp-timeline-header strong {
    font-size: 16px;
    color: var(--text);
}
.lp-time {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-soft);
    padding: 3px 8px;
    border-radius: 12px;
}
.lp-timeline-content {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 6px 0 12px;
}

.lp-resources {
    margin: 14px 0;
    padding: 14px;
    background: var(--bg-soft);
    border-radius: var(--radius);
}
.lp-resources-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.lp-resource-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-light);
    flex-wrap: wrap;
}
.lp-resource-item:last-child {
    border-bottom: none;
}
.lp-resource-icon {
    font-size: 16px;
    line-height: 1.4;
}
.lp-resource-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.lp-resource-link:hover {
    text-decoration: underline;
}
.lp-resource-sublist {
    width: 100%;
    padding-left: 26px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.lp-resource-sub {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
}
.lp-resource-sub:hover {
    color: var(--primary);
}
.lp-complete-btn {
    margin-top: 12px;
}

.lp-recommendations {
    margin-top: 28px;
    padding: 22px;
}
.lp-recommendations h3 {
    margin-bottom: 16px;
    font-size: 18px;
}
.lp-rec-section {
    margin-bottom: 18px;
}
.lp-rec-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.lp-rec-section ul {
    margin: 0;
    padding-left: 20px;
}
.lp-rec-section li {
    margin-bottom: 6px;
    font-size: 14px;
}

.lp-weak-tags {
    margin: 12px 0;
}

/* === 知识文章编辑 / 创建 === */
.knowledge-edit-container { max-width: 900px; margin: 0 auto; }
.knowledge-edit-container h1 { margin-bottom: 20px; }

.ke-section {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.ke-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ke-section h2 .btn { font-size: 13px; padding: 6px 12px; }

.ke-card {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    position: relative;
}
.ke-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ke-remove:hover { background: #fecaca; }

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.5;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.btn-light-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(147, 197, 253, 0.35);
}
.btn-light-blue:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #60a5fa 100%);
    color: #1e3a8a;
    box-shadow: 0 6px 16px rgba(147, 197, 253, 0.45);
    transform: translateY(-1px);
}
.btn-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}
.btn-info:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
}
/* 知识库操作按钮：教师端/管理端统一样式、紧凑尺寸，文字与表格一致 */
.kb-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    line-height: 20px;
    border-radius: 6px;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
}
.kb-act.edit { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.kb-act.edit:hover { background: #dbeafe; }
.kb-act.preview { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.kb-act.preview:hover { background: #f1f5f9; }
.kb-act.del { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.kb-act.del:hover { background: #fee2e2; }
.kb-act.design { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.kb-act.design:hover { background: #ede9fe; }
.kb-act.off { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.kb-act.off:hover { background: #fef3c7; }
.kb-act.on { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.kb-act.on:hover { background: #d1fae5; }
.btn-outline {
    background: var(--card-bg);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-warning {
    background: var(--warning);
    color: #fff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }
.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-block { display: block; width: 100%; }
.btn-icon-only { padding: 8px; }

/* === 表单 === */
.form { max-width: 100%; }
.form-group { margin-bottom: var(--space-4); }
.form-group label, .form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.form-input, .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    line-height: 1.5;
    transition: all 0.2s ease;
}
.form-input:hover, .form-control:hover { border-color: #cbd5e1; }
.form-input:focus, .form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-input::placeholder, .form-control::placeholder { color: var(--text-muted); }
select.form-control, .form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: 6px 0;
}
.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}
.form-check-label {
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}
.form-row { display: flex; gap: var(--space-4); }
.form-row .form-group { flex: 1; }
.code-area {
    font-family: var(--font-mono);
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
}
.form-container { max-width: 800px; }

/* === 统计卡片 === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin: var(--space-5) 0;
}
.stat-card {
    background: var(--card-bg);
    padding: var(--space-5);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}
.stat-card.success::before { background: linear-gradient(90deg, var(--success), #34d399); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info), #22d3ee); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #a78bfa); }
.stat-number { font-size: 34px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.stat-icon {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--primary-soft);
}

/* === 卡片 === */
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-4); }
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all 0.25s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-body { padding: var(--space-5); flex: 1; }
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-2);
    line-height: 1.4;
}
.card h3 { font-size: 16px; margin-bottom: var(--space-2); font-weight: 700; }
.card p { font-size: 14px; color: var(--text-secondary); margin-bottom: var(--space-2); line-height: 1.6; }

/* 变更日志页(后台) */
.changelog-card { transform: none; }
.changelog-card:hover { transform: none; }
.changelog-content { font-size: 14px; line-height: 1.7; color: var(--text); }
.changelog-content h1 { font-size: 22px; margin: 0 0 var(--space-3); }
.changelog-content h2 { font-size: 17px; margin: var(--space-5) 0 var(--space-2); padding-bottom: var(--space-1); border-bottom: 1px solid var(--border); }
.changelog-content h3 { font-size: 15px; margin: var(--space-3) 0 var(--space-1); }
.changelog-content ul { margin: var(--space-1) 0 var(--space-3) 20px; list-style: disc; }
.changelog-content li { margin-bottom: var(--space-1); }
.changelog-content li > ul { margin-bottom: 0; }
.changelog-content p { margin-bottom: var(--space-2); }
.changelog-content code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.changelog-content blockquote { border-left: 3px solid var(--primary); padding-left: var(--space-3); color: var(--text-secondary); margin: var(--space-3) 0; }
.changelog-content hr { border: none; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
.changelog-content a { color: var(--primary); }
.card-actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); flex-wrap: wrap; }
.card-footer {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-soft);
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: var(--space-3);
}
.card-icon.blue { background: var(--primary-soft); }
.card-icon.green { background: var(--success-soft); }
.card-icon.orange { background: var(--orange-soft); }
.card-icon.purple { background: var(--purple-soft); }
.card-icon.cyan { background: var(--info-soft); }

/* === 徽章 === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-correct { background: var(--success-soft); color: #047857; }
.badge-incorrect, .badge-error, .badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-partial, .badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-pending, .badge-info { background: var(--info-soft); color: #0e7490; }
.badge-timeout { background: var(--orange-soft); color: #c2410c; }
.badge-overdue, .badge-late { background: #fee2e2; color: #991b1b; }
.badge-outline { background: #fff; color: var(--text-secondary); border: 1px solid var(--border); }

/* === 层级徽章 === */
.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.tier-beginner { background: var(--primary-soft); color: var(--primary-dark); }
.tier-basic { background: var(--warning-soft); color: #b45309; }
.tier-advanced { background: var(--danger-soft); color: #b91c1c; }

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--bg-soft);
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* === 筛选器 === */
.filter-bar { margin: var(--space-4) 0; }
.filter-group { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; }
.filter-group label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-weight: 500; }
.filter-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    font-weight: 500;
}
.filter-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.filter-tag:hover:not(.active) { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }

/* === 题目网格 === */
.question-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-4);
}
.question-card {
    position: relative;
    flex: 1 1 300px;
    min-width: 300px;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: var(--space-4);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: hidden;
}
.question-card > a[data-practice-btn] { margin-top: auto; }
.question-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-soft); }
.question-card.completed {
    border-left: 4px solid var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, var(--card-bg) 60%);
}
.question-card.failed { border-left: 4px solid var(--danger); }

/* 已通过/未通过状态角标 - 文字45度倾斜并严格居中 */
.qc-status-corner {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
    background: var(--success);
    pointer-events: none;
    z-index: 2;
}
.qc-status-corner .corner-text {
    position: absolute;
    top: 14px;
    right: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    transform: rotate(45deg);
    transform-origin: center center;
    white-space: nowrap;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.question-card.failed .qc-status-corner {
    background: var(--danger);
}

/* 理论题库题目卡片 */
.question-card .card-title {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 16px;
    font-weight: 700;
}

.question-card .options-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 16px 0;
}

.question-card .option-item {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
}

.question-card .option-item:hover {
    background: var(--bg-soft);
}

.question-card .option-item input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.question-card .option-label {
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1.5;
}

.question-card .option-text {
    font-size: 16px;
    line-height: 1.5;
}
.qc-header { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); flex-wrap: wrap; align-items: center; }
.qc-title { font-size: 16px; margin-bottom: var(--space-2); font-weight: 700; }
.qc-title a { color: var(--text); text-decoration: none; }
.qc-title a:hover { color: var(--primary); }
.qc-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: var(--space-3); line-height: 1.6; }
.qc-footer { display: flex; gap: var(--space-3); font-size: 12px; color: var(--text-secondary); margin-bottom: var(--space-3); }

/* === 进度条 === */
.progress-section { margin: var(--space-4) 0; }
.progress-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; font-weight: 500; }
.progress-bar { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-light); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-hover)); border-radius: 4px; transition: width 0.6s ease; }
.progress-fill.success { background: linear-gradient(90deg, var(--success), #34d399); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* === 技能条 === */
.skill-bars { margin-top: var(--space-3); }
.skill-bar-item { margin-bottom: var(--space-3); }
.skill-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; font-weight: 500; }
.skill-bar-track { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-light); }
.skill-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.skill-bar-fill.success { background: linear-gradient(90deg, var(--success), #34d399); }
.skill-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.skill-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* === 表格 === */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th {
    background: var(--bg-soft);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table th:first-child { border-top-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); }
.table tr { transition: background 0.15s ease; }
.table tr:hover { background: rgba(241, 245, 249, 0.7); }
.table-responsive { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.table-responsive .table { border: none; }
.table-responsive .table th:first-child, .table-responsive .table th:last-child { border-radius: 0; }

/* === 认证页面 === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background:
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.06) 0%, transparent 35%);
}
.auth-container { width: 100%; max-width: 440px; }
.auth-card {
    background: var(--card-bg);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}
.auth-header { text-align: center; margin-bottom: var(--space-6); }
.auth-header .auth-brand {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto var(--space-4);
    box-shadow: var(--shadow-colored);
}
.auth-header h1 {
    font-size: 24px;
    color: var(--primary-dark);
    font-weight: 800;
    letter-spacing: -0.2px;
    margin-bottom: var(--space-4);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.auth-header h2 { font-size: 16px; color: var(--text-secondary); font-weight: 500; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: var(--space-2); }
.auth-form .form-input { padding: 12px 16px; }
.auth-form .form-group { margin-bottom: var(--space-4); }
.role-select { display: flex; gap: var(--space-3); }
.role-option {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-soft, #f8fafc);
    border: 2px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s ease;
}
.role-option:hover { border-color: var(--primary); color: var(--primary); }
.role-option.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--shadow-colored, none);
}
#teacher-fields .auth-hint { margin-top: var(--space-2); padding: 8px 12px; }
.username-hint { margin-top: var(--space-2); font-size: 13px; font-weight: 500; }
.username-ok { color: #16a34a; }
.username-bad { color: #dc2626; }
.auth-footer { text-align: center; margin-top: var(--space-5); font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer-sep { margin: 0 10px; color: var(--text-secondary); }
.auth-footer-admin { margin-top: 6px; font-size: 13px; color: #94a3b8; }
.auth-hint { margin-top: var(--space-3); font-size: 13px; color: var(--warning); background: var(--warning-soft); padding: 10px 14px; border-radius: var(--radius-sm); }
.setup-card { max-width: 540px; }
.setup-info { margin: var(--space-4) 0; }
.setup-info ol { margin-left: 20px; }
.setup-info li { margin-bottom: var(--space-2); color: var(--text-secondary); }
.credential-box { background: var(--success-soft); border: 1px solid #86efac; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin: var(--space-2) 0; color: #047857; }
.warning-text { color: var(--warning); font-size: 13px; margin-top: var(--space-2); }

/* === 页面标题与 Hero === */
.page-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-6); }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.3px; }
.page-header p { color: var(--text-secondary); font-size: 15px; }
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    color: #fff;
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-colored);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.hero h1 { font-size: 28px; font-weight: 800; margin-bottom: var(--space-2); position: relative; }
.hero p { font-size: 16px; opacity: 0.92; position: relative; }
.hero .hero-stats {
    display: flex;
    gap: var(--space-6);
    margin-top: var(--space-5);
    position: relative;
}
.hero .hero-stat { text-align: center; }
.hero .hero-stat .num { font-size: 28px; font-weight: 800; }
.hero .hero-stat .label { font-size: 13px; opacity: 0.85; }
.hero-sm {
    background: linear-gradient(135deg, var(--primary-soft) 0%, #cffafe 100%);
    color: var(--text);
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius);
    margin-bottom: var(--space-5);
    border: 1px solid var(--border);
}
.hero-sm h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; color: var(--primary-dark); }
.hero-sm p { color: var(--text-secondary); }

/* === 工具类 === */
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; font-weight: 700; }
.font-bold { font-weight: 700; }
.section { margin: var(--space-6) 0; }
.section h2 { font-size: 18px; margin-bottom: var(--space-4); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: var(--space-2); }
.quick-actions { display: flex; gap: var(--space-3); margin: var(--space-5) 0; flex-wrap: wrap; }
.empty-state { text-align: center; padding: var(--space-10) var(--space-5); color: var(--text-secondary); background: var(--card-bg); border-radius: var(--radius); border: 2px dashed var(--border); }
.empty-state p { margin-bottom: var(--space-4); font-size: 16px; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: var(--space-4); opacity: 0.6; }
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-2); margin: var(--space-6) 0; }
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.pagination a { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-secondary); }
.pagination a:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.pagination .current { background: var(--primary); color: #fff; font-weight: 600; }
.page-info { font-size: 14px; color: var(--text-secondary); }

/* === 网格系统 === */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row > [class*="col-"] { padding: 0 8px; }
.g-3 { gap: 16px 0; }
.col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; }
.col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-md-9 { flex: 0 0 75%; max-width: 75%; }
.col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* === 间距工具类 === */
.p-4 { padding: 24px; }
.pt-3 { padding-top: 16px; }
.pb-3 { padding-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.w-100 { width: 100%; }

/* === 实操题库管理专用样式 === */
.action-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.action-cell .btn { white-space: nowrap; flex-shrink: 0; }
.inline-form { display: inline-flex; margin: 0; }
.table-card .table td:last-child,
.table-card .table th:last-child { white-space: nowrap; }
.page-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.page-header-bar h1 { font-size: 26px; margin: 0; font-weight: 800; }
.action-bar { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.filter-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}
.filter-card .row { align-items: flex-end; }
.filter-card .form-group { margin-bottom: 0; }
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.table-card .table { margin: 0; }
.table-card .table th { background: var(--bg-soft); font-weight: 700; }
.table-card .table td, .table-card .table th { padding: 14px 18px; }
.import-card {
    background: linear-gradient(135deg, var(--success-soft) 0%, #ffffff 100%);
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}
.import-card h2 { font-size: 16px; margin-bottom: 4px; color: #047857; font-weight: 700; }
.import-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-2); }
.import-result {
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}
.import-result h3 { font-size: 15px; color: #b91c1c; margin-bottom: var(--space-3); font-weight: 700; }
.failure-list { display: flex; flex-direction: column; gap: var(--space-2); }
.failure-item {
    display: grid;
    grid-template-columns: 80px 1fr 1.5fr;
    gap: var(--space-3);
    align-items: center;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.failure-row { color: var(--text-muted); }
.failure-title { font-weight: 600; color: var(--text); }
.failure-reason { color: var(--danger); }

.info-box {
    background: var(--info-soft);
    border: 1px solid #67e8f9;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: #0e7490;
    margin: var(--space-3) 0;
}
.info-box ul, .info-box ol { margin-left: 20px; }

/* === 响应式 === */
@media (max-width: 768px) {
    .nav-container { height: 56px; padding: 0 var(--space-4); }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        padding: var(--space-3) var(--space-4) var(--space-5);
        gap: var(--space-1);
        align-items: stretch;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 12px 14px; }
    .nav-user {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: var(--space-3);
        margin-top: var(--space-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
    .flash-container {
        right: var(--space-3);
        left: var(--space-3);
        top: 68px;
        max-width: none;
    }
    .row { margin: 0 -6px; }
    .row > [class*="col-"] { padding: 0 6px; flex: 0 0 100% !important; max-width: 100% !important; }
    .form-row { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-list, .card-grid, .question-grid { grid-template-columns: 1fr; }
    .lp-grid { grid-template-columns: 1fr; }
    .learning-paths-page .lp-hero { padding: 24px; }
    .ke-tabs { flex-wrap: wrap; }
    .ke-tab { flex: 1 1 33%; font-size: 13px; padding: 10px 6px; }
    .ke-tab-content { padding: 16px; }
    .ke-split { flex-direction: column; }
    .ke-preview { min-height: 200px; margin-top: 12px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
    .main-content { margin: var(--space-4) auto; padding: 68px var(--space-4) 0; }
    .auth-card { padding: var(--space-6); margin: 0 var(--space-3); }
    .page-header-bar { flex-direction: column; align-items: flex-start; }
    .hero { padding: var(--space-6); }
    .hero .hero-stats { gap: var(--space-4); }
    .hero h1 { font-size: 22px; }
}

/* === 讲评清单打印样式（屏幕版覆盖） === */
.checklist-header { text-align: center; margin-bottom: var(--space-5); }
.checklist-header h1 { font-size: 26px; color: var(--text); font-weight: 800; }
.checklist-header h2 { font-size: 18px; color: var(--text-secondary); font-weight: 500; }
.checklist-section { margin: var(--space-6) 0; }
.checklist-section h3 { font-size: 18px; border-bottom: 2px solid var(--primary); padding-bottom: var(--space-2); margin-bottom: var(--space-3); font-weight: 700; }
.checklist-table th { background: var(--primary-soft); color: var(--primary-dark); }
.no-print { }

/* === 题目选择网格 === */
.question-select-grid {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    background: var(--bg-soft);
}
.question-checkbox {
    display: flex; align-items: center; gap: var(--space-2);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}
.question-checkbox:hover { background: var(--primary-soft); }

/* === 课程思政卡片 === */
.ideology-card .card-icon { font-size: 36px; margin-bottom: var(--space-2); }
.ideology-card h3 { font-size: 16px; font-weight: 700; }
.ideology-card details { margin-top: var(--space-3); }
.ideology-card pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 13px;
    font-family: var(--font-mono);
}
.ideology-card .discussion-questions { margin-top: var(--space-3); font-size: 14px; }

/* === 错误页面 === */
.error-container { text-align: center; padding: 80px var(--space-5); }
.error-container h1 { font-size: 80px; font-weight: 800; color: var(--text-secondary); line-height: 1; }
.error-container p { font-size: 18px; color: var(--text-secondary); margin: var(--space-4) 0; }

/* === 难度星星 === */
.difficulty { font-size: 13px; color: var(--warning); letter-spacing: 1px; }

/* === 作业列表项 === */
.exercise-question-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    transition: all 0.2s ease;
}
.exercise-question-item:hover { box-shadow: var(--shadow-md); }
.eqi-header { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); align-items: center; }
.eqi-number { font-weight: 800; color: var(--primary); font-size: 14px; }

/* === 图标系统覆盖 === */
.ico { display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border-radius:8px; flex-shrink:0; vertical-align:middle; margin-right:4px; }
.ico svg { width:20px; height:20px; }
.ico-sm { width:30px; height:30px; border-radius:7px; }
.ico-sm svg { width:18px; height:18px; }
.ico-lg { width:48px; height:48px; border-radius:12px; margin-right:0; }
.ico-lg svg { width:28px; height:28px; }
.ico{background:transparent}.ico svg{opacity:1}
.preview{margin:8px 0}.preview img{max-width:100%;max-height:400px;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,0.1)}.preview video{max-width:100%;max-height:400px;border-radius:10px;outline:none}.preview .file-card{display:flex;align-items:center;gap:10px;background:var(--success-soft);padding:10px 16px;border-radius:10px;font-size:14px}.preview .file-card a{color:var(--primary);font-weight:600;text-decoration:none}

/* === 加载骨架屏 === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 25%, #e2e8f0 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* === 标签页 === */
.tab-nav {
    display: flex;
    gap: var(--space-1);
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--space-5);
}
.tab-nav a, .tab-nav button {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
}
.tab-nav a:hover, .tab-nav button:hover { color: var(--primary); }
.tab-nav a.active, .tab-nav button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* === 时间线 === */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: var(--space-4); }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

/* === 工具提示 === */
[title] { position: relative; }

/* === 自定义滚动条 === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-soft); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 成就解锁提示 */
.achievement-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fffbe6, #fff);
    border: 1px solid #ffe58f;
    border-left: 5px solid #faad14;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    max-width: 320px;
}

.achievement-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-toast .toast-icon {
    font-size: 32px;
    line-height: 1;
}

.achievement-toast .toast-body {
    flex: 1;
}

.achievement-toast .toast-title {
    font-weight: 700;
    color: #d48806;
    font-size: 14px;
}

.achievement-toast .toast-desc {
    color: #666;
    font-size: 13px;
    margin-top: 2px;
}

/* ===== 我的小组页面美化 ===== */

/* 小组公共输入框 */
.se-inp {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--card-bg);
    color: var(--text);
    line-height: 1.5;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.se-inp:hover { border-color: #cbd5e1; }
.se-inp:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.se-inp::placeholder { color: var(--text-muted); }
textarea.se-inp { resize: vertical; min-height: 96px; }
select.se-inp { appearance: auto; padding-right: 36px; }
input[type="file"].se-inp { padding: 8px; }
input[type="datetime-local"].se-inp { width: auto; min-width: 220px; }

/* 小组头部 */
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}
.group-header .group-title {
    display: flex;
    align-items: center;
    gap: 14px;
}
.group-header .group-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}
.group-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}
.group-header .text-muted {
    font-size: 14px;
    color: var(--text-secondary);
}
.group-header .btn-outline {
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 13px;
}

/* 标签页 */
.group-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}
.group-tabs .tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.group-tabs .tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.7);
}
.group-tabs .tab.active {
    color: var(--primary-dark);
    background: #fff;
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}
.group-tabs .tab .tab-icon { font-size: 15px; }

/* 通用小组卡片 */
.group-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.25s ease;
}
.group-card:hover { box-shadow: var(--shadow-md); }
.group-card .card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.group-card .card-title .title-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* 排行榜 */
.group-leaderboard {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    min-width: 180px;
    flex: 1;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}
.lb-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.lb-item.rank-1 { background: linear-gradient(135deg, #fef3c7 0%, #fff 100%); border-color: #fde68a; }
.lb-item.rank-2 { background: linear-gradient(135deg, #f1f5f9 0%, #fff 100%); border-color: #e2e8f0; }
.lb-item.rank-3 { background: linear-gradient(135deg, #fff7ed 0%, #fff 100%); border-color: #fed7aa; }
.lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    background: #fff;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}
.lb-item.rank-1 .lb-rank { color: #f59e0b; }
.lb-item.rank-2 .lb-rank { color: #64748b; }
.lb-item.rank-3 .lb-rank { color: #f97316; }
.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 700; color: var(--text); }
.lb-score { font-size: 12px; color: var(--text-secondary); }
a.lb-item {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.lb-item:hover { border-color: var(--primary); }
a.lb-item .lb-name::after {
    content: ' ›';
    color: var(--primary);
    font-size: 12px;
}

/* 发帖表单 */
.post-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.post-form .form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}
.post-form .form-actions {
    display: flex;
    justify-content: flex-end;
}

/* 讨论帖 */
.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
    animation: fadeInUp 0.4s ease-out forwards;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-card.pinned-post {
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(37,99,235,0.03) 0%, #fff 100%);
}
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.post-author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
    border: 1px solid var(--border-light);
}
.post-meta { display: flex; flex-direction: column; }
.post-name { font-size: 15px; font-weight: 700; color: var(--text); }
.post-time { font-size: 12px; color: var(--text-secondary); }
.post-actions { display: flex; gap: 8px; align-items: center; }
.post-card .markdown-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 16px;
}
.post-card .markdown-content p { margin-bottom: 10px; }
.post-card .markdown-content p:last-child { margin-bottom: 0; }
.post-card .markdown-content pre {
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow: auto;
    margin: 12px 0;
}
.post-card .markdown-content pre code {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 13px;
    background: transparent;
    padding: 0;
}
.post-card .markdown-content code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-dark);
}

/* 回复列表 */
.reply-list {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 12px;
}
.reply-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.reply-item:last-child { border-bottom: none; }
.reply-item .reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.reply-item .reply-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.reply-item .reply-time {
    font-size: 12px;
    color: var(--text-secondary);
}
.reply-item .markdown-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.reply-empty {
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    margin: 0;
    padding: 8px 0;
}
.reply-box {
    margin-top: 12px;
    padding: 14px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

/* 代码块通用 */
.code-block {
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow: auto;
    margin: 0;
}
.code-block code {
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    background: transparent;
    padding: 0;
}

/* 代码片段 */
.snippet-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
}
.snippet-card:hover { box-shadow: var(--shadow-md); }
.snippet-card .snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.snippet-card .snippet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.snippet-card .snippet-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 互评 */
.review-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
}
.review-card:hover { box-shadow: var(--shadow-md); }
.review-card .review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.review-card .review-title { font-size: 16px; font-weight: 700; color: var(--text); }
.review-card .review-meta { font-size: 12px; color: var(--text-secondary); }
.review-card .code-block { margin-bottom: 16px; }
.review-card .review-reply-form {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.review-card .review-line-ref {
    width: 130px;
    flex-shrink: 0;
}
.review-card .review-reply-content { flex: 1; min-width: 200px; }

/* 任务 */
.task-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.25s ease;
    border-left: 4px solid var(--primary);
}
.task-card:hover { box-shadow: var(--shadow-md); }
.task-card .task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}
.task-card .task-title { font-size: 16px; font-weight: 700; color: var(--text); }
.task-card .task-deadline {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-soft);
    padding: 4px 10px;
    border-radius: 20px;
}
.task-card .task-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}
.task-card .task-progress { margin-bottom: 16px; }
.task-card .task-submit-area {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-light);
}
.task-submissions {
    background: var(--bg-soft);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
}
.task-submission-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.task-submission-item:last-child { border-bottom: none; }
.task-submission-item pre {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px;
    margin: 8px 0 0;
    border: 1px solid var(--border-light);
}

/* 工具卡片 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tool-card .tool-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 4px;
}
.tool-card .tool-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.tool-card .tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 4px;
}
.tool-card .tool-result {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    min-height: 28px;
}
.tool-card .btn { margin-top: 4px; }

/* 雷达页 */
.radar-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 20px;
}
.radar-card .chart-wrap {
    max-width: 360px;
    margin: 0 auto;
    padding: 10px 0;
}
.member-scores {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.member-score {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    min-width: 150px;
    flex: 1;
    border: 1px solid var(--border-light);
}
.member-score .score-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-soft) 0%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}
.member-score .score-info { flex: 1; }
.member-score .score-name { font-size: 14px; font-weight: 700; color: var(--text); }
.member-score .score-value { font-size: 12px; color: var(--text-secondary); }
a.member-score {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
a.member-score:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.14);
    transform: translateY(-2px);
}
.member-score .score-go {
    font-size: 11px;
    color: var(--primary);
    white-space: nowrap;
}

/* 错题本 */
.weakpoint-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}
.weakpoint-grid .group-card { margin-bottom: 0; }
.weakpoint-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.weakpoint-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.weakpoint-list li:last-child { border-bottom: none; }
.weakpoint-list .wp-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}
.weakpoint-list .wp-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-soft);
    padding: 2px 10px;
    border-radius: 20px;
}

/* 小组错题本表格 */
.wp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.wp-table th, .wp-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.wp-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    background: var(--bg-soft);
    white-space: nowrap;
}
.wp-table td {
    color: var(--text);
}
.wp-answer {
    max-width: 380px;
    max-height: 60px;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    background: var(--bg-soft);
    border-radius: 6px;
    padding: 4px 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 协同编辑 */
.editor-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
}
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.editor-toolbar .editor-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.editor-toolbar .editor-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.editor-status {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-soft);
    padding: 4px 10px;
    border-radius: 20px;
}
.editor-card textarea.se-inp {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    min-height: 400px;
}

/* 文件空间 */
.file-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    padding: 20px;
}
.file-upload-area {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}
.file-upload-area:hover { border-color: var(--primary); background: var(--primary-soft); }

/* 空状态 */
.group-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}
.group-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}

/* 响应式 */
@media (max-width: 768px) {
    .group-header { flex-direction: column; align-items: flex-start; }
    .group-header .btn-outline { align-self: flex-start; }
    .group-tabs { width: 100%; }
    .group-tabs .tab { padding: 8px 12px; font-size: 13px; }
    .weakpoint-grid { grid-template-columns: 1fr; }
    .post-header, .review-card .review-header, .snippet-card .snippet-header, .task-card .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .post-author { gap: 8px; }
    .reply-item .reply-header { flex-direction: column; align-items: flex-start; gap: 2px; }
    .tool-card { padding: 20px; }
    .group-card, .post-card, .snippet-card, .review-card, .task-card, .file-card, .editor-card {
        padding: 16px;
    }
    .review-card .review-reply-form { flex-direction: column; }
    .review-card .review-line-ref { width: 100%; }
}

