/* ============================================================
   天枢控制台 · portal.css
   设计语言：深海夜行（ocean-night）深色玻璃态
   - 背景：近黑藏蓝 + 双色极光光晕（青/紫），静止不晃
   - 面板：半透白玻璃 + 大模糊 + 极细描边
   - 强调色：青绿 #43e7c9 → 蓝 #5b9dff → 紫 #9b7bff 三段渐变
   - 动效：进场淡入+轻微位移；尊重 prefers-reduced-motion
   ============================================================ */
:root {
  --bg-0: #070b14;
  --bg-1: #0b1020;
  --bg-2: #0f1729;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-hi: rgba(255, 255, 255, 0.10);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --fg: #e9eefb;
  --fg-2: #c3cde0;
  --muted: #8b98b3;
  --muted-2: #6b7793;
  --accent: #43e7c9;
  --accent-2: #5b9dff;
  --accent-3: #9b7bff;
  --grad: linear-gradient(120deg, #43e7c9, #5b9dff 55%, #9b7bff);
  --grad-soft: linear-gradient(120deg, rgba(67,231,201,.16), rgba(91,157,255,.16) 55%, rgba(155,123,255,.16));
  --ok: #46d6a0;
  --warn: #f2c14e;
  --bad: #f0728b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, .75), 0 2px 8px -4px rgba(0, 0, 0, .5);
  --shadow-glow: 0 0 0 1px rgba(91,157,255,.18), 0 14px 40px -20px rgba(67,231,201,.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-x: hidden;
}
/* 极光背景：两层径向光晕，固定不晃 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(67, 231, 201, .14), transparent 60%),
    radial-gradient(1000px 700px at 105% 8%, rgba(155, 123, 255, .14), transparent 58%),
    radial-gradient(1200px 900px at 50% 120%, rgba(91, 157, 255, .10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
/* 细网格纹理 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 90%);
  pointer-events: none;
}

::selection { background: rgba(91,157,255,.35); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 滚动条 ---------- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); background-clip: padding-box; }

/* ============================================================
   启动占位
   ============================================================ */
.boot-splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; color: var(--muted);
}
.boot-mark { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.boot-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent); border-right-color: var(--accent-2);
  animation: spin 1s linear infinite;
}
.boot-glyph { font-size: 26px; font-weight: 700; color: var(--fg); letter-spacing: 2px; }
.boot-text { font-size: 13px; letter-spacing: .5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   登录门
   ============================================================ */
.gate {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 480px at 50% 30%, rgba(67,231,201,.07), transparent 60%),
    radial-gradient(800px 600px at 50% 80%, rgba(155,123,255,.07), transparent 60%);
}
.gate-card {
  width: 100%; max-width: 400px;
  padding: 38px 34px 30px;
  border-radius: 20px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  box-shadow: var(--shadow);
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.gate-logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line);
  font-size: 20px; color: var(--accent); box-shadow: var(--shadow-glow);
}
.gate-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.gate-sub { color: var(--muted); font-size: 13px; margin: 2px 0 22px; }
/* v7.0.0：登录页全站公告（设置中心下发） */
.gate-notice { padding: 10px 14px; margin: 0 0 16px; }
.gate-notice .txt { font-size: 13px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--fg-2); margin-bottom: 7px; letter-spacing: .3px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg); font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
}
.field textarea { resize: vertical; min-height: 150px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(91,157,255,.6);
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 3px rgba(91,157,255,.16);
}
.field input::placeholder { color: var(--muted-2); }
.field .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }
.gate-card .remember {
  display: flex; align-items: center; gap: 7px; margin: 4px 0 12px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none;
  font-family: system-ui;
}
.gate-card .remember input { accent-color: var(--accent, #5694ff); width: 15px; height: 15px; cursor: pointer; }
.gate-card .remember .muted { font-size: 11px; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--glass); color: var(--fg);
  cursor: pointer; transition: transform .12s, background .18s, border-color .18s, box-shadow .18s, opacity .18s;
  user-select: none;
}
.btn:hover { background: var(--glass-hi); border-color: rgba(255,255,255,.16); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--grad); color: #06121f; border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(67,231,201,.6);
}
.btn.primary:hover { box-shadow: 0 14px 32px -10px rgba(91,157,255,.7); filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: rgba(240,114,139,.35); background: rgba(240,114,139,.08); }
.btn.danger:hover { background: rgba(240,114,139,.16); border-color: rgba(240,114,139,.55); }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btn .ico { font-size: 15px; line-height: 1; }

/* ============================================================
   应用壳：单行顶栏 + 主区（v26.0.0：侧栏改顶栏）
   ============================================================ */
.shell { display: flex; flex-direction: column; min-height: 100vh; }

