/* ============================================================
   课堂翻译管理系统 v3.0 - 全局样式（布局优化版）
   ============================================================ */

/* ========== CSS 变量 ========== */
:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --primary-lighter: #5c6bc0;
    --primary-bg: #e8eaf6;
    --primary-gradient: linear-gradient(135deg, #1a237e 0%, #283593 100%);

    --teacher-accent: #e65100;
    --teacher-light: #ff8f00;
    --teacher-bg: #fff3e0;
    --teacher-gradient: linear-gradient(135deg, #e65100 0%, #bf360c 100%);

    --student-accent: #2e7d32;
    --student-light: #43a047;
    --student-bg: #e8f5e9;
    --student-gradient: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);

    --gray-50: #f8f9fa;
    --gray-100: #f0f2f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --warning: #f57f17;
    --warning-bg: #fff8e1;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --info: #1565c0;
    --info-bg: #e3f2fd;

    --radius-sm: 6px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.25);

    --transition: all 0.2s ease;
    --transition-slow: all 0.35s ease;

    --sidebar-width: 260px;
    --navbar-height: 36px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 布局系统 ========== */

/* 带侧边栏的布局 */
.layout-sidebar {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 20px 0;
    position: sticky;
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 50;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; padding: 0 12px; }

.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: var(--radius);
    color: var(--gray-700); font-size: 0.9em; font-weight: 500;
    transition: var(--transition); text-decoration: none;
}
.sidebar-nav a:hover { background: var(--gray-100); color: var(--primary); }
.sidebar-nav a.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.sidebar-nav a .nav-icon { font-size: 1.2em; width: 24px; text-align: center; }

.sidebar-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.sidebar-section-title {
    font-size: 0.72em; text-transform: uppercase; letter-spacing: 1px;
    color: var(--gray-500); padding: 0 14px; margin-bottom: 8px; font-weight: 700;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 24px 28px;
}

/* 两栏布局 */
.layout-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* 三栏布局 */
.layout-three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 混合比例布局 */
.layout-70-30 {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 24px;
}

.layout-30-70 {
    display: grid;
    grid-template-columns: 3fr 7fr;
    gap: 24px;
}

/* ========== 导航栏（增强版） ========== */
.navbar {
    background: var(--primary-gradient);
    color: white;
    padding: 0 20px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.nav-brand {
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.nav-brand .icon { font-size: 1.1em; }

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

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: var(--radius);
    font-size: 0.82em;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-links a.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }

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

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
}

.role-badge {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.role-badge.teacher { background: rgba(230,81,0,0.2); color: #ffcc80; }
.role-badge.student { background: rgba(46,125,50,0.2); color: #a5d6a7; }

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); text-decoration: none; }

.nav-user-name {
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.9;
    white-space: nowrap;
}

/* 移动端导航汉堡菜单按钮 */
.nav-toggle {
    display: none;
    background: none; border: none;
    color: white; font-size: 1.5em;
    cursor: pointer; padding: 4px 8px;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}
.container-narrow { max-width: 900px; margin: 0 auto; padding: 24px 20px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 24px 20px; }

/* ========== 页面标题/Hero区域 ========== */
.page-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: '';
    position: absolute;
    top: -50%; right: -10%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}
.page-hero h1 { font-size: 1.6em; margin-bottom: 6px; }
.page-hero .hero-subtitle { opacity: 0.85; font-size: 0.92em; }

.page-hero.teacher-hero { background: var(--teacher-gradient); }
.page-hero.student-hero { background: var(--student-gradient); }

/* ========== 面包屑 ========== */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.85em; color: var(--gray-600);
    margin-bottom: 20px; padding: 0 4px;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb .sep { color: var(--gray-400); }

