/* ══════════════════════════════════════════════════════════
   云学谷智能数学管理后台（HQ）样式
   配色沿用 ai-core 主色，保证全平台一套视觉语言
   ══════════════════════════════════════════════════════════ */
:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #1c2533;
  --muted: #6b7686;
  --line: #e3e9f2;
  --accent: #1f497d;
  --accent-2: #2f7cf6;
  --accent-soft: #eaf1fd;
  --ok: #1f9d55;
  --warn: #b7791f;
  --bad: #c0392b;
  --shadow: 0 6px 24px rgba(31, 73, 125, .08);
  --shadow-lg: 0 18px 48px rgba(20, 40, 70, .18);
  --radius: 14px;
  --rail-w: 236px;
  --rail-w-min: 68px;
  --top-h: 58px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12.5px; }
b, strong { font-weight: 600; }

/* ───────────── 通用控件 ───────────── */
.btn {
  appearance: none; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 10px; padding: 8px 14px;
  font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #c9d6e8; background: #f8fbff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent; color: #fff; font-weight: 500;
}
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; display: block; }
.btn.danger { color: var(--bad); border-color: #f0d4d0; }
.btn.danger:hover { background: #fdf3f1; border-color: #e7b9b2; }

.icon-btn {
  appearance: none; border: 0; background: transparent; color: inherit;
  width: 34px; height: 34px; border-radius: 9px; font-size: 16px;
  cursor: pointer; display: grid; place-items: center; line-height: 1;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn.dark:hover { background: var(--accent-soft); }

.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-size: 13px; color: #8a95a8; margin-bottom: 7px; }
input[type="text"], input:not([type]), input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%; border: 1px solid #dfe6f0; border-radius: 10px;
  padding: 12px 14px; font-size: 14.5px; font-family: inherit;
  color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft);
}

.msg { margin-top: 12px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.7;
  padding: 10px 12px; border-radius: 10px; background: #f5f8fd; color: var(--muted); }
.msg.good { background: #eefaf2; color: #14663a; }
.msg.bad { background: #fdf1ef; color: #97352a; }

/* ═══════════════════════════════════════════════════════════════
   登录页：飞入数学宇宙
   深空星野 + 由远及近穿行的公式/符号/图形 + 磨砂玻璃登录卡
   ═══════════════════════════════════════════════════════════════ */
.login-wrap {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; display: grid; place-items: center; padding: 26px;
  background:
    radial-gradient(1180px 660px at 50% 2%, #102650 0%, rgba(16,38,80,0) 64%),
    radial-gradient(860px 580px at 6% 98%, #0b1b40 0%, rgba(11,27,64,0) 62%),
    radial-gradient(760px 540px at 98% 86%, #1a1245 0%, rgba(26,18,69,0) 64%),
    linear-gradient(180deg, #03060e 0%, #050b1a 46%, #02040b 100%);
}

/* 星空画布（星点由 JS 绘制，带视差与闪烁） */
#cosmos { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }

/* 缓慢旋转的极光光带 */
.rays {
  position: absolute; inset: -30%; z-index: 1; pointer-events: none; opacity: .55;
  background: conic-gradient(from 0deg at 50% 50%,
    rgba(77, 124, 254, 0) 0deg, rgba(77, 124, 254, .14) 44deg, rgba(34, 211, 238, .10) 98deg,
    rgba(139, 92, 246, 0) 152deg, rgba(139, 92, 246, .13) 220deg, rgba(77, 124, 254, 0) 302deg);
  animation: raysSpin 58s linear infinite;
  -webkit-mask-image: radial-gradient(58% 58% at 50% 50%, transparent 32%, #000 100%);
  mask-image: radial-gradient(58% 58% at 50% 50%, transparent 32%, #000 100%);
}
@keyframes raysSpin { to { transform: rotate(360deg); } }

/* ── 3D 空间：公式由远及近穿过 ── */
.space {
  position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none;
  perspective: 900px; perspective-origin: 50% 46%;
}
.fly {
  position: absolute; left: 50%; top: 50%;
  color: #fff; white-space: nowrap; line-height: 1;
  font-size: var(--fs, 22px);
  opacity: 0;
  transform: translate3d(-50%, -50%, -3200px);
  animation: flyby var(--dur, 18s) linear var(--delay, 0s) infinite;
  will-change: transform, opacity;
  backface-visibility: hidden;
  text-shadow: 0 0 16px rgba(160, 200, 255, .55), 0 0 46px rgba(90, 140, 255, .32);
}
@keyframes flyby {
  0%   { transform: translate3d(calc(-50% + var(--x)), calc(-50% + var(--y)), -3200px) rotate(var(--rot, 0deg)); opacity: 0; }
  10%  { opacity: var(--op, .5); }
  80%  { opacity: var(--op, .5); }
  100% { transform: translate3d(calc(-50% + var(--x)), calc(-50% + var(--y)), 240px) rotate(var(--rot, 0deg)); opacity: 0; }
}
/* 景深：远处雾化一批，强化「远近」层次 */
.fly.dfar { filter: blur(1.15px); }
/* 数学公式（原生 MathML，零依赖） */
.fly math { font-size: inherit; }
/* 大号数学符号 */
.fly .sym { font-family: "Times New Roman", Georgia, serif; font-weight: 400; }
/* 数字序列 */
.fly.num { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .14em; }
/* 几何图形（内联 SVG 线稿） */
.fly.fig svg { display: block; overflow: visible; }
.fly.fig svg :is(path, circle, line, polyline, polygon, ellipse, rect) {
  fill: none; stroke: #fff; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 会「变」的公式：同一位置轮换，淡入淡出 */
.f-cycle { display: grid; place-items: center; }
.f-cycle > * { grid-area: 1 / 1; opacity: 0; transform: scale(.93); transition: opacity 1s ease, transform 1s ease; }
.f-cycle > .on { opacity: 1; transform: none; }

/* 暗角：压住四周、把注意力聚到中央 */
.vig {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(118% 104% at 50% 48%, rgba(0, 0, 0, 0) 38%, rgba(1, 4, 11, .58) 100%);
}

/* ── 舞台：光晕 + 磨砂玻璃卡 ── */
.login-stage { position: relative; z-index: 10; width: 100%; max-width: 410px; }
.glow {
  position: absolute; inset: -36px; border-radius: 44px; pointer-events: none;
  background: radial-gradient(closest-side at 50% 50%,
    rgba(77, 124, 254, .55), rgba(139, 92, 246, .30) 58%, rgba(34, 211, 238, 0) 100%);
  filter: blur(30px);
  animation: glowPulse 7.5s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: .60; transform: scale(.965); }
  50%      { opacity: .92; transform: scale(1.035); }
}
.login-card {
  position: relative; width: 100%; color: #fff;
  background: linear-gradient(158deg,
    rgba(255, 255, 255, .145) 0%, rgba(255, 255, 255, .055) 52%, rgba(255, 255, 255, .10) 100%);
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: 24px; padding: 36px 34px 26px;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, .66),
    0 0 0 1px rgba(255, 255, 255, .05) inset,
    inset 0 1px 0 rgba(255, 255, 255, .30);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  animation: cardIn .9s cubic-bezier(.2, .85, .25, 1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to   { opacity: 1; transform: none; }
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-brand h1 { margin: 0; font-size: 19px; letter-spacing: .4px; text-shadow: 0 2px 20px rgba(90, 140, 255, .55); }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
#login .brand-logo {
  box-shadow: none;                        /* 去掉原来的方形描边线框 */
  filter: drop-shadow(0 0 20px rgba(150, 190, 255, .55))
          drop-shadow(0 0 46px rgba(90, 140, 255, .3));
}

/* ── 登录页表单：深色玻璃态（覆盖全局白底控件样式） ── */
#login .fld { margin-bottom: 15px; }
#login .fld > span { color: rgba(255, 255, 255, .58); font-size: 12px; letter-spacing: .5px; margin-bottom: 7px; }
#login input[type="text"], #login input[type="password"] {
  background: rgba(255, 255, 255, .065);
  border: 1px solid rgba(255, 255, 255, .17);
  color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14px; letter-spacing: .4px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
#login input::placeholder { color: rgba(255, 255, 255, .32); }
#login input:hover { border-color: rgba(255, 255, 255, .28); }
#login input:focus {
  border-color: rgba(122, 162, 255, .9);
  background: rgba(255, 255, 255, .11);
  box-shadow: 0 0 0 4px rgba(77, 124, 254, .20), 0 0 26px rgba(77, 124, 254, .30);
}
#login input:-webkit-autofill, #login input:-webkit-autofill:hover, #login input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  box-shadow: 0 0 0 1000px rgba(20, 32, 64, .96) inset;
  transition: background-color 9999s ease-out;
}

#login .btn.primary {
  position: relative; overflow: hidden;
  margin-top: 6px; padding: 12px 16px; border-radius: 12px;
  font-size: 14.5px; font-weight: 600; letter-spacing: 3px; color: #fff;
  background: linear-gradient(120deg, #4d7cfe 0%, #7b5cf6 58%, #22d3ee 140%);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 12px 34px rgba(77, 124, 254, .45), inset 0 1px 0 rgba(255, 255, 255, .34);
}
#login .btn.primary::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  transform: skewX(-18deg); animation: sweep 4.8s ease-in-out infinite;
}
@keyframes sweep { 0%, 64% { left: -60%; } 90%, 100% { left: 132%; } }
#login .btn.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 40px rgba(77, 124, 254, .58), inset 0 1px 0 rgba(255, 255, 255, .4);
}
#login .btn.primary:disabled { filter: saturate(.4) brightness(.9); }

#login .msg { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .76); border: 1px solid rgba(255, 255, 255, .12); }
#login .msg.good { background: rgba(34, 197, 94, .14); color: #8ff0b6; border-color: rgba(34, 197, 94, .30); }
#login .msg.bad { background: rgba(248, 113, 113, .14); color: #ffb4ac; border-color: rgba(248, 113, 113, .32); }
#login .login-foot { color: rgba(255, 255, 255, .36); }

@media (max-height: 640px) {
  .login-card { padding: 26px 26px 18px; }
  .login-brand { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .fly, .rays, .glow, #login .btn.primary::after, .login-card { animation: none !important; }
  .fly { opacity: .38; transform: translate3d(calc(-50% + var(--x)), calc(-50% + var(--y)), 0); }
}

/* ── 品牌 LOGO：白色版原图（透明底，圆角方块 + 抠空图形），按高度等比缩放 ── */
.brand-logo {
  height: 48px; width: auto; flex: none; display: block;
  filter: drop-shadow(0 6px 18px rgba(47, 124, 246, .35));
}
.brand-logo.sm { height: 34px; width: auto; filter: none; }

/* 旧的字形占位标（保留兼容，界面已改用真实 LOGO） */
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; display: grid; place-items: center;
  font-size: 23px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 6px 16px rgba(47, 124, 246, .3);
}
.brand-mark.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; box-shadow: none; }
.login-foot { margin-top: 20px; font-size: 11.5px; color: #9aa5b4; text-align: center; line-height: 1.7; }

/* ───────────── 顶栏 ───────────── */
.app { height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--top-h); flex: none;
  display: flex; align-items: center; gap: 16px; padding: 0 16px 0 10px;
  background: linear-gradient(115deg, #1b3f6d 0%, #23579b 48%, #2f7cf6 100%);
  color: #fff; position: relative; z-index: 40;
  box-shadow: 0 3px 16px rgba(31, 73, 125, .28);
}
.topbar .icon-btn { color: #fff; }
.tb-left { display: flex; align-items: center; gap: 10px; flex: none; }
.tb-brand { line-height: 1.25; }
.tb-brand b { display: block; font-size: 15px; letter-spacing: .6px; }
.tb-brand span { font-size: 11px; opacity: .8; }

.tb-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tb-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 4px 12px; font-size: 12px;
  white-space: nowrap; max-width: 100%;
}
.tb-chip .chip-k { opacity: .72; }
.tb-chip .chip-v { font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #f6d365; flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .14); }
.dot.ok { background: #7ef0a8; }
.dot.bad { background: #ff9a9a; }

.tb-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }

/* 用户区 */
.user {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1);
  transition: background .15s; outline: none;
}
.user:hover, .user:focus-visible { background: rgba(255, 255, 255, .2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
  background: linear-gradient(135deg, #ffffff 0%, #d9e8ff 100%);
  color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}
.avatar.lg { width: 42px; height: 42px; font-size: 17px; }
.user-txt { line-height: 1.25; }
.user-txt b { display: block; font-size: 13px; }
.user-txt span { font-size: 11px; opacity: .82; }
.caret { font-size: 10px; opacity: .8; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 232px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px;
  z-index: 60; animation: pop .14s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.um-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 10px; }
.um-head b { display: block; font-size: 13.5px; }
.um-head span { font-size: 11.5px; color: var(--muted); }
.um-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.um-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--ink);
  padding: 9px 10px; border-radius: 9px; font-size: 13px;
  font-family: inherit; cursor: pointer; text-align: left;
}
.um-item i { font-style: normal; font-size: 13px; color: var(--muted); width: 16px; text-align: center; }
.um-item:hover { background: var(--accent-soft); }
.um-item.danger { color: var(--bad); }
.um-item.danger i { color: var(--bad); }
.um-item.danger:hover { background: #fdf1ef; }

/* ───────────── 布局 ───────────── */
.body { flex: 1; display: flex; min-height: 0; }

.rail {
  width: var(--rail-w); flex: none; background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  transition: width .2s ease;
}
.rail.collapsed { width: var(--rail-w-min); }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }
.rail-foot { flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.rail-ver { font-size: 11px; color: #a4aebb; }
.rail.collapsed .rail-ver { display: none; }

/* 一级菜单 */
.nav-group { margin-bottom: 3px; }
.nav-l1 {
  width: 100%; display: flex; align-items: center; gap: 11px;
  border: 0; background: transparent; color: var(--ink);
  padding: 10px 11px; border-radius: 10px; font-size: 13.5px;
  font-family: inherit; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-l1:hover { background: var(--accent-soft); }
.nav-l1 .ic {
  font-style: normal; width: 20px; text-align: center; flex: none;
  font-size: 14px; color: var(--accent-2); opacity: .9;
}
.nav-l1 .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-l1 .chev {
  width: 0; height: 0; flex: none; margin: 0 4px 0 2px;
  border-left: 5px solid #8a93a3;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .2s ease, border-left-color .15s;
}
.nav-l1:hover .chev { border-left-color: var(--accent); }
.nav-group.open > .nav-l1 .chev {
  transform: rotate(90deg);
  border-left-color: var(--accent);
}
.nav-group.open > .nav-l1 { color: var(--accent); font-weight: 600; }
.nav-group.has-active > .nav-l1 { color: var(--accent); font-weight: 600; }
.nav-group.has-active > .nav-l1 .ic { opacity: 1; }

/* 二级菜单 */
.nav-sub { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.nav-group.open > .nav-sub { max-height: 800px; }
.nav-l2 {
  width: 100%; display: block;
  border: 0; background: transparent; color: #4d5867;
  padding: 7px 11px 7px 42px; border-radius: 9px; font-size: 13px;
  font-family: inherit; cursor: pointer; text-align: left;
  position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .15s, color .15s;
}
.nav-l2::before {
  content: ''; position: absolute; left: 24px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: #cfd8e5;
}
.nav-l2:hover { background: #f4f8ff; color: var(--accent); }
.nav-l2.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-l2.on::before { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(47, 124, 246, .18); }
.nav-l2 .soon {
  font-size: 10px; color: #97a3b3; background: #f1f4f9;
  border-radius: 5px; padding: 1px 5px; margin-left: 6px;
}

/* 一级即页面（无二级）：点标题直达，当前项高亮 */
.nav-l1.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-l1.on .ic { opacity: 1; }
.nav-l1 .soon {
  font-size: 10px; color: #97a3b3; background: #f1f4f9;
  border-radius: 5px; padding: 1px 5px; flex: none;
}

/* 收起态 */
.rail.collapsed .nav-l1 { justify-content: center; padding: 11px 0; }
.rail.collapsed .nav-l1 .lbl,
.rail.collapsed .nav-l1 .chev,
.rail.collapsed .nav-l1 .soon,
.rail.collapsed .nav-sub { display: none; }

/* 教材章节页（rd.book）：左章节树 × 右详情绑定 */
.bk-layout { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.bk-treecard { max-height: 70vh; overflow: auto; }
.bk-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.bk-row:hover { background: #f4f8ff; }
.bk-row.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.bk-row .tg { width: 16px; text-align: center; color: #6b7688; flex: none; cursor: pointer; font-size: 13px; }
.bk-row .tg.leaf { color: #c4cdd9; cursor: default; }
.bk-row .bk-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-row .bk-cnt { font-size: 11.5px; color: #8a95a6; background: #f1f4f9; border-radius: 9px; padding: 1px 7px; flex: none; }
.bk-row.on .bk-cnt { background: rgba(47, 124, 246, .16); color: var(--accent); }
.bk-kids { margin-left: 18px; border-left: 1px dashed #dde5f0; padding-left: 4px; }
.bk-crumb { font-size: 13px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid #edf1f7; margin-bottom: 10px; }
.bk-sums { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.bk-sec { margin-top: 14px; }
.bk-sec-t { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.bk-vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; margin-bottom: 10px; }
.bk-vids .ck.dis { opacity: .55; }
.bk-oldwarn { background: #fff7e8; border: 1px solid #f2ddb0; color: #9a6b12; border-radius: 9px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.bk-pts td { font-size: 13px; }

/* 内容区 */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px 34px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.crumbs i { font-style: normal; margin: 0 6px; color: #c2cbd8; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.page-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────────── 卡片 / 表格 ───────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px;
}
.card > h3 { margin: 0 0 12px; font-size: 14px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.card > h3 .tag { font-size: 11px; font-weight: 400; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 17px;
}
.stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: .5px; margin-top: 5px; line-height: 1.15; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }
.stat .s { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.stat.accent { background: linear-gradient(130deg, #1f497d 0%, #2f7cf6 100%); border-color: transparent; color: #fff; }
.stat.accent .k, .stat.accent .s { color: rgba(255, 255, 255, .82); }
.stat.accent .v { color: #fff; }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--muted);
  background: #f7fafe; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl .num { font-variant-numeric: tabular-nums; }
table.tbl .actions { white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: #f0f3f8; color: #5a6675; border: 1px solid transparent;
}
.badge.ok { background: #eafaf0; color: #14713d; }
.badge.warn { background: #fdf7e8; color: #96650f; }
.badge.bad { background: #fdf1ef; color: #97352a; }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.gray { background: #f2f4f7; color: #78838f; }

.bar { height: 7px; border-radius: 999px; background: #eef2f8; overflow: hidden; min-width: 62px; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.empty { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 10px; }
.empty .big { font-size: 26px; opacity: .5; display: block; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.note {
  font-size: 12.5px; color: #55627a; background: #f5f8fd;
  border-left: 3px solid var(--accent-2); border-radius: 8px; padding: 10px 13px; line-height: 1.75;
}

/* 规划中占位 */
.soon-wrap { max-width: 760px; }
.soon-plan { list-style: none; margin: 10px 0 0; padding: 0; }
.soon-plan li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.soon-plan li:last-child { border-bottom: 0; }
.soon-plan .n { color: var(--accent-2); font-weight: 600; width: 20px; flex: none; }

/* 「关于」类说明列表：与 .soon-plan 同款观感，
   但独立类名 —— 巡检脚本靠 .soon-plan 判断「规划中」，别混用 */
.about-list { list-style: none; margin: 10px 0 0; padding: 0; }
.about-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.about-list li:last-child { border-bottom: 0; }
.about-list .n { color: var(--accent-2); font-weight: 600; width: 20px; flex: none; }

/* 菜单管理：二级菜单胶囊 */
.menu-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: #f4f7fc; border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 9px; margin: 2px 5px 2px 0;
  font-size: 12.5px; color: #4d5867; white-space: nowrap;
}
.menu-chip i { font-style: normal; font-size: 10.5px; color: #97a3b3; }
.menu-chip.on { background: var(--accent-soft); border-color: #cfe0ff; color: var(--accent); }
.menu-chip.on i { color: var(--accent-2); }

/* ───────────── 供应商选择卡片 ───────────── */
.cfg-item {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 13px; margin-bottom: 9px; cursor: pointer;
  background: #fff; transition: border-color .15s, background .15s, box-shadow .15s;
}
.cfg-item:hover { border-color: #c9d6e8; background: #fafcff; }
.cfg-item.on { border-color: var(--accent-2); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(47, 124, 246, .1); }
.cfg-item .radio {
  width: 16px; height: 16px; border-radius: 50%; flex: none; margin-top: 3px;
  border: 2px solid #c6d2e2; background: #fff; position: relative; transition: border-color .15s;
}
.cfg-item.on .radio { border-color: var(--accent-2); }
.cfg-item.on .radio::after {
  content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent-2);
}
.cfg-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; background: #f1f4f9; color: #3b4a5f;
  padding: 1px 6px; border-radius: 6px;
}

/* ───────────── 学生详情抽屉 ───────────── */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(18, 30, 48, .42);
  z-index: 80; display: flex; justify-content: flex-end;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  width: min(660px, 94vw); height: 100%; background: var(--bg);
  box-shadow: -14px 0 40px rgba(15, 30, 55, .2);
  display: flex; flex-direction: column;
  animation: slideIn .22s ease-out;
}
@keyframes slideIn { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { margin: 0; font-size: 15px; }
.drawer-head .icon-btn { color: var(--muted); }
.drawer-head .icon-btn:hover { background: #f1f5fa; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 30px; }

/* ───────────── 弹层 / 提示 ───────────── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 30, 48, .42);
  z-index: 90; display: grid; place-items: center; padding: 20px;
  animation: fade .16s ease-out;
}
.modal {
  width: 100%; max-width: 460px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop .18s ease-out;
}
.modal-wide .modal { max-width: min(1100px, calc(100vw - 60px)); width: 100%; }
.modal-wide .modal-body { max-height: 72vh; }
/* 全屏弹窗（新闻编辑等大表单场景） */
.modal-full .modal { max-width: none; width: calc(100vw - 24px); height: calc(100vh - 24px); display: flex; flex-direction: column; }
.modal-full .modal-body { flex: 1; max-height: none; overflow-y: auto; }
/* 新闻文章详情：阅读/编辑模式（contenteditable 富文本区） */
.cnw-doc { flex: 1; width: 100%; min-height: 240px; overflow-y: auto; padding: 14px 18px; border: 1px solid #d8e2f2; border-radius: 8px; font-size: 14px; line-height: 1.85; color: #1f2a3a; background: #fff; box-sizing: border-box; outline: none; overflow-wrap: break-word; }
.cnw-doc:focus { border-color: #9db8dd; box-shadow: 0 0 0 2px rgba(80, 130, 200, .10); }
.cnw-doc:empty::before { content: '暂无正文，可直接输入…'; color: #9aa6b8; }
.cnw-doc img { max-width: 100%; height: auto; border-radius: 6px; }
.cnw-doc p { margin: .5em 0; }
.cnw-doc h1, .cnw-doc h2, .cnw-doc h3 { margin: .8em 0 .4em; line-height: 1.4; }
.cnw-doc section { display: block; }
.cnw-doc table { border-collapse: collapse; }
.cnw-doc td, .cnw-doc th { border: 1px solid #d8e2f2; padding: 4px 8px; }
.cnw-doc a { color: #2f6fd8; pointer-events: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-head .icon-btn { color: var(--muted); }
.modal-head .icon-btn:hover { background: #f1f5fa; }
.modal-body { padding: 18px; font-size: 13.5px; line-height: 1.8; max-height: 62vh; overflow-y: auto; }
.modal-foot { padding: 0 18px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot:empty { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1d2a3d; color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 10px; z-index: 120;
  box-shadow: 0 12px 30px rgba(10, 20, 40, .3);
  animation: pop .16s ease-out;
}
.toast.good { background: #14663a; }
.toast.bad { background: #97352a; }

.spin { display: inline-block; animation: rot 1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ───────────── 响应式 ───────────── */
@media (max-width: 1180px) {
  .grid.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rail { position: fixed; left: 0; top: var(--top-h); bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
  .rail.collapsed { width: 0; border: 0; }
  .main { padding: 14px 14px 28px; }
  .grid.c3, .grid.c4, .grid.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid.c2, .grid.c3, .grid.c4, .grid.c5 { grid-template-columns: 1fr; }
  .user-txt { display: none; }
}

/* ════════ 题库管理（切片 1b） ════════ */
.tabs { display: flex; gap: 6px; margin: 14px 0 16px; border-bottom: 1px solid #e3eaf5; }
.tabs button {
  padding: 9px 16px; border: 0; background: transparent; cursor: pointer;
  font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab { padding: 9px 16px; cursor: pointer; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.bank-filter { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 13px; }
.bank-filter select { padding: 6px 8px; border: 1px solid #d8e2f2; border-radius: 8px; font-size: 13px; background: #fff; }
.bank-filter label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.q-card { margin-bottom: 12px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-meta .sid { color: var(--muted); font-size: 12px; }
.q-stem { font-size: 14px; line-height: 1.75; margin-bottom: 10px; }
.q-stem .katex { font-size: 1.06em; }

.draft-card { border: 1px solid #e3eaf5; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fbfdff; }
.d-head { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.draft-card textarea {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d8e2f2;
  border-radius: 8px; font-size: 13.5px; font-family: inherit; resize: vertical;
}
.d-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 8px; }
.d-opts .opt { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.d-opts .opt input { flex: 1; padding: 5px 8px; border: 1px solid #d8e2f2; border-radius: 7px; font-size: 13px; }
.d-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.d-row label { display: inline-flex; align-items: center; gap: 5px; }
.d-row input, .d-row select { padding: 5px 8px; border: 1px solid #d8e2f2; border-radius: 7px; font-size: 13px; width: 130px; }
.draft-card .acts { margin-top: 10px; display: flex; gap: 8px; }
/* 答案解析条：独立一行，默认收起、点开展开全部解题步骤（2026-11-02） */
.d-ana-bar { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px dashed #c9d6ec; border-radius: 8px; background: #f6f9ff; cursor: pointer; user-select: none; }
.d-ana-bar b { font-size: 13px; color: #2b3a5e; flex: 0 0 auto; }
.d-ana-bar .d-ana-sum { flex: 1; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-ana-bar .d-ana-caret { font-style: normal; font-size: 12px; color: #3b6fe0; flex: 0 0 auto; }
.d-ana-body { margin-top: 8px; }
.d-ana-body .d-preview { margin-top: 6px; }

.pp-pool {
  margin-top: 10px; max-height: 300px; overflow: auto; border: 1px solid #e3eaf5;
  border-radius: 10px; padding: 8px;
}
.pp-item { display: flex; gap: 8px; align-items: center; padding: 6px 8px; font-size: 13px; border-radius: 8px; }
.pp-item:hover { background: #f4f8ff; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stem-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 筛选条：标签与控件一行显示，不竖排折行 */
.bank-filter label { white-space: nowrap; }
.bank-filter { column-gap: 28px; }
.bank-filter select { min-width: 110px; }
.bank-filter label { flex-shrink: 0; }

/* ═══ 官网式条件条（菁优检索台 v2） ═══ */
.cond-box { padding: 6px 18px; }
.cond { display: flex; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed #eef2f9; font-size: 13px; gap: 10px; }
.cond:last-child { border-bottom: 0; }
.cond > b { flex: 0 0 44px; color: var(--muted); font-weight: 500; padding-top: 5px; }
.cond .chips { display: flex; flex-wrap: wrap; gap: 4px 2px; }
.chip { padding: 4px 11px; border-radius: 14px; cursor: pointer; color: var(--ink); background: transparent; border: 0; font-size: 13px; line-height: 1.5; }
.chip:hover { background: #eef4ff; }
.chip.on { background: var(--accent); color: #fff; }
.cond .grow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.cond .mini { padding: 5px 9px; border: 1px solid #d8e2f2; border-radius: 7px; font-size: 12.5px; background: #fff; min-width: 96px; width: auto; flex: 0 0 auto; }
.cond .ck { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; padding-top: 4px; }
.cond .dim { color: var(--muted); padding-top: 5px; font-size: 12.5px; }

/* ═══ 检索台左右双卡片联动 ═══ */
.bank-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.point-panel { padding: 12px; position: sticky; top: 66px; max-height: calc(100vh - 88px); display: flex; flex-direction: column; }
.point-panel .mini { width: 100%; box-sizing: border-box; }
.ptree { overflow: auto; flex: 1; margin-top: 10px; font-size: 13px; min-height: 200px; }
.pt-row { display: flex; align-items: flex-start; gap: 6px; padding: 5px 7px; border-radius: 8px; cursor: pointer; line-height: 1.5; }
.pt-row:hover { background: #f0f5ff; }
.pt-row.on { background: var(--accent); color: #fff; }
.pt-row.on .tg, .pt-row.on .pt-path { color: rgba(255,255,255,.75); }
.pt-row .tg { flex: 0 0 14px; text-align: center; color: var(--muted); user-select: none; }
.pt-row .tg.leaf { color: #c3cfe3; }
.pt-kids { margin-left: 14px; border-left: 1px dashed #e3eaf5; padding-left: 3px; }
.pt-path { font-size: 11.5px; color: var(--muted); }
.pt-hint { font-size: 12px; color: var(--muted); padding: 2px 6px 8px; }

/* ═══ 自建题公式/图片预览 ═══ */
.d-preview { margin-top: 10px; border: 1px dashed #d8e2f2; border-radius: 10px; padding: 10px 12px; background: #fff; }
.d-preview-tag { display: inline-block; font-size: 11.5px; color: var(--muted); background: #f4f8ff; border-radius: 8px; padding: 1px 8px; margin-bottom: 6px; }
.d-preview-body { font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.own-img { max-width: 260px; max-height: 180px; display: inline-block; vertical-align: middle; margin: 4px 6px 4px 0; border: 1px solid #e3eaf5; border-radius: 8px; background: #fff; }
/* WORD 表格（[表]...[/表] 块渲染） */
.own-tbl { border-collapse: collapse; margin: 8px auto; font-size: 13.5px; }
.own-tbl td { border: 1px solid #cbd7ea; padding: 5px 16px; text-align: center; min-width: 40px; color: var(--ink); }

/* 选项：输入框 + 下方实时公式渲染（input 里放不下 KaTeX） */
.opt-wrap { display: flex; flex-direction: column; gap: 3px; }
.opt-wrap .opt { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.opt-wrap .opt input { flex: 1; padding: 5px 8px; border: 1px solid #d8e2f2; border-radius: 7px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
.opt-render { font-size: 13.5px; line-height: 1.8; padding: 2px 6px 4px 20px; color: var(--ink); min-height: 18px; }
.opt-render .katex { font-size: 1.02em; }
.opt-render:empty { display: none; }

/* 列表/选题池里渲染公式后的收编 */
.stem-cell { max-height: 60px; overflow: hidden; }
.stem-cell .katex { font-size: 1em; }
.stem-cell img, .pp-stem img { max-height: 42px; max-width: 120px; vertical-align: middle; border-radius: 6px; border: 1px solid #e3eaf5; }
.pp-item .pp-stem { flex: 1; overflow: hidden; max-height: 44px; line-height: 1.6; }

/* ═══ 课程生产管理台 ═══ */
.prod-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.prod-tabs .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 16px; }
.prod-tabs .chip:hover { background: #eef4ff; }
.prod-tabs .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.prod-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.prod-step { border: 1px solid var(--line); background: var(--accent-soft); border-radius: 12px; padding: 9px 16px; cursor: pointer; font-family: inherit; text-align: left; display: flex; flex-direction: column; gap: 1px; transition: border-color .15s, background .15s; }
.prod-step:hover { border-color: var(--accent-2); background: #e0edff; }
.prod-step b { font-size: 13px; color: var(--accent); font-weight: 500; }
.prod-step span { font-size: 12px; color: var(--muted); }
.prod-arr { color: #b8c5d9; font-size: 15px; }
video.prod-vid { width: 100%; border-radius: 10px; background: #000; max-height: 68vh; display: block; }
#prodBody .card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ═══════ 数据页统一展示规范（2026-09-17）：统计条 → 筛选 → 表格 → 分页 ═══════ */
.statbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.statbar .scard { background: #fff; border: 1px solid #e3ebf6; border-radius: 10px; padding: 10px 14px; }
.statbar .scard .lab { color: var(--muted); font-size: 12px; }
.statbar .scard .val { font-size: 22px; font-weight: 500; margin-top: 2px; line-height: 1.2; }
.statbar .scard .val .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.statbar .scard .val.c-err { color: var(--err, #b91c1c); }
.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 10px; }
.dt-search { flex: 1 1 180px; min-width: 150px; max-width: 280px; padding: 6px 10px; border: 1px solid #d8e2f2; border-radius: 8px; font-size: 13px; background: #fff; font-family: inherit; }
.dt-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dt-wrap { background: #fff; border: 1px solid #e3ebf6; border-radius: 10px; overflow: hidden; }
.dt-wrap .tbl { border: 0; }
.dt-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 8px 12px; border-top: 1px solid #eef2f8; background: #fbfdff; font-size: 12.5px; color: var(--muted); }
.dt-foot .pager-btns { display: flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.dt-foot button { padding: 3px 12px; }
table.tbl th.sortable { cursor: pointer; user-select: none; }
table.tbl th.sortable:hover { color: var(--accent); }
.dt-loading { padding: 16px 14px; color: var(--muted); font-size: 13px; }

/* ── 筛选栏（数据页统一）── */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-bottom: 1px solid #eef2f8; background: #fbfdff; }
.filter-bar .input { min-width: 160px; }
.filter-bar .grow { flex: 1 1 auto; }
.filter-bar .spacer { flex: 1 1 auto; }
/* 单行紧凑筛选：所有查询条件在同一行 */
.filter-bar.single-row { flex-wrap: nowrap; overflow-x: auto; }
.filter-bar.single-row .fld { flex: 1 1 0; min-width: 110px; max-width: 220px; }
.filter-bar.single-row .btn { flex: none; white-space: nowrap; }

/* ── 状态开关 switch ── */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: #cfd8e6; border-radius: 999px; transition: .18s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(20,40,80,.25); transition: .18s; }
.switch input:checked + i { background: var(--accent, #2f6bff); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled + i { opacity: .55; }

/* ════════ 系统配置中心 ════════ */
.sys-config-tabs { display: flex; gap: 6px; margin: 0 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; width: fit-content; }
.sys-config-tabs button { appearance: none; border: 0; background: transparent; cursor: pointer; font-size: 13.5px; color: var(--muted); padding: 8px 18px; border-radius: 9px; transition: background .15s, color .15s; }
.sys-config-tabs button:hover { color: var(--ink); background: #f4f7fb; }
.sys-config-tabs button.on { background: var(--accent); color: #fff; font-weight: 500; }

.sys-config-body { max-width: 1100px; }
.sys-config-card { padding: 22px 24px; margin-bottom: 16px; }
.sys-config-card h3 { margin: 0 0 16px; font-size: 15px; color: var(--ink); font-weight: 600; }
.sys-config-foot { display: flex; justify-content: center; gap: 10px; margin-top: 8px; padding-bottom: 30px; }

.sys-form-grid { display: grid; gap: 0 18px; }
.sys-form-grid.c2 { grid-template-columns: 1fr 1fr; }

.logo-upload-row { display: flex; gap: 18px; margin-bottom: 18px; }
.logo-upload {
  width: 120px; height: 120px; border: 2px dashed #c9d6e8; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color .15s, background .15s; background: #fbfdff; position: relative; overflow: hidden;
}
.logo-upload:hover { border-color: var(--accent-2); background: #f4f9ff; }
.logo-upload img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.logo-upload .placeholder { font-size: 32px; color: #c9d6e8; line-height: 1; }
.logo-upload .label { position: absolute; bottom: 0; left: 0; right: 0; font-size: 11px; color: #5f6c80; text-align: center; padding: 6px 4px; background: rgba(255,255,255,.92); line-height: 1.35; white-space: pre-line; }

.radio-group { display: flex; gap: 16px; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.radio input { width: 16px; height: 16px; accent-color: var(--accent); }

.engine-opts { display: flex; gap: 12px; flex-wrap: wrap; }
.engine-card {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: #fbfdff; transition: border-color .15s, background .15s, color .15s;
}
.engine-card input { display: none; }
.engine-card span { font-size: 13.5px; }
.engine-card.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }

.check-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--ink); }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }

.test-sms-bar { display: flex; gap: 10px; margin-top: 18px; padding: 14px; background: #f8fbff; border: 1px dashed #d6e3f3; border-radius: 10px; }
.test-sms-bar input { flex: 1; }

.file-engine-tabs { display: flex; gap: 6px; margin: -8px 0 18px; border-bottom: 1px solid var(--line); }
.file-engine-tabs button { appearance: none; border: 0; background: transparent; cursor: pointer; font-size: 13.5px; color: var(--muted); padding: 8px 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.file-engine-tabs button:hover { color: var(--ink); }
.file-engine-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.llm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.llm-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: #fbfdff; }
.llm-card h4 { margin: 0 0 14px; font-size: 14.5px; color: var(--ink); font-weight: 600; }
.llm-card .fld { margin-bottom: 12px; }
.llm-card .fld:last-child { margin-bottom: 0; }

.extra-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.extra-toolbar input { flex: 1; max-width: 320px; }
#extraTbody input { border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 6px; }
#extraTbody input:focus { background: #fbfdff; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
#extraTbody tr.empty-row td { text-align: center; color: var(--muted); padding: 28px; }

/* ── 知识图谱管理 ── */
.page:has(.kg-page) { height: 100%; }
.kg-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.kg-header { flex: 0 0 auto; display: flex; flex-direction: column; gap: 10px; }
.kg-page .statbar { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .kg-page .statbar { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .kg-page .statbar { grid-template-columns: repeat(2, 1fr); } }
.kg-filter { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px 14px; }
.kg-filter select, .kg-filter input { box-sizing: border-box; height: 34px; padding: 6px 9px; border: 1px solid #d8e2f2; border-radius: 8px; font-size: 13px; background: #fff; font-family: inherit; }
.kg-filter select { width: auto; min-width: 130px; flex: 0 0 auto; }
.kg-filter input { flex: 1 1 240px; max-width: 360px; min-width: 180px; }
.kg-filter #kgCount { margin-left: auto; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.kg-layout { flex: 1 1 auto; min-height: 0; display: flex; gap: 16px; align-items: stretch; overflow: hidden; }
.kg-tree-panel { flex: 1 1 58%; min-width: 0; height: 100%; overflow: auto; }
.kg-graph-panel { flex: 1 1 42%; min-width: 0; height: 100%; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.kg-tree-tbl code { font-size: 11px; color: var(--accent); background: #f4f7fb; padding: 2px 5px; border-radius: 4px; }
.kg-tree-tbl tr { cursor: pointer; }
.kg-tree-tbl tr:hover td { background: #f8fafc; }
.kg-tree-tbl tr.selected td { background: #eef4ff; }
.kg-tree-tbl td:nth-child(5) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 图谱治理台（kgov）── */
.kgov-page { padding: 0 0 20px; }
.kgov-page .page-head { margin-bottom: 16px; }
.kgov-statbar { margin-bottom: 16px; }
.kgov-statbar > .statbar { grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kgov-statbar > .statbar .scard { min-width: 0; padding: 10px 12px; }
.kgov-statbar > .statbar .scard .lab { font-size: 11.5px; margin-bottom: 3px; }
.kgov-statbar > .statbar .scard .val { font-size: 21px; }
.kgov-statbar > .statbar .scard .val .sub { font-size: 12px; }

.kgov-tabs { display: flex; gap: 8px; margin-bottom: 12px; border-bottom: 1px solid #e3ebf6; padding-bottom: 10px; }
.kgov-tab { background: #fff; border: 1px solid #d0d7e3; border-radius: 6px; padding: 7px 18px; font-size: 13.5px; cursor: pointer; color: #334155; transition: all .15s; }
.kgov-tab:hover { border-color: #94a3b8; }
.kgov-tab.active { background: #0f172a; color: #fff; border-color: #0f172a; }

.kgov-subtabs { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.kgov-subtabs .mini-btn { background: #fff; border: 1px solid #d0d7e3; border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: #334155; transition: all .15s; }
.kgov-subtabs .mini-btn:hover { border-color: #94a3b8; }
.kgov-subtabs .mini-btn.on { background: #0f172a; color: #fff; border-color: #0f172a; }
.kgov-subtabs .mini-input { border: 1px solid #d0d7e3; border-radius: 6px; padding: 5px 10px; font-size: 13px; min-width: 160px; height: 30px; box-sizing: border-box; font-family: inherit; }
.kgov-subtabs .spacer { flex: 1 1 auto; }

.kgov-pager { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; padding: 10px 12px; border-top: 1px solid #eef2f8; background: #fbfdff; font-size: 13px; color: var(--muted); }
.kgov-pager .pg-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; background: #fff; border: 1px solid #d0d7e3; border-radius: 6px; color: #334155; cursor: pointer; font-size: 13px; transition: all .12s; }
.kgov-pager .pg-btn:hover:not(:disabled):not(.active) { border-color: #94a3b8; background: #f8fafc; }
.kgov-pager .pg-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.kgov-pager .pg-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.kgov-pager .pg-ellipsis { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; color: #94a3b8; }
.kgov-pager .pg-jump { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kgov-pager .pg-jump input { flex: none; width: 42px; height: 28px; border: 1px solid #d0d7e3; border-radius: 4px; text-align: center; font-size: 13px; font-family: inherit; }
.kgov-pager .pg-size { flex: none; width: auto; height: 28px; border: 1px solid #d0d7e3; border-radius: 4px; font-size: 13px; padding: 0 6px; background: #fff; font-family: inherit; }
@media (max-width: 900px) {
  .kgov-pager { flex-wrap: wrap; justify-content: center; }
  .kgov-pager .pg-jump { margin-left: auto; }
}

/* 图谱概览 */
.kg-overview { height: 100%; display: flex; flex-direction: column; }
.kg-overview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kg-overview-head b { font-size: 15px; }
.kg-stage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 1 1 auto; min-height: 0; }
.kg-stage-card { border: 1px solid #e3ebf6; border-radius: 12px; padding: 14px; background: #fbfdff; cursor: pointer; transition: box-shadow .15s, border-color .15s; display: flex; flex-direction: column; }
.kg-stage-card:hover { border-color: var(--accent-2); box-shadow: 0 4px 12px rgba(47,108,255,.08); }
.kg-stage-title { margin-bottom: 8px; }
.kg-stage-num { font-size: 28px; font-weight: 600; color: #1d2b45; margin-bottom: 10px; }
.kg-stage-num span { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.kg-stage-roots { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; align-content: flex-start; }
.kg-root-tag { display: inline-block; background: #f4f7fb; color: var(--accent); border: 1px solid #e3ebf6; border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.kg-root-tag:hover { background: var(--accent-soft); color: var(--accent); }
.kg-overview-hint { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef2f8; font-size: 12px; color: var(--muted); }
.kg-overview-hint .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.kg-overview-hint .dot.center { background: #2f7cf6; }
.kg-overview-hint .dot.prereq { background: #e11d48; }
.kg-overview-hint .dot.post { background: #10b981; }
@media (max-width: 1100px) { .kg-stage-grid { grid-template-columns: 1fr; } }
.kg-graph-head { margin-bottom: 12px; }
.kg-graph-head b { font-size: 15px; margin-right: 10px; }
.kg-graph-svg { width: 100%; height: 260px; border: 1px dashed var(--line); border-radius: 10px; background: #fbfdff; }
.kg-edge { stroke-width: 1.5; fill: none; marker-end: url(#kg-arrow); }
.kg-edge.prereq { stroke: #dc2626; stroke-dasharray: 4 3; }
.kg-edge.post { stroke: #1d9d55; }
.kg-node { cursor: pointer; }
.kg-node circle { stroke: #fff; stroke-width: 2; }
.kg-node.center circle { fill: #2f6bff; }
.kg-node.prereq circle { fill: #dc2626; }
.kg-node.post circle { fill: #1d9d55; }
.kg-node text { font-size: 11px; fill: var(--ink); pointer-events: none; }
.kg-node:hover circle { stroke: var(--ink); }
.kg-graph-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.kg-graph-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.kg-graph-legend .dot.center { background: #2f6bff; }
.kg-graph-legend .dot.prereq { background: #dc2626; }
.kg-graph-legend .dot.post { background: #1d9d55; }
.kg-detail { margin-top: 16px; }
.kg-detail h5 { font-size: 13px; margin: 14px 0 8px; color: var(--ink); }
.kg-detail p { margin: 6px 0; }
.kg-detail-section ul { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.7; }
.kg-detail-section li { cursor: pointer; }
.kg-detail-section li:hover { color: var(--accent); }

/* ───────────── 知识图谱交互网络画布 ───────────── */
.kg-network-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 12px; border: 1px dashed var(--line); background: #fbfdff; }
.kg-network-toolbar {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 8px 10px; background: rgba(255,255,255,.92); border: 1px solid #e3ebf6;
  border-radius: 10px; backdrop-filter: blur(4px); box-shadow: 0 2px 8px rgba(29,43,69,.05);
}
.kg-nt-group { display: flex; align-items: center; gap: 6px; }
.kg-nt-group label { font-size: 12px; color: var(--muted); }
.kg-nt-btn {
  border: 1px solid #d8e2f2; background: #fff; border-radius: 6px; padding: 4px 10px;
  font-size: 12px; color: var(--ink); cursor: pointer; transition: all .12s;
}
.kg-nt-btn:hover { border-color: var(--accent-2); color: var(--accent); }
.kg-nt-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.kg-nt-select {
  border: 1px solid #d8e2f2; background: #fff; border-radius: 6px; padding: 4px 8px;
  font-size: 12px; color: var(--ink); font-family: inherit;
}
.kg-network-svg { width: 100%; height: 100%; display: block; cursor: grab; }
.kg-network-svg:active { cursor: grabbing; }
.kg-network-g { transform-origin: 0 0; }
.kg-network-edge { stroke-width: 1.5; fill: none; }
.kg-network-edge.prereq { stroke: #dc2626; stroke-dasharray: 4 3; marker-end: url(#kg-arr-prereq); }
.kg-network-edge.post { stroke: #1d9d55; marker-end: url(#kg-arr-post); }
.kg-network-edge.tree-parent { stroke: #94a3b8; stroke-dasharray: 2 2; opacity: .7; marker-end: url(#kg-arr-tree); }
.kg-network-node { cursor: pointer; }
.kg-network-node circle { stroke: #fff; stroke-width: 2.5; transition: all .12s; }
.kg-network-node.center circle { fill: #2f6bff; }
.kg-network-node.prereq circle { fill: #dc2626; }
.kg-network-node.post circle { fill: #1d9d55; }
.kg-network-node:hover circle { stroke: var(--ink); filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.kg-network-node text { font-size: 11.5px; fill: var(--ink); pointer-events: none; font-weight: 500; }
.kg-network-node.center text { font-size: 13px; font-weight: 600; }
.kg-network-drawer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
  max-height: 42%; background: rgba(255,255,255,.96); border-top: 1px solid #e3ebf6;
  border-radius: 12px 12px 0 0; padding: 12px 14px; overflow: auto;
  backdrop-filter: blur(4px); box-shadow: 0 -2px 12px rgba(29,43,69,.06);
}
.kg-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kg-drawer-head b { font-size: 14px; }
.kg-drawer-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kg-drawer-col h5 { font-size: 12px; margin: 0 0 6px; color: var(--ink); }
.kg-drawer-col p { margin: 0 0 10px; font-size: 12px; line-height: 1.6; }
.kg-drawer-col ul { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.7; }
.kg-drawer-col li { cursor: pointer; }
.kg-drawer-col li:hover { color: var(--accent); }
@media (max-width: 1100px) { .kg-drawer-body { grid-template-columns: 1fr; } }

.kg-import ol { line-height: 1.8; padding-left: 20px; }

/* ── 授权树（角色→菜单）── */
.menu-tree { display: grid; gap: 4px; max-height: 56vh; overflow: auto; padding: 4px 2px; }
.menu-tree .mt-dir { font-weight: 600; color: #1d2b45; margin-top: 8px; display: flex; align-items: center; gap: 8px; }

/* ── 代理管理 ── */
.agency-layout { display: flex; height: calc(100vh - 56px); background: #f5f8fc; }
.agency-tree-panel { width: 260px; flex: none; background: #fff; border-right: 1px solid #e3ebf6; display: flex; flex-direction: column; }
.agency-tree-panel .filter-bar { padding: 10px 12px; }
.agency-tree { flex: 1; overflow: auto; padding: 8px 10px 14px; font-size: 13px; }
.agency-tree-list { list-style: none; margin: 0; }
.agency-tree-list .agency-tree-list { border-left: 1px dashed #dce5f2; margin-left: 5px; padding-left: 12px; }
.agency-node { margin: 2px 0; }
.agency-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; cursor: pointer;
  transition: background .12s, color .12s; color: #2a3950;
}
.agency-row:hover { background: #f0f5fb; }
.agency-row.active { background: var(--accent-soft, #e8f0ff); color: var(--accent, #2f6bff); }
.agency-chev {
  width: 20px; height: 20px; flex: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px;
}
.agency-chev:hover { background: #e3ebf6; }
.agency-chev::after {
  content: '';
  width: 0; height: 0;
  border-left: 5px solid #9aa8bc;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform .15s, border-left-color .12s;
}
.agency-chev.open::after { transform: rotate(90deg); border-left-color: var(--accent, #2f6bff); }
.agency-chev.blank { visibility: hidden; cursor: default; }
.agency-chev.blank:hover { background: transparent; }
.agency-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agency-tag { flex: none; font-size: 10.5px; padding: 1px 5px; border-radius: 4px; font-weight: 600; }
.agency-tag.has { background: #e6f4ea; color: #1a7f37; }
.agency-tag.none { background: #ffebee; color: #c62828; }
.agency-actions { flex: none; display: none; gap: 4px; margin-left: 4px; }
.agency-row:hover .agency-actions { display: flex; }
.agency-actions i {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 12px; border-radius: 4px;
  cursor: pointer; color: #5f6c80;
}
.agency-actions i:hover { background: #e3ebf6; color: var(--accent, #2f6bff); }
.agency-actions .agency-del:hover { background: #ffebee; color: #c62828; }
.agency-main { flex: 1; overflow: auto; padding: 18px 22px; }
.agency-detail { max-width: 900px; }
.agency-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.agency-head h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 18px; }
.agency-head .actions { display: flex; gap: 10px; }
.agency-stat { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.agency-stat .stat { background: #fff; border: 1px solid #e3ebf6; border-radius: 10px; padding: 14px 12px; }
.agency-stat .stat .k { font-size: 12px; color: #5f6c80; margin-bottom: 8px; }
.agency-stat .stat .fld { font-size: 20px; font-weight: 700; padding: 6px 8px; text-align: center; }
.agency-form { padding: 18px 20px; }
.agency-form h3 { margin: 0 0 16px; font-size: 15px; color: #1d2b45; }
.agency-form .grid.c2 { gap: 14px 18px; }
.agency-line { display: flex; align-items: center; margin: 18px 0 8px; padding-top: 14px; border-top: 1px dashed #e3ebf6; }
.fld-box { display: flex; flex-direction: column; gap: 7px; }
.fld-box > span { font-size: 13px; color: #8a95a8; font-weight: 400; }
.fld-box .fld { width: 100%; }
.fld-box textarea.fld { resize: vertical; min-height: 60px; }
.menu-tree .mt-dir:first-child { margin-top: 0; }
.menu-tree .mt-leaf { display: flex; align-items: center; gap: 8px; padding: 4px 0 4px 22px; color: #44506a; }
.menu-tree .mt-leaf label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-weight: 400; }
.menu-tree .mt-all { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e3ebf6; margin-bottom: 4px; font-weight: 600; color: var(--accent, #2f6bff); }
.menu-tree input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent, #2f6bff); }
.menu-tree .mt-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── 角色 / 账号卡片里的多选标签 ── */
.chk-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chk-list label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #d8e2f2; border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; }
.chk-list label:hover { border-color: var(--accent, #2f6bff); }
.chk-list input { accent-color: var(--accent, #2f6bff); }

/* ── 单选数据权限 ── */
.scope-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border: 1px solid #e3ebf6; border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.scope-opt:hover { border-color: var(--accent, #2f6bff); background: #f7faff; }
.scope-opt.sel { border-color: var(--accent, #2f6bff); background: #eef4ff; }
.scope-opt input { margin-top: 3px; accent-color: var(--accent, #2f6bff); }
.scope-opt .t { font-weight: 600; color: #1d2b45; }
.scope-opt .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

@media (max-width: 1100px) { .statbar { grid-template-columns: repeat(2, 1fr); } }

/* ══════════════════════════════════════════════════════════════
   门店分布地图（腾讯地图 GL JS）
   ══════════════════════════════════════════════════════════════ */
.main.storemap-main { padding: 0; overflow: hidden; }
.storemap-main .page { height: 100%; }
.storemap-page { display: flex; flex-direction: column; height: 100%; background: #0b1120; color: #e2e8f0; }

/* 顶部筛选条 */
.storemap-topbar {
  display: grid; grid-template-columns: auto auto auto auto auto 1fr auto; align-items: center;
  padding: 10px 16px; background: #151e2e; border-bottom: 1px solid #27344d;
  flex: none; gap: 10px; white-space: nowrap;
}
.storemap-topbar .title { font-weight: 600; color: #e2e8f0; margin-right: 6px; font-size: 14px; white-space: nowrap; }
.storemap-topbar select.fld,
.storemap-topbar input.fld {
  min-width: 130px; background: #0b1120; color: #e2e8f0; border-color: #475569; flex: none;
}
.storemap-topbar .btn { flex: none; color: #e2e8f0; }
.storemap-topbar .spacer { display: none; }
.storemap-topbar .right-links { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12px; color: #64748b; flex-wrap: nowrap; white-space: nowrap; }
.storemap-topbar .right-links a { color: #64748b; text-decoration: none; }
.storemap-topbar .right-links a:hover { color: #94a3b8; }

/* 主体：地图铺满，左右面板浮在上方 */
.storemap-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }

/* 中间地图铺满 */
.storemap-map-wrap { position: absolute; inset: 0; z-index: 1; background: #e8f4fc; }

/* 左侧统计面板 — 浮在地图左上角 */
.storemap-left {
  position: absolute; left: 16px; top: 16px; z-index: 10;
  width: 120px; padding: 10px; background: rgba(11,17,32,0.88);
  backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  display: flex; flex-direction: column; gap: 0; overflow: visible;
}
.storemap-stat {
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0; padding: 12px 6px; text-align: center; cursor: pointer;
  transition: background .15s;
}
.storemap-stat:last-child { border-bottom: none; }
.storemap-stat:hover { background: rgba(255,255,255,0.04); }
.storemap-stat.on { background: rgba(59,130,246,0.15); }
.storemap-stat .num { font-size: 24px; font-weight: 700; line-height: 1; }
.storemap-stat .lbl { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.storemap-stat.all .num { color: #38bdf8; }
.storemap-stat.standard .num { color: #34d399; }
.storemap-stat.flagship .num { color: #a78bfa; }
.storemap-stat.trial .num { color: #fbbf24; }
.storemap-stat.expired .num { color: #f87171; }
.storemap-map-wrap .tmap-container { width: 100%; height: 100%; }
.storemap-map-wrap .map-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #64748b; font-size: 14px; z-index: 5;
}

/* 自定义数字气泡 */
.map-bubble-wrap {
  position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center;
  cursor: pointer; user-select: none;
}
.map-bubble {
  display: flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 7px;
  background: #0ea5e9; color: #fff; border-radius: 50% 50% 50% 0;
  font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  border: 2px solid #fff; white-space: nowrap; transform: rotate(-45deg);
}
.map-bubble span { transform: rotate(45deg); }
.map-bubble.active { background: #f59e0b; }
.map-bubble-label {
  margin-top: 4px; font-size: 12px; color: #0f172a; font-weight: 600;
  text-shadow: 0 1px 2px rgba(255,255,255,.8); white-space: nowrap;
}

/* 右侧选址检测面板 — 浮在地图右上角 */
.storemap-right {
  position: absolute; right: 16px; top: 16px; z-index: 10;
  width: 340px; padding: 0; background: transparent; border: none;
  overflow: visible;
}
.storemap-check {
  background: rgba(11,17,32,0.88); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  padding: 18px; box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.storemap-check h4 { margin: 0 0 16px; font-size: 15px; color: #e2e8f0; font-weight: 600; }
.storemap-check .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.storemap-check .row.paste { grid-template-columns: 1fr auto; }
.storemap-check .row.paste input.fld { min-width: 0; }
.storemap-check input.fld { width: 100%; min-width: 0; box-sizing: border-box; background: #0b1120; color: #e2e8f0; border-color: #475569; }
.storemap-check .btn { width: 100%; margin-bottom: 0; }
.storemap-check .btn.secondary { background: #1e293b; border-color: #475569; color: #e2e8f0; }
.storemap-check .hint { font-size: 12px; color: #94a3b8; line-height: 1.7; margin-top: 10px; }
.storemap-check .result { margin-top: 12px; padding: 12px; border-radius: 8px; font-size: 13px; }
.storemap-check .result.ok { background: rgba(6,78,59,.45); color: #34d399; }
.storemap-check .result.warn { background: rgba(69,26,3,.45); color: #fbbf24; }
.storemap-check .result.err { background: rgba(69,10,10,.45); color: #f87171; }
.storemap-check .pick-mode { color: #38bdf8; font-size: 12px; margin-bottom: 10px; }

/* 腾讯地图版权信息（若 SDK 未自带则兜底） */
.tmap-copyright {
  position: absolute; left: 8px; bottom: 4px; font-size: 11px; color: #64748b;
  z-index: 10; pointer-events: none;
}

/* 地图组件加载/初始化失败时的明确提示（不降级为伪造 SVG） */
.map-error {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 28px;
  text-align: center; background: linear-gradient(180deg, #eaf4fd, #dbeafe);
  color: #1f3a5f; z-index: 6;
}
.map-error-icon { font-size: 40px; }
.map-error-title { font-size: 17px; font-weight: 700; color: #1f497d; }
.map-error-msg { font-size: 13.5px; color: #b42318; max-width: 520px; line-height: 1.7; word-break: break-word; }
.map-error-tip {
  font-size: 12px; color: #475569; max-width: 560px; line-height: 1.8;
  background: rgba(255,255,255,.7); border: 1px solid #cdd9ea; border-radius: 10px; padding: 12px 14px;
}
.map-error-tip code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; color: #1f497d; font-size: 11.5px; }

/* 地图筛选后下方明细（若开启） */
.storemap-bottom {
  position: absolute; left: 16px; bottom: 16px; right: 332px;
  background: rgba(21,30,46,.92); border: 1px solid #27344d; border-radius: 10px;
  padding: 12px; max-height: 220px; overflow-y: auto; backdrop-filter: blur(6px);
}
.storemap-bottom h5 { margin: 0 0 8px; font-size: 13px; color: #e2e8f0; }
.storemap-bottom .tbl { font-size: 12px; background: transparent; color: #e2e8f0; }
.storemap-bottom .tbl th { background: rgba(255,255,255,.08); color: #94a3b8; border-bottom-color: #334155; }
.storemap-bottom .tbl td { border-bottom-color: #334155; }
.storemap-bottom .tbl tbody tr:hover { background: rgba(255,255,255,.06); }
.storemap-bottom .tbl th,
.storemap-bottom .tbl td { padding: 6px 8px; }

@media (max-width: 1300px) {
  .storemap-topbar .right-links { display: none; }
}
@media (max-width: 1100px) {
  .storemap-left { width: 110px; }
  .storemap-right { width: 300px; }
  .storemap-bottom { right: 332px; }
}

/* ══════════════════ 日志管理 ══════════════════ */
.bank-filter input[type="date"] {
  padding: 5px 8px;
  border: 1px solid #d8e2f2;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  font-family: inherit;
}
.log-row-check, #logCheckAll { cursor: pointer; }
#logCheckAll { vertical-align: middle; }

/* ── 机构编辑弹窗：区块小标签 + 选点状态 ── */
.oe-label { font-size: 13px; color: #8a95a8; font-weight: 400; margin-bottom: 6px; }
#oe_guard.conflict { color: #b45309; font-weight: 500; }
#oe_guard.okk { color: #16803c; }
/* 开关+文字组合：label 自适应宽度，文字不被 40px 开关遮挡 */
.switch.has-txt { position: relative; width: auto; height: auto; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch.has-txt i { position: relative; inset: auto; width: 40px; height: 22px; flex: 0 0 auto; }
.switch.has-txt span { font-size: 13px; color: var(--ink, #1f2d3d); white-space: nowrap; }
.agency-line .switch span { white-space: nowrap; }

/* ── 机构管理 · 状态直切开关（2026-11-01 马总：徽标换成可直接切换的开关，绿色，文字在下）── */
.sw-cell { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.sw-cell .switch { width: 40px; height: 22px; }
.sw-cell .switch input:checked + i { background: #34a853; }
.sw-cell > span:last-child { font-size: 12px; color: #8a93a6; }
.sw-cell.on > span:last-child { color: #34a853; }
.sw-cell:hover .switch i { box-shadow: 0 0 0 3px rgba(52, 168, 83, 0.12); }

/* ── 店铺类型徽章（标准店/旗舰店）── */
.ot-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.ot-badge.standard { background: #e8f1ff; color: #2f6fe4; }
.ot-badge.flagship { background: linear-gradient(135deg, #ffe9b3, #f5c542); color: #6b4b00; box-shadow: 0 1px 4px rgba(214, 158, 46, 0.35); }
.ot-badge.flagship .star { font-size: 11px; }
.ot-badge.flagship.off { background: #eceff4; color: #8a93a6; box-shadow: none; }
.ot-badge.flagship.off .star { opacity: 0.5; }
.ot-sub { font-size: 11.5px; color: #8a93a6; margin-top: 3px; }
.ot-sub.warn { color: #b45309; font-weight: 500; }

/* 两行截断（反馈列表内容摘要） */
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 意见反馈对话气泡（弹窗内） */
#fbHqChat .fb-msg { animation: fbIn .18s ease; }
@keyframes fbIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 菁优题预览弹窗 ── */
.jy-pts { margin: 10px 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jy-pts b { font-size: 12.5px; color: var(--muted); }
.jy-stem { padding: 12px 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; line-height: 1.9; font-size: 14px; }
.jy-stem table { border-collapse: collapse; }
.jy-stem img { max-width: 100%; vertical-align: middle; }
.jy-opts { margin: 6px 0 10px; display: grid; gap: 6px; }
.jy-opt { display: flex; gap: 8px; align-items: baseline; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; line-height: 1.8; }
.jy-opt b { color: var(--muted); flex: 0 0 auto; }
.jy-sec { margin: 10px 0; }
.jy-sec > b { display: inline-block; font-size: 12.5px; color: #fff; background: #3b82f6; border-radius: 4px; padding: 2px 8px; margin-bottom: 6px; }
.jy-sec.jy-ans > b { background: #16a34a; }
.jy-sec-bd { line-height: 1.9; font-size: 14px; }
.jy-sec-bd table { border-collapse: collapse; }
.jy-sec-bd img { max-width: 100%; vertical-align: middle; }

/* ═══ 知识图谱星座画布（P0 · 2026-10-28） ═══════════════════════ */
.kgc [hidden] { display: none !important; }
.kgc { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.kgc-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; flex-wrap: nowrap; }
.kgc-seg { display: inline-flex; background: #eef3fa; border-radius: 9px; padding: 2px; flex: 0 0 auto; }
.kgc-seg button { border: 0; background: transparent; font-family: inherit; font-size: 12.5px; color: #5a6a80; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.kgc-seg button.on { background: #fff; color: #185fa5; font-weight: 600; box-shadow: 0 1px 3px rgba(24,59,104,.12); }
.kgc-chips { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.kgc-chips button { border: 1px solid #dbe4f0; background: #fff; color: #5a6a80; font-family: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.kgc-chips button.on { border-color: #185fa5; color: #185fa5; background: #eaf2ff; font-weight: 600; }
.kgc-spacer { flex: 1 1 auto; }
.kgc-btn { border: 1px solid #dbe4f0; background: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: #4d5867; font-size: 14px; line-height: 1; flex: 0 0 auto; }
.kgc-btn:hover { border-color: #185fa5; color: #185fa5; }
.kgc-stage { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 12px; overflow: hidden; background: #fbfdff; border: 1px solid #e4ecf7; }
.kgc-stage canvas { display: block; cursor: grab; }
.kgc-tip { position: absolute; pointer-events: none; background: rgba(255,255,255,.98); border: 1px solid #dbe4f0; border-radius: 10px; box-shadow: 0 6px 20px rgba(24,59,104,.14); padding: 8px 11px; font-size: 12.5px; color: #1b2b45; max-width: 230px; z-index: 5; }
.kgc-tip b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.kgc-tip-meta { display: flex; align-items: center; gap: 5px; color: #6b7a90; font-size: 11.5px; margin-top: 2px; }
.kgc-tip-meta i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.kgc-crumb { position: absolute; left: 12px; top: 10px; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.94); border: 1px solid #dbe4f0; border-radius: 9px; padding: 5px 10px; font-size: 12px; color: #5a6a80; z-index: 4; max-width: calc(100% - 24px); overflow: hidden; white-space: nowrap; }
.kgc-crumb button { border: 1px solid #dbe4f0; background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; color: #185fa5; cursor: pointer; font-family: inherit; }
.kgc-crumb span { cursor: pointer; }
.kgc-crumb span:hover { color: #185fa5; }
.kgc-crumb i { color: #b6c2d2; font-style: normal; }
.kgc-crumb b { color: #1b2b45; }
.kgc-legend { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.9); border: 1px solid #e4ecf7; border-radius: 9px; padding: 5px 9px; font-size: 11px; color: #6b7a90; z-index: 3; max-width: calc(100% - 24px); }
.kgc-legend span { display: inline-flex; align-items: center; gap: 4px; }
.kgc-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kgc-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8b98a9; font-size: 13px; background: #fbfdff; }
.kgc-btn-wide { width: auto; padding: 0 9px; font-size: 12px; }
.kgc-btn-wide.on { border-color: #185fa5; color: #185fa5; background: #eaf2ff; font-weight: 600; }
.kgc-legend em { font-style: normal; color: #97a4b6; }
.kgc-hint { font-size: 12px; color: #8b98a9; margin-left: 8px; white-space: nowrap; }
.kgc [hidden] { display: none !important; }
.kgc-seg button:disabled { opacity: .38; cursor: default; }

/* ───────────── 操作列「更多」下拉（学生管理 → 更多 → 密码重置） ───────────── */
.more-btn {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px;
  padding: 3px 10px; font-family: inherit; font-size: 12px; line-height: 1.5;
  color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; vertical-align: middle; transition: background .15s, border-color .15s;
}
.more-btn:hover { background: #dbe9fd; border-color: #c3d9fa; }
.more-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.more-btn i { font-style: normal; font-size: 10px; opacity: .75; }
.more-pop {
  position: fixed; z-index: 100; min-width: 136px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 2px;
  animation: mpIn .12s ease-out;
}
@keyframes mpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.more-pop .mp-item {
  display: block; padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--ink); white-space: nowrap;
  cursor: pointer; user-select: none;
}
.more-pop .mp-item:hover { background: var(--accent-soft); color: var(--accent); }
.more-pop .mp-item.danger { color: var(--bad); }
.more-pop .mp-item.danger:hover { background: #fdf1ef; }
