/* ============================================================
   医学院校在线技能训练平台 · 管理后台
   设计系统 — 医疗青蓝配色 / 深色导航 + 浅色内容
   ============================================================ */

:root {
  /* 品牌色 */
  --brand-50:  #ecfdff;
  --brand-100: #cffafe;
  --brand-200: #a5f3fc;
  --brand-400: #22d3ee;
  --brand-500: #0891b2;
  --brand-600: #0e7490;
  --brand-700: #155e75;
  --brand-800: #164e63;

  /* 功能色 */
  --ok:      #16a34a;
  --ok-bg:   #ecfdf3;
  --warn:    #d97706;
  --warn-bg: #fffbeb;
  --danger:  #dc2626;
  --danger-bg:#fef2f2;
  --info:    #2563eb;
  --info-bg: #eff6ff;
  --purple:  #7c3aed;
  --purple-bg:#f5f3ff;

  /* 中性色 */
  --bg:        #f2f6f8;
  --surface:   #ffffff;
  --surface-2: #f8fafb;
  --line:      #e3eaee;
  --line-soft: #eef3f5;
  --text:      #0f2027;
  --text-2:    #52646d;
  --text-3:    #8b9aa3;

  /* 侧边栏 */
  --nav-bg:     #0b2027;
  --nav-bg-2:   #0e2a33;
  --nav-text:   #93a8b3;
  --nav-text-2: #5f7784;
  --nav-active: #ffffff;

  /* 阴影/圆角 */
  --shadow-xs: 0 1px 2px rgba(15,32,39,.05);
  --shadow-sm: 0 1px 3px rgba(15,32,39,.06), 0 1px 2px rgba(15,32,39,.04);
  --shadow-md: 0 4px 16px -2px rgba(15,32,39,.08), 0 2px 6px -2px rgba(15,32,39,.05);
  --shadow-lg: 0 18px 48px -12px rgba(15,32,39,.22);
  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --sidebar-w: 236px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 62px;
}

/* 深色主题 */
[data-theme="dark"] {
  --bg:        #0d161a;
  --surface:   #132127;
  --surface-2: #17292f;
  --line:      #22363d;
  --line-soft: #1c2e35;
  --text:      #e6f1f4;
  --text-2:    #a3b6bf;
  --text-3:    #8199a4;
  --nav-bg:    #0a161b;
  --nav-bg-2:  #0c1d23;
  --ok-bg:     rgba(22,163,74,.14);
  --warn-bg:   rgba(217,119,6,.14);
  --danger-bg: rgba(220,38,38,.14);
  --info-bg:   rgba(37,99,235,.16);
  --purple-bg: rgba(124,58,237,.16);
  --brand-50:  rgba(8,145,178,.14);
  --brand-100: rgba(8,145,178,.22);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 6px 20px -4px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 50px -12px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
}

html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 只有管理后台是「固定视口」布局：整页不滚动，滚动交给 .content 自己。
   登录 / 改密 / 学生中心 / 下载页都是普通文档流页面，必须允许纵向滚动，
   否则内容一超过首屏就被裁掉、还滚不动（学生端曾因此只能看到上半屏）。 */
body.has-shell {
  height: 100%;
  overflow: hidden;
}

h1,h2,h3,h4,h5 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--text-3); font-weight: 400; }
.mono { font-family: "SF Mono", "Cascadia Mono", Consolas, monospace; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3d2d8; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8bcc4; background-clip: content-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2b4048; background-clip: content-box; }

/* ============================== 布局 ============================== */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(175deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width .22s cubic-bezier(.4,0,.2,1), flex-basis .22s cubic-bezier(.4,0,.2,1);
  z-index: 30;
}
.sidebar::after {
  content:""; position:absolute; inset:0;
  background: radial-gradient(600px 180px at 10% 0%, rgba(34,211,238,.09), transparent 70%);
  pointer-events:none;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex: 0 0 auto;
}
.brand-mark {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, #22d3ee, #0e7490);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(34,211,238,.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; white-space: nowrap; }
.brand-text strong { color: #fff; font-size: 13.5px; letter-spacing: .2px; }
.brand-text span { color: var(--nav-text-2); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

.nav-group-label {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--nav-text-2);
  padding: 12px 10px 6px;
  font-weight: 600;
  white-space: nowrap; overflow: hidden;
}
.nav-group-label:first-child { padding-top: 2px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: 9px;
  color: var(--nav-text);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #d7e5ea; }
.nav-item.active { background: rgba(34,211,238,.13); color: var(--nav-active); }
.nav-item.active::before {
  content:""; position:absolute; left:-10px; top:50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 3px 3px 0;
  background: #22d3ee;
}
.nav-ico {
  width: 18px; flex: 0 0 18px; text-align: center;
  font-size: 14px; opacity: .85;
}
.nav-item.active .nav-ico { opacity: 1; color: #22d3ee; }
.nav-label { transition: opacity .15s; }

.sidebar-foot {
  flex: 0 0 auto;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex; align-items: center; gap: 8px;
}
.env-badge {
  flex: 1; display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--nav-text);
  background: rgba(255,255,255,.05);
  padding: 6px 10px; border-radius: 8px;
  white-space: nowrap; overflow: hidden;
}
.env-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,.18);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.collapse-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: var(--nav-text);
  border-radius: 8px;
  font-size: 14px; line-height: 1;
  transition: all .15s;
}
.collapse-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* 收起态 */
.sidebar.collapsed { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .env-badge { opacity: 0; width: 0; overflow: hidden; padding: 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .nav-ico { font-size: 15px; }
.sidebar.collapsed .sidebar-foot { flex-direction: column; }
.sidebar.collapsed .collapse-btn { transform: rotate(180deg); }

/* ---------- 主区域 ---------- */
.main-area {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  gap: 16px;
  position: relative; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden;
}
.breadcrumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.breadcrumb .sep { opacity: .5; }

.global-search {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 9px;
  height: 34px; width: 260px;
  transition: all .15s;
}
.global-search:focus-within { border-color: var(--brand-400); background: var(--surface); box-shadow: 0 0 0 3px rgba(34,211,238,.13); width: 300px; }
.global-search .search-ico { color: var(--text-3); font-size: 14px; }
.global-search input {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--text); font-size: 12.5px; min-width: 0;
}
.global-search input::placeholder { color: var(--text-3); }
.global-search kbd {
  font-size: 9.5px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 4px; background: var(--surface);
  font-family: inherit;
}

.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  border-radius: 9px;
  font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  transition: all .15s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.only-collapsed { display: none; }
.sidebar-collapsed-state .only-collapsed { display: grid; }

.bell-badge {
  position: absolute; top: 3px; right: 2px;
  min-width: 15px; height: 15px;
  background: var(--danger); color: #fff;
  border-radius: 8px;
  font-size: 9.5px; font-style: normal; font-weight: 700;
  display: grid; place-items: center;
  padding: 0 3px;
  border: 2px solid var(--surface);
}

.bell-wrap { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 50;
}
.popover.open { display: block; animation: popIn .16s ease; }
@keyframes popIn { from { opacity:0; transform: translateY(-6px) } to { opacity:1; transform:none } }
.popover-head {
  padding: 9px 10px; font-size: 12.5px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line-soft); margin-bottom: 4px;
}
.popover-head .muted { font-size: 11px; }
.notice-item {
  display: flex; gap: 9px; padding: 9px 10px;
  border-radius: 8px; transition: background .15s;
}
.notice-item:hover { background: var(--surface-2); }
.notice-item p { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.notice-item small { color: var(--text-3); font-size: 10.5px; }
.notice-tag {
  flex: 0 0 auto; align-self: flex-start;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 5px;
  margin-top: 1px;
}
.notice-tag.warn { background: var(--warn-bg); color: var(--warn); }
.notice-tag.info { background: var(--info-bg); color: var(--info); }
.notice-tag.ok { background: var(--ok-bg); color: var(--ok); }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 9px 4px 4px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.user-chip:hover { background: var(--surface-2); border-color: var(--line); }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(140deg, #22d3ee, #0e7490);
  color: #fff; font-weight: 600; font-size: 13px;
  display: grid; place-items: center;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-meta strong { font-size: 12.5px; font-weight: 600; }
.user-meta span { font-size: 10.5px; color: var(--text-3); }
.user-chip .caret { font-size: 9px; color: var(--text-3); }

/* ---------- 内容滚动区 ---------- */
.content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 22px 24px 10px;
  scroll-behavior: smooth;
}
.page-foot {
  flex: 0 0 auto;
  height: 34px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-size: 11px; color: var(--text-3);
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

/* ============================== 通用组件 ============================== */

/* 页头 */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.page-title h2 { font-size: 19px; letter-spacing: -.3px; }
.page-title p { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px; font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #cbd8de; background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary {
  background: linear-gradient(140deg, var(--brand-500), var(--brand-700));
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px -2px rgba(14,116,144,.45);
}
.btn.primary:hover { box-shadow: 0 6px 16px -3px rgba(14,116,144,.55); filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--danger); border-color: #f3d0d0; background: var(--danger-bg); }
.btn.danger:hover { background: #fde5e5; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* 卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 12px;
  gap: 12px;
}
.card-head h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 11px; color: var(--text-3); font-weight: 400; }
.card-body { padding: 0 18px 16px; }
.card-body.flush { padding: 0; }

/* 网格 */
.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
@media (max-width: 1400px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3-2, .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .g-3, .g-2 { grid-template-columns: 1fr; }
}

/* ---------- KPI 卡 ---------- */
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::before {
  content:""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--acc, var(--brand-500));
  opacity: .85;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 14px;
  background: var(--acc-bg, var(--brand-50));
  color: var(--acc, var(--brand-600));
}
.kpi-val { display: flex; align-items: baseline; gap: 5px; }
.kpi-val b { font-size: 25px; font-weight: 650; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.kpi-val span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 11.5px; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--text-3); }