/* ========== 卡片系统 ========== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    transition: var(--transition);
    border: 1px solid transparent;
}
.card:hover { box-shadow: var(--shadow-md); }
.card.card-hover { cursor: pointer; }
.card.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gray-200); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--gray-200);
}
.card-header h2 {
    font-size: 1.15em; color: var(--primary);
    display: flex; align-items: center; gap: 8px; margin: 0;
}

/* 彩色卡片变体 */
.card-accent-primary { border-left: 4px solid var(--primary); }
.card-accent-success { border-left: 4px solid var(--student-accent); }
.card-accent-warning { border-left: 4px solid var(--warning); }
.card-accent-danger { border-left: 4px solid var(--danger); }

/* ========== 统计卡片（增强版） ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 2em;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.stat-card .stat-info { 
    flex: 1; 
    min-width: 0; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.stat-card .stat-label {
    font-size: 0.9em; color: var(--gray-600);
    font-weight: 500; line-height: 1.3;
}
.stat-card .stat-number {
    font-size: 1.5em; font-weight: 800; color: var(--primary);
    line-height: 1; font-variant-numeric: tabular-nums;
}

/* 统计卡片颜色变体 */
.stat-card.teacher-card::before { background: var(--teacher-accent); }
.stat-card.teacher-card .stat-icon { background: var(--teacher-bg); }
.stat-card.teacher-card .stat-number { color: var(--teacher-accent); }

.stat-card.student-card::before { background: var(--student-accent); }
.stat-card.student-card .stat-icon { background: var(--student-bg); }
.stat-card.student-card .stat-number { color: var(--student-accent); }

.stat-card.success-card::before { background: var(--success); }
.stat-card.success-card .stat-icon { background: var(--success-bg); }
.stat-card.success-card .stat-number { color: var(--success); }

.stat-card.warning-card::before { background: var(--warning); }
.stat-card.warning-card .stat-icon { background: var(--warning-bg); }
.stat-card.warning-card .stat-number { color: var(--warning); }

/* 统计卡片作为链接 */
.stat-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.stat-card-link:hover { text-decoration: none; }

