/* ===================================================================
   扬帆高级中学 · 德育积分系统
   设计系统 v2
   -------------------------------------------------------------------
   基调：深海军蓝（校服/海洋）+ 砖红（校徽）+ 米白底
   层级：surface 1/2/3 + 三级阴影；圆角 16/12/10/8
   =================================================================== */

:root {
  /* 品牌色 */
  --navy-900: #071A2E;
  --navy-800: #0A2540;
  --navy-700: #0F3460;
  --navy-600: #1B4B7E;
  --navy-500: #2C6BA0;
  --navy-050: #EAF1FA;

  --red-700: #A32B1E;
  --red-600: #C0392B;
  --red-500: #E05A4A;
  --red-050: #FDEDEA;

  --gold-600: #B58A16;
  --gold-500: #D4A017;
  --gold-050: #FBF3DF;

  --teal-600: #1F7A6C;
  --teal-050: #EAF6F3;

  /* 中性色 */
  --bg: #F1F4F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --surface-3: #F5F8FC;
  --line: #E4EAF2;
  --line-strong: #D3DDE9;
  --ink-900: #131F33;
  --ink-700: #33445C;
  --ink-500: #64748B;
  --ink-400: #8A99AF;
  --ink-300: #AEBACB;

  /* 尺寸 */
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;
  --r-xs: 8px;
  --sidebar-w: 232px;

  --sh-1: 0 1px 2px rgba(16, 38, 66, .05), 0 1px 3px rgba(16, 38, 66, .04);
  --sh-2: 0 2px 6px rgba(16, 38, 66, .06), 0 10px 28px -14px rgba(16, 38, 66, .22);
  --sh-3: 0 18px 50px -20px rgba(16, 38, 66, .38);

  --ease: cubic-bezier(.22, .8, .32, 1);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--navy-600); text-decoration: none; }
