/* ==========================================================================
   成长影像管理后台 · 设计令牌与组件（对齐 docs/02 与 docs/06）
   ========================================================================== */
:root {
  --primary: #E8762C;
  --primary-deep: #C85E1B;
  --primary-soft: #FDF0E4;
  --mint: #2F9E7E;
  --mint-soft: #E8F6F1;
  --blue: #2F6FD0;
  --blue-soft: #EAF1FC;
  --red: #D93A3A;
  --red-soft: #FDECEC;
  --amber: #B7791F;
  --amber-soft: #FBF1DE;
  --ink: #2B2622;
  --ink-2: #6B615A;
  --ink-3: #9A8F87;
  --line: #EFE4D9;
  --bg: #FBF6F0;
  --surface: #fff;
  --shadow: 0 8px 24px rgba(43, 38, 34, .06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
}
[hidden] { display: none !important; }
a { color: var(--primary-deep); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: flex; }
.login-brand {
  flex: 1; background: linear-gradient(155deg, #F2904A, #C85E1B); color: #fff;
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.lb-logo {
  width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px;
}
.login-brand h1 { font-size: 34px; line-height: 1.35; margin: 0; letter-spacing: .5px; }
.login-brand p { font-size: 13px; opacity: .9; line-height: 1.9; max-width: 420px; margin: 18px 0 0; }
.lb-foot { font-size: 11px; opacity: .72; line-height: 1.8; }
.login-form-wrap { width: 500px; flex: 0 0 500px; display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; margin: 0 0 6px; }
.login-form .muted { margin: 0 0 24px; color: var(--ink-3); font-size: 12px; }
.login-form label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }
.login-form input {
  width: 100%; height: 46px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; font-size: 14px; background: #FFFDFB; color: var(--ink);
}
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,118,44,.12); }
.login-mode { margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.switch-line { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.form-error { background: var(--red-soft); color: #A32B2B; border: 1px solid #F3C9C9; padding: 9px 12px; border-radius: 9px; font-size: 12px; margin-bottom: 12px; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; background: #FFFCF8; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 16px; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg,#F79A4B,#E8762C); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.brand b { display: block; font-size: 13.5px; line-height: 1.3; }
.brand span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.side-title { font-size: 10px; color: var(--ink-3); letter-spacing: 1.4px; padding: 14px 8px 6px; }
.nav { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.nav:hover { background: #F7EFE6; color: var(--ink); }
.nav.on { background: var(--primary-soft); color: var(--primary-deep); font-weight: 600; }
.nav .ico { width: 18px; text-align: center; }
.nav .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px; border-radius: 9px; background: #F8F2EA; font-size: 10.5px; color: var(--ink-2); line-height: 1.6; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: rgba(255,252,248,.94); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px);
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); }
.crumb b { color: var(--ink); }
.crumb a { color: var(--primary-deep); cursor: pointer; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.select { height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 8px; font-size: 12.5px; color: var(--ink-2); }
.user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg,#F7C59F,#EE9B62); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: 0 0 auto; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: 16px; }
.view { padding: 22px 24px 60px; max-width: 1480px; width: 100%; }

/* ---------- 通用组件 ---------- */
.page-h { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 { font-size: 21px; margin: 0; }
.page-h p { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); }
.spacer { flex: 1; }
.btn { height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { background: #E9E1D9; color: #A79C93; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--red); border-color: #F3C9C9; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; }
.card { background: #fff; border: 1px solid #F3EAE1; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px 18px; }
.sec-h { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.sec-h h3 { margin: 0; font-size: 13.5px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 15px 16px; }
.kpi .lb { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.kpi .num { font-size: 27px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.kpi .num.red { color: var(--red); }
.kpi .num.mint { color: var(--mint); }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 2px 7px; border-radius: 5px; background: #F4EEE7; color: var(--ink-2); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.mint { background: var(--mint-soft); color: var(--mint); }
.badge.amber { background: var(--amber-soft); color: var(--amber); border: 1px dashed #E6C68E; }
.badge.gray { background: #F1ECE7; color: var(--ink-2); }
.badge.solid { background: var(--red); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; color: var(--ink-3); font-weight: 500; text-align: left; padding: 9px 10px; background: #FBF6F0; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #F6EFE7; font-size: 12.5px; vertical-align: middle; }
tbody tr:hover { background: #FFFCF8; }
tr.overdue { background: var(--red-soft); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.num-cell { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); font-size: 11.5px; }
.link { color: var(--primary-deep); cursor: pointer; font-size: 12px; }
.link.danger { color: var(--red); }
.empty { padding: 64px 20px; text-align: center; color: var(--ink-3); }
.empty .ico { width: 64px; height: 64px; border-radius: 18px; background: #F8F1E9; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #C9BCB0; }
.skeleton { background: linear-gradient(90deg,#F2EAE1 25%,#F8F2EB 37%,#F2EAE1 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 筛选 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.fi { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; padding: 0 10px; color: var(--ink-2); }
.fi:focus { outline: none; border-color: var(--primary); }
.fi.on { border-color: var(--primary); color: var(--primary-deep); background: var(--primary-soft); }
.fi.wide { min-width: 180px; }
.chip-btn { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.chip-btn.on { background: var(--primary-soft); border-color: #F0C9A8; color: var(--primary-deep); font-weight: 600; }

/* ---------- 看板 ---------- */
.campus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.campus-card { padding: 16px; cursor: pointer; transition: .15s; }
.campus-card:hover { border-color: #F0C9A8; transform: translateY(-1px); }
.campus-card h3 { margin: 0 0 3px; font-size: 15px; }
.cc-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; color: var(--ink-2); }
.cc-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: #F3EAE1; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--mint); }
.bar.warn i { background: var(--amber); }
.bar.bad i { background: var(--red); }
.two { display: grid; grid-template-columns: 1.55fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ---------- 图表 ---------- */
.chart-box { padding: 14px 16px 8px; }
.chart-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.chart svg { width: 100%; height: 170px; display: block; }
.chart text { font-size: 9px; fill: var(--ink-3); }

/* ---------- 媒体网格 ---------- */
.media-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; }
.mtile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #EDE4DA; cursor: pointer; }
.mtile .ph { position: absolute; inset: 0; }
.ph { background: linear-gradient(145deg,#F9C58E,#EFA05E); }
.ph.p2 { background: linear-gradient(145deg,#B9DCC9,#7FBF9F); }
.ph.p3 { background: linear-gradient(145deg,#C9D9F0,#8FB0DA); }
.ph.p4 { background: linear-gradient(145deg,#F2C9C9,#DE9494); }
.ph.p5 { background: linear-gradient(145deg,#E7D6B8,#CDB48A); }
.ph.p6 { background: linear-gradient(145deg,#D9CDEB,#AE9BD8); }
.mtile .flag { position: absolute; top: 5px; right: 5px; background: rgba(47,111,208,.92); color: #fff; font-size: 9px; padding: 1px 4px; border-radius: 4px; }
.mtile .pick { position: absolute; top: 5px; left: 5px; width: 17px; height: 17px; border-radius: 5px; background: rgba(255,255,255,.86); border: 1px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; }
.mtile.sel { outline: 2.5px solid var(--primary); outline-offset: -2.5px; }
.mtile.sel .pick { background: var(--primary); border-color: var(--primary); }
.mtile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 5px 4px; color: #fff; font-size: 9px; background: linear-gradient(transparent, rgba(0,0,0,.55)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batchbar { position: sticky; bottom: 12px; background: #2B2622; color: #fff; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; margin-top: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.batchbar .btn { height: 32px; font-size: 12px; }

/* ---------- 树 ---------- */
.tree { font-size: 12.5px; }
.tree .grp { padding: 7px 8px; border-radius: 7px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.tree .grp:hover { background: #FBF6F0; }
.tree .grp.on { background: var(--primary-soft); color: var(--primary-deep); font-weight: 600; }
.tree .child { margin-left: 20px; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tree .child:hover { background: #FBF6F0; }
.tree .child.on { background: #F7EFE6; color: var(--ink); font-weight: 600; }

/* ---------- 组织树（三级：集团/园区/班级） ---------- */
.tree-search { position: relative; margin-bottom: 8px; }
.tree-search input {
  width: 100%; height: 34px; padding: 0 32px 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 12.5px; color: var(--ink);
}
.tree-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tree-search input::-webkit-search-cancel-button { display: none; }
.tree-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--ink-3); cursor: pointer;
  font-size: 17px; line-height: 1; padding: 4px 6px;
}
.tree-search-clear:hover { color: var(--ink); }

.tree { font-size: 12.5px; max-height: 58vh; overflow: auto; overscroll-behavior: contain; }
.tree-row {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px;
  border-radius: 7px; cursor: pointer; user-select: none;
}
.tree-row:hover { background: #FBF6F0; }
.tree-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tree-row.root { cursor: default; color: var(--ink-2); font-weight: 600; }
.tree-row.root:hover { background: transparent; }
.tree-row.lv2 { margin-left: 10px; }
.tree-row.lv3 { margin-left: 32px; }
.tree-row.lv3.on {
  background: var(--primary-soft); color: var(--ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--primary);
}
.tree-row.active-campus { color: var(--ink); }
.tree-row.graduated { opacity: .62; }
.tree-row.disabled { opacity: .48; cursor: not-allowed; pointer-events: none; }
.tree-row.empty { cursor: default; color: var(--ink-3); font-size: 11.5px; }
.tree-row.empty:hover { background: transparent; }
.tree-arrow { flex: 0 0 12px; width: 12px; text-align: center; color: var(--ink-3); font-size: 10px; }
.tree-arrow.leaf { visibility: hidden; }
.tree-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-meta { flex: 0 0 auto; color: var(--ink-3); font-size: 11px; }
.tree-tag {
  flex: 0 0 auto; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--primary-soft); color: var(--primary-deep);
}
.tree mark { background: #FDE8C8; color: inherit; border-radius: 3px; padding: 0 1px; }
.tree-empty { padding: 18px 8px; text-align: center; color: var(--ink-3); font-size: 12px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field label { display: block; font-size: 11.5px; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; background: #FFFDFB; color: var(--ink);
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,118,44,.1); }
.field .hint { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.field.full { grid-column: 1 / -1; }
.switch { width: 38px; height: 22px; border-radius: 99px; background: #E3D8CC; position: relative; cursor: pointer; border: 0; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .16s; }
.switch.on { background: var(--primary); }
.switch.on::after { left: 18px; }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row .grow { flex: 1; }

/* ---------- 弹层 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(43,38,34,.46); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 540px; max-width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal.wide { width: 720px; }
.modal-h { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h h3 { margin: 0; font-size: 15px; }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--ink-3); font-size: 20px; background: none; border: 0; }
.modal-b { padding: 18px; }
.modal-f { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.alert { display: flex; gap: 8px; padding: 10px 12px; border-radius: 9px; font-size: 11.5px; line-height: 1.65; }
.alert.red { background: var(--red-soft); color: #A32B2B; border: 1px solid #F3C9C9; }
.alert.amber { background: var(--amber-soft); color: #8A6320; border: 1px solid #F3DFBE; }
.alert.blue { background: var(--blue-soft); color: #24589F; border: 1px solid #CFE0F8; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 10px); background: rgba(43,38,34,.9); color: #fff; font-size: 12.5px; padding: 10px 16px; border-radius: 9px; opacity: 0; transition: .2s; z-index: 120; pointer-events: none; max-width: 70vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 失败提示：红色 + 可换行，长文案（含请求号/原因）也要能读完整 */
.toast.err { background: #B3261E; max-width: 440px; line-height: 1.6; text-align: left; white-space: normal; box-shadow: 0 8px 24px rgba(179,38,30,.28); }
/* 数据区局部刷新：半透明遮罩 + 顶部提示，不铺整页骨架、不移动布局 */
.region-loading { position: relative; }
.region-loading::before { content: ''; position: absolute; inset: 0; background: rgba(252,248,244,.62); z-index: 6; border-radius: 12px; transition: opacity .12s; }
.region-loading::after { content: '加载中…'; position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 7;
  background: rgba(43,38,34,.88); color: #fff; font-size: 12px; padding: 6px 14px; border-radius: 999px; letter-spacing: .5px; }
.region-loading > * { pointer-events: none; }
.drawer-mask { position: fixed; inset: 0; background: rgba(43,38,34,.4); z-index: 95; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 94vw; background: #fff; z-index: 96; padding: 20px; overflow: auto; box-shadow: -20px 0 50px rgba(0,0,0,.15); }
.drawer h3 { margin: 0 0 12px; font-size: 16px; }
.kv { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F6EFE7; font-size: 12px; }
.kv b { width: 90px; color: var(--ink-3); font-weight: 400; flex: 0 0 auto; }
.kv span { flex: 1; word-break: break-all; }
pre.detail { background: #FAF6F1; border-radius: 8px; padding: 10px; font-size: 11px; overflow: auto; max-height: 280px; }

/* ---------- 响应式 ---------- */
.only-mobile { display: none; }
.mobile-nav { display: none; }
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .campus-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(4, 1fr); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .login-brand { display: none; }
  .login-form-wrap { width: 100%; flex: 1; }
  .side { display: none; }
  .only-mobile { display: inline-flex; align-items: center; justify-content: center; }
  .view { padding: 14px 12px 88px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
  .two, .three { grid-template-columns: 1fr; }
  .topbar { padding: 0 12px; }
  .crumb { display: none; }
  .user span { display: none; }
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
    border-top: 1px solid var(--line); padding: 6px 2px calc(8px + env(safe-area-inset-bottom)); z-index: 40; justify-content: space-around;
  }
  .mobile-nav button { border: 0; background: none; font-size: 9.5px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; }
  .mobile-nav button.on { color: var(--primary-deep); font-weight: 600; }
  .mobile-nav .ico { font-size: 17px; }
  .drawer { width: 100%; }
  .batchbar { flex-wrap: wrap; }
}
@media print { .side, .topbar, .batchbar, .filters { display: none; } .view { padding: 0; } }

/* ==========================================================================
   深色模式（html[data-theme=dark]，手动切换或跟随系统）
   仅覆盖颜色，不改布局；浅色不变。
   ========================================================================== */
html[data-theme="dark"] {
  --ink: #F2E9E0;
  --ink-2: #B9AB9E;
  --ink-3: #8A7D71;
  --line: #3A312A;
  --bg: #17130F;
  --surface: #221C17;
  --primary: #F2904A;
  --primary-deep: #F0A05E;
  --primary-soft: #33251A;
  --mint: #4FC3A1;
  --mint-soft: #1E3029;
  --blue: #7FA9EC;
  --blue-soft: #1D2735;
  --red: #FF7B7B;
  --red-soft: #3A2222;
  --amber: #E0B062;
  --amber-soft: #332919;
  --shadow: 0 8px 24px rgba(0, 0, 0, .38);
}
html[data-theme="dark"] body { background: #17130F; color: #F2E9E0; }
html[data-theme="dark"] .login-form-wrap { background: #17130F; }
html[data-theme="dark"] .login-form input { background: #1D1813; color: #F2E9E0; border-color: #3A312A; }
html[data-theme="dark"] .login-brand { background: linear-gradient(155deg, #B8581C, #6E3512); }

html[data-theme="dark"] .side { background: #1C1712; border-right-color: #2E2721; }
html[data-theme="dark"] .side .brand { border-bottom-color: #2E2721; }
html[data-theme="dark"] .nav:hover { background: #2A231D; }
html[data-theme="dark"] .nav.on { background: #33251A; color: #F0A05E; }
html[data-theme="dark"] .side-foot { background: #241E19; color: #B9AB9E; }
html[data-theme="dark"] .topbar { background: #1C1712; border-bottom-color: #2E2721; }

html[data-theme="dark"] .select,
html[data-theme="dark"] .fi,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .chip-btn,
html[data-theme="dark"] .btn.ghost { background: #241E19; color: #E8DCD0; border-color: #3A312A; }
html[data-theme="dark"] .btn.danger { background: #2A1B1B; color: #FF9B9B; border-color: #5A2F2F; }
html[data-theme="dark"] .card { background: #221C17; border-color: #2E2721; box-shadow: none; }
html[data-theme="dark"] .card-pad, html[data-theme="dark"] .sec-h { border-color: #2E2721; }
html[data-theme="dark"] th { background: #1D1813; color: #8A7D71; border-bottom-color: #2E2721; }
html[data-theme="dark"] td { border-bottom-color: #2A231D; }
html[data-theme="dark"] tbody tr:hover { background: #2A231D; }
html[data-theme="dark"] .badge { background: #2A231D; color: #C9BBAD; }
html[data-theme="dark"] .badge.gray { background: #2A231D; color: #B9AB9E; }
html[data-theme="dark"] .empty .ico { background: #2A231D; color: #7A6E63; }
html[data-theme="dark"] .bar { background: #2E2721; }
html[data-theme="dark"] .tree-row:hover { background: #2A231D; }
html[data-theme="dark"] .tree-row.lv3.on { background: #33251A; color: #F0A05E; box-shadow: inset 2px 0 0 #F2904A; }
html[data-theme="dark"] .tree-search input { background: #1D1813; color: #F2E9E0; border-color: #3A312A; }
html[data-theme="dark"] .tree mark { background: #5A4526; color: #F7E7CE; }
html[data-theme="dark"] .tree-tag { background: #33251A; color: #F0A05E; }
html[data-theme="dark"] .tree .grp:hover,
html[data-theme="dark"] .tree .child:hover { background: #2A231D; }
html[data-theme="dark"] .tree .child.on { background: #33251A; color: #F0A05E; }
html[data-theme="dark"] .modal { background: #221C17; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
html[data-theme="dark"] .modal-mask { background: rgba(0,0,0,.6); }
html[data-theme="dark"] .drawer { background: #1E1915; box-shadow: -20px 0 50px rgba(0,0,0,.5); }
html[data-theme="dark"] pre.detail { background: #1A1511; color: #D8CBBE; }
html[data-theme="dark"] .mtile, html[data-theme="dark"] .mtile .ph { background: #2A231D; }
html[data-theme="dark"] .mobile-nav { background: #1E1915; border-top-color: #2E2721; }
html[data-theme="dark"] .batch-bar { background: #1E1915; border-top-color: #2E2721; }
html[data-theme="dark"] .toast { background: #F2E9E0; color: #1C1712; }
html[data-theme="dark"] .toast.err { background: #7A1C16; color: #FFEDEB; }
html[data-theme="dark"] .region-loading::before { background: rgba(28,23,18,.62); }
html[data-theme="dark"] .region-loading::after { background: rgba(242,233,224,.92); color: #1C1712; }
html[data-theme="dark"] .kpi { background: #221C17; }
html[data-theme="dark"] .alert.blue { background: #1D2735; color: #A9C6F2; }
html[data-theme="dark"] .alert.amber { background: #332919; color: #E8C98C; }
html[data-theme="dark"] .alert.red { background: #3A2222; color: #FFA8A8; }

/* ==========================================================================
   v2.1 素材详情抽屉 / 改密弹窗 / 高危确认
   ========================================================================== */
.user { border: 0; background: none; padding: 2px 4px; cursor: pointer; color: inherit; font: inherit; border-radius: 8px; }
.user:hover { background: #FBF6F0; }
.user:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 素材瓦片：勾选改为独立按钮，点瓦片=看详情 */
.mtile .pick { padding: 0; cursor: pointer; line-height: 1; color: #fff; }
.mtile .pick.on { background: var(--primary); border-color: var(--primary); }
.mtile:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.mtile .tip { position: absolute; top: 5px; right: 5px; background: rgba(43,38,34,.62); color: #fff; font-size: 9px; padding: 2px 5px; border-radius: 4px; }
.mtile .flag + .tip { top: 24px; }
.media-more { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px 0 6px; }

/* 抽屉骨架 */
.media-drawer { width: 520px; padding: 0; display: flex; flex-direction: column; }
.media-drawer .drawer-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fff; flex: 0 0 auto; }
.media-drawer .drawer-h h3 { margin: 0; font-size: 15px; }
.media-drawer .drawer-h .x { margin-left: auto; border: 0; background: none; font-size: 20px; color: var(--ink-3); cursor: pointer; line-height: 1; }
.media-drawer .drawer-b { padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); overflow: auto; flex: 1; -webkit-overflow-scrolling: touch; }

/* 详情：预览台 */
.md-stage { position: relative; border-radius: 12px; overflow: hidden; background: #F4EEE7; min-height: 190px; display: flex; align-items: center; justify-content: center; }
.md-stage.loading { flex-direction: column; gap: 10px; font-size: 12px; }
.md-stage img, .md-stage video, .md-media { display: block; width: 100%; max-height: 58vh; object-fit: contain; background: #EFE7DE; }
.md-mockvideo { position: relative; width: 100%; }
.md-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 54px; height: 54px; border-radius: 50%; background: rgba(43,38,34,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.md-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(43,38,34,.62); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 5px; }
.md-stage.err { flex-direction: column; gap: 6px; padding: 30px 18px; text-align: center; }
.md-ico { width: 42px; height: 42px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.md-err-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.md-err-ops { display: flex; gap: 8px; margin-top: 10px; }
.md-meta { margin-top: 14px; }
.md-meta-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.md-meta-h h4 { margin: 0; font-size: 13.5px; flex: 1; line-height: 1.4; }
.md-actions { display: flex; gap: 8px; margin-top: 14px; }

/* 加载指示 */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--primary); animation: mspin .8s linear infinite; }
@keyframes mspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* 改密规则清单 */
.pwd-rules { list-style: none; margin: 12px 0; padding: 12px 14px; background: #FBF6F0; border-radius: 9px; font-size: 11.5px; color: var(--ink-3); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.pwd-rules li { display: flex; align-items: center; gap: 6px; }
.pwd-rules i { width: 14px; height: 14px; border-radius: 50%; background: #EFE5DB; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-style: normal; flex: 0 0 auto; }
.pwd-rules li.ok { color: #2F8F6E; }
.pwd-rules li.ok i { background: var(--mint); }
/* 删除前置拦截的原因清单：单列 + 正常字号（pwd-rules 的双列/11.5px 是给密码规则用的，放长句会挤） */
.block-list { list-style: none; margin: 0; padding: 12px 14px; background: var(--red-soft); border: 1px solid #F3C9C9; border-radius: 9px; font-size: 12.5px; line-height: 1.7; color: #7E2A2A; display: grid; gap: 8px; }
.block-list li { display: flex; gap: 6px; }
.block-list li::before { content: '·'; font-weight: 700; color: var(--red); }
/* 绑定微信弹窗的步骤说明 */
.bind-steps { margin: 12px 0 4px; padding-left: 20px; font-size: 12.5px; line-height: 1.9; color: var(--ink-2); }
.bind-steps li { list-style: decimal; }
.bind-steps b { color: var(--ink); }

/* 高危确认 */
.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-deep); display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: 0 0 auto; }
.confirm-ico.danger { background: var(--red-soft); color: var(--red); }
.confirm-text { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.confirm-hint { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

@media (max-width: 860px) {
  .pwd-rules { grid-template-columns: 1fr; }
  .media-drawer { width: 100%; }
}

/* 深色 */
html[data-theme="dark"] .user:hover { background: #2A231D; }
html[data-theme="dark"] .media-drawer .drawer-h { background: #1E1915; border-bottom-color: #2E2721; }
html[data-theme="dark"] .md-stage { background: #2A231D; }
html[data-theme="dark"] .md-stage img, html[data-theme="dark"] .md-stage video { background: #241E19; }
html[data-theme="dark"] .md-meta-h h4, html[data-theme="dark"] .confirm-text, html[data-theme="dark"] .md-err-t { color: #F2E9E0; }
html[data-theme="dark"] .pwd-rules { background: #241E19; }
html[data-theme="dark"] .block-list { background: #2E1D1B; border-color: #4A2A27; color: #F3BEBB; }
html[data-theme="dark"] .bind-steps b { color: var(--ink); }
html[data-theme="dark"] .pwd-rules i { background: #3A312A; }
html[data-theme="dark"] .pwd-rules li.ok { color: #7FD9BC; }
html[data-theme="dark"] .confirm-ico { background: #33251A; color: #F0A05E; }
html[data-theme="dark"] .confirm-ico.danger { background: #3A2222; color: #FF9B9B; }
html[data-theme="dark"] .kv { border-bottom-color: #2E2721; }
html[data-theme="dark"] .btn:disabled { background: #2A231D; color: #6E6258; }

/* 带班班级多选 */
.class-check { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; max-height: 180px; overflow: auto; }
.class-check .chk { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); cursor: pointer; padding: 3px 0; }
.class-check .chk input { width: 14px; height: 14px; accent-color: var(--primary); }
html[data-theme="dark"] .class-check { background: #1D1813; border-color: #3A312A; }
html[data-theme="dark"] .class-check .chk { color: #C9BBAD; }
@media (max-width: 860px) { .class-check { grid-template-columns: 1fr; } }

/* ==========================================================================
   v2.3 审计变更快照 / 权限只读态
   ========================================================================== */
.diff-table { font-size: 12px; }
.diff-table th { font-size: 11px; }
.diff-table td:first-child { color: var(--ink-3); width: 110px; }
.diff-table tr.diff-changed td { background: #FFF7E8; }
.diff-table tr.diff-changed td:last-child { color: #8A6320; font-weight: 600; }
input[readonly] { background: #F7F2EC; color: var(--ink-3); cursor: not-allowed; }
.btn:disabled { opacity: .72; }
html[data-theme="dark"] .diff-table tr.diff-changed td { background: #332919; }
html[data-theme="dark"] .diff-table tr.diff-changed td:last-child { color: #E8C98C; }
html[data-theme="dark"] input[readonly] { background: #241E19; color: #8A7D71; }

/* ==========================================================================
   v2.4 子页面园区选择器（右上角全局选择器已移除）
   ========================================================================== */
.campus-pick {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 4px 0 10px; border-radius: 9px;
  background: #FFFDFB; border: 1px solid var(--line);
}
.campus-pick .cp-label { font-size: 11.5px; color: var(--ink-3); }
.campus-pick select {
  height: 30px; border: 0; background: transparent; color: var(--ink);
  font-size: 12.5px; font-family: inherit; padding: 0 4px; outline: none; cursor: pointer;
}
.campus-pick.readonly { padding-right: 10px; background: #F7F2EC; }
.campus-pick.readonly b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.campus-pick.readonly select { cursor: not-allowed; color: var(--ink-2); }
.campus-pick:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(232,118,44,.12); }

/* 窄屏：选择器换行但不挤压按钮 */
@media (max-width: 860px) {
  .page-h { flex-wrap: wrap; }
  .campus-pick { order: -1; }
}
html[data-theme="dark"] .campus-pick { background: #241E19; border-color: #3A312A; }
html[data-theme="dark"] .campus-pick .cp-label { color: #8A7D71; }
html[data-theme="dark"] .campus-pick select,
html[data-theme="dark"] .campus-pick.readonly b { color: #F2E9E0; }
html[data-theme="dark"] .campus-pick.readonly { background: #1D1813; }

/* ==========================================================================
   v2.5 看板下钻局部刷新：选中态 / loading / 报错 / 淡入
   ========================================================================== */
.campus-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.campus-card:hover { border-color: #F0C9A6; }
.campus-card:active { transform: translateY(1px); }
.campus-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(232,118,44,.14), var(--shadow); }
.campus-card.on h3 { color: var(--primary-deep); }
.campus-card:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.drill-card { margin-top: 12px; }
.drill-card .sec-h .link { font-size: 11.5px; }
.drill-row { height: 34px; margin-bottom: 8px; border-radius: 8px; }
.drill-row:last-child { margin-bottom: 0; width: 68%; }

/* loading 指示：小圆点脉冲，比整块 spinner 更轻 */
.drill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: drillPulse 1s ease-in-out infinite; }
@keyframes drillPulse { 0%, 100% { opacity: .22 } 50% { opacity: 1 } }

.drill-fade { animation: drillFade .18s ease-out; }
@keyframes drillFade { from { opacity: 0; transform: translateY(4px) } to { opacity: 1; transform: none } }

@media (prefers-reduced-motion: reduce) {
  .drill-dot, .drill-fade { animation: none; }
  .campus-card { transition: none; }
}

html[data-theme="dark"] .campus-card:hover { border-color: #7A4A28; }
html[data-theme="dark"] .campus-card.on { border-color: #F2904A; box-shadow: 0 0 0 2px rgba(242,144,74,.18), none; }
html[data-theme="dark"] .campus-card.on h3 { color: #F0A05E; }

/* ==========================================================================
   v2.6 操作日志园区范围提示
   ========================================================================== */
.scope-note { margin-bottom: 12px; }
.scope-note b { font-weight: 600; }