/* 统计卡片操作提示（管理 →） */
.stat-action-hint {
    font-size: 0.75em;
    color: var(--student-accent);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.stat-card:hover .stat-action-hint { opacity: 1; }

/* ========== 上传课件横幅 ========== */
.upload-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    background: var(--teacher-gradient);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(230,81,0,0.25);
    transition: var(--transition);
}
.upload-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(230,81,0,0.35);
    text-decoration: none;
    color: white;
}
.upload-banner-icon { font-size: 2em; flex-shrink: 0; }
.upload-banner-body { flex: 1; min-width: 0; }
.upload-banner-title {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 4px;
}
.upload-banner-sub {
    display: block;
    font-size: 0.82em;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-banner-arrow {
    font-size: 1.4em;
    flex-shrink: 0;
    opacity: 0.8;
}

/* ========== 筛选栏组件 ========== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    background: white;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}
.filter-selects,
.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-selects { flex: 1; min-width: 0; }
.filter-selects select,
.filter-actions .btn {
    min-width: 120px;
}
.filter-selects select {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 0.9em;
    color: var(--gray-800);
    flex: 1;
}

/* ========== 快捷操作面板（紧凑版） ========== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.quick-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--gray-800);
    transition: var(--transition);
    border: 1px solid transparent;
}
.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.quick-action-card.action-upload { background: linear-gradient(135deg, #e8eaf6, #e3f2fd); border-color: rgba(26,35,126,0.08); }
.quick-action-card.action-upload .quick-action-icon { color: var(--primary); }
.quick-action-card.action-upload .quick-action-arrow { color: var(--primary); }
.quick-action-card.action-students { background: linear-gradient(135deg, #fff3e0, #fce4ec); border-color: rgba(230,81,0,0.08); }
.quick-action-card.action-students .quick-action-icon { color: var(--teacher-accent); }
.quick-action-card.action-students .quick-action-arrow { color: var(--teacher-accent); }
.quick-action-icon { font-size: 1.6em; flex-shrink: 0; }
.quick-action-text {
    font-weight: 600;
    font-size: 0.95em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quick-action-arrow {
    font-size: 1.2em;
    flex-shrink: 0;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .filter-bar { padding: 12px; }
    .filter-selects,
    .filter-actions { width: 100%; }
    .filter-selects select,
    .filter-actions .btn { flex: 1; min-width: 100px; }

    .quick-actions { gap: 10px; }
    .quick-action-card { padding: 12px 14px; gap: 8px; }
    .quick-action-icon { font-size: 1.3em; }
    .quick-action-text { font-size: 0.85em; }
    .quick-action-arrow { font-size: 1em; }

    .upload-banner { padding: 14px 16px; gap: 12px; }
    .upload-banner-icon { font-size: 1.6em; }
    .upload-banner-title { font-size: 1em; }
    .upload-banner-sub { font-size: 0.75em; white-space: normal; }
    .upload-banner-arrow { font-size: 1.1em; }

    .stat-action-hint { opacity: 1; font-size: 0.7em; }
}

/* ========== 网格卡片组件（课程卡片） ========== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.course-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex; flex-direction: column;
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
}
.course-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    text-decoration: none;
}

.course-card .card-top {
    padding: 20px 20px 12px;
    display: flex; align-items: flex-start; gap: 14px;
}
.course-card .card-icon {
    font-size: 2.2em; flex-shrink: 0;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg); border-radius: var(--radius);
}
.course-card .card-body { flex: 1; min-width: 0; }
.course-card .card-title {
    font-size: 1em; font-weight: 600; color: var(--gray-800);
    margin-bottom: 6px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.course-card .card-meta {
    display: flex; flex-wrap: wrap; gap: 4px 12px;
    font-size: 0.78em; color: var(--gray-600);
}
.course-card .card-meta span { display: flex; align-items: center; gap: 4px; }

.course-card .card-footer {
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--gray-50); border-top: 1px solid var(--gray-200);
    font-size: 0.82em;
}
.course-card .card-badge {
    padding: 3px 10px; border-radius: 20px; font-size: 0.75em; font-weight: 600;
}
.card-badge.edited { background: var(--teacher-bg); color: var(--teacher-accent); }
.card-badge.upload { background: var(--info-bg); color: var(--info); }
.card-badge.new { background: var(--success-bg); color: var(--success); }
.card-badge.profession { background: var(--primary-bg); color: var(--primary); }

/* ========== 标签页（Tabs） ========== */
.tabs {
    display: flex; gap: 2px;
    background: var(--gray-100); border-radius: var(--radius);
    padding: 4px; margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    isolation: isolate;
    transform: translateZ(0);
}
.tab-btn {
    flex: 1; padding: 10px 20px; border: none; border-radius: calc(var(--radius) - 4px);
    background: transparent; color: var(--gray-600);
    font-size: 0.9em; font-weight: 600; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tab-btn:hover { color: var(--primary); background: rgba(0,0,0,0.03); }
.tab-btn.active {
    background: white; color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeSlideIn 0.3s ease; overflow: hidden; }

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

/* ========== 筛选栏（增强版） ========== */
.filter-bar {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-bar select, .filter-bar input[type="text"], .filter-bar input[type="search"] {
    padding: 9px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.88em;
    background: white;
    outline: none;
    transition: var(--transition);
    min-width: 160px;
}
.filter-bar select:focus, .filter-bar input:focus,
.filter-bar input[type="text"]:focus, .filter-bar input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}

.filter-bar .spacer { flex: 1; }

/* 搜索输入框 */
.search-box {
    position: relative; flex: 1; min-width: 200px;
}
.search-box .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-500); font-size: 1em;
}
.search-box input {
    width: 100%; padding: 9px 14px 9px 36px !important;
}

/* ========== 文件列表（紧凑单行版） ========== */
.file-list { display: flex; flex-direction: column; gap: 6px; }

.file-item {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    border-left: 4px solid transparent;
    text-decoration: none;
    color: inherit;
}
.file-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
    text-decoration: none;
}
.file-item.edited { border-left-color: var(--teacher-accent); }
.file-item:hover:not(.edited) { border-left-color: var(--primary); }