/* 单行顶栏：品牌 · 版本徽标 · 分组下拉导航 · 搜索 · 通知 · 主题 · 用户 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--glass-strong), var(--glass));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}
.topbar .who { display: flex; align-items: center; gap: 11px; flex: none; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line);
  font-size: 16px; color: var(--accent); box-shadow: var(--shadow-glow);
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .5px; line-height: 1.1; white-space: nowrap; }
.brand-name small { display: block; font-size: 9.5px; font-weight: 500; color: var(--muted); letter-spacing: 1.4px; }

/* 顶栏版本徽标：只显示版本号，详情进 tooltip；跨端版本漂移时转警示色 */
.ver-pill {
  flex: none; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  color: var(--muted); background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 10px;
  transition: color .16s, border-color .16s;
}
.ver-pill:hover { color: var(--fg-2); border-color: var(--accent); }
.ver-pill.drift { color: var(--warn, #b7791f); border-color: var(--warn, #b7791f); }

/* ---------- 顶栏分组下拉导航（v26.0.0 取代分组式侧栏） ----------
   注意：这里【不能】用 overflow 裁剪（overflow-x:auto 也不行）——
   下拉面板是 .tgroup 的子元素，一旦祖先出现 overflow，面板会被裁在导航条那一行里而完全看不见。
   宽度自适应改用「分级隐藏」：窄屏先收起次要控件，再让分组只留图标，因此永远不需要横向滚动。 */
.tnav {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 2px;
}
.tgroup { position: relative; flex: none; }
.tgroup-btn {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 10px; margin: 0; cursor: pointer; font-family: inherit;
  background: none; border: 1px solid transparent; border-radius: 10px;
  color: var(--fg-2); font-size: 13.5px; font-weight: 600;
  transition: background .16s, color .16s, border-color .16s;
}
.tgroup-btn:hover { background: var(--glass); color: var(--fg); }
.tgroup-btn .tg-ico { font-size: 14px; opacity: .9; }
.tgroup-btn .tg-caret { font-size: 10px; opacity: .65; transition: transform .18s; }
.tgroup.open .tgroup-btn {
  color: var(--fg); background: var(--glass-strong); border-color: var(--line);
}
.tgroup.open .tgroup-btn .tg-caret { transform: rotate(180deg); }
/* 当前视图所在分组：常驻高亮，便于在没有面包屑时定位 */
.tgroup.active > .tgroup-btn { color: var(--accent); }
.tgroup.active > .tgroup-btn .tg-ico { opacity: 1; }

.tgroup-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  min-width: 252px; max-width: 340px; max-height: min(74vh, 620px); overflow-y: auto;
  padding: 7px; display: none;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.tgroup-panel::before { /* 悬停过渡缓冲：避免鼠标从按钮移到面板途中被判定为移出 */
  content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 9px;
}
.tgroup.open .tgroup-panel { display: block; }
.tgroup-panel a {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: var(--fg-2); border: 1px solid transparent;
}
.tgroup-panel a:hover { background: var(--glass); color: var(--fg); }
.tgroup-panel a.active {
  background: var(--grad-soft); color: var(--fg);
  border-color: rgba(91, 157, 255, .32);
}
.tgroup-panel a .nv-ico { width: 20px; text-align: center; font-size: 15px; opacity: .9; flex: none; line-height: 1.5; }
.tgroup-panel a .nv-txt { display: flex; flex-direction: column; min-width: 0; }
.tgroup-panel a .nv-label { font-size: 13.5px; font-weight: 600; }
.tgroup-panel a .nv-desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

.main { flex: 1; padding: 26px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------- 应用中心卡片（v26.0.0 补齐样式） ----------
   说明：.app-card 系列类名自 v8 起就在 views.js 里生成，但一直没有任何 CSS 规则，
   页面实际渲染成一摞没有层级的裸 glass 块。此处补全：图标 / 中文名 / 版本 / 状态 / 接口数 / 能力小标签。 */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; }
.app-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 15px 16px; border-radius: 14px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.app-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.app-card.off { opacity: .62; }
.app-card-top { display: flex; align-items: center; gap: 10px; }
.app-ico {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-size: 17px; background: var(--grad-soft); border: 1px solid var(--line);
}
.app-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.app-title b { font-size: 14.5px; font-weight: 700; }
.app-ver {
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--panel-soft); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 1px 7px;
}
.app-badge {
  font-size: 10.5px; font-weight: 600; border-radius: 999px; padding: 1px 8px;
  border: 1px solid transparent;
}
.app-badge.ok { color: var(--ok, #43e7c9); background: rgba(67, 231, 201, .13); border-color: rgba(67, 231, 201, .3); }
.app-badge.off { color: var(--warn, #b7791f); background: rgba(183, 121, 31, .14); border-color: rgba(183, 121, 31, .32); }
.app-sub { display: flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-2); }
.app-desc { font-size: 13px; color: var(--fg-2); line-height: 1.55; }
.app-caps { display: flex; flex-wrap: wrap; gap: 5px; }
.app-cap {
  font-size: 11px; color: var(--muted); background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 7px; line-height: 1.5;
}
.app-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.app-foot .muted { flex: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #06121f; background: var(--grad);
}
.who .meta { line-height: 1.2; }
.who .meta .nm { font-size: 13.5px; font-weight: 600; }
.who .meta .rl { font-size: 11px; color: var(--muted); }
.role-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px; font-weight: 600;
  background: rgba(91,157,255,.16); color: #aacbff; border: 1px solid rgba(91,157,255,.3);
}
.role-tag.admin { background: rgba(67,231,201,.15); color: #8af0d8; border-color: rgba(67,231,201,.32); }
.role-tag.root { background: rgba(155,123,255,.16); color: #c8b6ff; border-color: rgba(155,123,255,.34); }

/* ---------- 视图进场动画 ---------- */
.view { animation: viewIn .42s cubic-bezier(.22,.61,.36,1); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.view.leaving { animation: viewOut .28s ease forwards; }
@keyframes viewOut { to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================
   通用板块 / 卡片 / 标题
   ============================================================ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: .5px; }
.page-head .desc { color: var(--muted); font-size: 13px; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  box-shadow: var(--shadow);
}
.section-title { font-size: 14px; font-weight: 600; color: var(--fg-2); margin: 26px 0 12px; letter-spacing: .4px; }

.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-2.wide { grid-template-columns: 1.4fr 1fr; }

/* 统计卡 */
.stat { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat .k .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 8px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stat .v.sm { font-size: 18px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .spark { position: absolute; right: 14px; top: 14px; font-size: 20px; opacity: .5; }

/* 面板 */
.panel { padding: 18px 20px; }
.panel > h2 { font-size: 15px; font-weight: 650; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.panel > h2 .ph-ico { color: var(--accent); }

/* 状态徽标 */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.pill.ok { background: rgba(70,214,160,.14); color: #7ef0c2; border: 1px solid rgba(70,214,160,.3); }
.pill.warn { background: rgba(242,193,78,.14); color: #f4d488; border: 1px solid rgba(242,193,78,.3); }
.pill.bad { background: rgba(240,114,139,.14); color: #f7a3b3; border: 1px solid rgba(240,114,139,.3); }
.pill.off { background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line); }
.pill.subj { background: rgba(91,157,255,.12); color: var(--accent); border: 1px solid rgba(91,157,255,.3); }
.pill .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 标签 / 码值 */
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--fg-2); border: 1px solid var(--line-soft); }
.code-badge {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 7px; color: #a9e9ff;
  background: rgba(91,157,255,.12); border: 1px solid rgba(91,157,255,.28);
}

/* 表格 */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: rgba(255,255,255,.02);
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tbl tbody tr { transition: background .14s; }
table.tbl tbody tr:hover { background: rgba(255,255,255,.035); }
table.tbl tbody tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.muted { color: var(--muted); }
.dim { color: var(--muted-2); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* 空 / 错误态 */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .big { font-size: 34px; margin-bottom: 10px; opacity: .7; }
.degrade {
  border: 1px dashed rgba(242,193,78,.4); background: rgba(242,193,78,.06);
  border-radius: var(--radius-sm); padding: 12px 14px; color: #e8cf8f; font-size: 12.5px;
}
.degrade.bad { border-color: rgba(240,114,139,.4); background: rgba(240,114,139,.06); color: #f3aeb9; }
.err-text { color: var(--bad); }

/* 缩略图 */
.thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; display: block; }

/* 加载圈 */
.loader { display: grid; place-items: center; padding: 40px; }
.ring {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.12); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

/* ============================================================
   工具条 / 筛选
   ============================================================ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-width: 220px;
}
.search input { background: none; border: none; outline: none; color: var(--fg); font-size: 13.5px; width: 100%; }
.search .ico { color: var(--muted); }
.inline-select {
  padding: 9px 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--fg); font-size: 13.5px; outline: none;
}
.inline-select:focus { border-color: rgba(91,157,255,.6); }

.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ============================================================
   课程表网格
   ============================================================ */
/* v27.0.0 可滚动课程表：横向 + 纵向滚动，表头与节次列吸附，今天列高亮 */
.tt-wrap {
  overflow: auto;
  max-height: min(64vh, 620px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}
table.timetable { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
table.timetable thead th { position: sticky; top: 0; z-index: 2; }
table.timetable .period-col { position: sticky; left: 0; z-index: 1; }
table.timetable thead th.period-col { z-index: 3; }
table.timetable th.today-col { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
table.timetable td.today-col { background: rgba(91, 157, 255, .07); }
table.timetable th, table.timetable td {
  border: 1px solid var(--line-soft); padding: 0; text-align: center; font-size: 12.5px;
}
table.timetable thead th { background: rgba(255,255,255,.04); padding: 11px 8px; color: var(--fg-2); font-weight: 600; }
table.timetable .period-col { width: 96px; background: rgba(255,255,255,.025); }
table.timetable .period-label { font-weight: 600; color: var(--fg); }
table.timetable .period-time { font-size: 10.5px; color: var(--muted); display: block; }
.tt-cell { padding: 9px 8px; min-height: 58px; vertical-align: top; transition: background .14s; }
.tt-cell.filled { background: var(--grad-soft); }
.tt-cell.filled:hover { background: rgba(91,157,255,.14); }
.tt-cell .subj { font-weight: 650; color: #fff; font-size: 13px; }
.tt-cell .room, .tt-cell .teacher { font-size: 10.5px; color: var(--fg-2); display: block; }
.tt-cell.empty { color: var(--muted-2); }
.tt-cell.raw { font-family: var(--mono); font-size: 10px; color: var(--warn); padding: 6px; text-align: left; white-space: pre-wrap; word-break: break-all; }

/* ============================================================
   抽屉（课程表 JSON 编辑）
   ============================================================ */
.drawer-layer { position: fixed; inset: 0; z-index: 60; display: grid; }
.drawer-layer .scrim { position: absolute; inset: 0; background: rgba(3,6,12,.55); backdrop-filter: blur(2px); }
.drawer {
  position: relative; margin-left: auto; width: min(560px, 94vw); height: 100%;
  background: var(--bg-2); border-left: 1px solid var(--line);
  box-shadow: -30px 0 60px -30px rgba(0,0,0,.8);
  display: flex; flex-direction: column; animation: drawerIn .3s cubic-bezier(.22,.61,.36,1);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-body { flex: 1; padding: 18px 22px; overflow: auto; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   弹窗 modal
   ============================================================ */
.modal-layer {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px;
  background: rgba(3,6,12,.6); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .2s;
}
.modal-layer.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow: auto;
  padding: 22px 24px; border-radius: 18px;
  transform: translateY(10px) scale(.98); transition: transform .22s cubic-bezier(.22,.61,.36,1);
}
.modal-layer.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.modal-x:hover { color: var(--fg); }
.modal .form-row { display: flex; gap: 12px; }
.modal .form-row > * { flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ============================================================
   toast
   ============================================================ */
#toast-layer { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: 13px; font-weight: 500;
  background: rgba(20,26,42,.9); border: 1px solid var(--line); color: var(--fg);
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
  transform: translateX(20px); opacity: 0; transition: transform .25s, opacity .25s;
  max-width: 360px;
}
.toast.show { transform: none; opacity: 1; }
.toast.ok { border-color: rgba(70,214,160,.4); }
.toast.err { border-color: rgba(240,114,139,.45); color: #f7c2cc; }
.toast.info { border-color: rgba(91,157,255,.4); }

/* 网络三卡 */
.net-card .kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.net-card .kv:last-child { border-bottom: none; }
.net-card .kv .key { color: var(--muted); }
.net-card .kv .val { text-align: right; font-variant-numeric: tabular-nums; }
.peer-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* 账号 */
.kv-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; padding: 6px 2px; }
.kv-grid .k { color: var(--muted); font-size: 13px; }
.kv-grid .v { font-size: 13.5px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1020px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .cols-2.wide { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  /* v26.0.0：顶栏在窄屏改为「分组仅留图标 + 横向可容纳」，不再有侧栏抽屉 */
  .brand-name { display: none; }
  .tgroup-btn { padding: 7px 9px; }
  .tgroup-panel { position: fixed; left: 12px; right: 12px; min-width: 0; max-width: none; top: 62px; }
}
/* 顶栏宽度分级：优先保住导航标签，先收起次要控件 */
@media (max-width: 1560px) {
  .theme-btns .btn:nth-child(2), .theme-btns .btn:nth-child(3) { display: none; }
  .who .meta { display: none; }
  .gsearch { flex-basis: 200px; }
}
/* 再窄就只留分组图标（分组名进 title 提示），保证永不横向滚动、也不会盖住搜索框 */
@media (max-width: 1320px) {
  .tgroup-btn .tg-title { display: none; }
  .tgroup-btn { padding: 8px; }
}
@media (max-width: 620px) {
  .who [data-action="logout"] { display: none; }
  .brand-logo { width: 30px; height: 30px; font-size: 14px; }
}
@media (max-width: 760px) {
  .main { padding: 16px; }
  .topbar { padding: 10px 14px; gap: 9px; }
  .gsearch { display: none; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .toolbar .search { min-width: 0; width: 100%; }
  .who .meta { display: none; }
  .ver-pill { display: none; }
  #toast-layer { left: 14px; right: 14px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 520px) {
  .stat .v { font-size: 22px; }
}

/* 尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .boot-ring { animation: none; }
}

/* ============================================================
   v2-v4 增量样式：数据中心 / 审计 / 监控 / 主题皮肤
   ============================================================ */
:root { --panel-soft: rgba(255, 255, 255, .03); }

/* 侧栏版本徽标（v4：div 改为可点按钮） */
/* 侧栏版本徽标样式（v4 的 button.nav-foot）已在 v26.0.0 随侧栏移除，
   版本号改为顶栏 .ver-pill（见文件上部布局段） */

/* 顶栏主题按钮 */
.theme-btns { display: flex; gap: 6px; margin-right: 10px; }
.theme-btns .btn { padding: 6px 10px; }

/* 公告横幅 */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; margin-bottom: 18px; border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}
.notice .ico { font-size: 17px; line-height: 1.4; }
.notice .txt { flex: 1; font-size: 13.5px; color: var(--fg-2); }
.notice .when { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }

/* 运行监控 */
.monitor-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.latency-badge { display: flex; flex-direction: column; gap: 2px; min-width: 96px; }
.latency-badge .k { font-size: 11.5px; color: var(--muted-2); }
.latency-badge .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.spark { flex: 1; min-width: 220px; display: flex; align-items: flex-end; }
.spark-bars {
  display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 56px;
  padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-soft);
}
.spark-bars .bar { flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; transition: height .3s; }
.spark-bars .bar.ok { background: linear-gradient(180deg, var(--accent), rgba(67,231,201,.25)); }
.spark-bars .bar.warn { background: linear-gradient(180deg, var(--warn), rgba(242,193,78,.25)); }
.spark-bars .bar.bad { background: linear-gradient(180deg, var(--bad), rgba(240,114,139,.25)); }
.method-badge { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent-2); letter-spacing: .4px; }

/* 数据中心：集合卡片 */
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.coll-card {
  display: flex; align-items: center; gap: 12px; padding: 18px; cursor: pointer;
  font-family: inherit; color: var(--fg); text-align: left; transition: transform .18s, background .18s;
}
.coll-card:hover { transform: translateY(-2px); background: var(--glass-strong); }
.coll-card .ico { font-size: 20px; }
.coll-card .nm { flex: 1; font-weight: 600; font-size: 14.5px; }
.coll-card .go { font-size: 12px; color: var(--muted); }
.coll-name { font-weight: 600; }

/* 媒体库卡片（与集合卡片同语言） */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.media-card {
  display: flex; align-items: center; gap: 10px; padding: 14px; cursor: pointer;
  font-family: inherit; color: var(--fg); text-align: left; transition: transform .18s, background .18s;
}
.media-card:hover { transform: translateY(-2px); background: var(--glass-strong); }
.media-card .ico { font-size: 19px; }
.media-card .nm {
  flex: 1; min-width: 0; font-weight: 600; font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.media-card .go { flex-shrink: 0; font-size: 11.5px; color: var(--muted); }

/* Office 文本级预览（office 模块渲染输出） */
.office-html h2, .office-html h3, .office-html h4 { margin: 18px 0 8px; color: var(--fg); }
.office-html h2 { font-size: 18px; } .office-html h3 { font-size: 15.5px; } .office-html h4 { font-size: 14px; color: var(--muted); }
.office-html p { margin: 6px 0; }
.office-html table { border-collapse: collapse; margin: 14px 0; }
.office-html th, .office-html td {
  border: 1px solid var(--line-soft); padding: 5px 12px; font-size: 12.5px; text-align: left;
}
.office-html th { background: var(--panel-soft); font-weight: 600; }
.office-html tr:first-child td { background: var(--panel-soft); font-weight: 600; }
.office-html .slide { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
/* v1.2.0 升级10：Excel 行列号（rc）与 Word 表格样式 */
.office-html .rc { color: var(--muted); background: var(--panel-soft); font-weight: 600; text-align: center; white-space: nowrap; }
.office-html table.vtbl thead th { background: var(--line-soft); position: sticky; top: 0; }
.office-html ul.bul { margin: 6px 0 6px 18px; padding: 0; }
.office-html ul.bul li { margin: 3px 0; }

/* v1.2.0 升级13：全局搜索（Ctrl+K） */
.gs-holder #gsInput {
  width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 14px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel-soft); color: var(--fg); outline: none;
}
.gs-holder #gsInput:focus { border-color: var(--accent-2); }
.gs-list { margin-top: 8px; max-height: 380px; overflow: auto; }
.gs-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 9px; cursor: pointer; color: var(--fg);
}
.gs-row:hover { background: var(--glass-hi); }
.gs-ico { font-size: 15px; }
.gs-body { flex: 1; min-width: 0; font-size: 13px; }
.gs-body .muted { font-size: 12px; }
.gs-go { font-size: 12px; white-space: nowrap; }

/* JSON 编辑域（数据 / 备份导入） */
.json-ta {
  width: 100%; min-height: 260px; resize: vertical; margin-top: 12px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  color: var(--fg); background: var(--panel-soft);
  border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; outline: none;
}
.json-ta:focus { border-color: var(--accent-2); }
.cell-json { font-size: 11.5px; color: var(--muted); }

/* 升级日志弹窗 */
.changelog { max-height: 56vh; overflow-y: auto; padding-right: 4px; }
.cl-item { padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.cl-item:last-child { border-bottom: none; }
.cl-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cl-v { font-weight: 700; color: var(--accent); font-size: 14.5px; }
.cl-d { font-size: 11.5px; color: var(--muted-2); }
.cl-item ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--fg-2); }
.cl-item li { margin: 3px 0; }

/* ============================================================
   皮肤系统（v4）：改三段强调色
   ============================================================ */
html[data-skin="violet"] {
  --accent: #a78bfa; --accent-2: #7dd3fc; --accent-3: #f0abfc;
  --grad: linear-gradient(120deg, #a78bfa, #7dd3fc 55%, #f0abfc);
  --grad-soft: linear-gradient(120deg, rgba(167,139,250,.16), rgba(125,211,252,.16) 55%, rgba(240,171,252,.16));
  --shadow-glow: 0 0 0 1px rgba(167,139,250,.18), 0 14px 40px -20px rgba(167,139,250,.35);
}
html[data-skin="sunset"] {
  --accent: #fbbf24; --accent-2: #fb7185; --accent-3: #f97316;
  --grad: linear-gradient(120deg, #fbbf24, #fb7185 55%, #f97316);
  --grad-soft: linear-gradient(120deg, rgba(251,191,36,.15), rgba(251,113,133,.15) 55%, rgba(249,115,22,.15));
  --shadow-glow: 0 0 0 1px rgba(251,191,36,.18), 0 14px 40px -20px rgba(251,146,60,.35);
}
html[data-skin="emerald"] {
  --accent: #34d399; --accent-2: #4ade80; --accent-3: #2dd4bf;
  --grad: linear-gradient(120deg, #34d399, #4ade80 55%, #2dd4bf);
  --grad-soft: linear-gradient(120deg, rgba(52,211,153,.16), rgba(74,222,128,.16) 55%, rgba(45,212,191,.16));
  --shadow-glow: 0 0 0 1px rgba(45,212,191,.18), 0 14px 40px -20px rgba(52,211,153,.35);
}

/* ============================================================
   外观引擎 v2（v11.0.0）：无障碍对比度 + 聚焦可见 + 主题过渡
   修复点：任何鼠标悬停状态都保证文字与背景对比——绝不允许
   「滑过某行文字消失」（桌面 DarkListView 同类问题在 Web 一并封堵）。
   ============================================================ */
/* 键盘聚焦始终可见（焦点环不受主题/皮肤影响） */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 3px;
}
/* 统一悬停底色：深色=提亮白，浅色=盖一层蓝灰，均保持 --fg 可读 */
:root {
  --hover-bg: rgba(255, 255, 255, .075);
  --row-hover: rgba(255, 255, 255, .045);
}
html[data-theme="light"] {
  --hover-bg: rgba(13, 30, 60, .08);
  --row-hover: rgba(59, 130, 246, .06);
}
/* 行/条目 hover 用专属 token，前景色交由文字自身（不覆盖成同色） */
table.tbl tbody tr:hover { background: var(--row-hover); }
.np-item:hover { background: var(--row-hover); }
.gs-item:hover { background: var(--row-hover, var(--panel-soft)); }
.coll-card:hover { background: var(--glass-strong); }
.media-card:hover { background: var(--glass-strong); }
/* 悬停区文字颜色显式取前景，杜绝系统/浏览器把 hover 前景盖成背景同色 */
table.tbl tbody tr:hover td { color: var(--fg); }
table.tbl tbody tr:hover .muted, table.tbl tbody tr:hover .mono { color: inherit; }
/* 主题过渡（尊重减弱动效偏好） */
html:not([data-reduced]) body, html:not([data-reduced]) .gate-card,
html:not([data-reduced]) .modal, html:not([data-reduced]) .drawer,
html:not([data-reduced]) .nav, html:not([data-reduced]) .glass {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* ============================================================
   安全中心（security 视图）· v8.2.0
   ============================================================ */
.sec-score-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sec-ring {
  --val: 0;
  width: 116px; height: 116px; border-radius: 50%; flex: 0 0 auto;
  background:
    radial-gradient(closest-side, var(--bg-1) 70%, transparent 71% 100%),
    conic-gradient(var(--accent) calc(var(--val) * 1%), var(--line) 0);
  display: grid; place-items: center; position: relative;
  box-shadow: var(--shadow-glow);
}
.sec-ring .num { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; color: var(--fg); }
.sec-ring .num small { font-size: 14px; font-weight: 600; color: var(--muted-2); }
.sec-ring.s-crit { --accent: #f06a8b; }
.sec-ring.s-high { --accent: #fb7185; }
.sec-ring.s-med  { --accent: #f4d488; }
.sec-ring.s-ok   { --accent: #7ef0c2; }
.sec-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-counts .c { display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 10px; border-radius: 10px; background: var(--panel-soft); border: 1px solid var(--line-soft); }
.sec-counts .c b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sec-counts .c span { font-size: 11px; color: var(--muted-2); }
.sec-counts .c.crit b { color: #f06a8b; }
.sec-counts .c.high b { color: #fb7185; }
.sec-counts .c.med  b { color: #f4d488; }
.sec-counts .c.low  b { color: var(--muted); }
.sec-counts .c.good b { color: #7ef0c2; }

.sec-findings { display: grid; gap: 10px; }
.sec-finding { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel-soft); border: 1px solid var(--line-soft); border-left-width: 3px; }
.sec-finding.sv-critical { border-left-color: #f06a8b; }
.sec-finding.sv-high     { border-left-color: #fb7185; }
.sec-finding.sv-medium   { border-left-color: #f4d488; }
.sec-finding.sv-low      { border-left-color: var(--muted); }
.sec-finding.sv-good     { border-left-color: #7ef0c2; }
.sec-finding.sv-unknown  { border-left-color: var(--muted-2); }
.sec-badge { align-self: start; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.sec-badge.sv-critical { background: rgba(240,106,139,.16); color: #f7a3b3; }
.sec-badge.sv-high     { background: rgba(240,114,139,.16); color: #f7a3b3; }
.sec-badge.sv-medium   { background: rgba(242,193,78,.16); color: #f4d488; }
.sec-badge.sv-low      { background: rgba(255,255,255,.06); color: var(--muted); }
.sec-badge.sv-good     { background: rgba(70,214,160,.14); color: #7ef0c2; }
.sec-badge.sv-unknown  { background: rgba(255,255,255,.06); color: var(--muted-2); }
.sec-finding .ft { font-weight: 600; color: var(--fg); }
.sec-finding .fcat { font-size: 11px; color: var(--muted-2); margin-left: 8px; }
.sec-finding .fdetail { font-size: 12.5px; color: var(--fg-2); margin-top: 4px; word-break: break-word; font-family: var(--mono); }
.sec-finding .frec { font-size: 12.5px; color: var(--accent-2); margin-top: 4px; }

/* 加固开关 */
.sec-switch { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.sec-switch:last-of-type { border-bottom: none; }
.sec-switch .lbl { flex: 1; }
.sec-switch .lbl b { font-weight: 600; color: var(--fg); }
.sec-switch .lbl small { display: block; color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.sec-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.sec-switch .track { width: 42px; height: 24px; border-radius: 20px; background: var(--line); position: relative; transition: .18s; flex: 0 0 auto; cursor: pointer; }
.sec-switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .18s; }
.sec-switch input:checked + .track { background: var(--accent); }
.sec-switch input:checked + .track::after { left: 21px; }
.sec-res { font-size: 12.5px; color: var(--fg-2); margin-top: 8px; white-space: pre-wrap; font-family: var(--mono); }
.btn.danger { color: #f7a3b3; border-color: rgba(240,114,139,.4); background: rgba(240,114,139,.1); }
.btn.danger:hover { background: rgba(240,114,139,.2); border-color: rgba(240,114,139,.6); }

/* ============================================================
   浅色主题（v4）：晴空白昼（daylight）
   ============================================================ */
html[data-theme="light"] {
  --bg-0: #eef2fb; --bg-1: #f3f6fd; --bg-2: #ffffff;
  --glass: rgba(15, 30, 60, .045);
  --glass-strong: rgba(15, 30, 60, .07);
  --glass-hi: rgba(15, 30, 60, .10);
  --line: rgba(13, 30, 60, .13);
  --line-soft: rgba(13, 30, 60, .08);
  --fg: #16233c; --fg-2: #2c3d5e;
  --muted: #5c6b88; --muted-2: #8593ab;
  --panel-soft: rgba(13, 30, 60, .045);
  --ok: #0e9f6e; --warn: #b7791f; --bad: #d64562;
  --accent: #0d9488; --accent-2: #3b82f6; --accent-3: #8b5cf6;
  --grad: linear-gradient(120deg, #0d9488, #3b82f6 55%, #8b5cf6);
  --grad-soft: linear-gradient(120deg, rgba(13,148,136,.14), rgba(59,130,246,.14) 55%, rgba(139,92,246,.14));
  --shadow: 0 14px 40px -20px rgba(30, 50, 90, .25), 0 2px 8px -4px rgba(30, 50, 90, .12);
  --shadow-glow: 0 0 0 1px rgba(59,130,246,.15), 0 14px 40px -20px rgba(13,148,136,.25);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(13, 148, 136, .10), transparent 60%),
    radial-gradient(1000px 700px at 105% 8%, rgba(139, 92, 246, .10), transparent 58%),
    radial-gradient(1200px 900px at 50% 120%, rgba(59, 130, 246, .08), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
html[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(13,30,60,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,30,60,.035) 1px, transparent 1px);
}
html[data-theme="light"] ::selection { background: rgba(59,130,246,.25); color: var(--fg); }
/* 浅色下常见深色内联/组件兜底 */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, .75); color: var(--fg);
  border-color: var(--line);
}
html[data-theme="light"] .toast,
html[data-theme="light"] .modal,
html[data-theme="light"] .drawer { background: rgba(255, 255, 255, .92); color: var(--fg); }
html[data-theme="light"] .code-badge { background: rgba(13, 30, 60, .07); color: var(--fg-2); }
html[data-theme="light"] .role-tag,
html[data-theme="light"] .tag { color: var(--fg-2); }
html[data-theme="light"] .toast.err { color: var(--bad); }

/* ==================== v4.4.0 通知中心 ==================== */
.bell-btn {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  border-radius: 10px;
  width: 34px; height: 34px;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  transition: border-color .16s, transform .16s;
}
.bell-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.bell-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bad, #e5484d);
  color: #fff;
  font-size: 10.5px; font-weight: 700;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-0, #0b1020);
}
.notif-panel {
  position: fixed;
  top: 58px; right: 18px;
  width: 340px; max-width: calc(100vw - 36px);
  max-height: min(480px, calc(100vh - 90px));
  display: flex; flex-direction: column;
  border-radius: 14px;
  z-index: 90;
  overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.np-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.np-head .muted { flex: 1; font-size: 12px; }
.np-list { overflow-y: auto; padding: 6px; }
.np-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 10px;
  border-radius: 10px;
}
.np-item:hover { background: var(--panel-soft); }
.np-dot {
  width: 7px; height: 7px; border-radius: 50%;
  margin-top: 6px; flex: none;
  background: var(--accent, #43e7c9);
}
.np-dot.alt { background: var(--warn, #f5a524); }
.np-body { min-width: 0; flex: 1; }
.np-txt { font-size: 12.8px; word-break: break-all; line-height: 1.45; }
.np-ts { font-size: 11px; margin-top: 2px; }
html[data-theme="light"] .bell-badge { box-shadow: 0 0 0 2px #fff; }

/* ==================== 全局搜索（v4.5.0） ==================== */
.gsearch {
  position: relative;
  flex: 0 1 240px; min-width: 132px;
  max-width: 36vw;
}
.gsearch-input {
  width: 100%;
  height: 34px;
  padding: 0 34px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--panel-soft, rgba(127,127,127,.08));
  color: var(--text);
  font-size: 12.8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.gsearch-input::placeholder { color: var(--text-dim, #8a93a6); }
.gsearch-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #43e7c9) 18%, transparent);
}
.gsearch-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: min(440px, calc(100vh - 100px));
  overflow-y: auto;
  border-radius: 14px;
  z-index: 95;
  padding: 8px;
}
.gsearch-panel[hidden] { display: none; }
.gs-group + .gs-group { margin-top: 6px; }
.gs-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px 4px;
  font-size: 11.5px; font-weight: 700;
  color: var(--text-dim, #8a93a6);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.gs-item {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left;
  padding: 8px 10px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.gs-item:hover { background: var(--panel-soft, rgba(127,127,127,.1)); }
.gs-title { font-size: 13px; font-weight: 600; word-break: break-all; }
.gs-sub { font-size: 11.5px; color: var(--text-dim, #8a93a6); word-break: break-all; }
.gs-empty { padding: 22px 12px; text-align: center; font-size: 12.8px; }
.gs-foot {
  padding: 8px 10px 4px;
  font-size: 11px;
  text-align: right;
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
}
@media (max-width: 900px) {
  .gsearch { width: 170px; }
  .gsearch-input { font-size: 12px; }
}

/* ============================================================
   v5.0.0 磁盘视图（D 盘全览）
   ============================================================ */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; margin: 0 0 10px; padding: 10px 14px;
  background: var(--glass); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.crumbs a {
  color: var(--fg); opacity: .78; cursor: pointer; text-decoration: none;
  padding: 2px 6px; border-radius: 6px; transition: opacity .15s, background .15s;
}
.crumbs a:hover { opacity: 1; background: var(--glass-hi); }
.crumbs .sep { opacity: .35; user-select: none; }
.disk-editor {
  width: 100%; min-height: 58vh; resize: vertical;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px;
  font-family: var(--mono); font-size: 12.5px; color: var(--fg);
  line-height: 1.6; outline: none;
}
.disk-editor:focus { border-color: var(--accent-2); box-shadow: 0 0 0 1px var(--accent-2); }

/* ============================================================
   v5.1.0 磁盘视图增强（容量条 / 搜索 / 批量操作）
   ============================================================ */
.capbar { margin: 0 0 10px; padding: 10px 14px; background: var(--glass); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.capbar-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; margin-bottom: 6px; color: var(--fg); opacity: .85;
}
.capbar-track { height: 8px; border-radius: 4px; background: rgba(127,127,127,.18); overflow: hidden; }
.capbar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.capbar-fill.ok { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.capbar-fill.warn { background: linear-gradient(90deg, var(--warn), #f2a14e); }
.capbar-fill.bad { background: linear-gradient(90deg, var(--bad), #f04e6e); }
.disk-search { width: 300px; }
.disk-search::placeholder { opacity: .55; }
.batchbar { border-style: dashed; animation: batchbar-in .18s ease; }
@keyframes batchbar-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tbl input[type="checkbox"] { accent-color: var(--accent-2); width: 15px; height: 15px; cursor: pointer; }
@media (max-width: 900px) { .disk-search { width: 100%; } }

/* ============================================================
   v5.2.0 磁盘视图增强（网格视图 / 常用目录收藏）
   ============================================================ */
.grid-disk {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.gcard {
  background: var(--glass); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.gcard:hover {
  border-color: var(--accent-2); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.gcard-thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: calc(var(--radius-sm) - 3px); background: rgba(127,127,127,.12);
  display: block;
}
div.gcard-thumb { display: flex; align-items: center; justify-content: center; }
.gcard-ico { font-size: 42px; }
.gcard-name {
  font-size: 12.5px; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gcard-sub { font-size: 11px; color: var(--fg); opacity: .55; }
.pinrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.pinchip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 12.5px;
  background: var(--glass); border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.pinchip a { color: var(--fg); text-decoration: none; cursor: pointer; }
.pinchip a:hover { color: var(--accent-2); }
.pinchip .pinx {
  background: none; border: none; color: var(--fg); opacity: .4;
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.pinchip .pinx:hover { opacity: 1; color: var(--bad); }


/* ── v6.0.0 设置中心 ── */
.gate-notice { padding: 10px 14px; border-radius: 12px; font-size: 13px; margin: 0 0 16px; color: var(--fg); }
.mode-card input { margin-top: 3px; }

/* v7.0.0：设置中心 · 强调色色板 */
.acc-card {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  font-size: 12.5px; border: 1px solid var(--line-soft);
}
.acc-card input[type="radio"] { margin: 0; accent-color: var(--accent); }
.acc-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.acc-dot {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), 0 0 6px rgba(0, 0, 0, .18);
}
.acc-auto { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }

/* ============================================================
   v8.0.0 —— 分组式导航 / 四个新页面 / 主题与移动端适配
   命名沿用既有约定（小写 + 连字符 + 功能前缀），不另起一套
   ============================================================ */

/* ---------- v26.0.0：分组式侧栏导航样式已随「侧栏改顶栏」移除 ----------
   原 .nav-group / .nav-group-head / .nav-group-body / .nav-scrim / .nav-toggle
   全部由新的 .tnav / .tgroup / .tgroup-btn / .tgroup-panel 取代（见文件上部布局段）。
   侧栏抽屉与遮罩不再存在，移动端改为横向滚动分组条。
--------------------------------------------------------------------------- */

/* ---------- 登录页版本行 ---------- */
.gate-version {
  margin: 14px 0 0; text-align: center;
  font-size: 11.5px; color: var(--muted-2); letter-spacing: .3px;
}

/* ---------- 统计 / 网格补充 ---------- */
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.perf-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.perf-k { font-size: 12px; }
.perf-v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.quant .v.sm { font-size: 17px; }

/* ---------- 更新中心 ---------- */
.art-card .art-kv { grid-template-columns: 96px 1fr; }
.art-card .art-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 4px 0 14px; position: relative; }
.tl-item + .tl-item { border-top: 1px dashed var(--line-soft); padding-top: 14px; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.tl-body { min-width: 0; flex: 1; }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-sub { font-size: 12px; margin-top: 3px; word-break: break-all; }

/* ---------- 性能剖析 ---------- */
.metric-chart {
  height: 150px; padding: 10px 12px;
  border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft);
}
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.chart-bar { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; transition: height .28s; }
.chart-bar.ok { background: linear-gradient(180deg, var(--accent), rgba(67, 231, 201, .22)); }
.chart-bar.err { background: linear-gradient(180deg, var(--bad), rgba(240, 114, 139, .25)); }
.chart-axis {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 7px; font-size: 11.5px; color: var(--muted-2);
}
.status-dist { display: flex; flex-direction: column; gap: 12px; }
.sd-row { display: flex; align-items: center; gap: 10px; }
.sd-key { width: 34px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--fg-2); }
.sd-key.warn { color: var(--warn); }
.sd-key.bad { color: var(--bad); }
.sd-key.muted { color: var(--muted); }
.sd-bar { flex: 1; }
.sd-val { min-width: 96px; text-align: right; font-size: 12px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--fg-2); }
th.sortable.on { color: var(--accent); }

/* ---------- 权限矩阵 ---------- */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.role-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.rc-desc { font-size: 12.5px; min-height: 18px; }
.rc-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.rc-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; }
.perm-table th { text-align: center; }
.perm-table th:first-child { text-align: left; }
.perm-table tr.perm-group td {
  background: rgba(255, 255, 255, .035); font-size: 12px; font-weight: 700;
  color: var(--fg-2); letter-spacing: .4px; padding: 8px 14px;
}
.perm-key-cell { min-width: 210px; }
.perm-key { font-size: 12.5px; color: #a9e9ff; }
.perm-desc { font-size: 11.5px; }
.perm-cell { text-align: center; }
.perm-yes { color: var(--ok); font-weight: 700; }
.perm-no { color: var(--muted-2); }
.role-pick-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; }
.role-pick, .perm-line {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 13px; padding: 9px 11px;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel-soft);
}
.role-pick input, .perm-line input { margin-top: 3px; accent-color: var(--accent); }
.perm-group-box { margin-bottom: 12px; }
.pg-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .5px; margin-bottom: 6px; }

/* ---------- 站点托管 ---------- */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.site-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; }
.sc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14.5px; }
.sc-url { display: flex; align-items: center; gap: 10px; }
.site-kv { grid-template-columns: 72px 1fr; }
.sc-desc { font-size: 12.5px; }
.sc-foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ---------- 设置中心：主题 / 色板 ---------- */
.acc-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   v26.0.0 —— 移动端适配（≤768px）：顶栏紧凑 / 表格改卡片
   注：侧栏抽屉与遮罩已随「侧栏改顶栏」整体移除；顶栏分组条在 920px 断点已转为横向滚动。
   ============================================================ */
@media (max-width: 768px) {
  /* 顶栏折叠：搜索框与皮肤 / 模式按钮收起，保留主题与通知 */
  .topbar { gap: 10px; padding: 10px 14px; }
  .topbar .gsearch { display: none; }
  .theme-btns { margin-right: 4px; }
  .theme-btns .btn:nth-child(2), .theme-btns .btn:nth-child(3) { display: none; }
  .main { padding: 16px 14px; }

  /* 表格 → 卡片（td 有 data-th 时显示字段名，没有则仅堆叠，不影响可读性） */
  .tbl-wrap { overflow-x: visible; }
  table.tbl { display: block; }
  table.tbl thead { display: none; }
  table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr {
    border: 1px solid var(--line-soft); border-radius: 12px;
    background: var(--panel-soft); padding: 10px 12px; margin-bottom: 10px;
  }
  table.tbl tbody tr:hover { background: var(--panel-soft); }
  table.tbl td {
    border: none; padding: 4px 0;
    display: flex; gap: 10px; justify-content: space-between; align-items: baseline;
  }
  table.tbl td::before {
    content: attr(data-th); flex: 0 0 auto;
    color: var(--muted); font-size: 12px;
  }
  table.tbl td:last-child { border-bottom: none; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .perm-table tr.perm-group td { display: block; }
  .perm-table td.perm-cell { display: inline-flex; justify-content: flex-start; }

  /* 栅格收敛 */
  .grid.cols-3, .grid.cols-2, .cols-2.wide { grid-template-columns: 1fr; }
  .grid.cols-4, .grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: 12px; }
  .role-grid, .site-grid, .coll-grid, .media-grid { grid-template-columns: 1fr; }
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-chart { height: 118px; }
  .kv-grid { grid-template-columns: 92px 1fr; }
}

/* ── v13.0.0：可视化自动化编排 ─────────────────────────────── */
.wf-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.wf-col { display: flex; flex-direction: column; gap: 12px; }
.wf-side { display: flex; flex-direction: column; gap: 14px; }
.wf-card .wf-top { display: flex; align-items: center; gap: 10px; }
.wf-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.wf-ops { display: flex; gap: 8px; margin-top: 12px; }
.wf-run { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.wf-run:last-child { border-bottom: none; }
.form-stack label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.form-stack .u { background: var(--surface); border: 1px solid var(--hairline); color: var(--fg); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.form-stack .u.ta { font-family: var(--mono); font-size: 12px; resize: vertical; line-height: 1.5; }
.form-stack .chk { flex-direction: row; align-items: center; gap: 7px; color: var(--fg); }
@media (max-width: 980px) {
  .wf-layout { grid-template-columns: 1fr; }
}