/* 迷你进度条 */
.mini-bar { height: 5px; border-radius: 3px; background: var(--line-soft); overflow: hidden; margin-top: 9px; }
.mini-bar i { display: block; height: 100%; border-radius: 3px; background: var(--acc, var(--brand-500)); transition: width .7s cubic-bezier(.4,0,.2,1); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.dt {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
table.dt thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.dt thead th:first-child { padding-left: 18px; }
table.dt thead th:last-child { padding-right: 18px; }
table.dt tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.dt tbody td:first-child { padding-left: 18px; }
table.dt tbody td:last-child { padding-right: 18px; }
table.dt tbody tr { transition: background .12s; }
table.dt tbody tr:hover { background: var(--surface-2); }
table.dt tbody tr:last-child td { border-bottom: 0; }
table.dt .row-actions { display: flex; gap: 2px; white-space: nowrap; flex-wrap: nowrap; }
.link-btn {
  background: none; border: 0; padding: 2px 5px;
  white-space: nowrap;
  color: var(--brand-600); font-size: 12px; font-weight: 500;
  border-radius: 5px;
}
.link-btn:hover { background: var(--brand-50); }
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-bg); }

.person-cell { display: flex; align-items: center; gap: 9px; }
.person-cell .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 11.5px; border-radius: 8px; }
.person-cell .pinfo { display: flex; flex-direction: column; line-height: 1.35; }
.person-cell .pinfo b { font-weight: 550; font-size: 12.5px; }
.person-cell .pinfo small { color: var(--text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 550;
  padding: 2px 8px; border-radius: 20px;
  white-space: nowrap;
}
.badge::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.grey { background: var(--surface-2); color: var(--text-3); }

.tag {
  display: inline-block; font-size: 11px;
  padding: 1px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line-soft);
}
.tag.brand { background: var(--brand-50); color: var(--brand-700); border-color: transparent; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11px; color: var(--text-3); font-weight: 500; padding-left: 1px; }
.control {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 120px;
}
.control:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(34,211,238,.13); }
select.control { padding-right: 26px; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%238b9aa3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
select.control option { background: var(--surface); color: var(--text); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .control { padding-left: 28px; min-width: 190px; }
.input-wrap .ico { position: absolute; left: 9px; color: var(--text-3); font-size: 13px; pointer-events: none; }

/* 分段控件 */
.segmented {
  display: inline-flex; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 2px; gap: 2px;
}
.segmented button {
  border: 0; background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 500;
  padding: 4px 11px; border-radius: 7px;
  transition: all .15s;
}
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); font-weight: 600; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--line-soft);
  gap: 12px; flex-wrap: wrap;
}
.pager-info { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; gap: 4px; align-items: center; }
.page-btn {
  min-width: 29px; height: 29px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); border-radius: 7px;
  font-size: 12px; font-variant-numeric: tabular-nums;
  transition: all .13s;
}
.page-btn:hover:not([disabled]) { border-color: var(--brand-400); color: var(--brand-600); }
.page-btn.on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 600; }
.page-btn[disabled] { opacity: .4; pointer-events: none; }
.page-ellipsis { color: var(--text-3); font-size: 12px; padding: 0 2px; }

/* ---------- 图表容器 ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; }
.chart-tip {
  position: fixed;
  background: rgba(11,32,39,.94);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 9px;
  border-radius: 7px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  opacity: 0;
  transition: opacity .1s;
  line-height: 1.55;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-variant-numeric: tabular-nums; }

/* 图例 */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; }