.file-icon {
    font-size: 1.4em; width: 32px; text-align: center; flex-shrink: 0;
}
.file-info { 
    flex: 1; min-width: 0; 
    display: flex; align-items: center; gap: 12px;
    overflow: hidden;
}
.file-info .file-title {
    font-size: 0.95em; font-weight: 600; color: var(--gray-800);
    white-space: nowrap; flex-shrink: 0;
}
.file-info .file-badges {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.file-meta {
    display: flex; align-items: center; gap: 4px 14px; flex-shrink: 0;
    font-size: 0.78em; color: var(--gray-600);
}
.file-meta span { display: flex; align-items: center; gap: 3px; white-space: nowrap; }

.file-actions {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}

/* 手机端：文件列表堆叠 */
@media (max-width: 768px) {
    .file-item { flex-wrap: wrap; padding: 10px 12px; }
    .file-info { flex-wrap: wrap; gap: 6px; }
    .file-meta { width: 100%; }
    .file-actions { width: 100%; justify-content: flex-end; }
}

/* 紧凑文件列表（用于侧边栏等） */
.file-list-compact { gap: 6px; }
.file-list-compact .file-item { padding: 10px 12px; }
.file-list-compact .file-icon { font-size: 1.2em; width: 28px; }
.file-list-compact .file-title { font-size: 0.85em; }
.file-list-compact .file-meta { font-size: 0.72em; }

/* ========== 分组标题（增强版） ========== */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin: 28px 0 14px;
}
.section-header h2 {
    font-size: 1.15em; font-weight: 700; color: var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.section-header .badge {
    background: var(--primary-bg); color: var(--primary);
    padding: 4px 12px; border-radius: 20px; font-size: 0.75em; font-weight: 700;
}

.group-title {
    font-size: 1.08em; font-weight: 600; color: var(--primary);
    margin: 24px 0 12px;
    padding: 8px 0;
    border-bottom: 2px solid var(--primary-bg);
    display: flex; align-items: center; gap: 10px;
}
.group-title .count {
    font-size: 0.72em; background: var(--primary-bg);
    color: var(--primary); padding: 3px 12px;
    border-radius: 16px; font-weight: 600;
}

/* ========== 按钮系统（增强版） ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-sm { padding: 6px 14px; font-size: 0.82em; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 28px; font-size: 1em; border-radius: var(--radius-lg); }
.btn-xl { padding: 14px 36px; font-size: 1.1em; border-radius: var(--radius-lg); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 4px 12px rgba(26,35,126,0.3); }

.btn-outline {
    background: white; color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-bg); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c82333; box-shadow: 0 4px 12px rgba(198,40,40,0.3); }

.btn-success { background: var(--student-accent); color: white; }
.btn-success:hover { background: var(--student-light); box-shadow: 0 4px 12px rgba(46,125,50,0.3); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #e65100; }

.btn-ghost {
    background: transparent; color: var(--gray-700);
    border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--gray-100); border-color: var(--gray-300); }

.btn-gradient { background: var(--primary-gradient); color: white; }
.btn-gradient:hover { box-shadow: 0 4px 16px rgba(26,35,126,0.35); }

.btn-icon {
    width: 38px; height: 38px; padding: 0; border-radius: 50%;
    font-size: 1.1em;
}

/* 按钮组 */
.btn-group { display: flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* ========== "开始学习"按钮（学生端卡片） ========== */
.start-learning-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 0.92em;
    font-weight: 700;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
    letter-spacing: 0.5px;
    /* 活力蓝紫渐变 — 适合大学生 */
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 3px 14px rgba(99,102,241,0.45);
    transition: all 0.25s ease;
    animation: pulse-btn 2.2s ease-in-out infinite;
}
.start-learning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99,102,241,0.6);
    text-decoration: none;
    color: #fff;
}
@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 3px 14px rgba(99,102,241,0.45); }
    50% { box-shadow: 0 4px 26px rgba(139,92,246,0.7); }
}

