/* =============================================================
   腾云技协学习平台 - 全局样式表
   文件：assets/css/style.css
   风格：蓝白科技风 + 轻拟态玻璃效果，适合中学生使用
   ============================================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --purple: #7c3aed;

    --text: #0f172a;
    --text-sub: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --bg: #f1f5f9;
    --card: #ffffff;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --sidebar-w: 236px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.4; }
p { margin: 0 0 10px; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   布局骨架
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: linear-gradient(180deg, #0f172a 0%, #16233f 60%, #1a2b4d 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.brand-logo {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px;
    box-shadow: 0 6px 16px rgba(59, 130, 246, .38);
}
.brand-text { display: flex; flex-direction: column; overflow: hidden; }
.brand-text strong { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { color: #7f9cc4; font-size: 11px; }

.sidebar-nav { flex: 1; padding: 12px 10px 20px; }
.nav-section {
    font-size: 11px;
    color: #5c7799;
    letter-spacing: .08em;
    padding: 14px 10px 6px;
    text-transform: uppercase;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #c3d2e6;
    font-size: 13.5px;
    margin-bottom: 2px;
    transition: all .16s ease;
    border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, .28), rgba(59, 130, 246, .10));
    border-color: rgba(96, 165, 250, .35);
    color: #fff;
    font-weight: 500;
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; }

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; }
.side-user-info { display: flex; flex-direction: column; overflow: hidden; }
.side-user-info strong { color: #fff; font-size: 13px; }
.side-user-info span { color: #7f9cc4; font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 62px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-title h1 { font-size: 16.5px; }
.topbar-sub { font-size: 11.5px; color: var(--text-muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.icon-btn {
    border: 1px solid var(--border);
    background: #fff;
    width: 34px; height: 34px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-sub);
    transition: all .16s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

.branch-switcher select { min-width: 170px; }

.user-menu { position: relative; }
.user-menu-btn {
    display: flex; align-items: center; gap: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.user-menu-btn:hover { border-color: var(--primary); }
.caret { color: var(--text-muted); font-size: 10px; }
.user-menu-list {
    display: none;
    position: absolute;
    right: 0; top: calc(100% + 8px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    padding: 6px;
    z-index: 40;
}
.user-menu.open .user-menu-list { display: block; }
.user-menu-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-sub);
    font-size: 13px;
}
.user-menu-list a:hover { background: var(--primary-light); color: var(--primary-dark); }
.user-menu-list a.danger:hover { background: #fee2e2; color: var(--danger); }

.content { padding: 20px; flex: 1; }
.app-foot {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 14px 20px 22px;
}

.avatar {
    width: 32px; height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.avatar-sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 22px; }

/* ============================================================
   页面标题
   ============================================================ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.page-head-left h2 { font-size: 19px; }
.page-head-left p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   卡片
   ============================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, #fbfdff);
}
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--text-muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: #fbfdff; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

/* ============================================================
   统计卡片
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: .55;
}
.stat-card .label { color: var(--text-muted); font-size: 12.5px; position: relative; z-index: 1; }
.stat-card .value {
    font-size: 26px; font-weight: 700; color: var(--primary-dark);
    margin-top: 4px; position: relative; z-index: 1;
    font-variant-numeric: tabular-nums;
}
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.stat-card .hint { font-size: 12px; color: var(--text-muted); position: relative; z-index: 1; }
.stat-card.green .value { color: var(--success); }
.stat-card.green::after { background: #dcfce7; }
.stat-card.orange .value { color: var(--warning); }
.stat-card.orange::after { background: #fef3c7; }
.stat-card.purple .value { color: var(--purple); }
.stat-card.purple::after { background: #ede9fe; }
.stat-card.red .value { color: var(--danger); }
.stat-card.red::after { background: #fee2e2; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-sub);
    font-size: 13.5px;
    cursor: pointer;
    transition: all .16s ease;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.5;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: #f8fbff; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.btn-primary:hover { color: #fff; background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.btn-success { background: var(--success); border-color: transparent; color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   表单
   ============================================================ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item > label {
    font-size: 13px;
    color: var(--text-sub);
    font-weight: 500;
}
.form-item > label .req { color: var(--danger); margin-left: 2px; }
.form-item .tip { font-size: 12px; color: var(--text-muted); }

.form-control, .form-select, textarea.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
    outline: none;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.7; }
.form-control-sm, .form-select-sm { padding: 6px 10px; font-size: 13px; }
.form-control[type="file"] { padding: 7px 10px; background: #f8fafc; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-sub); }
.checkbox-line input[type="checkbox"], .checkbox-line input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; }

/* ============================================================
   工具栏 / 搜索筛选
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #fbfdff;
    border-bottom: 1px solid var(--border);
}
.toolbar .grow { flex: 1; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="text"], .toolbar input[type="search"], .toolbar select {
    padding: 7px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }

/* ============================================================
   表格
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left;
    padding: 11px 14px;
    background: #f8fafc;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
    vertical-align: middle;
}
.table tbody tr:hover { background: #f8fbff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.table .muted { color: var(--text-muted); font-size: 12.5px; }
.table-striped tbody tr:nth-child(even) { background: #fcfdff; }

/* ============================================================
   徽章 / 标签
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.7;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-gray   { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.badge-success{ background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-warn   { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-purple { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 6px 6px 0;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--text-sub);
    font-size: 12px;
}

/* ============================================================
   提示条
   ============================================================ */