/* ---------- 进度列表 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 13px; }
.rank-item { display: flex; align-items: center; gap: 11px; }
.rank-no {
  width: 21px; height: 21px; flex: 0 0 21px;
  border-radius: 6px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.rank-item:nth-child(1) .rank-no { background: linear-gradient(140deg,#fbbf24,#f59e0b); color: #fff; }
.rank-item:nth-child(2) .rank-no { background: linear-gradient(140deg,#cbd5e1,#94a3b8); color: #fff; }
.rank-item:nth-child(3) .rank-no { background: linear-gradient(140deg,#fdba74,#f97316); color: #fff; }
.rank-main { flex: 1; min-width: 0; }
.rank-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.rank-line b { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-line span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before {
  content:""; position: absolute; left: 4px; top: 5px; bottom: 5px;
  width: 1.5px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 15px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content:""; position: absolute; left: -18px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand-400);
}
.tl-item.gray::before { border-color: #cbd5e1; }
.tl-item.green::before { border-color: var(--ok); }
.tl-item.red::before { border-color: var(--danger); }
.tl-item p { font-size: 12.5px; line-height: 1.5; }
.tl-item small { font-size: 10.5px; color: var(--text-3); }

/* ---------- 树形结构 ---------- */
.tree { font-size: 13px; user-select: none; }
.tree-node { }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.tree-caret {
  width: 16px; flex: 0 0 16px; text-align: center;
  font-size: 9px; color: var(--text-3);
  transition: transform .18s;
}
.tree-caret.open { transform: rotate(90deg); }
.tree-caret.leaf { visibility: hidden; }
.tree-ico { font-size: 12px; opacity: .8; }
.tree-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-count {
  font-size: 10.5px; color: var(--text-3);
  background: var(--surface-2);
  padding: 0 6px; border-radius: 20px;
  font-variant-numeric: tabular-nums;
}
.tree-row.active .tree-count { background: rgba(14,116,144,.14); color: var(--brand-700); }
.tree-children { padding-left: 17px; overflow: hidden; }
.tree-children.collapsed { display: none; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(9,25,31,.42);
  backdrop-filter: blur(1.5px);
  opacity: 0; pointer-events: none; transition: opacity .22s;
  z-index: 100;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px; max-width: 92vw;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
  z-index: 101;
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 14.5px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(9,25,31,.45);
  backdrop-filter: blur(2px);
  display: none; place-items: center;
  z-index: 120;
  padding: 20px;
}
.modal-mask.open { display: grid; animation: fadeIn .16s; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 520px; max-width: 100%;
  max-height: 86vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn { from { opacity:0; transform: translateY(14px) scale(.98) } to { opacity:1; transform:none } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 0 20px 4px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px 18px;
}
.modal-foot:empty { display: none; }

/* 表单 */
.form-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item label { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.form-item label .req { color: var(--danger); }
.form-item .control { width: 100%; }
.form-item textarea.control { height: 74px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.hint { font-size: 10.5px; color: var(--text-3); }

/* 详情栅格 */
.dl { display: grid; grid-template-columns: 88px 1fr; gap: 10px 12px; font-size: 12.5px; align-items: baseline; }
.dl dt { color: var(--text-3); font-size: 12px; }
.dl dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

.section-title {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 7px;
  margin: 20px 0 11px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
}
.section-title:first-child { margin-top: 0; }
.section-title::before { content:""; width: 3px; height: 12px; border-radius: 2px; background: var(--brand-500); }

/* 分数大字 */
.score-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 16px;
  background: linear-gradient(135deg, var(--brand-50), transparent 70%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.score-ring { position: relative; width: 88px; height: 88px; flex: 0 0 88px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .val {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 650; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.score-meta { display: flex; flex-direction: column; gap: 4px; }
.score-meta b { font-size: 14px; }
.score-meta small { color: var(--text-3); font-size: 11.5px; }

/* 空状态 */
.empty {
  padding: 46px 20px; text-align: center; color: var(--text-3);
}
.empty .ico { font-size: 30px; opacity: .35; display: block; margin-bottom: 8px; }
.empty p { font-size: 12.5px; }

/* toast */
.toast-stack {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 9998; display: flex; flex-direction: column; gap: 8px;
  align-items: center; pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .22s cubic-bezier(.4,0,.2,1);
  max-width: 420px;
}
@keyframes toastIn { from { opacity:0; transform: translateY(-12px) } to { opacity:1; transform:none } }
.toast.out { animation: toastOut .2s forwards; }
@keyframes toastOut { to { opacity:0; transform: translateY(-10px) } }
.toast .ti { font-size: 13px; }
.toast.ok .ti { color: var(--ok); }
.toast.err .ti { color: var(--danger); }
.toast.info .ti { color: var(--info); }

/* 骨架 */
.skeleton {
  background: linear-gradient(90deg, var(--line-soft) 25%, var(--surface-2) 37%, var(--line-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* 热力图格子 */
.heat-grid { display: flex; flex-direction: column; gap: 3px; }
.heat-row { display: flex; gap: 3px; align-items: center; }
.heat-label { width: 30px; flex: 0 0 30px; font-size: 10px; color: var(--text-3); text-align: right; padding-right: 4px; }
.heat-cell {
  flex: 1; aspect-ratio: 1 / 1; min-height: 13px;
  border-radius: 3px;
  transition: transform .12s;
  cursor: default;
}
.heat-cell:hover { transform: scale(1.18); outline: 1.5px solid var(--brand-600); }
.heat-scale { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-3); margin-top: 8px; justify-content: flex-end; }
.heat-scale i { width: 12px; height: 12px; border-radius: 3px; display: block; }

/* 分段切换 tabs */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  padding: 0 18px;
}
.tab {
  border: 0; background: none;
  padding: 11px 13px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand-600); border-bottom-color: var(--brand-600); font-weight: 600; }

/* 权限矩阵 */
.perm-table { font-size: 12.5px; }
.perm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.perm-table th { text-align: left; padding: 8px 10px; font-size: 11.5px; color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--line); }
.switch {
  width: 34px; height: 19px; border-radius: 10px;
  background: var(--line); border: 0; padding: 0;
  position: relative; transition: background .18s;
}
.switch::after {
  content:""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s;
}
.switch.on { background: var(--brand-500); }
.switch.on::after { transform: translateX(15px); }

/* 动画：视图进入 */
.view-enter { animation: viewIn .26s cubic-bezier(.4,0,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

/* 滚动条内的卡列表 */
.scroll-list { max-height: 306px; overflow-y: auto; }

/* 五列网格 */
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1500px) { .g-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1000px) { .g-5 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---------- 数据导入 ---------- */
.import-drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .16s;
  background: var(--surface-2);
}
.import-drop:hover, .import-drop.over {
  border-color: var(--brand-400);
  background: var(--brand-50);
}
.import-summary {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-2);
  background: var(--surface-2);
  padding: 9px 12px; border-radius: 9px;
  margin-bottom: 8px;
}
/* 导入弹窗里的「只需要填这些」提示 */
.imp-note {
  margin-bottom: 9px; padding: 9px 12px; border-radius: 9px;
  background: var(--brand-50); border: 1px solid rgba(8,145,178,.16);
  font-size: 11.5px; line-height: 1.75; color: var(--text-2);
}
.import-error {
  background: var(--danger-bg);
  border: 1px solid rgba(220,38,38,.18);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--danger);
}
.import-error code {
  background: rgba(220,38,38,.1);
  padding: 0 4px; border-radius: 4px;
}
.modal .btn:disabled { opacity: .45; pointer-events: none; }

/* ============================================================
   登录页
   ============================================================ */
.auth-body {
  margin: 0;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.auth-page {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  min-height: 100vh;
  background:
    radial-gradient(780px 500px at 72% 4%, rgba(8,145,178,.075), transparent 62%),
    radial-gradient(640px 440px at 100% 100%, rgba(124,58,237,.05), transparent 64%),
    var(--bg);
}

/* ---------- 左侧品牌区：上段标题（顶层）+ 下段图片（底层） ---------- */
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 16px 0 16px 16px;
  border-radius: 20px;
  min-height: calc(100vh - 32px);
  background: var(--surface);
  box-shadow: 0 20px 46px -26px rgba(8,54,68,.42);
}

/* 上段：标题层，压在图片之上 */
.auth-lead {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 46px 46px 34px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

.auth-lead-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #0e7490 0%, #12a8c2 55%, #35cbd8 100%);
  box-shadow: 0 12px 24px -12px rgba(8,145,178,.85);
}

.auth-lead h1 {
  margin: 0;
  font-size: clamp(25px, 2.05vw, 32px);
  line-height: 1.3;
  font-weight: 660;
  letter-spacing: .8px;
  color: var(--text);
}
.auth-lead-en {
  margin: 10px 0 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--brand-600);
  opacity: .85;
}
/* 仅在改密页出现的补充说明，与标题同层 */
.auth-lead-tip {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-3);
}

/* 下段：整张图片作为底层铺满 */
.auth-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  overflow: hidden;
}
.auth-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 46% 60%;
}
.auth-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.30) 4%, rgba(255,255,255,0) 11%, rgba(6,42,52,.04) 60%, rgba(6,42,52,.32) 100%);
}
[data-theme="dark"] .auth-hero-img { filter: brightness(.86) saturate(1.02); }
[data-theme="dark"] .auth-hero-shade {
  background:
    linear-gradient(180deg, rgba(12,36,43,.96) 0%, rgba(12,36,43,.26) 5%, rgba(12,36,43,0) 12%, rgba(4,28,36,.22) 60%, rgba(4,28,36,.58) 100%);
}