/* ========== 表单（增强版） ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 0.84em; font-weight: 600;
    color: var(--gray-700); margin-bottom: 6px;
}
.form-group .hint {
    font-size: 0.78em; color: var(--gray-500); margin-top: 4px;
}
.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95em;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: white;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.form-control.error { border-color: var(--danger); }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ========== 编辑页面样式（增强版） ========== */
.edit-container { max-width: 1100px; }

.edit-header {
    background: var(--teacher-gradient);
    color: white;
    padding: 28px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.edit-header h1 { font-size: 1.35em; }
.edit-header .meta { opacity: 0.9; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85em; }

/* 双栏编辑视图 */
.edit-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.edit-col {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.edit-col-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600; font-size: 0.95em;
}

.segment-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}
.segment-card:hover { box-shadow: var(--shadow-md); }
.segment-card.saved { border-left-color: var(--success); }
.segment-card.modified { border-left-color: var(--warning); background: #fffdf8; }

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.82em;
    color: var(--gray-600);
}

.seg-index {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary); color: white;
    font-size: 0.85em; font-weight: 700;
}

/* 悬浮保存栏（sticky） */
.sticky-toolbar {
    position: sticky;
    bottom: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    z-index: 50;
    margin-top: 20px;
    border: 1px solid var(--gray-200);
}