.alert {
    padding: 11px 16px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-auto-hide { transition: opacity .4s; }

/* ============================================================
   空状态
   ============================================================ */
.empty { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty-icon { font-size: 40px; margin-bottom: 8px; opacity: .7; }
.empty p { margin: 0; font-size: 13.5px; }

/* ============================================================
   分页
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
}
.page-info { color: var(--text-muted); font-size: 12.5px; margin-right: 8px; }
.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-sub);
    font-size: 13px;
    background: #fff;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-dots { color: var(--text-muted); }

/* ============================================================
   Tabs
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
    padding: 9px 16px;
    font-size: 13.5px;
    color: var(--text-sub);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none; border-left: none; border-right: none;
    font-family: inherit;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ============================================================
   进度条
   ============================================================ */
.progress { height: 8px; background: #e2e8f0; border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #3b82f6, #0ea5e9); border-radius: 20px; transition: width .4s; }
.progress-bar.green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.orange { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-bar.red { background: linear-gradient(90deg, #f87171, #dc2626); }

/* ============================================================
   列表项 / 元信息
   ============================================================ */
.meta { color: var(--text-muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* 文件列表 */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfdff;
    font-size: 13px;
}
.file-item:hover { border-color: var(--primary); }
.file-item .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.file-item .fsize { color: var(--text-muted); font-size: 12px; }
.file-icon { font-size: 16px; }

/* ============================================================
   课程卡片
   ============================================================ */
.course-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: all .18s ease;
}
.course-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.course-cover {
    height: 140px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    background-size: cover;
    background-position: center;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px;
    color: #93c5fd;
}
.course-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.course-card-body h3 { font-size: 15px; }
.course-card-body .desc { color: var(--text-muted); font-size: 12.5px; flex: 1; }
.course-card-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: #fbfdff;
}

/* ============================================================
   弹窗（轻量自定义 Modal）
   ============================================================ */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(3px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: #fbfdff; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; line-height: 1; }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, .28), transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(14, 165, 233, .26), transparent 45%),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0c4a6e 100%);
}
.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, .96);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(2, 6, 23, .45);
    padding: 34px 32px 28px;
    border: 1px solid rgba(255, 255, 255, .5);
}
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .mark {
    width: 62px; height: 62px;
    margin: 0 auto 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #3b82f6, #0ea5e9);
    color: #fff;
    font-size: 28px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 28px rgba(37, 99, 235, .38);
}
.login-logo h1 { font-size: 21px; margin-bottom: 3px; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin: 0; }
.login-box .form-item { margin-bottom: 14px; }
.login-box .btn-lg { margin-top: 6px; }
.login-foot { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 18px; }
.login-hint {
    background: #f8fafc;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 16px;
    line-height: 1.9;
}

/* ============================================================
   打字练习 / 考试界面
   ============================================================ */
.typing-text {
    font-size: 20px;
    line-height: 2.1;
    letter-spacing: .5px;
    padding: 20px;
    background: #fbfdff;
    border: 1px solid var(--border);
    border-radius: 12px;
    user-select: none;
    word-break: break-word;
}
.typing-text .ok { color: #15803d; }
.typing-text .bad { color: #fff; background: #dc2626; border-radius: 3px; }
.typing-text .cur { background: #bfdbfe; border-radius: 3px; box-shadow: inset 0 -2px 0 var(--primary); }
.typing-text .pending { color: #94a3b8; }

.typing-input {
    width: 100%;
    min-height: 110px;
    font-size: 18px;
    line-height: 1.9;
    padding: 14px;
    border: 2px solid var(--border-strong);
    border-radius: 12px;
    outline: none;
    font-family: inherit;
    resize: none;
}
.typing-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.typing-input.disabled { background: #f1f5f9; color: var(--text-muted); }

.live-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.live-stat {
    flex: 1;
    min-width: 110px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    text-align: center;
}
.live-stat .v { font-size: 24px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.live-stat .k { font-size: 12px; color: var(--text-muted); }
.live-stat.green .v { color: var(--success); }
.live-stat.orange .v { color: var(--warning); }
.live-stat.red .v { color: var(--danger); }

.exam-timer {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
    padding: 4px 14px;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}
.exam-timer.warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.exam-timer.danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.q-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.q-nav-btn {
    width: 36px; height: 36px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-sub);
    font-family: inherit;
}
.q-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.q-nav-btn.answered { background: #dcfce7; border-color: #86efac; color: #15803d; }
.q-nav-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.q-nav-btn.marked { box-shadow: inset 0 0 0 2px #fbbf24; }

.question-block { padding: 18px 0; border-bottom: 1px dashed var(--border); }
.question-block:last-child { border-bottom: none; }
.question-title { font-size: 15px; margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-start; }
.question-no {
    flex: 0 0 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all .14s;
    background: #fff;
}
.option-item:hover { border-color: var(--primary); background: #f8fbff; }
.option-item.selected { border-color: var(--primary); background: #eff6ff; box-shadow: 0 0 0 2px rgba(37, 99, 235, .1); }
.option-item input { margin-top: 3px; accent-color: var(--primary); }
.option-key { font-weight: 600; color: var(--primary-dark); }
.option-item.correct { border-color: #86efac; background: #f0fdf4; }
.option-item.wrong { border-color: #fecaca; background: #fef2f2; }

.leaderboard-rank {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    background: #f1f5f9; color: #64748b;
}
.leaderboard-rank.r1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.leaderboard-rank.r2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.leaderboard-rank.r3 { background: linear-gradient(135deg, #fdba74, #ea580c); color: #fff; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .form-grid { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .content { padding: 14px; }
    .topbar { padding: 0 12px; }
    .branch-switcher { display: none; }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card .value { font-size: 21px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .user-menu-name { display: none; }
}

@media print {
    .sidebar, .topbar, .app-foot, .btn { display: none !important; }
}