/* 图标层：玻璃徽标浮在图片上 */
.auth-hero-icon {
  position: absolute;
  left: 46px;
  bottom: 40px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(8,54,66,.46);
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: 0 14px 30px -14px rgba(0,28,36,.75), inset 0 1px 0 rgba(255,255,255,.35);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}
.auth-hero-icon svg { width: 27px; height: 27px; }
[data-theme="dark"] .auth-hero-icon {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.34);
}


/* ---------- 右侧表单区 ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  padding: 18px 40px 16px;
  background: transparent;
  position: relative;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 34px;
  width: 100%;
  max-width: 404px;
  margin: 0 auto;
}

.auth-env {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
}
.auth-env i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 3px rgba(139,154,163,.16);
}
.auth-env.ok i { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.16); }
.auth-env.bad i { background: var(--warn); box-shadow: 0 0 0 3px rgba(217,119,6,.16); }

.auth-card {
  width: 100%;
  max-width: 404px;
  margin: auto;
  padding: 34px 32px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(15,32,39,.04),
    0 20px 50px -28px rgba(15,32,39,.30);
}
[data-theme="dark"] .auth-card {
  box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 22px 50px -26px rgba(0,0,0,.75);
}
.auth-card-head { margin-bottom: 24px; }
.auth-card-head h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: .2px;
  margin: 0 0 8px;
  color: var(--text);
}
.auth-card-head p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
  margin: 0;
}

.auth-field { display: block; margin-bottom: 15px; }
.auth-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: .2px;
}
.auth-input {
  position: relative;
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.auth-input:focus-within {
  border-color: var(--brand-500);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px rgba(8,145,178,.12);
}
.auth-input i {
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  font-style: normal;
  color: var(--text-3);
}
.auth-input i svg { width: 17px; height: 17px; display: block; }
.auth-input:focus-within i { color: var(--brand-600); }
.auth-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  padding-right: 10px;
  font-family: inherit;
}
.auth-input input::placeholder { color: var(--text-3); opacity: .8; }
.auth-eye {
  flex: 0 0 42px;
  height: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 13px;
  display: grid;
  place-items: center;
}
.auth-eye svg { width: 17px; height: 17px; display: block; }
.auth-eye .eye-off { display: none; }
.auth-eye.on .eye-open { display: none; }
.auth-eye.on .eye-off { display: block; }
.auth-eye:hover { color: var(--brand-600); }

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 18px;
}
.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.auth-check input {
  width: 14px; height: 14px;
  accent-color: var(--brand-600);
  cursor: pointer;
}
.auth-link {
  border: 0; background: none;
  font-size: 12.5px;
  color: var(--brand-600);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.auth-link:hover { text-decoration: underline; }

.auth-error {
  font-size: 12.5px;
  line-height: 1.7;
  padding: 10px 13px;
  border-radius: 10px;
  margin-bottom: 16px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,.16);
}
.auth-error.info {
  background: var(--info-bg);
  color: var(--info);
  border-color: rgba(37,99,235,.16);
}

.auth-submit {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #fff;
  font-family: inherit;
  background: linear-gradient(135deg, #0e7490, #0891b2 58%, #0e9bb8);
  box-shadow: 0 8px 20px -8px rgba(8,145,178,.62);
  transition: transform .14s, box-shadow .18s, filter .18s;
  position: relative;
}
.auth-submit:hover { filter: brightness(1.06); box-shadow: 0 12px 28px -8px rgba(8,145,178,.72); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: not-allowed; filter: grayscale(.25) brightness(.95); transform: none; }
.auth-submit .btn-loading { display: none; letter-spacing: 1px; }
.auth-submit.loading .btn-text { display: none; }
.auth-submit.loading .btn-loading { display: inline; }

/* 测试账号：默认收起，避免长期占据登录页视觉重心 */
.auth-hint {
  margin-top: 16px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
}
.auth-hint summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  user-select: none;
}
.auth-hint summary::-webkit-details-marker { display: none; }
.auth-hint summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  transition: transform .16s;
}
.auth-hint[open] summary::after { transform: rotate(180deg); }
.auth-hint summary:hover { color: var(--brand-600); }
.auth-hint summary b { font-weight: 600; }
.auth-hint summary .auth-hint-tag {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--brand-700);
  background: var(--brand-50);
  padding: 1px 6px;
  border-radius: 5px;
}
.auth-hint-body { padding: 2px 13px 12px; line-height: 1.95; }
.auth-hint b { color: var(--text-2); font-weight: 600; margin-right: 6px; }
.auth-hint code {
  background: var(--brand-50);
  color: var(--brand-700);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
[data-theme="dark"] .auth-hint code,
[data-theme="dark"] .auth-hint summary .auth-hint-tag { color: var(--brand-200); }

.auth-demo {
  margin-top: 14px;
  padding: 13px;
  border-radius: 10px;
  background: var(--warn-bg);
  border: 1px solid rgba(217,119,6,.22);
}
.auth-demo p { margin: 0 0 10px; font-size: 12px; color: var(--warn); line-height: 1.7; }
.auth-demo .btn { width: 100%; justify-content: center; }

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 404px;
  margin: 14px auto 0;
  padding-top: 0;
  border-top: 0;
  font-size: 11px;
  color: var(--text-3);
}
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }
.auth-foot i { font-style: normal; color: var(--text-3); opacity: .6; }
.auth-foot-link {
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 1px;
}
.auth-foot-link:hover { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main {
    padding: 20px 20px 16px;
    min-height: 100vh;
    align-items: center;
  }
  .auth-topbar { width: 100%; max-width: 404px; margin: 0 auto; }
  /* 小屏把卡片摊平，去掉阴影，避免手机上出现「浮块」的累赘感 */
  .auth-card {
    padding: 22px 4px 18px;
    background: transparent;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-input { background: var(--surface); }
  .auth-main::before {
    content: '医学技能训练平台';
    display: block;
    width: 100%;
    max-width: 404px;
    margin: 4px auto 20px;
    font-size: 15px;
    font-weight: 650;
    color: var(--brand-700);
    text-align: center;
    letter-spacing: 2px;
  }
  [data-theme="dark"] .auth-main::before { color: var(--brand-200); }
  .auth-card-head h2 { font-size: 21px; }
}

/* ============================================================
   用户菜单 / 个人信息
   ============================================================ */
.user-wrap { position: relative; }

.user-menu {
  right: 0;
  top: calc(100% + 8px);
  width: 246px;
  padding: 6px;
  border-radius: 12px;
}
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 9px 10px;
}
.user-menu-head .avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; font-size: 14px; }
.um-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.um-info strong { font-size: 13px; font-weight: 600; color: var(--text); }
.um-info span {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.um-row {
  padding: 0 9px 9px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}
.um-row .dot { margin: 0 5px; opacity: .5; }

.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }

.menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background .13s, color .13s;
}
.menu-item i {
  font-style: normal;
  width: 15px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item:hover i { color: var(--brand-600); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger i { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-bg); }

/* 个人信息弹窗 */
.profile-head {
  display: flex; align-items: center; gap: 13px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}
.avatar.lg {
  width: 46px; height: 46px; flex-basis: 46px;
  border-radius: 13px; font-size: 17px;
}
.profile-head strong { display: block; font-size: 15px; font-weight: 600; }
.profile-head span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.perm-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.perm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.perm-chip b { font-weight: 600; font-size: 10.5px; }
.perm-chip.ok { background: var(--ok-bg); border-color: rgba(22,163,74,.2); color: var(--ok); }
.perm-chip.info { background: var(--info-bg); border-color: rgba(37,99,235,.2); color: var(--info); }
.perm-chip.grey { color: var(--text-3); }
.perm-chip.grey b { color: var(--text-3); opacity: .8; }

/* hidden 属性需压过 display:flex 等类样式 */
.nav-item[hidden],
.nav-group-label[hidden] { display: none !important; }

/* 弹窗内表单字段（label 用 span 包裹） */
.field > span {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  padding-left: 1px;
}
.field > span i { font-style: normal; color: var(--danger); margin-left: 2px; }
.field .control { width: 100%; height: 36px; min-width: 0; }
.form-grid .field { margin-bottom: 2px; }

/* ============================================================
   作业考试
   ============================================================ */
.cell-title { display: flex; align-items: flex-start; gap: 9px; }
.cell-title b { display: block; font-size: 12.5px; font-weight: 550; line-height: 1.45; }
.cell-title small { display: block; font-size: 10.5px; margin-top: 2px; }
.asg-type-dot {
  flex: 0 0 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600;
  background: var(--info-bg); color: var(--info);
}
.asg-type-dot.exam { background: var(--purple-bg); color: var(--purple); }
b.link { color: var(--text); cursor: pointer; }
b.link:hover { color: var(--brand-600); text-decoration: underline; }

.progress-cell { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.progress-num { display: flex; align-items: baseline; gap: 4px; font-size: 11px; color: var(--text-3); }
.progress-num b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.progress-num em { margin-left: auto; font-style: normal; font-weight: 600; font-size: 11px; }
.progress-num em.ok { color: var(--ok); }
.progress-num em.warn { color: var(--warn); }
.progress-num em.danger { color: var(--danger); }

.asg-head h4 { font-size: 15px; font-weight: 600; margin: 8px 0 5px; line-height: 1.5; }
.asg-metrics {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px; margin: 14px 0 6px;
}
.asg-metrics > div {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 8px;
  text-align: center;
}
.asg-metrics b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.3px; }
.asg-metrics span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

.grade-head {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 10px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  font-size: 11.5px;
}
.grade-head > div { display: flex; flex-direction: column; gap: 2px; }
.grade-head b { font-size: 12.5px; font-weight: 600; }

.check-list {
  max-height: 176px; overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--surface);
}
.check-list label {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: 6px;
  font-size: 11.5px; cursor: pointer;
}
.check-list label:hover { background: var(--surface-2); }
.check-list input { accent-color: var(--brand-600); }
.check-list span { display: flex; flex-direction: column; line-height: 1.3; }
.check-list em { font-style: normal; font-size: 10px; color: var(--text-3); }

table.dt.compact tbody td { padding-top: 7px; padding-bottom: 7px; font-size: 12px; }

/* 角色数据范围 */
.scope-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.scope-pill.all { background: var(--brand-50); border-color: rgba(8,145,178,.2); color: var(--brand-700); }
.scope-pill.college { background: var(--info-bg); border-color: rgba(37,99,235,.2); color: var(--info); }
.scope-pill.school { background: var(--ok-bg); border-color: rgba(13,148,136,.22); color: var(--ok); }
.scope-pill.own { background: var(--purple-bg); border-color: rgba(124,58,237,.2); color: var(--purple); }
[data-theme="dark"] .scope-pill.all { color: var(--brand-200); }

/* ---------- 角色卡片 ---------- */
.role-card {
  padding: 12px 14px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}
.role-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.role-card-head b { font-size: 13px; font-weight: 600; }
.role-card-acts { margin-left: auto; display: flex; gap: 4px; }
.role-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }

.scope-note {
  margin-top: 16px;
  padding: 11px 14px;
  background: var(--info-bg);
  border: 1px solid rgba(37,99,235,.14);
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.9;
}
.scope-note b { color: var(--info); font-weight: 600; }

.cell-ellipsis {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 页面标题旁的数据范围标识 ---------- */
.scope-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px; padding: 3px 9px 3px 8px;
  font-size: 11px; font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  vertical-align: 1px;
  white-space: nowrap;
}
.scope-chip i {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .75;
}
.scope-chip.college { background: var(--info-bg); border-color: rgba(37,99,235,.2); color: var(--info); }
.scope-chip.own { background: var(--purple-bg); border-color: rgba(124,58,237,.22); color: var(--purple); }

/* 窄屏下表格横向滚动，避免列被压扁换行 */
table.dt { min-width: 880px; }
table.dt td.num { white-space: nowrap; }