svg { display: block; }
::selection { background: #CFE0F2; color: var(--navy-900); }

/* 细滚动条 */
* { scrollbar-width: thin; scrollbar-color: #CBD6E4 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #CBD6E4; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #AFC0D4; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--navy-500); outline-offset: 2px; border-radius: 6px; }

/* ===================================================================
   登录页
   =================================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  background: var(--navy-800);
}

.login-brand {
  position: relative;
  padding: 52px 58px;
  overflow: hidden;
  background:
    radial-gradient(1000px 560px at 8% -10%, #1E5185 0%, transparent 62%),
    linear-gradient(158deg, #10365F 0%, #071A2E 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  color: #EAF1F9;
}
.login-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 70% at 60% 40%, #000 20%, transparent 78%);
  mask-image: radial-gradient(80% 70% at 60% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}
.login-brand::after {
  content: "";
  position: absolute; inset: auto -12% -20% -12%; height: 52%;
  background: radial-gradient(closest-side, rgba(192,57,43,.42), transparent 72%);
  filter: blur(8px);
  pointer-events: none;
}
.brand-sail { position: absolute; right: -128px; top: 44%; transform: translateY(-50%); opacity: .08; color: #BFD6EE; }
.brand-logo { display: flex; align-items: center; gap: 13px; position: relative; z-index: 2; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(150deg, #D14B3B, #8E2A20);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 22px -8px rgba(192,57,43,.9), inset 0 1px 0 rgba(255,255,255,.25);
  flex: 0 0 auto;
}
.brand-name { font-size: 16.5px; font-weight: 600; letter-spacing: .6px; }
.brand-sub { font-size: 10.5px; color: #8FA8C4; letter-spacing: 2.2px; margin-top: 3px; font-weight: 500; }

.brand-copy { position: relative; z-index: 2; }
.brand-copy h1 { font-size: 39px; line-height: 1.24; margin: 0 0 18px; font-weight: 700; letter-spacing: 1.5px; }
.brand-copy h1 em { font-style: normal; color: #F2B933; }
.brand-copy p { color: #A6BDD6; font-size: 14.5px; max-width: 420px; margin: 0 0 28px; line-height: 1.75; }
.brand-points { display: flex; gap: 12px; flex-wrap: wrap; }
.brand-points div {
  font-size: 11.5px; color: #9BB2CB;
  padding: 11px 14px; border-radius: 11px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  min-width: 108px;
}
.brand-points strong { display: block; font-size: 14px; color: #fff; font-weight: 600; margin-bottom: 3px; letter-spacing: .4px; }
.brand-foot { font-size: 11px; color: #5D799B; letter-spacing: .6px; position: relative; z-index: 2; }

.login-panel {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; position: relative;
}
.login-box { width: 100%; max-width: 352px; }
.login-box h2 { font-size: 23px; margin: 0 0 7px; font-weight: 700; letter-spacing: .3px; }
.login-box .hint { color: var(--ink-500); font-size: 13px; margin: 0 0 26px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-700); margin-bottom: 7px; font-weight: 500; }
.input-wrap {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 0 12px; height: 47px; background: #FBFCFE;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s;
  color: var(--ink-400);
}
.input-wrap:focus-within { border-color: var(--navy-500); background: #fff; box-shadow: 0 0 0 4px rgba(44,107,160,.10); color: var(--navy-600); }
.input-wrap input {
  border: none; outline: none; background: none; flex: 1; min-width: 0; height: 100%;
  font-size: 15px; letter-spacing: .4px; color: var(--ink-900);
}
.input-wrap input::placeholder { color: var(--ink-300); letter-spacing: 0; font-size: 14px; }
.code-row { display: flex; gap: 9px; }
.code-row .input-wrap { flex: 1; }
.btn-code {
  height: 47px; padding: 0 15px; border-radius: var(--r-sm);
  background: var(--navy-050); color: var(--navy-700); font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: background .18s, opacity .18s; border: 1px solid transparent;
}
.btn-code:hover:not(:disabled) { background: #DFEAF7; }
.btn-code:disabled { color: var(--ink-400); background: #F3F6FA; cursor: default; }

.btn-primary {
  width: 100%; height: 49px; border-radius: var(--r-sm);
  background: linear-gradient(150deg, #24598F, var(--navy-800));
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 2px;
  box-shadow: 0 10px 24px -12px rgba(8,26,46,.9);
  transition: transform .12s var(--ease), box-shadow .2s, opacity .2s;
}
.btn-primary:hover { box-shadow: 0 14px 30px -14px rgba(8,26,46,1); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 6px 16px -10px rgba(8,26,46,.9); }
.btn-primary:disabled { opacity: .55; cursor: default; box-shadow: none; transform: none; }

.login-error { color: var(--red-600); font-size: 12.5px; min-height: 19px; margin: -3px 0 9px; }

.demo-block { margin-top: 24px; border-top: 1px dashed var(--line-strong); padding-top: 17px; }
.demo-block .demo-title {
  font-size: 11.5px; color: var(--ink-400); letter-spacing: .4px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.demo-list { display: flex; flex-direction: column; gap: 7px; }
.demo-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); text-align: left; transition: .16s var(--ease); width: 100%;
}
.demo-item:hover {
  border-color: #C3D5E8; background: #F6FAFE; transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(16,38,66,.18);
}
.demo-item .dn { font-size: 13.5px; font-weight: 600; }
.demo-item .dp { font-size: 11px; color: var(--ink-400); margin-top: 1px; font-variant-numeric: tabular-nums; }

.role-tag { font-size: 10.5px; padding: 3px 8px; border-radius: 6px; font-weight: 600; white-space: nowrap; letter-spacing: .2px; }
.role-admin { background: var(--red-050); color: var(--red-600); }
.role-head_teacher { background: var(--navy-050); color: var(--navy-700); }
.role-duty { background: var(--teal-050); color: var(--teal-600); }

.local-note {
  margin-top: 18px; font-size: 11.5px; color: #8A6E3C; line-height: 1.7;
  background: #FDF8EA; border: 1px solid #F0E3C0; border-radius: var(--r-sm); padding: 11px 13px;
}
.local-note b { color: #6F5526; }
.local-note.online { color: #1D6B5B; background: #F1FAF7; border-color: #CDE8E1; }
.local-note.online b { color: #14574A; }

/* ===================================================================
   应用外壳
   =================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(178deg, #0E3157 0%, #081C30 100%);
  color: #B9CADD; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30;
  transition: width .24s var(--ease), flex-basis .24s var(--ease);
  overflow: hidden;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 20px 16px 18px; position: relative; }
.sb-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.sb-brand .brand-mark svg { width: 18px; height: 18px; }
.sb-brand .brand-text { min-width: 0; flex: 1; }
.sb-brand .t1 { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.sb-brand .t2 { font-size: 10px; color: #6E8CAC; letter-spacing: 1.4px; white-space: nowrap; margin-top: 1px; }
.sb-collapse { color: #6E8CAC; padding: 5px; border-radius: 7px; flex: 0 0 auto; transition: .15s; }
.sb-collapse:hover { background: rgba(255,255,255,.08); color: #fff; }

.sb-nav { flex: 1; padding: 4px 10px; overflow-y: auto; overflow-x: hidden; }
.sb-nav::-webkit-scrollbar { width: 0; }
.sb-group { font-size: 10px; color: #517192; letter-spacing: 1.6px; padding: 16px 12px 7px; font-weight: 600; white-space: nowrap; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm); color: #A9BDD2;
  font-size: 13.5px; text-align: left; transition: .16s var(--ease);
  margin-bottom: 2px; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.06)); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: #F2B933;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .88; }
.nav-item.active svg { color: #F2B933; opacity: 1; }
.nav-item .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--red-600); color: #fff; font-size: 10.5px;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center;
  padding: 0 5px; font-weight: 600; flex: 0 0 auto;
}

.sb-user { border-top: 1px solid rgba(255,255,255,.08); padding: 13px 14px; display: flex; align-items: center; gap: 10px; }
.sb-user .info { flex: 1; min-width: 0; }
.sb-user .n { font-size: 13px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .r { font-size: 10.5px; color: #7E9AB8; white-space: nowrap; }
.sb-user .out { color: #7E9AB8; padding: 5px; border-radius: 7px; transition: .15s; }
.sb-user .out:hover { background: rgba(255,255,255,.1); color: #fff; }

.shell.collapsed { --sidebar-w: 68px; }
.shell.collapsed .sb-brand { padding: 20px 0; justify-content: center; }
.shell.collapsed .sb-brand .brand-text,
.shell.collapsed .sb-collapse,
.shell.collapsed .sb-group,
.shell.collapsed .nav-item .nav-label,
.shell.collapsed .sb-user .info { display: none; }
.shell.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.shell.collapsed .nav-item .nav-badge {
  position: absolute; top: 4px; right: 8px; min-width: 15px; height: 15px;
  font-size: 9.5px; padding: 0 4px;
}
.shell.collapsed .sb-user { justify-content: center; padding: 13px 0; }
.shell.collapsed .sb-user .out { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  min-height: 62px; background: rgba(255,255,255,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 26px; gap: 16px; position: sticky; top: 0; z-index: 25;
}
.tb-title { min-width: 0; }
.topbar h1 { font-size: 16px; font-weight: 650; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.topbar .tb-sub { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.term-pill { font-size: 11.5px; color: var(--navy-700); background: var(--navy-050); padding: 6px 12px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.today-pill { font-size: 11.5px; color: var(--ink-400); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 同步状态灯 */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  padding: 5px 10px 5px 8px; border-radius: 8px; border: 1px solid transparent;
  background: var(--surface-3); color: var(--ink-500); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.sync-pill.ok { color: #1D7F6B; background: #EAF7F3; border-color: #CDE8E1; }
.sync-pill.wait { color: #A9741A; background: #FDF4E4; border-color: #F2E1C2; }
.sync-pill.wait i { animation: syncPulse 1s ease-in-out infinite; }
.sync-pill.err { color: var(--red-600); background: #FDEDEA; border-color: #F6D3CC; }
.sync-pill.local { color: var(--ink-400); background: var(--surface-3); border-color: var(--line); }
.sync-pill:hover { filter: brightness(.97); }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 启动画面 */
.boot-splash {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 0; background: radial-gradient(120% 100% at 50% 0%, #14395F 0%, #071A2E 62%);
  color: #fff; z-index: 999;
}
.boot-splash .bs-mark {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(150deg, #E0574A, #8E2A20); color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}
.boot-splash .bs-name { margin-top: 18px; font-size: 15px; letter-spacing: 1.5px; opacity: .92; }
.boot-splash .bs-tip { margin-top: 8px; font-size: 12px; color: #8FA8C4; letter-spacing: .5px; }
.boot-splash .bs-bar {
  margin-top: 20px; width: 148px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.boot-splash .bs-bar i {
  display: block; width: 46%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #F2B933, #E0A320);
  animation: bootSlide 1.15s cubic-bezier(.5, 0, .5, 1) infinite;
}
@keyframes bootSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }
.tb-user {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff; transition: .16s;
}
.tb-user:hover { border-color: var(--line-strong); box-shadow: var(--sh-1); }
.tb-user .tb-name { font-size: 12.5px; font-weight: 600; color: var(--ink-700); }

.content { padding: 22px 26px 96px; max-width: 1300px; width: 100%; animation: pageIn .26s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ph-main { flex: 1; min-width: 200px; }
.page-head .ph-title { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.page-head .ph-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }
.page-head .ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tabbar { display: none; }

/* ===================================================================
   通用组件
   =================================================================== */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); border: 1px solid rgba(228,234,242,.9); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-head h3 { font-size: 14px; margin: 0; font-weight: 650; letter-spacing: .1px; }
.card-head .ch-sub { font-size: 11.5px; color: var(--ink-400); margin-left: 2px; }
.card-head .ch-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); }

/* KPI */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 12px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.kpi .k-label svg { color: var(--ink-400); }
.kpi .k-value { font-size: 28px; font-weight: 700; letter-spacing: -.8px; margin: 8px 0 3px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12.5px; font-weight: 500; color: var(--ink-400); margin-left: 4px; letter-spacing: 0; }
.kpi .k-foot { font-size: 11.5px; color: var(--ink-400); display: flex; align-items: center; gap: 6px; }
.kpi .k-foot .up { color: var(--red-600); font-weight: 600; }
.kpi .k-foot .down { color: var(--teal-600); font-weight: 600; }
.kpi-accent { position: absolute; right: -16px; top: -16px; width: 78px; height: 78px; border-radius: 50%; opacity: .06; background: var(--navy-700); }
.kpi.warn .k-value { color: var(--red-600); }
.kpi.warn .kpi-accent { background: var(--red-600); opacity: .09; }
.kpi .k-spark { position: absolute; right: 16px; bottom: 12px; opacity: .55; transition: opacity .2s; }
.kpi:hover .k-spark { opacity: .85; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-700);
  transition: .16s var(--ease); white-space: nowrap;
}
.btn:hover { border-color: #BFD0E3; background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 15px; height: 15px; }
.btn-solid { background: linear-gradient(150deg, #24598F, var(--navy-700)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -9px rgba(15,52,96,.9); }
.btn-solid:hover { background: linear-gradient(150deg, #2A649E, var(--navy-800)); box-shadow: 0 9px 20px -10px rgba(15,52,96,1); }
.btn-red { background: linear-gradient(150deg, var(--red-500), var(--red-600)); color: #fff; border-color: transparent; }
.btn-red:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-500); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink-900); border-color: transparent; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::after {
  content: ""; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite; margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 标签 */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--navy-050); color: var(--navy-700); white-space: nowrap; }
.chip.red { background: var(--red-050); color: var(--red-600); }
.chip.green { background: var(--teal-050); color: var(--teal-600); }
.chip.gold { background: var(--gold-050); color: #8C6D12; }
.chip.gray { background: #F0F3F7; color: var(--ink-500); }

.tabs { display: flex; gap: 3px; background: #EDF1F7; padding: 3px; border-radius: var(--r-md); }
.tab { padding: 7px 14px; border-radius: 9px; font-size: 13px; color: var(--ink-500); font-weight: 500; transition: .16s var(--ease); white-space: nowrap; }
.tab:hover { color: var(--ink-700); }
.tab.active { background: #fff; color: var(--navy-700); font-weight: 650; box-shadow: 0 1px 3px rgba(16,38,66,.14); }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg button { padding: 7px 13px; font-size: 12.5px; color: var(--ink-500); background: #fff; border-right: 1px solid var(--line); transition: .15s; }
.seg button:hover { background: var(--surface-3); color: var(--ink-900); }
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--navy-700); color: #fff; font-weight: 600; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; color: var(--ink-400); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
  letter-spacing: .3px; background: var(--surface-2);
}
.table td { padding: 11px 12px; border-bottom: 1px solid #F1F5FA; font-size: 13px; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .13s; }
.table tbody tr:hover { background: #F8FBFE; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 650; }
.table .rank-cell { width: 44px; }
.rank-badge {
  width: 23px; height: 23px; border-radius: 7px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; background: #EFF3F8; color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.rank-badge.r1 { background: linear-gradient(145deg, #F5D060, #D4A017); color: #4A3800; box-shadow: 0 2px 6px -2px rgba(212,160,23,.7); }
.rank-badge.r2 { background: linear-gradient(145deg, #DCE2EA, #AFB9C6); color: #36414F; }
.rank-badge.r3 { background: linear-gradient(145deg, #E6BA92, #C08252); color: #4A2D14; }
.table-wrap { overflow: auto; }

/* 列表项 */
.row-item { display: flex; align-items: center; gap: 11px; padding: 12px 20px; border-bottom: 1px solid #F1F5FA; transition: background .13s; }
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: #F8FBFE; }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.row-item .ri-sub { font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }
.row-item .ri-act { display: flex; gap: 6px; align-items: center; }
.row-item.clickable { cursor: pointer; }

/* 空状态 */
.empty { padding: 38px 20px; text-align: center; color: var(--ink-400); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty .empty-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-300); margin-bottom: 8px; }

/* 表单 */
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 12.5px; color: var(--ink-700); margin-bottom: 6px; font-weight: 500; }
.inp, select.inp, textarea.inp {
  width: 100%; height: 41px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 0 12px; background: #FBFCFE; outline: none; font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s, background .16s; color: var(--ink-900);
}
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; min-height: 74px; line-height: 1.6; }
.inp:focus { border-color: var(--navy-500); background: #fff; box-shadow: 0 0 0 4px rgba(44,107,160,.09); }
.inp::placeholder { color: var(--ink-300); }
.form-hint { font-size: 11.5px; color: var(--ink-400); margin-top: 6px; }

/* 搜索下拉 */
.search-box { position: relative; }
.search-box .inp { padding-left: 37px; }
.search-box .s-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
/* 下拉用视口定位：定位坐标由 JS 按输入框实时算，
   这样即使外层 .modal 有 overflow-y:auto 也不会把候选列表裁掉 */
.search-drop {
  position: fixed; left: 0; top: 0; z-index: 120;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 16px 38px -12px rgba(16, 38, 66, .28), 0 3px 8px -3px rgba(16, 38, 66, .12);
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 5px;
  animation: dropIn .16s var(--ease);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* 搜索下拉的说明行 / 命中高亮 */
.sd-tip {
  padding: 8px 11px 7px; font-size: 11px; color: var(--ink-400);
  border-bottom: 1px solid var(--line); margin-bottom: 4px; letter-spacing: .2px;
}
/* 空结果：给一块像样的面板，而不是飘在留白里的一行灰字 */
.sd-empty { display: flex; gap: 10px; align-items: flex-start; padding: 14px 12px 15px; }
.sd-empty > svg { flex: none; margin-top: 1px; color: var(--ink-300); }
.sd-empty-t { font-size: 12.5px; font-weight: 600; color: var(--ink-900); line-height: 1.45; }
.sd-empty-s { font-size: 11px; color: var(--ink-400); margin-top: 3px; line-height: 1.55; }
.search-opt mark { background: #FFF1C9; color: #8A5A00; padding: 0 1px; border-radius: 2px; font-weight: 700; }
.search-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer; width: 100%; text-align: left; transition: background .12s; }
.search-opt:hover { background: #F1F6FC; }
.search-opt.hl { background: #E9F1FB; box-shadow: inset 2px 0 0 var(--navy-500); }
.search-opt .so-name { font-size: 13px; font-weight: 600; }
.search-opt .so-meta { font-size: 11px; color: var(--ink-400); }

/* 已选学生 */
.picked { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.picked-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy-050); color: var(--navy-700); border-radius: 999px;
  padding: 5px 6px 5px 10px; font-size: 12.5px; font-weight: 500;
  animation: popIn .18s var(--ease);
}
.picked-item button { color: #7C93AE; display: grid; place-items: center; padding: 2px; border-radius: 50%; transition: .14s; }
.picked-item button:hover { background: rgba(15,52,96,.13); color: var(--navy-700); }

/* 全班花名册（录入页直接点选） */
.roster-bar { font-size: 11.5px; color: var(--ink-400); margin: 12px 0 7px; }
.roster-bar b { color: var(--ink-700); font-weight: 700; font-variant-numeric: tabular-nums; }
.roster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px;
  max-height: 214px; overflow-y: auto; padding: 1px 1px 3px;
  scrollbar-width: thin;
}
.roster-chip {
  font-size: 12.5px; line-height: 1; padding: 8px 4px; text-align: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-700);
  border-radius: var(--r-xs); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .13s, border-color .13s, color .13s, transform .1s;
}
.roster-chip:hover { border-color: var(--navy-500); color: var(--navy-700); background: #F4F8FD; }
.roster-chip:active { transform: scale(.96); }
.roster-chip.on {
  background: var(--navy-700); border-color: var(--navy-700); color: #fff; font-weight: 600;
  box-shadow: 0 2px 7px rgba(15,52,96,.22);
}
.roster-grid::-webkit-scrollbar { width: 6px; }
.roster-grid::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

/* 计分条目 */
.scene-row { display: flex; gap: 6px; flex-wrap: wrap; }
.scene-btn {
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--ink-500);
  border: 1px solid var(--line-strong); background: #fff; font-weight: 500; transition: .15s;
}
.scene-btn:hover { border-color: var(--navy-500); color: var(--navy-700); }
.scene-btn.active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); font-weight: 600; }

.rule-group { margin-bottom: 17px; }
.rule-group .rg-title { font-size: 11.5px; color: var(--ink-400); font-weight: 600; letter-spacing: .6px; margin-bottom: 9px; display: flex; align-items: center; gap: 8px; }
.rule-group .rg-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: #fff; font-size: 13px; transition: .16s var(--ease);
}
.rule-btn:hover { border-color: var(--navy-500); background: #F6FAFE; transform: translateY(-1px); box-shadow: 0 6px 14px -10px rgba(16,38,66,.5); }
.rule-btn:active { transform: translateY(0) scale(.985); }
.rule-btn .rp { font-size: 11.5px; font-weight: 700; color: var(--red-600); background: var(--red-050); padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.rule-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }

/* 时间轴 */
.timeline { padding: 6px 20px 18px; }
.tl-item { display: flex; gap: 12px; padding: 11px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: -11px; width: 2px; background: #EDF2F8; }
.tl-dot {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; z-index: 1;
  display: grid; place-items: center; background: var(--red-050); color: var(--red-600);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tl-dot.green { background: var(--teal-050); color: var(--teal-600); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-size: 13.5px; font-weight: 500; }
.tl-sub { font-size: 11.5px; color: var(--ink-400); margin-top: 2px; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(7,26,46,.46); backdrop-filter: blur(3px);
  z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .16s ease;
}
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 452px;
  box-shadow: 0 30px 70px -25px rgba(7,26,46,.6); max-height: 86vh; overflow-y: auto;
  animation: popIn .22s var(--ease);
}
.modal.wide { max-width: 660px; }
.modal-head { padding: 19px 20px 0; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h3 { font-size: 16px; margin: 0; font-weight: 650; }
.modal-head .mh-sub { font-size: 12px; color: var(--ink-400); margin-top: 3px; }
.modal-head .mh-close { margin-left: auto; color: var(--ink-400); padding: 5px; border-radius: var(--r-xs); transition: .14s; }
.modal-head .mh-close:hover { background: var(--surface-3); color: var(--ink-900); }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 4px 20px 18px; display: flex; gap: 9px; justify-content: flex-end; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985) } to { opacity: 1; transform: none } }

/* Toast */
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(13,30,50,.95); color: #fff; font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 999px; box-shadow: 0 14px 34px -12px rgba(0,0,0,.55);
  animation: toastIn .24s var(--ease); display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(6px);
}
.toast svg { width: 15px; height: 15px; flex: 0 0 15px; }
.toast.ok svg { color: #6FD3B5; }
.toast.err svg { color: #FF9384; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

/* 图表 */
.chart-wrap { padding: 8px 6px 4px; }
.chart-legend { display: flex; gap: 14px; padding: 2px 14px 10px; flex-wrap: wrap; }
.chart-legend span { font-size: 11.5px; color: var(--ink-500); display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: block; }

/* 进度条 */
.bar-line { height: 6px; border-radius: 3px; background: #EDF1F6; overflow: hidden; min-width: 60px; }
.bar-line i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--navy-500), var(--navy-700)); transition: width .5s var(--ease); }
.bar-line i.red { background: linear-gradient(90deg, var(--red-500), var(--red-600)); }

/* 兑换卡 */
.reward-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px,1fr)); gap: 12px; padding: 16px 20px 20px; }
.reward-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 14px;
  display: flex; flex-direction: column; gap: 7px; background: var(--surface-2);
  transition: .18s var(--ease); position: relative; overflow: hidden;
}
.reward-card::after { content: ""; position: absolute; right: -20px; top: -20px; width: 60px; height: 60px; border-radius: 50%; background: var(--navy-700); opacity: .04; }
.reward-card:hover { border-color: #C3D5E8; transform: translateY(-2px); box-shadow: var(--sh-2); background: #fff; }
.reward-card .rw-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--navy-050); color: var(--navy-600); }
.reward-card .rw-name { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.reward-card .rw-stock { font-size: 11.5px; color: var(--ink-400); }
.reward-card .rw-cost { font-size: 16px; font-weight: 700; color: var(--red-600); font-variant-numeric: tabular-nums; }
.reward-card .rw-cost small { font-size: 11px; font-weight: 500; color: var(--ink-400); }
.reward-card .rw-btn { margin-top: auto; height: 33px; font-size: 12.5px; }
.reward-card.disabled { opacity: .55; }
.reward-card.disabled:hover { transform: none; box-shadow: none; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filter-bar .spacer { flex: 1; }

/* 学生头部 */
.stu-hero {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  background: radial-gradient(600px 200px at 90% -30%, rgba(242,185,51,.16), transparent 70%), linear-gradient(135deg, #10365F, #1B4B7E);
  border-radius: var(--r-lg); color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--sh-2);
}
.stu-hero .sh-main { flex: 1; min-width: 0; z-index: 1; }
.stu-hero .sh-name { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; letter-spacing: .4px; }
.stu-hero .sh-meta { font-size: 12.5px; color: #A9C0D8; margin-top: 4px; }
.stu-hero .sh-points { text-align: right; z-index: 1; }
.stu-hero .sh-points b { font-size: 33px; font-weight: 700; letter-spacing: -1.2px; color: #F2B933; font-variant-numeric: tabular-nums; }
.stu-hero .sh-points span { display: block; font-size: 11.5px; color: #A9C0D8; }

/* 头像 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(145deg, #2C6BA0, #143A63);
  letter-spacing: .3px; user-select: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.avatar.lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 18px; border-radius: 16px; }
.avatar.sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; border-radius: 9px; }

/* 撤销条 */
.undo-bar {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  background: #F3F8FE; border: 1px solid #D8E6F5; border-radius: var(--r-md);
  font-size: 12.5px; color: var(--ink-700); margin-bottom: 14px;
  animation: popIn .2s var(--ease);
}
.undo-bar .ub-main { flex: 1; min-width: 0; }
.undo-bar b { color: var(--red-600); }

/* ===================================================================
   成长报告（可打印）
   =================================================================== */
.report { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 34px 38px; max-width: 860px; margin: 0 auto; }
.rp-head { display: flex; align-items: flex-start; gap: 18px; padding-bottom: 20px; border-bottom: 2px solid var(--navy-700); }
.rp-head .rp-logo { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(150deg, #D14B3B, #8E2A20); color: #fff; flex: 0 0 auto; }
.rp-head .rp-title { flex: 1; }
.rp-head .rp-title h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.rp-head .rp-title .rp-school { font-size: 12px; color: var(--ink-500); margin-top: 4px; letter-spacing: 2px; }
.rp-head .rp-term { font-size: 11.5px; color: var(--ink-400); text-align: right; white-space: nowrap; }
.rp-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.rp-meta div { background: var(--surface-3); border-radius: var(--r-sm); padding: 12px 14px; }
.rp-meta .rm-k { font-size: 11px; color: var(--ink-400); }
.rp-meta .rm-v { font-size: 19px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.rp-section { margin-bottom: 24px; }
.rp-section h4 { font-size: 13.5px; margin: 0 0 12px; font-weight: 650; display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 3px solid var(--navy-700); }
.rp-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 22px; }
.rp-facts div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 6px 0; font-size: 12.5px; }
.rp-facts b { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.rp-comment { background: var(--surface-3); border-left: 3px solid var(--gold-500); padding: 14px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 13px; line-height: 1.9; color: var(--ink-700); }
.rp-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-400); }

/* ===================================================================
   响应式
   =================================================================== */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; min-height: 56px; gap: 10px; }
  .topbar h1 { font-size: 15px; }
  .topbar .term-pill, .topbar .today-pill, .tb-user .tb-name { display: none; }
  .sync-pill span { display: none; }
  .sync-pill { padding: 7px; }
  .tb-user { padding: 3px; border: none; background: none; }
  .content { padding: 14px 14px 96px; }
  .g2, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .roster-grid { max-height: 268px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .g3 .kpi { padding: 11px 11px; }
  .g3 .k-value { font-size: 19px; }
  .g3 .k-value small { font-size: 10.5px; margin-left: 2px; }
  .g3 .k-label { font-size: 10.5px; gap: 4px; }
  .g3 .k-label svg { width: 12px; height: 12px; }
  .g3 .k-foot { font-size: 10px; }
  .grid { gap: 11px; }
  .card-pad { padding: 15px 16px; }
  .card-head { padding: 14px 16px 0; }
  .kpi { padding: 13px 14px; }
  .kpi .k-value { font-size: 21px; }
  .kpi .k-label { font-size: 11.5px; }
  .kpi .k-foot { font-size: 11px; }
  .kpi .k-spark { display: none; }
  .page-head { margin-bottom: 12px; }
  .page-head .ph-title { font-size: 17px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(255,255,255,.97); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; color: var(--ink-400); padding: 5px 0; border-radius: 9px;
    transition: .15s; position: relative;
  }
  .tabbar button svg { width: 20px; height: 20px; }
  .tabbar button.active { color: var(--navy-700); font-weight: 650; }
  .tabbar button.active::before {
    content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy-700);
  }
  .login-panel { padding: 26px 20px; min-height: 100vh; }
  .stu-hero { padding: 16px; }
  .stu-hero .sh-points b { font-size: 26px; }
  .table th, .table td { padding: 9px 10px; }
  .reward-grid { grid-template-columns: repeat(auto-fill, minmax(148px,1fr)); gap: 10px; padding: 14px 16px 18px; }
  .modal { max-width: 100%; }
  .report { padding: 22px 18px; border-radius: var(--r-md); }
  .rp-meta { grid-template-columns: repeat(2, 1fr); }
  .rp-facts { grid-template-columns: 1fr; }
  .rp-head { flex-wrap: wrap; }
}

/* ===================================================================
   打印（成长报告）
   =================================================================== */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .sidebar, .topbar, .tabbar, .page-head, .no-print { display: none !important; }
  .content { padding: 0; max-width: none; animation: none; }
  .report { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ddd; }
  .rp-section { break-inside: avoid; }
}