.ru-edit, .cn-edit {
    width: 100%;
    min-height: 60px;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: var(--transition);
    line-height: 1.6;
}
.ru-edit { background: var(--gray-50); color: var(--gray-800); }
.cn-edit { color: var(--primary); }
.ru-edit:focus, .cn-edit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.08);
}
.ru-edit.modified { border-color: var(--teacher-accent); background: #fff8f5; }
.cn-edit.modified { border-color: var(--teacher-accent); background: #fffdf8; }

.save-status {
    font-size: 0.78em; padding: 4px 10px; border-radius: 10px; font-weight: 600;
}
.save-status.saved { color: var(--success); background: var(--success-bg); }
.save-status.saving { color: var(--warning); background: var(--warning-bg); }
.save-status.error { color: var(--danger); background: var(--danger-bg); }

/* ========== 查看页面（增强版） ========== */
.view-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 32px 36px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.view-hero.student-hero { background: var(--student-gradient); }
.view-hero h1 { font-size: 1.5em; margin-bottom: 8px; }

.view-segment {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}
.view-segment:hover { box-shadow: var(--shadow-md); }

.view-ru {
    background: var(--gray-50);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 1em;
    line-height: 1.7;
    position: relative;
}
.view-ru .segment-label {
    position: absolute; top: -10px; left: 14px;
    background: var(--primary); color: white;
    padding: 2px 12px; border-radius: 10px;
    font-size: 0.7em; font-weight: 700;
}

.view-cn {
    background: var(--primary-bg);
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 1em;
    line-height: 1.7;
    color: var(--primary);
}

/* ========== 空状态（增强版） ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}
.empty-state .icon { font-size: 4em; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 1.2em; margin-bottom: 8px; color: var(--gray-700); }
.empty-state p { font-size: 0.9em; margin-bottom: 16px; }

/* ========== 登录页（增强版） ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b4a 0%, #1a237e 30%, #283593 60%, #3949ab 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(57,73,171,0.3) 0%, transparent 70%);
    top: -200px; right: -100px;
    border-radius: 50%;
}
.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(57,73,171,0.2) 0%, transparent 70%);
    bottom: -100px; left: -50px;
    border-radius: 50%;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: loginSlideIn 0.5s ease;
}
@keyframes loginSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 6px;
    font-size: 1.5em;
}
.login-card .subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 32px;
    font-size: 0.88em;
}

.login-tabs {
    display: flex; margin-bottom: 24px;
    background: var(--gray-100); border-radius: var(--radius);
    padding: 4px; gap: 2px;
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
}
.login-tab {
    flex: 1; padding: 10px 8px; text-align: center;
    cursor: pointer; font-weight: 600; font-size: 0.88em;
    color: var(--gray-600); background: transparent;
    border: none; border-radius: calc(var(--radius) - 4px);
    transition: var(--transition);
}
.login-tab.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }
.login-tab:hover:not(.active) { color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.login-card .btn {
    width: 100%; padding: 13px;
    font-size: 1em; justify-content: center; margin-top: 8px;
}

.login-hint {
    margin-top: 20px; padding: 14px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 0.78em; color: var(--gray-600); line-height: 1.8;
}
.login-hint strong { color: var(--primary); }

.register-link {
    text-align: center; margin-top: 18px; font-size: 0.88em;
}
.register-link a { color: var(--primary); font-weight: 600; }
.register-link a:hover { text-decoration: underline; }

.privacy-notice {
    margin-top: 16px; padding: 12px;
    text-align: center; font-size: 0.75em;
    color: var(--gray-500); line-height: 1.6;
    background: var(--gray-50); border-radius: var(--radius);
}

/* 验证码输入行 */
.code-row { display: flex; gap: 10px; align-items: flex-end; }
.code-row .form-group { flex: 1; }

.btn-send-code {
    white-space: nowrap; padding: 12px 16px; border-radius: var(--radius);
    border: 1.5px solid var(--primary); background: white;
    color: var(--primary); font-weight: 600; cursor: pointer;
    font-size: 0.88em; transition: var(--transition); min-width: 110px; text-align: center;
}
.btn-send-code:hover:not(:disabled) { background: var(--primary); color: white; }
.btn-send-code:disabled {
    border-color: var(--gray-300); color: var(--gray-400);
    cursor: not-allowed; background: var(--gray-100);
}
.code-hint { font-size: 0.78em; color: var(--gray-500); margin-top: 6px; }

/* ========== 提示消息（增强版） ========== */
.alerts { margin-bottom: 20px; }

.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlideIn 0.3s ease;
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #c8e6c9; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffcdd2; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #ffecb3; }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid #bbdefb; }

/* ========== Toast 通知（增强版） ========== */
.toast-container {
    position: fixed; top: 20px; right: 20px;
    z-index: 10000; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 14px 24px; border-radius: var(--radius);
    color: white; font-size: 0.9em; font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.35s ease;
    pointer-events: auto;
    max-width: 380px;
    display: flex; align-items: center; gap: 10px;
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

/* ========== 水印层 ========== */
.watermark-layer {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background-repeat: repeat;
}

/* ========== TTS 发音按钮 ========== */
.btn-tts {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; margin-left: 4px;
    border: 1.5px solid var(--gray-300); border-radius: 50%;
    background: white; font-size: 12px; cursor: pointer;
    vertical-align: middle; transition: var(--transition);
    flex-shrink: 0;
}
.btn-tts:hover {
    background: var(--info-bg); border-color: var(--info);
    transform: scale(1.15);
}
.btn-tts:active { transform: scale(0.95); }
.btn-tts:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-tts.playing {
    background: var(--success-bg); border-color: var(--success);
    animation: tts-pulse 0.8s ease-in-out infinite;
}
@keyframes tts-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }
}
.tts-segment { display: inline-flex; align-items: center; flex-wrap: wrap; }

/* ========== AI 学习工具箱面板 ========== */
.toolbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.toolbox-panel {
    background: white;
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    overflow: hidden;
    min-width: 0;
}
.toolbox-panel:hover { box-shadow: var(--shadow-md); }
.toolbox-panel h4 {
    margin: 0 0 10px 0; font-size: 0.95em;
    display: flex; align-items: center; gap: 6px;
}
.toolbox-content {
    font-size: 0.9em; line-height: 1.8; white-space: pre-wrap; color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    max-width: 100%;
}

/* 面板颜色 */
.toolbox-vocab { border-left: 4px solid #00897b; }
.toolbox-vocab h4 { color: #00695c; }
.toolbox-sentence { border-left: 4px solid var(--info); }
.toolbox-sentence h4 { color: var(--info); }
.toolbox-exam { border-left: 4px solid var(--teacher-accent); }
.toolbox-exam h4 { color: var(--teacher-accent); }
.toolbox-cards { border-left: 4px solid #7b1fa2; }
.toolbox-cards h4 { color: #6a1b9a; }

/* ========== 进度条 ========== */
.progress-bar {
    height: 6px; background: var(--gray-200);
    border-radius: 3px; overflow: hidden;
}
.progress-bar .progress-fill {
    height: 100%; border-radius: 3px;
    background: var(--primary-gradient);
    transition: width 0.5s ease;
}
.progress-bar.success .progress-fill { background: var(--student-gradient); }
.progress-bar.warning .progress-fill { background: var(--teacher-gradient); }

/* ========== 标签/徽章 ========== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.75em; font-weight: 600;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ========== 搜索高亮 ========== */
mark {
    background: #fff176;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ========== 个人中心 ========== */
.profile-page { max-width: 560px; margin: 0 auto; }

.profile-card {
    text-align: center;
    padding: 40px;
}

.profile-avatar {
    width: 88px; height: 88px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(26,35,126,0.25);
}

.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    text-align: left;
    margin-top: 24px;
}
.profile-info-item {
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}
.profile-info-item .label {
    font-size: 0.75em; color: var(--gray-600); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.profile-info-item .value {
    font-size: 0.95em; color: var(--gray-800); font-weight: 500; margin-top: 2px;
}

/* ========== 表格组件 ========== */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.88em;
}
.data-table th {
    background: var(--gray-50); padding: 12px 14px;
    text-align: left; border-bottom: 2px solid var(--gray-200);
    white-space: nowrap; font-weight: 700; color: var(--gray-700);
    font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.data-table tbody tr { transition: var(--transition); }
.data-table tbody tr:hover { background: var(--gray-50); }

.status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.8em; font-weight: 600;
}
.status-badge.approved { background: var(--success-bg); color: var(--success); }
.status-badge.pending { background: var(--warning-bg); color: var(--warning); }

/* ========== 提示框 ========== */
.hint-box {
    background: var(--info-bg); border-left: 4px solid var(--info);
    padding: 14px 18px; border-radius: var(--radius);
    margin-bottom: 16px; font-size: 0.85em; color: var(--info);
    line-height: 1.6;
}
.hint-box.warning { background: var(--warning-bg); border-color: var(--warning); color: #5d4037; }

/* ========== 页脚 ========== */
.page-footer {
    text-align: center;
    padding: 28px 20px;
    color: var(--gray-500);
    font-size: 0.85em;
    border-top: 1px solid var(--gray-200);
    margin-top: 40px;
    letter-spacing: 0.5px;
}

/* ========== 上传组件 ========== */
.drop-zone {
    border: 2.5px dashed var(--gray-400);
    border-radius: var(--radius-lg); padding: 56px 24px;
    text-align: center; cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
    position: relative; overflow: hidden;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(26,35,126,0.03);
    transform: translateY(-2px);
}
.drop-zone .icon-upload { font-size: 3.5em; display: block; margin-bottom: 12px; }
.drop-zone .title { font-size: 1.1em; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.drop-zone .hint { font-size: 0.85em; color: var(--gray-600); }
.drop-zone input[type="file"] { display: none; }

.format-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 14px; }
.format-badge {
    background: var(--info-bg); color: var(--info);
    padding: 4px 14px; border-radius: 20px; font-size: 0.82em; font-weight: 600;
}

/* ========== 步骤指示器（增强版） ========== */
.steps {
    display: flex; gap: 12px; margin-bottom: 28px;
}
.step {
    flex: 1; text-align: center; padding: 16px 12px;
    border-radius: var(--radius); background: var(--gray-100);
    color: var(--gray-600); font-size: 0.84em; font-weight: 500;
    transition: var(--transition); position: relative;
}
.step::after {
    content: ''; position: absolute; top: 50%; right: -16px;
    width: 20px; height: 2px; background: var(--gray-300);
    transform: translateY(-50%);
}
.step:last-child::after { display: none; }
.step .step-num {
    display: block; font-size: 1.6em; font-weight: 800; margin-bottom: 4px;
}
.step.active {
    background: var(--primary); color: white; font-weight: 700;
    box-shadow: 0 4px 16px rgba(26,35,126,0.3);
}
.step.active .step-num { color: white; }
.step.done { background: var(--success-bg); color: var(--success); font-weight: 600; }
.step.done .step-num { color: var(--success); }

/* ========== 加载动画 ========== */
.loading-spinner {
    display: inline-block; width: 44px; height: 44px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: none; text-align: center; padding: 40px 20px;
}
.loading-overlay.show { display: block; }

/* ========== 响应式布局 ========== */
@media (max-width: 1024px) {
    .toolbox-grid { grid-template-columns: 1fr; }
    .layout-two-col, .layout-70-30, .layout-30-70 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container, .container-narrow, .container-wide {
        padding: 16px 12px;
    }
    .layout-sidebar { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        border-right: none; border-bottom: 1px solid var(--gray-200);
        padding: 12px;
    }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .sidebar-nav a { padding: 8px 14px; font-size: 0.82em; }
    .sidebar-section { display: none; }
    .main-content { padding: 16px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 16px; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.5em; }
    .stat-card .stat-number { font-size: 1.3em; }

    .card-grid { grid-template-columns: 1fr; }

    .steps { gap: 6px; }
    .step { padding: 12px 6px; font-size: 0.78em; }
    .step .step-num { font-size: 1.3em; }
    .step::after { right: -8px; width: 10px; }

    /* 导航栏手机布局：品牌+退出 一行 */
    .navbar {
        flex-wrap: wrap; height: auto; padding: 6px 12px; gap: 6px;
    }
    .nav-brand { width: auto; font-size: 0.92em; padding: 0; }
    .nav-user {
        width: auto; margin-left: auto; order: 1; padding: 0; font-size: 0.72em;
    }
    .nav-user .role-badge,
    .nav-user span:not(.btn-logout) { display: none; }
    .nav-links {
        display: flex; width: 100%; order: 2; padding: 0; gap: 8px;
        overflow-x: auto; scrollbar-width: none;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a {
        flex: 1; text-align: center; justify-content: center;
        padding: 6px 8px; font-size: 0.82em; border-radius: 8px;
        min-width: 80px;
    }

    .form-row { grid-template-columns: 1fr; }
    .edit-two-col { grid-template-columns: 1fr; }

    .data-table { font-size: 0.8em; }
    .data-table th, .data-table td { padding: 8px 10px; }

    .login-card { margin: 16px; padding: 28px 20px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 14px; flex-direction: row; align-items: center; gap: 10px; }
    .stat-card .stat-icon { width: 36px; height: 36px; font-size: 1.2em; }
    .stat-card .stat-label { font-size: 0.7em; }
    .stat-card .stat-number { font-size: 1.2em; }

    .filter-bar { flex-direction: column; }
    .filter-bar select, .filter-bar input { width: 100% !important; }

    .btn { font-size: 0.85em; padding: 8px 16px; }
    .btn-lg { padding: 10px 20px; }

    .page-hero { padding: 24px 20px; border-radius: var(--radius); }
    .page-hero h1 { font-size: 1.3em; }

    .upload-banner { padding: 12px 14px; gap: 8px; border-radius: var(--radius); }
    .upload-banner-icon { font-size: 1.4em; }
    .upload-banner-title { font-size: 0.95em; }
    .upload-banner-sub { font-size: 0.7em; white-space: normal; }
    .upload-banner-arrow { font-size: 1em; }

    .login-card { padding: 24px 16px; margin: 12px; }

    /* 手机端：开始学习按钮全宽 */
    .start-learning-btn {
        width: 100% !important;
        justify-content: center;
        font-size: 1em !important;
        padding: 12px 20px !important;
    }
    .card-footer { flex-direction: column; gap: 10px; }
    .card-footer > div:first-child { width: 100%; justify-content: center; display: flex; gap: 6px; flex-wrap: wrap; }
}