@media (max-width: 900px) {
  .global-search { display: none; }
  .user-chip .user-meta { display: none; }
  .user-chip .caret { display: none; }
}

/* ---------- 班级绑定教师 / 学生 ---------- */
.bind-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 9px;
}
.bind-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bind-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 5px 4px 9px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px; color: var(--text);
}
.bind-chip .x {
  border: 0; background: none; cursor: pointer;
  color: var(--text-3); font-size: 12px; line-height: 1;
  padding: 2px 3px; border-radius: 4px;
}
.bind-chip .x:hover { color: var(--danger); background: var(--danger-bg); }
.bind-empty { font-size: 12px; color: var(--text-3); padding: 7px 0; }

.pick-list {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 9px;
}
.pick-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; font-size: 12.5px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--surface-2); }
.pick-item input { accent-color: var(--brand); }
.pick-item .muted { margin-left: auto; font-size: 11px; }
.pick-item .stu-no { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pick-item .tag { font-size: 10.5px; padding: 0 6px; }
.pick-item.is-other { background: var(--warn-bg); }
.pick-item.is-other:hover { background: #fef3c7; }
[data-theme="dark"] .pick-item.is-other:hover { background: rgba(217,119,6,.2); }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.tag.ok { background: var(--ok-bg, #ecfdf5); color: var(--ok, #059669); border-color: transparent; }
.added-list {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 9px; padding: 8px 11px; font-size: 11.5px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: var(--surface-2); color: var(--text-3);
}

.pick-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }.pick-toolbar .control { flex: 1; min-width: 0; }
.pick-toolbar .btn { flex: none; height: 32px; }
.pick-group + .pick-group { border-top: 1px solid var(--line); }
.pick-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 11px 5px; font-size: 11px; font-weight: 600;
  color: var(--text-3); background: var(--surface-2);
  position: sticky; top: 0; z-index: 1;
}
.pick-group-head .muted { font-weight: 400; }
.stu-newform {
  border: 1px dashed var(--brand-200, var(--line));
  background: var(--brand-50, var(--surface-2));
  border-radius: 9px; padding: 12px; margin-bottom: 10px;
}
.stu-newform .control { height: 32px; }

.route-hint {
  margin-top: 12px; padding: 10px 13px;
  background: var(--info-bg); border: 1px solid rgba(37,99,235,.14);
  border-radius: 9px; font-size: 11.5px; color: var(--text-2); line-height: 1.85;
}
.route-hint b { color: var(--info); font-weight: 600; }

.class-cell {
  display: flex; align-items: center; gap: 3px;
  max-width: 150px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================================
   口令强度 / 强制改密页
   ============================================================ */
.pwd-meta { margin: -2px 0 2px; }
.pwd-meta:empty { display: none; }

.pwd-strength {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 7px;
}
.pwd-strength .lvl {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-3); letter-spacing: .2px;
}

.pwd-meter { display: inline-flex; gap: 4px; }
.pwd-meter i {
  display: block; width: 30px; height: 4px; border-radius: 2px;
  background: var(--line); transition: background .2s;
}
.pwd-meter.lvl-1 i.on { background: var(--danger); }
.pwd-meter.lvl-2 i.on { background: var(--warn); }
.pwd-meter.lvl-3 i.on { background: var(--ok); }
.pwd-meter.lvl-4 i.on { background: var(--brand-600); }

.pwd-rules {
  list-style: none; margin: 0 0 4px; padding: 0;
  display: flex; flex-wrap: wrap; gap: 5px 14px;
}
.pwd-rules li {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-3); line-height: 1.7;
}
.pwd-rules li b { font-weight: 400; color: var(--text-3); }
.pwd-rules li.ok { color: var(--ok); }
.pwd-rules li.ok b { color: var(--ok); }

.auth-security {
  margin-top: 14px; padding: 10px 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px; line-height: 1.75; color: var(--text-3);
}
.auth-security b { display: block; color: var(--text-2); font-size: 11.5px; margin-bottom: 2px; }

.auth-logout {
  display: block; margin: 12px auto 0;
  background: none; border: 0; cursor: pointer;
  font-size: 11.5px; color: var(--text-3);
}
.auth-logout:hover { color: var(--brand-600); text-decoration: underline; }

/* ============================================================
   客户端下载页
   ============================================================ */
.dl-body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.dl-top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dl-top-inner {
  max-width: 1060px; margin: 0 auto;
  padding: 13px 26px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.dl-brand {
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: inherit;
}
.dl-brand .brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800));
  color: #fff;
}
.dl-brand strong { display: block; font-size: 14.5px; letter-spacing: .2px; }
.dl-brand em {
  display: block; font-style: normal; margin-top: 1px;
  font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-3);
}
.dl-top-actions { display: flex; align-items: center; gap: 10px; }

.dl-main {
  max-width: 1060px; margin: 0 auto;
  padding: 44px 26px 60px;
}

/* ---------- 头部 ---------- */
.dl-hero { margin-bottom: 34px; }
.dl-eyebrow {
  display: inline-block; margin-bottom: 12px;
  padding: 4px 11px; border-radius: 99px;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 11.5px; letter-spacing: .5px;
}
.dl-hero h1 {
  margin: 0 0 12px;
  font-size: 30px; line-height: 1.35; font-weight: 650;
  letter-spacing: .4px;
}
.dl-hero p {
  margin: 0 0 20px; max-width: 660px;
  font-size: 13.5px; line-height: 1.95; color: var(--text-2);
}
.dl-version {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.dl-version span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px;
}
.dl-version i { font-style: normal; color: var(--text-3); }
.dl-version b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 下载卡片 ---------- */
.dl-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px; margin-bottom: 42px;
}
.dl-card {
  padding: 22px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex; flex-direction: column;
}
.dl-card.primary {
  border-color: rgba(14,116,144,.32);
  box-shadow: 0 1px 2px rgba(15,32,39,.04), 0 10px 26px -18px rgba(14,116,144,.5);
}
.dl-card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 18px; }
.dl-ico {
  flex: 0 0 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--brand-600);
}
.dl-card.primary .dl-ico {
  background: linear-gradient(140deg, var(--brand-600), var(--brand-800));
  border-color: transparent; color: #fff;
}
.dl-card-head h3 {
  margin: 2px 0 4px; font-size: 15px; font-weight: 620;
  display: flex; align-items: center; gap: 8px;
}
.dl-badge {
  font-style: normal; font-size: 10px; font-weight: 500;
  padding: 2px 7px; border-radius: 5px;
  background: var(--brand-100); color: var(--brand-700);
}
.dl-card-head p { margin: 0; font-size: 12px; color: var(--text-3); }

