:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #00a8e6;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }

/* Login */
.login-page { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 420px; max-width: 92%; animation: fadeIn 0.5s ease; }
.login-brand { text-align: center; color: #fff; margin-bottom: 24px; }
.login-logo { width: 80px; height: 80px; border-radius: 50%; background: #fff; padding: 8px; margin-bottom: 12px; }
.login-brand h1 { font-size: 28px; letter-spacing: 2px; }
.login-brand p { opacity: 0.9; font-size: 16px; }
.login-box { background: #fff; border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.18); padding: 28px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.login-tab { flex: 1; padding: 12px; border: none; background: none; cursor: pointer; font-size: 15px; color: var(--text-secondary); position: relative; }
.login-tab.active { color: var(--primary); font-weight: 600; }
.login-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 20%; width: 60%; height: 2px; background: var(--primary); }
.login-form .form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; transition: border 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
#captchaCanvas, #registerCaptchaCanvas, #bindCaptchaCanvas { border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: #f9fafb; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: var(--radius); border: none; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.login-links a { color: var(--primary); font-size: 13px; text-decoration: none; }
.login-links a:hover { text-decoration: underline; }
.login-agreement { text-align: center; font-size: 12px; color: var(--text-secondary); margin-top: 18px; }
.login-agree { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--text-secondary); margin-top: 14px; line-height: 1.5; }
.login-agree input[type="checkbox"] { margin-top: 2px; flex: 0 0 auto; }
.login-agree a { color: var(--primary); text-decoration: none; }
.login-agree a:hover { text-decoration: underline; }
.guardian-fields { margin-top: 8px; padding: 12px; background: #f7faff; border: 1px solid var(--border); border-radius: var(--radius); }
.reg-minor select { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-content { background: #fff; border-radius: var(--radius); width: 420px; max-width: 92%; max-height: 90vh; overflow: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; }
.modal-close { font-size: 22px; cursor: pointer; color: var(--text-secondary); }
.modal-body { padding: 20px; }
.text-muted { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }

/* App layout */
.app-page { display: flex; }
.sidebar { width: var(--sidebar-width); height: 100vh; background: #0f2444; color: #fff; display: flex; flex-direction: column; position: fixed; left: 0; top: 0; transition: width 0.25s; z-index: 100; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand img { width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.brand-subtitle { font-size: 11px; opacity: 0.7; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group { margin-bottom: 4px; }
.nav-title { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font-size: 13px; color: rgba(255,255,255,0.65); cursor: pointer; }
.nav-title:hover { color: #fff; }
.nav-items { display: none; }
.nav-group.open > .nav-items { display: block; }
.nav-item { display: block; padding: 10px 16px 10px 32px; color: rgba(255,255,255,0.8); font-size: 13px; text-decoration: none; border-left: 3px solid transparent; position: relative; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,0.06); border-left-color: var(--accent); }
/* 菜单角标（回访提醒红点） */
.nav-badge { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 0 0 2px #0f2444; }
.col-sel { width: 38px; text-align: center; }
.col-sel input { width: 16px; height: 16px; cursor: pointer; }
.tool-divider { display: inline-block; width: 1px; height: 20px; background: var(--border); margin: 0 6px; vertical-align: middle; }
.sel-info { font-size: 12px; color: var(--accent); margin-left: 4px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-info { display: flex; flex-direction: column; margin-bottom: 8px; }
.user-info span { font-weight: 600; }
.user-info small { opacity: 0.65; font-size: 11px; }
.main-wrapper { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.25s; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 16px; position: sticky; top: 0; z-index: 90; }
.menu-toggle { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-secondary); }
.breadcrumb { flex: 1; font-size: 16px; font-weight: 600; }
.topbar-actions { color: var(--text-secondary); font-size: 13px; }
.main-content { flex: 1; padding: 20px; }

/* 护眼模式：降低蓝光、暖色柔化 */
body.eye-care { filter: sepia(0.22) saturate(0.85) brightness(0.97); }
body.eye-care .topbar, body.eye-care .sidebar { filter: none; }
.usage-timer { font-size: 12.5px; color: var(--text-secondary); background: #f3f6fa; padding: 4px 10px; border-radius: 12px; }
.usage-timer.warn { color: #92400e; background: #fef3c7; }

/* 防沉迷休息提醒 */
.rest-toast { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: flex; align-items: center; gap: 12px; width: 320px; background: #fff; border: 1px solid #fde68a; box-shadow: 0 8px 28px rgba(0,0,0,0.16); border-radius: 12px; padding: 14px 16px; animation: fadeIn 0.3s; }
.rest-toast.hidden { display: none; }
.rest-toast-icon { font-size: 26px; }
.rest-toast-body { flex: 1; }
.rest-toast-body strong { font-size: 14px; color: #92400e; }
.rest-toast-body p { font-size: 12.5px; color: #5b5542; margin: 4px 0 0; line-height: 1.5; }

/* Dashboard */
.dashboard { animation: fadeIn 0.3s; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi-card h4 { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; font-weight: normal; }
.kpi-card .value { font-size: 26px; font-weight: 700; color: var(--primary); }
.kpi-card .sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }

/* 鼓励横幅（每日寄语 + 学习提示） */
.encourage-banner { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: #fff; border-radius: 14px; padding: 18px 22px; margin-bottom: 16px; box-shadow: 0 6px 18px rgba(37,99,235,0.18); }
.encourage-banner.mini { background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%); }
.encourage-banner .eb-greet { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.encourage-banner .eb-quote { font-size: 15px; opacity: 0.96; line-height: 1.6; }
.encourage-banner .eb-tip { font-size: 13px; opacity: 0.92; margin-top: 8px; }

/* 学习资源中心 */
.study-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.study-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: var(--card); box-shadow: var(--shadow); }
.study-card .subj-head { display: flex; align-items: center; font-weight: 700; font-size: 17px; color: var(--text); margin-bottom: 10px; }
.study-card .subj-head .dot { width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; }
.study-card .subj-head .fs { margin-left: auto; font-size: 12px; color: var(--text-secondary); font-weight: 500; background: #f1f5f9; padding: 2px 10px; border-radius: 20px; }
.study-card .kp-title { font-size: 13px; font-weight: 600; color: var(--text); margin: 10px 0 6px; }
.study-card .keypoints p { margin: 0 0 4px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.kp-chapter { border-top: 1px dashed #eef2f7; }
.kp-chapter:first-child { border-top: none; }
.kp-ch-title { display: flex; align-items: center; gap: 8px; padding: 10px 2px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); user-select: none; }
.kp-ch-title:hover { color: var(--primary); }
.kp-arrow { color: var(--primary); font-size: 11px; transition: 0.15s; }
.kp-count { margin-left: auto; font-size: 12px; color: #94a3b8; font-weight: 400; }
.kp-body { padding: 0 0 8px 4px; }
.kp-ch-intro { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.65; background: #f8fafc; border-left: 3px solid var(--sc, #2563eb); padding: 6px 10px; border-radius: 0 6px 6px 0; }
.kp-item { position: relative; margin: 7px 0 7px 14px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kp-item::before { content: '•'; color: var(--sc, #2563eb); position: absolute; left: -14px; font-weight: 700; }
.kp-formula { display: inline-block; font-family: 'Cascadia Code','Consolas','SFMono-Regular','Menlo',monospace; font-size: 12.5px; color: #0f766e; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 6px; padding: 2px 8px; }
.course-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.course-link-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #fff; background: var(--sc, #2563eb); padding: 7px 12px; border-radius: 8px; text-decoration: none; transition: 0.15s; }
.course-link-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* 知识点难度星级 */
.kp-stars { margin-left: 8px; font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.kp-star-on { color: #f59e0b; }
.kp-star-off { color: #cbd5e1; }
.kp-item-text { vertical-align: middle; }

/* 题库 */
.qb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.qb-tab { border: 1px solid var(--border, #e2e8f0); background: #fff; color: #334155; padding: 7px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: .15s; }
.qb-tab.active { background: var(--sc, #2563eb); border-color: var(--sc, #2563eb); color: #fff; }
.qb-chapter { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.qb-ch-title { padding: 10px 14px; font-weight: 600; color: #1e293b; background: #f8fafc; border-bottom: 1px solid var(--border, #e2e8f0); display: flex; align-items: center; gap: 8px; }
.qb-count { font-size: 12px; color: #94a3b8; font-weight: 400; }
.qb-items { padding: 10px 14px 14px; }
/* 进度条 */
.qb-progress { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: #475569; }
.qbp-item b { color: #1e293b; font-size: 15px; }
.qbp-bar { flex: 1; min-width: 120px; height: 8px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.qbp-fill { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #0ea5e9); transition: width .3s; }
/* 题目卡片 */
.qb-qcard { padding: 12px 0; border-bottom: 1px dashed #eef2f7; }
.qb-qcard:last-child { border-bottom: none; }
.qb-qhead { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #1e293b; line-height: 1.6; }
.qb-qno { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #eff6ff; color: #2563eb; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.qb-qtext { flex: 1; }
.qb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px 30px; }
.qb-opt { display: flex; align-items: flex-start; gap: 8px; text-align: left; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; padding: 9px 11px; cursor: pointer; font-size: 13.5px; color: #334155; transition: .15s; line-height: 1.5; }
.qb-opt:hover:not(:disabled) { border-color: #2563eb; background: #eff6ff; }
.qb-opt:disabled { cursor: default; }
.qb-opt-l { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #e2e8f0; color: #475569; font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.qb-opt-t { flex: 1; }
.qb-opt.correct { background: #f0fdf4; border-color: #16a34a; }
.qb-opt.correct .qb-opt-l { background: #16a34a; color: #fff; }
.qb-opt.wrong { background: #fef2f2; border-color: #dc2626; }
.qb-opt.wrong .qb-opt-l { background: #dc2626; color: #fff; }
/* 反馈区 */
.qb-feedback { margin: 4px 0 4px 30px; }
.qb-fb { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.qb-fb.ok { color: #16a34a; }
.qb-fb.no { color: #dc2626; }
.qb-exp { background: #f8fafc; border-left: 3px solid #0ea5e9; border-radius: 0 8px 8px 0; padding: 8px 12px; font-size: 13px; color: #334155; line-height: 1.7; }
.qb-label { display: inline-block; min-width: 20px; font-weight: 700; color: #2563eb; margin-right: 4px; }
.qb-label.exp { color: #0ea5e9; }
.qb-mistake-note { margin-top: 8px; font-size: 12.5px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 10px; display: inline-block; }
.kp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 2px 0 14px; font-size: 13px; }

/* 模拟考试 */
.exam-paper-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.exam-paper-card { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 16px; border-top: 3px solid var(--sc, #2563eb); }
.epc-head { font-weight: 600; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.epc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, #2563eb); }
.epc-meta { font-size: 12px; color: #94a3b8; margin: 8px 0 12px; }
.epc-start { width: 100%; background: var(--sc, #2563eb); color: #fff; border: none; padding: 9px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: .15s; }
.epc-start:hover { opacity: .9; }
.exam-paper-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ep-back { background: #f1f5f9; border: none; color: #475569; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ep-back:hover { background: #e2e8f0; }
.ep-title { font-weight: 600; color: #1e293b; flex: 1; }
.ep-progress { font-size: 13px; color: #64748b; }
.exam-questions { display: flex; flex-direction: column; gap: 12px; }
.exam-q { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 14px; }
.exam-q.result.right { border-color: #bbf7d0; background: #f0fdf4; }
.exam-q.result.wrong { border-color: #fecaca; background: #fef2f2; }
.exam-q.result.blank { border-color: #fde68a; background: #fffbeb; }
.eq-head { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: #1e293b; line-height: 1.6; }
.eq-no { font-weight: 700; color: #2563eb; }
.eq-tag { margin-left: auto; font-size: 12px; font-weight: 600; }
.exam-q.right .eq-tag { color: #16a34a; }
.exam-q.wrong .eq-tag { color: #dc2626; }
.exam-q.blank .eq-tag { color: #d97706; }
.eq-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.eq-opt { display: flex; align-items: center; gap: 8px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 9px 12px; cursor: pointer; font-size: 13px; color: #334155; transition: .15s; }
.eq-opt:hover { border-color: #93c5fd; background: #f8fafc; }
.eq-opt input { accent-color: #2563eb; }
.eq-opt.correct { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; font-weight: 600; }
.eq-opt.picked { border-color: #fecaca; background: #fef2f2; }
.eq-exp { margin-top: 10px; background: #f8fafc; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #334155; line-height: 1.7; display: flex; gap: 4px; }
.exam-submit-bar { margin-top: 18px; text-align: center; }
.exam-submit { background: #2563eb; color: #fff; border: none; padding: 12px 40px; border-radius: 10px; cursor: pointer; font-size: 15px; font-weight: 600; }
.exam-submit:hover { opacity: .9; }
.exam-score-card { text-align: center; background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 14px; padding: 22px; margin-bottom: 16px; }
.es-score { font-size: 44px; font-weight: 800; color: #2563eb; }
.es-total { font-size: 20px; color: #94a3b8; font-weight: 500; }
.es-meta { margin-top: 8px; font-size: 14px; color: #475569; }
.kp-legend-item { color: var(--text-secondary); }
.kp-legend-item .kp-star-on { color: #f59e0b; }
.kp-legend-item .kp-star-off { color: #cbd5e1; }

.form-actions.col { flex-direction: column; align-items: stretch; }

/* 打卡日历 */
.calendar { max-width: 100%; }
.cal-head, .cal-body { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-head { margin-bottom: 8px; }
.cal-head div { text-align: center; font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.cal-cell { min-height: 78px; border-radius: var(--radius); padding: 8px; border: 1px solid var(--border); transition: transform 0.1s; }
.cal-cell.empty { background: transparent; border: none; }
.cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.25); }
.cal-date { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-info { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.cal-info.muted { color: #cbd5e1; }

/* 首页待办卡片 */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.todo-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--primary); padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.todo-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.10); }
.todo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.todo-title { font-size: 15px; font-weight: 600; }
.todo-count { color: #fff; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 12px; padding: 0 8px; font-size: 13px; font-weight: 700; }
.todo-list { list-style: none; margin: 0; padding: 0; max-height: 132px; overflow: auto; }
.todo-list li { font-size: 13px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px dashed var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-empty { color: var(--text-secondary); }
.todo-foot { margin-top: 10px; font-size: 12px; color: var(--primary); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 15px; }
.card-body { padding: 20px; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 0; }
.chart-card.span-2 { grid-column: span 2; }
.chart-card .chart { width: 100%; height: 300px; }
.form-actions.col { flex-direction: column; align-items: stretch; }

/* Table */
.table-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-toolbar input, .table-toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: #f9fafb; color: var(--text-secondary); font-weight: 600; }
.table tr:hover { background: #f9fafb; }
.table .actions { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 12px; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-default { background: #f3f4f6; color: #4b5563; }

/* Pagination */
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; }
.pagination button { padding: 6px 12px; border: 1px solid var(--border); background: #fff; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--text-secondary); }

/* Form */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h2 { font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Misc */
.hidden { display: none !important; }
.empty-state { text-align: center; padding: 40px; color: var(--text-secondary); }
.empty-state p { margin-top: 8px; }

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

@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar-brand .brand-title, .sidebar-brand .brand-subtitle, .nav-title span, .nav-item span, .user-info { display: none; }
  .main-wrapper { margin-left: var(--sidebar-collapsed); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.span-2 { grid-column: span 1; }
}

/* ---------- 角色权限编辑器 ---------- */
.role-editor { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.role-list .role-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; transition: all .15s; background: #fff; }
.role-list .role-item:hover { border-color: var(--primary); }
.role-list .role-item.active { border-color: var(--primary); background: var(--primary-light); }
.role-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.role-key { font-size: 11px; font-weight: 400; color: var(--text-secondary); background: #eef2f7; border-radius: 4px; padding: 1px 6px; }
.role-desc { font-size: 12px; color: var(--text-secondary); margin: 4px 0; }
.role-meta { font-size: 12px; color: var(--primary); }
.role-perm-body { max-height: 70vh; overflow: auto; }
.perm-section { margin-bottom: 22px; }
.perm-section h4 { font-size: 14px; margin-bottom: 10px; color: var(--text); border-left: 3px solid var(--primary); padding-left: 8px; }
.tree { display: flex; flex-direction: column; gap: 8px; }
.tree-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: #fcfdff; }
.tree-parent { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; color: var(--text); }
.tree-children { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 8px; padding-left: 22px; }
.tree-leaf { font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }
.tree-leaf input, .tree-parent input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }
.admin-note { background: var(--primary-light); border: 1px solid #cfe0f7; color: var(--primary-dark); padding: 14px 16px; border-radius: var(--radius); font-size: 13px; }

/* ---------- 附件上传组件 ---------- */
.form-full { grid-column: 1 / -1; }
.att-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.att-empty { color: var(--text-secondary); font-size: 13px; padding: 6px 0; }
.att-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fcfdff; font-size: 13px; }
.att-item a { color: var(--primary); text-decoration: none; font-weight: 500; }
.att-item a:hover { text-decoration: underline; }
.att-size { color: var(--text-secondary); font-size: 12px; }
.att-del { margin-left: auto; border: none; background: transparent; color: #dc2626; cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; }
.att-del:hover { background: #fde8e8; }
.att-upload { display: flex; align-items: center; gap: 10px; }
.detail-attach { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.detail-attach h4 { font-size: 14px; margin-bottom: 8px; color: var(--text); border-left: 3px solid var(--primary); padding-left: 8px; }
@media (max-width: 900px) {
  .role-editor { grid-template-columns: 1fr; }
}

/* ---------- P1 智能学情 ---------- */
.weak-list { display: flex; flex-direction: column; gap: 10px; }
.weak-item { display: flex; align-items: center; gap: 12px; }
.weak-rank { width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: #fee2e2; color: #b91c1c; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.weak-name { width: 64px; flex: 0 0 auto; font-weight: 600; font-size: 14px; }
.weak-bar { flex: 1; height: 10px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.weak-fill { display: block; height: 100%; background: linear-gradient(90deg, #ef4444, #f59e0b); border-radius: 6px; }
.weak-val { width: 96px; flex: 0 0 auto; font-size: 12.5px; color: var(--text-secondary); text-align: right; }
.sp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px; margin-bottom: 16px; }
.sp-toolbar label { font-size: 13px; color: var(--text-secondary); }
.sp-toolbar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.sp-progress { font-size: 13px; color: var(--primary); margin-bottom: 10px; font-weight: 600; }
.sp-actions { margin-top: 12px; }
.sp-result { padding: 28px; text-align: center; }
.sp-result h3 { font-size: 18px; margin-bottom: 10px; }
.sp-result-num { font-size: 15px; color: var(--text-secondary); margin-bottom: 8px; }
.sp-result-num b { font-size: 24px; color: var(--primary); }
.rp-range { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rp-range li { font-size: 14px; color: var(--text); }
.rp-range b { color: var(--primary); font-size: 16px; }
.rp-text { font-size: 14px; line-height: 1.8; color: var(--text); }
.rp-text p { margin-bottom: 10px; }

/* P1-3 错题同类题 */
.sim-area { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 14px; }
.sim-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.sim-q { margin-bottom: 14px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fcfdff; }
.sim-q .qb-qhead { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.sim-q .qb-qtext { flex: 1; }
.sim-q .qb-opts { display: flex; flex-direction: column; gap: 6px; }
