/* 博雅 引航书院 · 家校共育平台（正式版）
   设计语言：苹果风格（浅灰底、毛玻璃导航、大圆角卡片、胶囊按钮）
   + iMac 马卡龙配色（七色点缀，科目三档色板：深色/粉彩/浅底）
   遵循 https://www.apple.com.cn/newsroom/2021/04/imac-features-all-new-design-in-vibrant-colors-m1-chip-and-45k-retina-display/ */
:root {
  /* 基础（苹果） */
  --accent: #0071e3;
  --accent-strong: #005bb5;
  --accent-light: #edf5ff;
  --accent-pastel: #bbd7f0;
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --line: #e8e8ed;
  --radius: 20px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .05);
  --danger: #c0392b;
  --ok: #1d7a46;
  /* iMac 马卡龙七色（点缀用） */
  --mac-blue: #6a9fd8;
  --mac-green: #9cc5a1;
  --mac-pink: #e8a8b8;
  --mac-orange: #f0a878;
  --mac-yellow: #e9cf7e;
  --mac-purple: #9a8fc0;
  --mac-red: #e8786a;
  --mac-silver: #c8c9cb;
  /* 品牌多彩渐变 */
  --brand-grad: linear-gradient(135deg, #0071e3 0%, #6a9fd8 38%, #9a8fc0 70%, #e8a8b8 100%);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}
button { font: inherit; cursor: pointer; transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(0,113,227,.35); outline-offset: 3px; }

/* ---------- 登录页（苹果风） ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #eef4fb 0%, #f5f5f7 42%, #f7f1f4 72%, #f3f1e8 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(20px);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 42px 38px 32px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 56px; height: 56px; border-radius: 18px;
  background: var(--brand-grad);
  color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 6px 18px rgba(0, 113, 227, .18);
}
.login-brand h1 { font-size: 22px; letter-spacing: -.6px; margin: 0 0 4px; }
.login-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: #4a4a4f; }
.login-card input {
  width: 100%; padding: 12px 15px; border: 1px solid var(--line);
  border-radius: 12px; background: #fafafc; outline: none;
}
.login-card input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(0, 113, 227, .12); }
.login-card .primary { width: 100%; margin-top: 24px; padding: 13px; border-radius: 999px; font-weight: 500; }
.login-hint { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.login-hint p { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.quick-accounts { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-accounts button {
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: #4a4a4f;
}
.quick-accounts button:hover { border-color: var(--accent); color: var(--accent); }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 10px; }

/* ---------- 布局：顶部毛玻璃导航（苹果风） ---------- */
.layout { display: block; min-height: 100vh; }
.sidebar {
  height: 66px;
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-direction: row; align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  background: rgba(250, 250, 252, .86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(210, 210, 215, .4);
  gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.6px; white-space: nowrap; padding: 0; }
.logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-grad);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 113, 227, .2);
}
.brand-sub { display: none; }
.sidebar nav { display: flex; flex: 1; min-width: 0; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.mobile-nav-toggle { display: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.nav {
  display: flex; flex-shrink: 0; align-items: center; gap: 5px;
  padding: 22px 13px 20px; margin: 0;
  border: 0; border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent; color: #606065; font-size: 13px; white-space: nowrap;
}
.nav .icon { display: none; }
.nav:hover { color: var(--text); background: none; }
.nav.active { background: none; color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.nav-badge {
  font-style: normal; background: var(--mac-red); color: #fff;
  font-size: 10px; line-height: 16px; min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 999px; display: inline-block; text-align: center; margin-left: 3px;
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  border: 0; margin: 0; padding: 0; flex: none;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #0071e3, #9a8fc0); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; font-size: 13px;
}
.user-chip .who { display: block; min-width: 0; max-width: 120px; }
.user-chip .who strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who small { display: block; color: var(--muted); font-size: 10px; }
.user-chip .logout { font-size: 12px; color: var(--muted); border: 0; background: none; padding: 6px; }
.user-chip .logout:hover { color: var(--danger); }

.main { padding: 40px 24px 70px; max-width: 1240px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.crumb { font-size: 12px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 600; }
.topbar .role-tag {
  font-size: 12px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-light); color: var(--accent-strong);
  font-weight: 500;
}
.heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.heading h1 { margin: 0; font-size: 34px; letter-spacing: -1.2px; font-weight: 650; line-height: 1.2; }
.heading .sub { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- 通用组件（苹果风卡片） ---------- */
.panel {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 20px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.4px; }
.panel-head .sub, .sub { color: var(--muted); font-size: 13px; }
.notice {
  background: #fdf8ee; border: 1px solid #f3e3bd; color: #7a5c14;
  border-radius: 14px; padding: 14px 18px; font-size: 13px; line-height: 1.7; margin-bottom: 20px;
}
.primary, .secondary, .text-btn {
  border-radius: 999px; padding: 10px 20px; font-size: 13px; border: 0;
}
.primary { background: var(--accent); color: #fff; font-weight: 500; }
.primary:hover { background: var(--accent-strong); transform: translateY(-1px); }
.primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.secondary { background: #eef0f3; color: #333; }
.secondary:hover { background: #e2e5ea; }
.text-btn { background: none; color: var(--accent); padding: 5px 10px; font-size: 13px; border-radius: 999px; }
.text-btn:hover { background: var(--accent-light); text-decoration: none; }
.text-btn.danger { color: var(--danger); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.tag {
  display: inline-block; font-size: 11px; padding: 3px 11px;
  border-radius: 999px; background: #f2f2f4; color: #6e6e73;
}
.tag.blue { background: var(--accent-light); color: var(--accent-strong); }
.empty { color: var(--muted); text-align: center; padding: 32px 10px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: #fafafc; }
.table-wrap { overflow-x: auto; }

/* ---------- 统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.stat-label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.stat strong { font-size: 30px; letter-spacing: -1px; display: block; margin: 8px 0 2px; font-weight: 600; }
.stat small { color: var(--muted); font-size: 11px; }

/* ---------- 课表 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.toolbar select, .toolbar input {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; outline: none; font-size: 13px;
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }

.timetable-wrap { overflow-x: auto; }
table.timetable { min-width: 720px; border-collapse: separate; border-spacing: 0; }
table.timetable th, table.timetable td { border: 1px solid var(--line); border-bottom: 0; border-right: 0; }
table.timetable th:last-child, table.timetable td:last-child { border-right: 1px solid var(--line); }
table.timetable tr:last-child th, table.timetable tr:last-child td { border-bottom: 1px solid var(--line); }
table.timetable th { background: #fafafc; font-size: 12px; text-align: center; padding: 9px 6px; }
table.timetable td { text-align: center; vertical-align: top; padding: 0; min-width: 92px; height: 62px; }
.slot-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cell {
  height: 100%; min-height: 62px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; padding: 6px 4px;
}
.cell .subject { font-size: 13px; font-weight: 600; }
.cell .teacher { font-size: 11px; color: var(--muted); }
.cell.empty { color: #c8c8cc; }
.cell.rest { background: #f6f6f8; color: #b8b8bd; font-size: 12px; }
.cell.editable { cursor: pointer; }
.cell.editable:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell .room { font-size: 10px; color: #a8a8ad; }

/* 科目配色默认值；动态配置会补齐浅底与可读的文字色。 */
.subj-语文 { --c:#EB5072; --pastel:#f8c0cc; --bg:#fdeaee; --subject-ink:#ad1435; }
.subj-数学 { --c:#448CE3; --pastel:#bcd6f5; --bg:#e9f1fc; --subject-ink:#195aa8; }
.subj-英语 { --c:#9364D5; --pastel:#d8c7f0; --bg:#f2ecfa; --subject-ink:#6f35c2; }
.subj-生物 { --c:#37AC72; --pastel:#b7e1cc; --bg:#e7f5ee; --subject-ink:#226a46; }
.subj-化学 { --c:#24AAA6; --pastel:#b0e0df; --bg:#e5f5f4; --subject-ink:#166764; }
.subj-物理 { --c:#6572D9; --pastel:#c8ccf1; --bg:#edeefa; --subject-ink:#3445cd; }
.subj-地理 { --c:#F28C38; --pastel:#fad6b7; --bg:#fdf1e7; --subject-ink:#96490a; }
.subj-政治 { --c:#C45EC2; --pastel:#eac5e9; --bg:#f8ecf8; --subject-ink:#8d348c; }
.subj-历史 { --c:#CE922B; --pastel:#edd8b3; --bg:#f9f2e6; --subject-ink:#7e591a; }
.subj-体育 { --c:#36ADDB; --pastel:#b7e1f2; --bg:#e7f5fb; --subject-ink:#186684; }
.cell:not(.rest):not(.empty) { background: linear-gradient(135deg, var(--bg), var(--pastel)); border-left: 3px solid var(--c); }
.cell .subject { color: var(--subject-ink, var(--c)); }

/* ---------- 排课管理 ---------- */
.tabs { display: flex; gap: 4px; background: #eef0f3; padding: 4px; border-radius: 999px; width: fit-content; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 8px 20px; border-radius: 999px; font-size: 13px; color: #4a4a4f; }
.tabs button.active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); color: var(--text); font-weight: 600; }
.period-row { display: grid; grid-template-columns: 70px 1fr 1fr 60px 70px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.period-row:last-child { border-bottom: 0; }
.period-row input, .period-row select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.period-head { display: grid; grid-template-columns: 70px 1fr 1fr 60px 70px; gap: 10px; color: var(--muted); font-size: 12px; padding-bottom: 4px; }

/* 排课编辑弹窗 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog#modal {
  border: 0; border-radius: 24px; padding: 0; max-width: 560px; width: 92%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
}
#modal::backdrop { background: rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
.modal-body { padding: 28px 30px; }
.modal-body h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.4px; }
.modal-body label { display: block; font-size: 13px; color: #4a4a4f; margin: 12px 0 5px; }
.modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafafc; outline: none;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--accent); background: #fff; }
.modal-body textarea { resize: vertical; }
.modal-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-top: 8px; }

/* ---------- 组织结构 ---------- */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.org-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--card); box-shadow: var(--shadow); }
.org-card h3 { margin: 0 0 6px; font-size: 15px; }
.org-card p { margin: 0; color: var(--muted); font-size: 12px; }
.status-ok { color: var(--ok); }
.status-off { color: var(--danger); }

/* ---------- 提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: rgba(29, 29, 31, .92); color: #fff; padding: 12px 24px;
  border-radius: 999px; font-size: 13px; display: none; z-index: 99; max-width: 80vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
#toast.error { background: rgba(192, 57, 43, .95); }

/* ---------- 账号页 ---------- */
.account-card { display: flex; gap: 18px; align-items: center; }
.account-card .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 20px; }
.account-info h2 { margin: 0 0 4px; letter-spacing: -.4px; }
.account-info p { margin: 2px 0; color: var(--muted); font-size: 13px; }

/* ===== 新增功能样式：邀请码注册 / 头像 / 通知 / 反馈（同苹果马卡龙风） ===== */
.register-entry { margin-top: 14px; font-size: 13px; }
.invite-student { margin: 6px 0 14px; padding: 11px 14px; border: 1px dashed rgba(0,113,227,.4); border-radius: 14px; background: var(--accent-light); }
.invite-badge { display: inline-block; font-size: 11px; color: var(--accent-strong); border: 1px solid rgba(0,113,227,.3); border-radius: 999px; padding: 1px 11px; margin-bottom: 6px; background: #fff; }
.nav-badge { font-style: normal; background: var(--mac-red); color: #fff; font-size: 10px; line-height: 16px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; display: inline-block; text-align: center; margin-left: 3px; }
/* 状态标签：马卡龙三档（绿/红/黄，取科目色板） */
.tag-ok { color: #317966; background: #eaf5f0; }
.tag-bad { color: #bb4657; background: #fbeced; }
.tag-warn { color: #876618; background: #fcf6df; }
/* 头像管理（账号页） */
.avatar-manage { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin: 18px 0; }
.avatar-big { width: 96px; height: 96px; border-radius: var(--radius); overflow: hidden; background: #f6f6f8; display: flex; align-items: center; justify-content: center; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { font-size: 40px; color: var(--muted); }
.avatar-upload { flex: 1; min-width: 260px; }
.avatar-upload input[type=file] { margin-bottom: 10px; }
.avatar-thumb { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; background: #f6f6f8; }
.avatar-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 头像审核队列 */
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.avatar-card { border: 0; border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.avatar-card-img { width: 100%; height: 180px; background: #f6f6f8; display: flex; align-items: center; justify-content: center; }
.avatar-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.avatar-card-body { padding: 14px 16px; }
.avatar-card-body h3 { margin: 0 0 4px; font-size: 15px; }
.avatar-review-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.avatar-review-actions .review-note { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: #fafafc; }
/* 通知中心 */
.notice-item { display: flex; gap: 12px; padding: 16px 6px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notice-item.unread { background: rgba(0,113,227,.04); border-radius: 12px; }
.notice-item .notice-icon { width: 18px; text-align: center; color: var(--muted); }
.notice-item.unread .notice-icon { color: var(--accent); }
.notice-body { flex: 1; min-width: 0; }
.notice-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.notice-title small { margin-left: auto; }
.notice-body p { margin: 6px 0 0; color: var(--text); }
/* 家校反馈 */
.feedback-thread { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 6px; border-bottom: 1px solid var(--line); }
.feedback-thread h3 { margin: 0 0 4px; font-size: 15px; }
.fb-thread { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.fb-msg { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: var(--card); }
.fb-msg.system { background: var(--accent-light); border-color: #d6e6fa; }
.fb-msg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.fb-msg p { margin: 0; color: var(--text); }

/* ---------- 成绩追踪 / 学习分析（苹果马卡龙风） ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); margin-bottom: 20px; }
.track-toolbar { display: block; margin-bottom: 22px; }
.subject-discovery { margin-bottom: 20px; }
.subject-tabs { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); gap: 10px; margin-bottom: 18px; }
.subject-tabs button {
  display: flex; align-items: center; flex-direction: column; gap: 7px;
  background: linear-gradient(145deg, var(--bg), var(--pastel)); border: 1px solid var(--pastel); border-top: 4px solid var(--c); border-radius: 18px;
  padding: 15px 4px 12px; color: var(--subject-ink, #31313a); font-size: 12px; font-weight: 600; min-width: 0;
}
.subject-tabs button:hover { transform: translateY(-3px); box-shadow: 0 6px 16px #1d1d1f12; }
.subject-tabs button.chosen { border-color: var(--c); color: var(--subject-ink); box-shadow: inset 0 0 0 2px var(--c); }
.subject-orb {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(145deg, #fff, var(--pastel));
  color: var(--subject-ink, #31313a); font-size: 16px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .14), inset 0 1px 2px rgba(255, 255, 255, .35);
}
.subject-tabs small { font-size: 9px; color: var(--subject-ink, #515154); font-weight: 400; white-space: nowrap; }
.subject-tabs .chosen small { font-weight: 600; }
.track-selects { display: flex; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.track-selects label { font-size: 11px; color: #86868b; display: flex; align-items: center; gap: 7px; }
.track-selects select { border-radius: 999px; border: 1px solid #d2d2d7; background: #fff; color: #515154; padding: 8px 12px; font-size: 12px; }
.track-stats .stat:first-child { background: var(--sc-light, var(--accent-light)); }
.track-stats .stat:first-child strong { color: var(--sc, var(--accent)); }
.track-stats .stat:last-child strong { font-size: 25px; }
.track-chart-head { align-items: flex-start; gap: 14px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.chart-legend button { font-size: 11px; color: #6e6e73; background: none; border: 0; display: flex; align-items: center; gap: 5px; padding: 3px 0; }
.chart-legend button i { width: 14px; height: 3px; border-radius: 3px; display: inline-block; }
.chart-legend button.muted { opacity: .4; }
.chart-legend button[data-series="avg"] i { border-radius: 0; height: 3px; }
.chart-legend button[data-series="high"] i { transform: rotate(45deg); }
.chart-legend button[data-series="low"] i { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.chart-scroll { overflow-x: auto; padding-bottom: 6px; }
.trend-svg { display: block; }
.axis-label { fill: #86868b; font-size: 10px; }
.exam-pickers { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.exam-pickers button { border: 1px solid #e8e8ed; border-radius: 12px; padding: 11px 14px; color: #6e6e73; font-size: 12px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.exam-pickers button span { color: #86868b; font-size: 11px; }
.exam-pickers .chosen { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.exam-detail { background: #f5f5f7; border: 0; border-radius: 15px; padding: 20px 22px; margin-top: 18px; }
.exam-detail h3 { margin: 4px 0 4px; font-size: 17px; letter-spacing: -.4px; }
.detail-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0 10px; }
.detail-values div { display: flex; flex-direction: column; gap: 4px; }
.detail-values span { font-size: 12px; }
.detail-values strong { font-size: 26px; letter-spacing: -.8px; font-weight: 600; }
.detail-values strong small { font-size: 11px; color: #86868b; margin-left: 3px; font-weight: 400; }
.comparison-insight { margin: 0; color: #6e6e73; border-top: 1px solid #dedee3; padding-top: 10px; font-size: 13px; }
.gap-chart { display: flex; flex-direction: column; gap: 12px; }
.gap-row { display: flex; align-items: center; gap: 12px; color: #6e6e73; font-size: 12px; }
.gap-row span { min-width: 130px; white-space: nowrap; }
.gap-row b { min-width: 44px; text-align: right; font-weight: 600; color: var(--text); }
.gap-track { position: relative; flex: 1; height: 10px; background: #f5f5f7; border-radius: 999px; overflow: hidden; }
.gap-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #b7b7bd; transform: translateX(-50%); }
.gap-fill { position: absolute; top: 0; bottom: 0; background: var(--sc, var(--accent)); border-radius: 999px; }
.gap-fill.negative { background: var(--sc-light, var(--accent-pastel)); }
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #515154; }
.bar-row > span:first-child { min-width: 34px; font-weight: 500; }
.bar-row > span:last-child { min-width: 40px; text-align: right; color: #6e6e73; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 10px; background: #eeeef1; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 999px; }
.eyebrow { font-size: 10px; font-weight: 500; color: #86868b; letter-spacing: 1px; }

/* ---------- 学科与配色管理（教务） ---------- */
.subject-color-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.subject-color-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--pastel); border-left: 5px solid var(--c); border-radius: 16px; background: linear-gradient(110deg, var(--bg), #fff); flex-wrap: wrap; }
.subject-color-row b { color: var(--subject-ink); }
.subject-color-preview { padding: 6px 10px; border-radius: 9px; background: var(--c); color: var(--on-subject, #1d1d1f); font-size: 11px; }
.subject-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.removed-subjects { margin: 18px 0; }
.removed-subjects > summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.subject-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); flex: none; }
.subject-color-row b { min-width: 56px; font-size: 13px; }
.palette { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.palette-dot { width: 29px; height: 29px; border-radius: 9px; border: 2px solid transparent; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .08); transition: transform .15s, box-shadow .15s; }
.palette-dot:hover { transform: scale(1.18); }
.palette-dot.on { border-color: #1d1d1f; transform: scale(1.12); }
.subject-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px dashed var(--line); }
.subject-add input { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; min-width: 200px; outline: none; }
.subject-add input:focus { border-color: var(--accent); }

/* ---------- 学生管理 ---------- */
.class-group { border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.class-group summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.class-group summary::-webkit-details-marker { display: none; }
.class-group summary .class-title { font-weight: 600; font-size: 14px; }
.class-group summary .count { color: var(--muted); font-size: 12px; }
.class-group summary .primary.sm { margin-left: auto; padding: 6px 14px; font-size: 12px; border-radius: 999px; }
.class-group .table-wrap { border-top: 1px solid var(--line); }
.class-manage-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.class-manage-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px 4px 10px; border-radius: 999px; background: #f5f6f8; color: #515154; font-size: 12px; }
.class-manage-item .text-btn { padding: 2px 4px; font-size: 11px; }
.removed-class-panel { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line); }
.removed-class-panel h3 { margin: 0 0 5px; font-size: 14px; }
.removed-class-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.removed-class-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid #ececf0; border-radius: 12px; background: #fafafc; }
.removed-class-row > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.removed-class-row small { color: var(--muted); font-size: 11px; }
.removed-class-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.check-line { display: flex !important; align-items: center; gap: 8px; }
.check-line input { width: auto !important; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--chip-bg, #f0f1f3); color: #515154; font-size: 11px; cursor: pointer; margin: 2px 2px 2px 0; white-space: nowrap; }
.chip.ok { background: #eaf6ee; color: #2d7a4f; }
.chip small { opacity: .75; }
.invite-result { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.invite-result div { display: flex; align-items: center; gap: 10px; }
.invite-result code { background: var(--chip-bg, #f0f1f3); padding: 6px 12px; border-radius: 10px; font-size: 13px; letter-spacing: 1px; }
.student-batch-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.pwd-fields { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pwd-fields label { flex: 1; min-width: 160px; }
.pwd-fields input { width: 100%; }
.class-overview { margin-top: 18px; }
.overview-stats { margin: 12px 0 16px; }
.overview-stats .stat { padding: 14px 16px; box-shadow: none; border: 1px solid var(--line); }
.overview-stats .stat strong { font-size: 25px; margin: 5px 0 1px; }
.class-subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; }
.class-subject-card { min-height: 148px; padding: 16px; border: 1px solid var(--pastel); border-top: 5px solid var(--c, var(--accent)); border-radius: 18px; background: linear-gradient(140deg, var(--bg), var(--pastel)); color: var(--subject-ink); }
.class-subject-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.class-subject-head .subject-orb { width: 27px; height: 27px; font-size: 12px; }
.class-subject-head div { display: flex; flex-direction: column; min-width: 0; }
.class-subject-head b { font-size: 13px; }
.class-subject-head small { color: var(--subject-ink); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-subject-card > strong { display: block; margin: 12px 0 5px; font-size: 23px; letter-spacing: -.5px; }
.class-subject-card > .sub { display: block; margin-top: 6px; font-size: 11px; color: var(--subject-ink); }
.mini-progress { height: 7px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); }
.overview-delta { color: var(--ok); }
.overview-delta.down { color: var(--danger); }
.class-distribution { margin-top: 18px; }
.distribution-list { display: flex; flex-direction: column; gap: 12px; }
.distribution-row { display: grid; grid-template-columns: 54px 1fr 48px 45px; gap: 10px; align-items: center; font-size: 12px; }
.distribution-row > span { color: #4a4a4f; }
.distribution-row > b { text-align: right; font-weight: 600; }
.distribution-row > small { color: var(--muted); text-align: right; }
.distribution-track { height: 10px; background: #eef0f3; border-radius: 999px; overflow: hidden; }
.distribution-track i { display: block; height: 100%; border-radius: inherit; }

/* 学科色延伸到内容板块：浅色画布、同色标题带及数据卡片。 */
.subject-panel { background: linear-gradient(145deg, var(--bg) 0%, #fff 75%); border: 1px solid var(--pastel); border-top: 5px solid var(--c); }
.subject-panel > .panel-head { background: var(--pastel); color: var(--subject-ink); border-radius: 13px; padding: 14px 16px; }
.subject-panel > .panel-head .sub { color: var(--subject-ink); }
.subject-panel .tag { background: #ffffffc9; color: var(--subject-ink); }
.subject-panel .chart-scroll { background: #ffffffd9; border-radius: 14px; padding: 10px 0; }
.subject-panel .exam-detail { background: var(--bg); border-left: 4px solid var(--c); }
.subject-panel .exam-pickers .chosen { border-color: var(--c); background: var(--pastel); color: var(--subject-ink); }
.subject-panel .exam-pickers .chosen span { color: var(--subject-ink); }
.subject-panel thead { background: var(--bg); }
.track-stats.subject-surface .stat { background: linear-gradient(135deg, var(--bg), #fff); border-top: 4px solid var(--c); }
.track-stats.subject-surface .stat:first-child { background: linear-gradient(135deg, var(--bg), var(--pastel)); }
.track-stats.subject-surface .stat strong { color: var(--subject-ink); }
.mastery-row { padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.mastery-row > span:first-child { color: var(--subject-ink); }
.mastery-row .bar { background: #fff; }

/* ---------- 组织结构：子栏目 / 折叠 / 搜索 ---------- */
.org-search { display: flex; gap: 10px; margin: 6px 0 14px; }
.org-search input { flex: 1; max-width: 480px; }
.org-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.org-tabs button { border: none; background: none; padding: 8px 14px; font-size: 14px; color: #5b5b60; border-radius: 999px; cursor: pointer; }
.org-tabs button:hover { background: var(--chip-bg, #f0f1f3); }
.org-tabs button.active { background: var(--accent, #2f7c9e); color: #fff; }
.org-tab-page[hidden] { display: none; }
.fold-btn { border: none; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 8px; border-radius: 8px; margin-left: auto; }
.fold-btn:hover { background: var(--chip-bg, #f0f1f3); }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-body { display: block; }
.panel.collapsed .panel-body { display: none; }
.search-hit { background: #fff3b8 !important; box-shadow: 0 0 0 3px rgba(233, 199, 44, .35); border-radius: 8px; }
.class-group:has(.search-hit) summary { background: #fff8dd; }

/* ---------- 成绩录入 ---------- */
.se-search input { padding: 8px 12px; }

/* ---------- 注册页角色选择 ---------- */
.role-pick select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; margin-top: 6px; }
.invite-student .warn { color: var(--danger, #c0392b); font-size: 12px; margin-top: 6px; }
.invite-student code { background: var(--chip-bg, #f0f1f3); padding: 2px 8px; border-radius: 8px; font-size: 13px; }

/* ---------- 课表模板 ---------- */
.tmpl-select { margin-left: 6px; }
.tmpl-select select { max-width: 200px; }
.tmpl-grade { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; padding: 10px 14px; }
.tmpl-grade legend { font-size: 13px; color: #4a4a4f; }
.tmpl-cls { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; font-size: 13px; }
.tmpl-targets { max-height: 320px; overflow: auto; }
.tmpl-actions { margin: 0 0 6px; }
.conflict-box { margin: 6px 0 4px; padding: 8px 10px; background: #fff7e6; border: 1px solid #ffd591; border-radius: 8px; }
.conflict-title { font-size: 13px; font-weight: 600; color: #ad6800; margin: 0 0 6px; }
.conflict-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; font-size: 13px; }
.conflict-info { flex: 1; }
.conflict-select { max-width: 230px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .sidebar { height: auto; padding: 12px 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
  .brand { grid-column: 1; grid-row: 1; }
  .user-chip { grid-column: 2; grid-row: 1; }
  .sidebar nav { grid-column: 1 / -1; grid-row: 2; gap: 2px; }
  .sidebar .nav { min-height: 44px; padding: 12px 13px 10px; }
  .main { padding: 32px 24px 60px; }
}
@media (max-width: 700px) {
  .sidebar { padding: 10px 16px 12px; position: relative; gap: 8px 10px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand .logo { flex: none; width: 28px; height: 28px; }
  .user-chip { position: static; gap: 6px; }
  .user-chip .who { display: none; }
  .user-chip .logout { min-height: 44px; min-width: 44px; }
  .mobile-nav-toggle { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); text-align: left; font-weight: 600; }
  .mobile-nav-label { color: var(--accent); font-size: 12px; font-weight: 400; white-space: nowrap; }
  .sidebar nav { grid-row: 3; display: none; margin: 0; overflow: visible; }
  .sidebar nav.is-open { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sidebar .nav { justify-content: center; padding: 10px 4px; border: 0; border-radius: 10px; background: #fff; font-size: 12px; }
  .sidebar .nav.active { color: var(--accent-strong); background: var(--accent-light); }
  .topbar { padding: 4px 0; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
  .crumb { font-size: 10px; }
  .content-wrap, .main { padding: 26px 18px 50px; }
  .heading h1 { font-size: 27px; letter-spacing: -.8px; }
  .panel { padding: 22px 18px; border-radius: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat { padding: 17px 16px; border-radius: 18px; }
  .stat strong { font-size: 26px; }
  .grid { grid-template-columns: 1fr; }
  .subject-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .subject-tabs button { border-radius: 13px; padding: 11px 2px 9px; font-size: 11px; }
  .subject-orb { width: 31px; height: 31px; font-size: 14px; }
  .track-selects { justify-content: flex-start; }
  .detail-values { grid-template-columns: repeat(2, 1fr); }
  .gap-row span { min-width: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .primary:hover { transform: none; }
}

/* Single-assessment snapshot: restrained surfaces, subject accents and readable comparisons. */
.exam-overview { margin-top: 24px; scroll-margin-top: 90px; background: linear-gradient(145deg, var(--accent-light), #fff 52%); }
.track-stats { scroll-margin-top: 90px; }
.exam-eyebrow { display: block; color: var(--accent-strong); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin-bottom: 10px; }
.exam-overview .panel-head { align-items: flex-start; flex-wrap: wrap; gap: 22px; }
.exam-select-label { display: grid; gap: 8px; font-size: 12px; color: var(--muted); max-width: 100%; }
.exam-select-label select { max-width: 100%; width: min(440px, 100%); min-height: 44px; }
.exam-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 24px 0; }
.exam-summary-grid article { padding: 22px; border: 1px solid rgba(0,0,0,.05); border-radius: 22px; background: rgba(255,255,255,.86); box-shadow: 0 5px 18px rgba(0,0,0,.025); }
.exam-summary-grid span, .exam-summary-grid small { display: block; color: var(--muted); font-size: 12px; line-height: 1.7; }
.exam-summary-grid strong { display: block; font-size: clamp(22px,2.4vw,34px); letter-spacing: -.04em; margin: 12px 0; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.exam-comparison-note { font-size: 12px; line-height: 1.8; padding: 16px 18px; border-radius: 16px; background: rgba(0,0,0,.025); color: var(--muted); }
.exam-table-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.exam-table-caption span { font-size: 12px; color: var(--muted); }
.exam-comparison-table { min-width: 760px; font-variant-numeric: tabular-nums; }
.exam-score-track { position: relative; width: 160px; height: 9px; border-radius: 8px; background: rgba(0,0,0,.055); }
.exam-score-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.exam-score-track b { position: absolute; top: -4px; height: 17px; width: 2px; background: var(--accent-strong); transform: translateX(-1px); }
.exam-status { color: var(--muted); font-size: 13px; }
#modal:has(#project-form) { width: min(1040px, 95vw); max-width: 1040px; }
#project-form .pwd-fields { flex-wrap: wrap; }
#project-form .pwd-fields label { flex: 1; min-width: min(220px,100%); }
#project-form select, #project-form input { max-width: 100%; }
#project-form table { min-width: 650px; }
#project-form [data-project-score] { width: 110px; }
#project-form [data-project-choice] { max-width: 270px; }
#modal:has(#report-export-form) { width: min(850px,95vw); max-width: 850px; }
#report-export-form fieldset { border: 1px solid var(--line); border-radius: 16px; margin: 18px 0; padding: 14px; }
.export-choices { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
.export-choices label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #f5f5f7; }
.export-choices input[type=checkbox] { width: 18px; height: 18px; }
#export-students { max-height: 270px; overflow-y: auto; }
.auto-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.auto-fields label { display:grid; gap:8px; font-size:13px; color:var(--muted); }
.auto-fields input,.auto-fields select { width:100%; min-width:0; }
.auto-task { background:#f5f5f7; padding:20px; border-radius:18px; margin:16px 0; }
.import-issue { border:1px solid var(--line); border-radius:14px; padding:16px; margin:12px 0; }
.import-issue summary { cursor:pointer; line-height:1.7; }
.import-issue .auto-fields { margin:16px 0; }
.import-issue textarea { border:1px solid var(--line); border-radius:10px; padding:12px; }
.auto-class-list,.auto-locks { display:flex; gap:12px; flex-wrap:wrap; margin:16px 0; }
.auto-class-list label,.auto-locks label { display:flex; align-items:center; gap:8px; padding:8px 10px; background:white; border:1px solid var(--line); border-radius:10px; font-size:12px; }
.auto-class-list input,.auto-locks input { width:17px; height:17px; }
.auto-locks { max-height:260px; overflow:auto; }
.auto-time-grid { min-width:850px; table-layout:fixed; }
.auto-time-grid th,.auto-time-grid td { text-align:center; padding:10px 6px; }
.auto-time-grid small { display:block; color:var(--muted); font-size:11px; line-height:1.7; }
.auto-time-grid select { width:100%; min-width:0; font-size:12px; padding:8px 4px; }
.auto-time-grid input { width:17px; height:17px; }
@media(max-width:700px) { .auto-fields { grid-template-columns:repeat(2,minmax(0,1fr)); } .auto-task { padding:14px; } }
.exam-overview > .sub { margin-top: 18px; font-size: 12px; line-height: 1.7; }
@media (max-width: 1000px) { .exam-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) {
  .exam-summary-grid { gap: 10px; }
  .exam-summary-grid article { padding: 16px 12px; border-radius: 16px; }
  .exam-select-label { width: 100%; min-width: 0; }
  .exam-select-label select { width: 100%; }
}