.dl-meta { margin: 0 0 20px; padding: 0; font-size: 12px; }
.dl-meta > div {
  display: flex; gap: 12px; padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.dl-meta > div:last-child { border-bottom: 0; }
.dl-meta dt { flex: 0 0 74px; color: var(--text-3); }
.dl-meta dd {
  margin: 0; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dl-meta .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; }

.dl-btn {
  margin-top: auto;
  height: 40px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 550; cursor: pointer;
  transition: all .18s;
}
.dl-btn:hover { border-color: var(--brand-600); color: var(--brand-700); }
/* 下载按钮可能是 <a>（真实文件）或 <button disabled>（暂无文件），统一外观 */
a.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.dl-card.primary .dl-btn {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px -8px rgba(14,116,144,.75);
}
.dl-card.primary .dl-btn:hover { filter: brightness(1.06); }
.dl-btn.disabled {
  background: var(--surface-2) !important; color: var(--text-3) !important;
  border-color: var(--line) !important; box-shadow: none !important;
  cursor: not-allowed;
}

/* ---------- 文本区块 ---------- */
.dl-block { margin-bottom: 38px; }
.dl-block h2 {
  margin: 0 0 16px; font-size: 16px; font-weight: 620;
  padding-left: 11px; border-left: 3px solid var(--brand-600);
  line-height: 1.3;
}
.dl-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; counter-reset: step;
}
.dl-steps li {
  position: relative;
  padding: 16px 18px 16px 52px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; counter-increment: step;
}
.dl-steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 16px;
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 12px; font-weight: 600;
}
.dl-steps b { display: block; font-size: 13px; margin-bottom: 5px; }
.dl-steps span { display: block; font-size: 12px; line-height: 1.8; color: var(--text-3); }

.dl-faq {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}
.dl-faq > div {
  padding: 14px 17px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px;
}
.dl-faq b { display: block; font-size: 12.5px; margin-bottom: 5px; }
.dl-faq span { display: block; font-size: 12px; line-height: 1.8; color: var(--text-3); }

.dl-note {
  margin: 0 0 32px; padding: 13px 16px;
  background: var(--warn-bg); border: 1px solid rgba(217,119,6,.22);
  border-radius: 10px;
  font-size: 12px; line-height: 1.85; color: #92400e;
}
.dl-note code {
  background: rgba(217,119,6,.12); padding: 0 4px; border-radius: 4px;
}
/* 空态提示条：上半段给学生，下半段折叠给管理员 */
.dl-note-t { display: block; margin-bottom: 4px; font-size: 12.5px; }
.dl-note-l { display: block; }
.dl-note-admin { margin-top: 9px; }
.dl-note-admin > summary {
  cursor: pointer; font-size: 11.5px; opacity: .82; list-style: none;
}
.dl-note-admin > summary::-webkit-details-marker { display: none; }
.dl-note-admin > summary::before { content: '▸ '; }
.dl-note-admin[open] > summary::before { content: '▾ '; }
.dl-note-admin > summary:hover { opacity: 1; }
.dl-note-admin > p { margin: 7px 0 0; font-size: 11.5px; line-height: 1.9; }
/* 暗色下 #92400e 贴在深底上几乎看不清，改用浅琥珀 */
[data-theme="dark"] .dl-note { color: #fcd34d; border-color: rgba(217,119,6,.38); }
[data-theme="dark"] .dl-note code { background: rgba(245,158,11,.16); color: #fde68a; }
[data-theme="dark"] .dl-note-admin > summary { opacity: .92; }

.dl-foot {
  max-width: 1060px; margin: 0 auto;
  padding: 20px 26px 34px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .dl-hero h1 { font-size: 23px; }
  .dl-main { padding: 28px 18px 44px; }
  .dl-top-inner { padding: 11px 18px; }
  .dl-faq { grid-template-columns: 1fr; }
}

/* 外链式导航项（客户端下载） */
.nav-item.nav-out { text-decoration: none; }
.nav-out-ico {
  margin-left: auto; font-size: 11px;
  color: var(--nav-text-2); opacity: .7;
}
.nav-item.nav-out:hover .nav-out-ico { color: #22d3ee; opacity: 1; }
.sidebar.collapsed .nav-out-ico { display: none; }

.dl-btn-hint {
  display: block; margin-top: 9px;
  font-style: normal; font-size: 11px;
  color: var(--text-3); text-align: center;
}

/* ============================================================
   项目配置 · 教学配置
   ============================================================ */
.teach-summary {
  display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap;
  padding-bottom: 2px;
}
.teach-summary .tc-k { font-size: 10.5px; color: var(--text-3); line-height: 1.5; }
.teach-summary .tc-v { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.teach-summary .tc-v b { color: var(--brand-600); }

.pj-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pj-cell > b { font-weight: 550; font-size: 12.5px; }

table.dt .link-btn[disabled] { opacity: .32; cursor: not-allowed; }

/* 权限边界说明条（教师视角：项目只读，只能决定开放范围） */
.lock-note {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--info-bg);
  font-size: 12px; line-height: 1.65; color: var(--text-2);
}
.lock-note .ln-ico {
  flex: none; width: 16px; height: 16px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--info);
  border: 1.2px solid currentColor; border-radius: 5px;
}
.lock-note b { color: var(--text); font-weight: 600; }
.lock-note .ln-body { flex: 1; min-width: 0; }

/* 多班同步：已选班级 chips */
.tc-multi { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
.tc-multi .tm-label { font-size: 10.5px; color: var(--text-3); }
.tc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 4px 0 9px;
  background: var(--brand-50); color: var(--brand-700);
  border: 1px solid var(--brand-200); border-radius: 999px;
  font-size: 12px; white-space: nowrap;
}
[data-theme="dark"] .tc-chip { color: var(--brand-400); }
.tc-chip button {
  width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; opacity: .55;
  font-size: 12px; line-height: 1;
}
.tc-chip button:hover { opacity: 1; background: rgba(0,0,0,.07); }
.tc-pick-add {
  height: 24px; padding: 0 10px; border-radius: 999px;
  border: 1px dashed var(--line); background: transparent;
  color: var(--text-2); font-size: 11.5px;
}
.tc-pick-add:hover { border-color: var(--brand-400); color: var(--brand-600); }


/* ============================================================
   批量授权面板（项目配置 → 批量授权）
   ============================================================ */
.grant-card .card-body { padding-top: 4px; }

.grant-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grant-col {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  background: var(--surface-2);
}

.grant-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12.5px;
}
.grant-col-head b { font-weight: 600; }
.grant-col-head .muted { font-size: 11px; }

.grant-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 11px;
}

.grant-list {
  max-height: 268px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 4px 6px;
}
.grant-list.sm { max-height: 236px; }

.grant-group + .grant-group { margin-top: 4px; }

.grant-group-head {
  position: sticky;
  top: -4px;
  z-index: 1;
  padding: 5px 4px 4px;
  background: var(--surface);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--text-3);
  text-transform: none;
  border-bottom: 1px solid var(--line-soft);
}

.grant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.grant-row:hover { background: var(--surface-2); }
.grant-row input { flex: none; accent-color: var(--brand-600); }
.grant-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grant-rules {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.grant-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.grant-summary {
  min-width: 0;
  flex: 1;
  font-size: 12px;
  color: var(--text-2);
}
.grant-summary b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

.tabs.sm .tab { padding: 5px 12px; font-size: 11.5px; }

@media (max-width: 900px) {
  .grant-cols { grid-template-columns: 1fr; }
  .grant-foot { flex-direction: column; align-items: stretch; }
  .grant-summary { flex: none; }
}

/* ============================================================
   导入结果 / 导出确认（importer.js · exporter.js）
   ============================================================ */

/* 导入结果面板 */
.imp-result {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.imp-result.ok { background: var(--ok-bg); border-color: rgba(22,163,74,.22); }
.imp-result.partial { background: var(--warn-bg); border-color: rgba(217,119,6,.22); }
.imp-result.allfail { background: var(--danger-bg); border-color: rgba(220,38,38,.22); }
.imp-result-ico {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700; color: #fff;
  background: var(--ok);
}
.imp-result.partial .imp-result-ico { background: var(--warn); }
.imp-result.allfail .imp-result-ico { background: var(--danger); }
.imp-result-main b { display: block; font-size: 14px; }
.imp-result-main span { font-size: 11.5px; color: var(--text-2); }

.imp-msglist {
  max-height: 190px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2);
  padding: 8px 12px;
  font-size: 11.5px; line-height: 1.9;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.imp-msglist div { border-bottom: 1px dashed var(--line-soft); }
.imp-msglist div:last-child { border-bottom: 0; }

/* 导出确认弹窗 */
.exp-scope {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--brand-50);
  border: 1px solid rgba(8,145,178,.16);
}
.exp-scope-ico {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--surface); color: var(--brand-700); font-size: 13px;
}
.exp-scope-main { min-width: 0; }
/* 只让标题独占一行；正文里的强调词保持行内，避免句子被拆断 */
.exp-scope-main > b { display: block; font-size: 12.5px; }
.exp-scope-main span { font-size: 11px; color: var(--text-2); line-height: 1.6; }
.exp-scope-main span b { font-weight: 600; color: var(--brand-700); }

.exp-block { margin-top: 16px; }
.exp-block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.exp-block-head em {
  font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--text-3);
}

.exp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 11px; max-width: 100%;
}
.exp-chip i { font-style: normal; color: var(--text-3); font-size: 10px; }
.exp-chip b { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.exp-chip.none {
  background: var(--warn-bg); border-color: rgba(217,119,6,.2); color: var(--warn);
}
.exp-chip.none i { color: inherit; }

.exp-count {
  display: flex; align-items: baseline; gap: 8px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.exp-count b {
  font-size: 25px; font-weight: 650; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; color: var(--brand-600);
}
.exp-count span { font-size: 11.5px; color: var(--text-3); }
.exp-count .exp-count-note { margin-left: auto; font-size: 11px; color: var(--text-3); }

.exp-fields {
  display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 96px; overflow-y: auto;
}
.exp-field {
  font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--line-soft);
}

.exp-tip {
  margin-top: 14px; font-size: 11px; color: var(--text-3); line-height: 1.7;
  padding-top: 10px; border-top: 1px dashed var(--line-soft);
}

/* 导出被上限截断时的强提示 */
.exp-warn {
  margin-top: 9px; padding: 9px 11px; border-radius: 8px;
  background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  display: flex; flex-direction: column; gap: 3px;
}
.exp-warn b { font-size: 12px; color: var(--warn); font-weight: 620; }
.exp-warn span { font-size: 11.5px; color: var(--text-2); line-height: 1.65; }
.exp-warn span b { color: var(--warn); font-size: 11.5px; }

/* 项目批量授权 */
.grant-workspace .card-head { padding-bottom: 15px; }
.grant-intro { margin-top: 5px; font-size: 12px; }
.grant-pickers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.grant-picker { min-width:0; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.grant-picker-title { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:13px; font-size:13px; }
.grant-picker-title i { display:inline-grid; place-items:center; width:23px; height:23px; margin-right:5px; border-radius:7px; font-style:normal; color:var(--brand-700); background:var(--brand-50); }
.grant-picker-title > span { color:var(--text-3); font-size:11px; white-space:nowrap; }
.grant-picker-tools { display:flex; flex-wrap:wrap; gap:12px; align-items:center; min-height:35px; font-size:11px; }
.grant-picker-tools .muted { margin-left:auto; }
.grant-picker-list { height:300px; overflow:auto; padding:5px; background:var(--surface); border:1px solid var(--line-soft); border-radius:8px; }
.grant-choice { display:flex; align-items:flex-start; gap:10px; padding:9px; border-radius:6px; cursor:pointer; }
.grant-choice:hover { background:var(--surface-2); }
.grant-choice.is-selected { background:var(--brand-50); }
.grant-choice input { margin-top:3px; accent-color:var(--brand-600); flex:none; }
.grant-choice span { min-width:0; display:grid; gap:3px; }
.grant-choice strong { font-size:12px; font-weight:550; overflow-wrap:anywhere; }
.grant-choice small { color:var(--text-3); font-size:11px; overflow-wrap:anywhere; }
.grant-empty { padding:25px 10px; text-align:center; color:var(--text-3); font-size:12px; }
.grant-action-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-top:18px; padding:15px; border-radius:8px; background:var(--surface-2); font-size:12px; }
.grant-action-bar b { color:var(--brand-700); font-size:16px; }
.grant-action-bar span { margin:0 5px; color:var(--text-3); }
.grant-action-buttons { display:flex; flex-wrap:wrap; gap:8px; }
@media(max-width:1000px) { .grant-pickers { grid-template-columns:1fr; } .grant-picker-list { height:220px; } }

/* 班级教学配置 */
.teaching-workspace .card-head { padding-bottom:15px; }
.teaching-intro { margin-top:5px; font-size:12px; }
.teaching-note { padding:11px 14px; border:1px solid var(--line-soft); border-radius:8px; background:var(--surface-2); color:var(--text-2); font-size:12px; line-height:1.7; }
.teaching-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:16px; }
.teaching-section { min-width:0; padding:16px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2); }
.teaching-section-title { display:flex; align-items:flex-start; gap:9px; margin-bottom:16px; }
.teaching-section-title i { display:grid; place-items:center; flex:none; width:25px; height:25px; border-radius:7px; font-style:normal; font-weight:600; color:var(--brand-700); background:var(--brand-50); }
.teaching-section-title div { display:grid; gap:4px; }
.teaching-section-title b { font-size:13px; }
.teaching-section-title small { color:var(--text-3); font-size:11px; }
.teaching-select-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.teaching-select-grid .field { gap:6px; min-width:0; }
.teaching-rule-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr); gap:10px; }
.teaching-rule-grid .field { min-width:0; }
.teaching-save { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; margin-top:16px; font-size:12px; }
.teaching-list-card { margin-top:14px; }
.teaching-count { color:var(--text-3); font-size:12px; }
.teaching-empty { padding:35px 20px; text-align:center; color:var(--text-3); font-size:12px; }
@media(max-width:1100px) { .teaching-form { grid-template-columns:1fr; } }
@media(max-width:600px) { .teaching-select-grid,.teaching-rule-grid { grid-template-columns:1fr; } }
