/* ============================================================
   狸花云 · 控制台设计系统（蓝白猫系 / 深色双主题）
   ============================================================ */
:root {
  --blue: hsl(210 92% 52%);
  --blue-2: hsl(232 80% 62%);
  --cyan: hsl(190 90% 45%);
  --blue-soft: hsl(204 94% 90%);
  --ink: hsl(222 47% 15%);
  --ink-2: hsl(215 25% 38%);
  --ink-3: hsl(216 15% 52%);
  --line: hsl(214 32% 84%);
  --card: hsl(0 0% 100% / .74);
  --card-solid: hsl(0 0% 100% / .92);
  --card-line: hsl(0 0% 100% / .65);
  --danger: hsl(0 84% 58%);
  --ok: hsl(160 84% 35%);
  --warn: hsl(38 95% 45%);
  --shadow: 0 8px 32px hsl(210 80% 40% / .10);
  --shadow-lg: 0 16px 48px hsl(210 80% 40% / .16);
  --page-grad: linear-gradient(160deg, hsl(204 100% 94%) 0%, hsl(225 90% 96%) 45%, hsl(210 60% 92%) 100%);
  --veil: hsl(204 100% 98% / var(--veil-op, .55));
  --code-bg: hsl(222 47% 12% / .92);
  --grad-text: linear-gradient(120deg, var(--blue), var(--blue-2), var(--cyan));

  /* ★ 兼容别名（历史遗留）：代码里用的是 --fg-* / --brand / --border */
  --fg-1: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --brand: var(--blue);
  --brand-2: var(--blue-2);
  --border: var(--line);
  --bg-secondary: hsl(210 40% 97%);
  --nav-bg: hsl(0 0% 100% / .86);
  --bg-blur: 14px;
  --bg-bright: 1;
  --veil-op: .28;
  --ok: hsl(152 60% 40%);
  --warn: hsl(38 92% 50%);
  --danger: hsl(0 72% 55%);
}
html.dark {
  --ink: hsl(210 40% 95%);
  --ink-2: hsl(214 30% 78%);
  --ink-3: hsl(215 20% 62%);
  --line: hsl(217 30% 28%);
  --card: hsl(222 40% 12% / .66);
  --card-solid: hsl(222 42% 13% / .92);
  --card-line: hsl(210 40% 45% / .28);
  --shadow: 0 8px 32px hsl(222 47% 5% / .4);
  --shadow-lg: 0 16px 48px hsl(222 47% 4% / .5);
  --page-grad: linear-gradient(160deg, hsl(222 50% 10%) 0%, hsl(230 45% 14%) 50%, hsl(215 50% 9%) 100%);
  --veil: hsl(222 50% 8% / var(--veil-op, .65));
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--page-grad) fixed;
  -webkit-font-smoothing: antialiased; font-size: 14px;
}
::selection { background: var(--blue-soft); color: var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: hsl(210 60% 78% / .7); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--blue); text-decoration: none; }

#bg { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center;
  filter: blur(var(--bg-blur, 0px)) brightness(var(--bg-bright, 1)); transition: filter .3s; }
#bg::after { content: ""; position: absolute; inset: 0; background: var(--veil); transition: background .3s; }

/* ---------- 组件库 ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-line); border-radius: 16px;
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  box-shadow: var(--shadow); padding: 22px; transition: box-shadow .25s, transform .25s;
}
.card.hoverable:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px;
  border-radius: 10px; border: none; font-size: 14px; cursor: pointer; transition: all .18s; font-family: inherit;
}
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 4px 14px hsl(210 92% 52% / .35); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 20px hsl(210 92% 52% / .45); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-ghost { background: hsl(210 40% 94% / .7); color: var(--ink-2); border: 1px solid var(--line); }
html.dark .btn-ghost { background: hsl(217 30% 20% / .6); }
.btn-ghost:hover { background: var(--blue-soft); color: hsl(210 85% 35%); }
.btn-danger { background: hsl(0 84% 60% / .12); color: var(--danger); border: 1px solid hsl(0 84% 60% / .35); }
.btn-danger:hover { background: hsl(0 84% 60% / .22); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: hsl(0 0% 100% / .55); color: var(--ink); font-size: 14px; font-family: inherit;
  outline: none; transition: border .18s, box-shadow .18s;
}
html.dark .input { background: hsl(222 40% 16% / .55); }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px hsl(210 92% 52% / .15); }
.label { display: block; font-size: 13px; color: var(--ink-2); margin: 14px 0 6px; }
.label:first-child { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.badge-ok { background: hsl(160 84% 35% / .12); color: var(--ok); }
.badge-off { background: hsl(216 15% 52% / .15); color: var(--ink-3); }
.badge-role { background: hsl(210 92% 52% / .12); color: var(--blue); }
.badge-warn { background: hsl(38 95% 45% / .12); color: var(--warn); }
.section-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.section-desc { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 7px 16px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-2); border: 1px solid transparent; transition: all .15s; }
.tab:hover { background: hsl(210 40% 92% / .5); }
.tab.active { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 3px 10px hsl(210 92% 52% / .3); }

/* ---------- 登录页（官网 Hero 风） ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; pointer-events: none; animation: float 12s ease-in-out infinite; }
.orb-1 { width: 420px; height: 420px; background: hsl(210 92% 65% / .6); top: -120px; left: -100px; }
.orb-2 { width: 360px; height: 360px; background: hsl(232 80% 70% / .5); bottom: -100px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 240px; height: 240px; background: hsl(190 90% 60% / .4); top: 40%; right: 12%; animation-delay: -8s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -26px) scale(1.06); } }
.login-card { width: 100%; max-width: 420px; text-align: center; position: relative; z-index: 1; padding: 36px 30px; }
.login-logo { font-size: 52px; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; display: inline-block; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-brand { font-size: 26px; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: 1px; }
.login-sub { font-size: 13px; color: var(--ink-3); margin: 10px 0 26px; line-height: 1.7; }
.login-card .input { padding: 12px 14px; }
.login-feats { display: flex; justify-content: center; gap: 18px; margin-top: 24px; font-size: 12px; color: var(--ink-3); }
.login-feats span::before { content: "✦ "; color: var(--blue); }
.login-foot { margin-top: 26px; font-size: 11.5px; color: var(--ink-3); opacity: .8; }

/* ---------- 控制台框架 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; flex-shrink: 0; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border-right: 1px solid var(--card-line);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  position: sticky; top: 0; height: 100vh; z-index: 20; transition: transform .25s;
}
.brand { padding: 4px 10px 18px; }
.brand-name { font-size: 16.5px; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.nav-group { font-size: 11.5px; color: var(--ink-3); padding: 14px 10px 6px; letter-spacing: 1px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 11px;
  color: var(--ink-2); font-size: 15px; font-weight: 500; cursor: pointer;
  transition: color .18s, background .18s; user-select: none;
  position: relative; z-index: 1; margin-bottom: 2px;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}

/* ===== 点击水波纹（Material Ripple） ===== */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  transform: scale(0); opacity: .55;
  animation: lihuaRipple .62s cubic-bezier(.22,.61,.36,1) forwards;
  background: currentColor;
}
.nav-item .ripple { background: hsl(210 92% 52% / .35); }
.nav-item.ind-on .ripple { background: rgba(255,255,255,.55); }
@keyframes lihuaRipple {
  0%   { transform: scale(0);   opacity: .55; }
  100% { transform: scale(2.6); opacity: 0; }
}
/* 其他按钮也给水波纹 */
.btn { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.btn .ripple { background: rgba(255,255,255,.5); }
.btn-ghost .ripple, .btn-sm .ripple { background: hsl(210 92% 52% / .25); }
.nav-item:hover { background: hsl(210 40% 92% / .6); color: var(--ink); }
html.dark .nav-item:hover { background: hsl(217 30% 22% / .6); }
/* active 本身不改颜色（防止指示器滞后时出现"白字看不见"） */
.nav-item.active { color: var(--ink-2); background: transparent; }
/* 只有真正被蓝色指示器覆盖的那一项才是白字 */
.nav-item.ind-on { color: #fff !important; }
.nav-indicator {
  position: absolute; left: 0; top: 0; width: 0; height: 0; border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 2px 8px hsl(210 92% 52% / .26);
  transition: transform .32s cubic-bezier(.4,0,.2,1), height .18s ease;
  pointer-events: none; z-index: 0; opacity: 0;
}
.nav-indicator.ready { opacity: 1; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-2)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; flex-shrink: 0; }
.main { flex: 1; padding: 26px 30px 70px; max-width: 1220px; min-width: 0; }
.page-head { margin-bottom: 22px; }
.page-title { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.page-sub { font-size: 13px; color: var(--ink-3); margin-top: 5px; }

/* 仪表盘 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; }
.stat .s-icon { position: absolute; right: 14px; top: 14px; font-size: 26px; opacity: .3; }
.stat-num { font-size: 30px; font-weight: 800; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.chart-tip { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid hsl(214 32% 88% / .5); font-size: 13.5px; }
html.dark .feed-item { border-bottom-color: hsl(217 30% 22% / .5); }
.feed-item:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-2)); flex-shrink: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.quick-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border-radius: 12px;
  border: 1px solid var(--line); background: hsl(0 0% 100% / .4); cursor: pointer; transition: all .18s; font-size: 13px; color: var(--ink-2); }
html.dark .quick-btn { background: hsl(217 30% 18% / .4); }
.quick-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); }
.quick-btn .q-icon { font-size: 24px; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; padding: 10px 12px; color: var(--ink-3); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid hsl(214 32% 88% / .5); vertical-align: middle; }
html.dark .tbl td { border-bottom-color: hsl(217 30% 22% / .5); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: hsl(210 40% 94% / .35); }
html.dark .tbl tbody tr:hover td { background: hsl(217 30% 20% / .35); }
.code-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 8px; background: hsl(210 92% 52% / .1); color: var(--blue); font-size: 13px; cursor: pointer; white-space: nowrap; }
.code-pill:hover { background: hsl(210 92% 52% / .2); }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 7px; transition: background .15s; }
.icon-btn:hover { background: hsl(210 40% 90% / .6); }
html.dark .icon-btn:hover { background: hsl(217 30% 25% / .6); }

/* 最新代码 */
.latest-code {
  font-size: 26px; font-weight: 800; letter-spacing: 1px; text-align: center; padding: 30px 16px;
  border: 1.5px dashed hsl(210 92% 60% / .5); border-radius: 14px; word-break: break-all; cursor: pointer;
  background: hsl(210 92% 96% / .4); transition: all .18s;
  background-image: var(--grad-text); -webkit-background-clip: text; background-clip: text;
}
html.dark .latest-code { background-color: hsl(217 40% 18% / .4); }
.latest-code:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.latest-code .lc-text { color: transparent; }
.latest-empty { font-size: 14px; color: var(--ink-3); font-weight: 400; letter-spacing: 0; -webkit-text-fill-color: var(--ink-3); }

/* toast / 模态 */
#toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 20px; border-radius: 999px; background: hsl(222 40% 14% / .88); color: hsl(210 40% 95%);
  font-size: 13.5px; backdrop-filter: blur(10px); box-shadow: 0 6px 24px hsl(222 47% 8% / .3); animation: toast-in .25s ease; }
.toast.err { background: hsl(0 70% 42% / .92); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal-mask { position: fixed; inset: 0; background: hsl(222 47% 8% / .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 90; padding: 20px; animation: toast-in .2s ease; }
.modal { width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-x { background: none; border: none; font-size: 19px; color: var(--ink-3); cursor: pointer; }

/* 背景设置 */
.bg-preview { height: 110px; border-radius: 12px; border: 1px solid var(--line); background-size: cover; background-position: center; position: relative; overflow: hidden; margin-bottom: 14px; }
.bg-preview::after { content: ""; position: absolute; inset: 0; background: var(--veil); }
.slider-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.slider-row .s-label { width: 70px; font-size: 13px; color: var(--ink-2); flex-shrink: 0; }
.slider-row .s-val { width: 46px; text-align: right; font-size: 12.5px; color: var(--ink-3); flex-shrink: 0; }
input[type="range"] { flex: 1; accent-color: var(--blue); height: 4px; }
.file-drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 20px; text-align: center; color: var(--ink-3); font-size: 13px; cursor: pointer; transition: all .18s; }
.file-drop:hover, .file-drop.drag { border-color: var(--blue); color: var(--blue); background: hsl(210 92% 52% / .05); }

/* 文档页 */
.doc h3 { font-size: 15.5px; margin: 20px 0 8px; display: flex; align-items: center; gap: 7px; }
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 13.5px; color: var(--ink-2); line-height: 1.9; }
.doc ul { padding-left: 20px; }
.code-block { background: var(--code-bg); color: hsl(210 40% 92%); border-radius: 12px; padding: 15px 17px;
  font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.8; overflow-x: auto; margin: 10px 0; position: relative; white-space: pre; }
.code-block .cmt { color: hsl(215 20% 55%); }
.code-block .str { color: hsl(160 84% 60%); }
.code-copy { position: absolute; top: 8px; right: 8px; }

.paw-mark { position: fixed; right: 18px; bottom: 14px; font-size: 30px; opacity: .16; pointer-events: none; transform: rotate(-15deg); z-index: 1; }
.topbar { display: none; }

/* 骨架与动效 */
.fade-in { animation: fade-in .35s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
 * 移动端：抽屉式侧栏 + 顶部汉堡栏
 * ============================================================ */

/* 顶部移动栏（默认隐藏，≤860px 显示） */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 150;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--nav-bg, rgba(255,255,255,.86));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
/* 汉堡按钮：品牌色实心 + 白线 + 发光（显眼） */
.mb-burger {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4.5px;
  width: 42px; height: 42px; padding: 0;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #4d6bfe 0%, #3f85ff 55%, #64b4ff 100%);
  box-shadow: 0 3px 12px rgba(77,107,254,.38), inset 0 1px 0 rgba(255,255,255,.22);
  cursor: pointer; flex-shrink: 0;
  transition: transform .18s, box-shadow .18s;
  -webkit-tap-highlight-color: transparent;
}
.mb-burger:active { transform: scale(.93); }
.mb-burger:hover { box-shadow: 0 5px 18px rgba(77,107,254,.5), inset 0 1px 0 rgba(255,255,255,.22); }
.mb-burger span {
  display: block;
  width: 19px; height: 2.5px; border-radius: 2px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: transform .26s cubic-bezier(.4,0,.2,1), opacity .2s, width .26s;
}

/* 展开时变 X */
.sidebar.open ~ .mobile-bar .mb-burger span:nth-child(1),
body.drawer-open .mb-burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.sidebar.open ~ .mobile-bar .mb-burger span:nth-child(2),
body.drawer-open .mb-burger span:nth-child(2) { opacity: 0; width: 0; }
.sidebar.open ~ .mobile-bar .mb-burger span:nth-child(3),
body.drawer-open .mb-burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* 移动栏整体也提亮一点 */
@media (max-width: 860px) {
  .mobile-bar {
    background: rgba(255,255,255,.92);
    box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(20,34,60,.05);
  }
  html.dark .mobile-bar { background: rgba(18,24,34,.9); }
  .mb-brand { font-size: 15.5px; letter-spacing: -.015em; }
  .mb-user {
    padding: 4px 10px; border-radius: 99px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    font-size: 12px; font-weight: 600; color: var(--fg-2);
  }
}
.mb-brand {
  display: flex; align-items: center; gap: 7px;
  font-size: 15px; font-weight: 800; color: var(--fg-1);
  letter-spacing: -.01em;
}
.mb-user {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--fg-3);
}

/* 遮罩 */
.sidebar-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 12, 22, .42);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  transition: opacity .24s;
}
.sidebar-mask.on { display: block; opacity: 1; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }

  .mobile-bar { display: flex; }
  body { padding-top: 56px; }

  /* 侧栏变抽屉（外层不滚，导航区滚动，底部固定） */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;            /* ← 用 top+bottom 定义高度，不写 height */
    right: auto;
    width: 280px;
    max-width: 84vw;
    /* 不要 height:100vh/100dvh —— 会和 bottom:0 冲突导致底部溢出 */
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 8px 0 32px rgba(10,16,30,.2);
    border-right: 1px solid var(--border);
    overflow: hidden;
    background: var(--card);
    box-sizing: border-box;
  }
  .sidebar.open { transform: translateX(0); }

  /* 品牌区固定 */
  .sidebar .brand {
    flex-shrink: 0;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    width: auto;
  }

  /* 导航区：唯一滚动区域 */
  .sidebar-nav {
    flex: 1 1 0%;         /* ← 关键：basis 0，强制参与收缩 */
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 8px 4px;
    position: relative;
  }

  /* 底部：固定在抽屉最下方，永不滚走 */
  .sidebar .sidebar-foot {
    flex: 0 0 auto;       /* ← 不参与伸缩，永远保留空间 */
    margin-top: 0;
    flex-direction: column;
    width: auto;
    border-top: 1px solid var(--border);
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    gap: 8px;
    box-sizing: border-box;
  }
  .sidebar .user-chip { font-size: 12.5px; padding: 8px 10px; }
  .sidebar .sidebar-foot .btn { font-size: 13px; padding: 9px 10px; }

  .brand { padding: 4px 10px 14px; width: auto; }
  .nav-group { display: block; }
  .nav-group-toggle { display: flex !important; }
  .nav-item { padding: 11px 12px; font-size: 14.5px; }

  .main { padding: 16px 14px 70px; width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .latest-code { font-size: 20px; }

  /* 移动端卡片更紧凑 */
  .card { padding: 16px; border-radius: 14px; }
  .page-title { font-size: 19px; }
  .page-head { margin-bottom: 16px; }
  .stat-row { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-num { font-size: 22px; }
  .btn { padding: 9px 14px; font-size: 13.5px; }
  .input { font-size: 15px; }   /* 防 iOS 自动放大 */
}

@media (max-width: 480px) {
  .main { padding: 12px 10px 66px; }
  .card { padding: 13px; }
  .page-title { font-size: 17px; }
}

/* ===== 侧栏分组折叠按钮（明显可点） ===== */
.nav-group-toggle {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 6px 7px; padding: 7px 10px;
  border-radius: 9px; cursor: pointer; user-select: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--ink-3); text-transform: uppercase;
  border: 1px dashed transparent;
  transition: background .16s, color .16s, border-color .16s;
}
.nav-group-toggle:hover {
  background: hsl(210 92% 52% / .09);
  color: var(--blue);
  border-color: hsl(210 92% 52% / .28);
}
.nav-group-toggle:hover .ng-hint::after { content: '点击切换'; margin-left: 4px; opacity: .8; }
.ng-arrow {
  font-size: 11px; line-height: 1; transition: transform .22s ease;
  display: inline-block; width: 12px; text-align: center;
}
.ng-arrow.folded { transform: rotate(-90deg); }
.ng-name { flex: 0 0 auto; }
.ng-count {
  font-size: 10px; font-weight: 700; min-width: 16px; text-align: center;
  padding: 1px 5px; border-radius: 99px;
  background: hsl(210 20% 88% / .9); color: var(--ink-3);
}
html.dark .ng-count { background: hsl(217 30% 26%); }
.nav-group-toggle:hover .ng-count { background: var(--blue); color: #fff; }
.ng-hint { margin-left: auto; font-size: 10px; font-weight: 500; opacity: .75; letter-spacing: 0; text-transform: none; }
/* 折起后整块变淡蓝，视觉上"收起来了" */
.nav-group-toggle:has(.ng-arrow.folded) { background: hsl(210 20% 96% / .7); }
html.dark .nav-group-toggle:has(.ng-arrow.folded) { background: hsl(217 30% 18% / .6); }

/* ============================================================
 * 登录 / 注册：左视觉 + 右表单（潮流双栏）
 * ============================================================ */
.auth-split {
  display: grid;
  grid-template-columns: 60% 40%;
  min-height: 100vh;
  min-height: 100dvh;   /* 移动端：不含地址栏的动态高度 */
  width: 100%;
  height: 100%;
}

/* ---------- 左侧视觉区 ---------- */
.auth-visual {
  position: relative;
  overflow: hidden;
  /* 原图直接铺底（白底 JPG + 遮罩融合） */
  background-image: url('/console/assets/mascot-official.jpg') !important;
  background-size: cover !important;
  background-position: center 8% !important;   /* 宽屏下偏上，显示头部 */
  background-repeat: no-repeat !important;
  background-color: #f4f8ff !important;
  display: flex;
  align-items: center;
  padding: 64px 72px;
  color: #fff;
}
/* 浅色遮罩：左侧实、右侧透，文字清晰、立绘可见 */
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(246, 250, 255, .84) 0%,     /* 左侧 .96 → .84 */
    rgba(244, 249, 255, .78) 34%,    /* 文字区保持够白 */
    rgba(242, 248, 255, .34) 50%,    /* 快速淡出 .54 → .34 */
    rgba(240, 247, 255, .08) 68%,    /* 立绘区几乎全透 */
    rgba(240, 247, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
}
.av-inner { z-index: 2; }

/* 网格纹理 */
.av-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(77,107,254,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77,107,254,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 30%, transparent 78%);
  pointer-events: none;
  z-index: 1;
}

/* 光球 */
.av-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  pointer-events: none;
  opacity: .22;   /* 浅色背景上更含蓄 */
  z-index: 1;
}
.av-orb-1 { width: 420px; height: 420px; background: #6b8cff; top: -90px; left: -70px; animation: avFloat 18s ease-in-out infinite; }
.av-orb-2 { width: 340px; height: 340px; background: #a78bfa; bottom: -80px; left: 38%; animation: avFloat 22s ease-in-out infinite reverse; }
.av-orb-3 { width: 260px; height: 260px; background: #7dd3fc; top: 46%; right: -60px; animation: avFloat 26s ease-in-out infinite; }
@keyframes avFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(24px,-28px) scale(1.08); }
}

.av-inner { position: relative; z-index: 2; max-width: 54%; }

.av-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 700; letter-spacing: .12em;
  color: #5a6b8a; margin-bottom: 40px;
}
.av-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(135deg,#64b4ff,#4d6bfe);
  box-shadow: 0 0 14px rgba(100,180,255,.85);
}

.av-title {
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 800; line-height: 1.22;
  letter-spacing: -.02em; margin: 0 0 22px;
  color: #14203a;
}
.av-title em {
  font-style: normal;
  background: linear-gradient(100deg,#8ec5ff,#4d6bfe 45%,#a78bfa);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.av-sub {
  font-size: 15px; line-height: 1.9;
  color: #5a6b8a; margin: 0 0 34px;
}

.av-feats { list-style: none; padding: 0; margin: 0 0 42px; display: flex; flex-direction: column; gap: 13px; }
.av-feats li {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; color: #3d4d68;
}
.av-ck {
  display: inline-flex; align-items: center; justify-content: center;
  width: 19px; height: 19px; border-radius: 50%;
  background: rgba(77,107,254,.14); color: #4d6bfe;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}

.av-stats { display: flex; gap: 38px; padding-top: 30px; border-top: 1px solid rgba(77,107,254,.14); }
.av-stats > div { display: flex; flex-direction: column; gap: 4px; }
.av-stats b { font-size: 26px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(120deg,#3f6cff,#8b6cff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.av-stats span { font-size: 11.5px; color: #7a8aa5; letter-spacing: .04em; }

.av-foot { margin-top: 46px; font-size: 12px; color: #9aa8bd; letter-spacing: .06em; }

/* ---------- 右侧表单区 ---------- */
.auth-form-side {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: #ffffff;              /* ← 明确纯白，不依赖未定义变量 */
  position: relative;
  z-index: 2;                        /* 盖住任何底层背景 */
}
.af-box { width: 100%; max-width: 360px; }

.af-head { margin-bottom: 32px; }
.af-logo { font-size: 34px; line-height: 1; margin-bottom: 14px; }
.af-head h2 { font-size: 26px; font-weight: 800; margin: 0 0 7px; letter-spacing: -.02em; color: var(--fg-1); }
.af-head p { font-size: 13.5px; color: var(--fg-3); margin: 0; }

.af-alt { margin-top: 22px; font-size: 13.5px; color: var(--fg-3); text-align: center; }
.af-alt a { color: var(--brand); font-weight: 700; text-decoration: none; }
.af-alt a:hover { text-decoration: underline; }

.af-badges {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border);
}
.af-badges span {
  font-size: 11px; color: var(--fg-3);
  padding: 4px 10px; border-radius: 99px;
  background: var(--bg-secondary); border: 1px solid var(--border);
}

/* ---------- 响应式 ---------- */
/* ---- 始终保持左右分栏，只调整比例与密度 ---- */
@media (max-width: 1200px) {
  .auth-split { grid-template-columns: 56% 44%; }
  .av-inner { max-width: 100%; }
  .auth-visual { padding: 52px 44px; }
  .av-title { font-size: 38px; }
}
@media (max-width: 980px) {
  .auth-split { grid-template-columns: 55% 45%; }
  .av-inner { max-width: 100%; }
  .auth-visual { padding: 40px 30px; }
  .av-title { font-size: 30px; margin-bottom: 14px; }
  .av-sub { font-size: 13px; margin-bottom: 22px; }
  .av-feats { gap: 9px; margin-bottom: 26px; }
  .av-feats li { font-size: 12.5px; }
  .av-stats { gap: 20px; padding-top: 20px; }
  .av-stats b { font-size: 20px; }
  .av-brand { margin-bottom: 26px; font-size: 12.5px; }
  .av-foot { margin-top: 28px; font-size: 11px; }
  .auth-form-side {
    padding: 32px 26px;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .af-box { max-width: 100%; }
  .af-head h2 { font-size: 22px; }
}
@media (max-width: 760px) {
  .auth-split { grid-template-columns: 50% 50%; }
  .av-title br { display: none; }
  .av-inner { max-width: 100%; }
  .auth-visual { padding: 26px 18px; }
  .av-title { font-size: 21px; line-height: 1.3; margin-bottom: 10px; }
  .av-sub { font-size: 11.5px; line-height: 1.7; margin-bottom: 16px; }
  .av-feats { display: none; }
  .av-stats { gap: 12px; padding-top: 14px; flex-wrap: wrap; }
  .av-stats b { font-size: 16px; }
  .av-stats span { font-size: 9.5px; }
  .av-brand { margin-bottom: 18px; font-size: 11px; letter-spacing: .06em; }
  .av-dot { width: 6px; height: 6px; }
  .av-foot { display: none; }
  .av-orb-1 { width: 200px; height: 200px; }
  .av-orb-2, .av-orb-3 { display: none; }
  .auth-form-side { padding: 24px 18px; }
  .af-logo { font-size: 26px; margin-bottom: 10px; }
  .af-head h2 { font-size: 19px; }
  .af-head p { font-size: 12px; }
  .af-head { margin-bottom: 22px; }
  .af-badges { margin-top: 22px; padding-top: 16px; gap: 6px; }
  .af-badges span { font-size: 10px; padding: 3px 8px; }
  .input { font-size: 14px; padding: 9px 11px; }
  .af-alt { font-size: 12.5px; margin-top: 16px; }
}
@media (max-width: 480px) {
  .auth-split { grid-template-columns: 46% 54%; min-height: 100dvh; }
  .av-inner { max-width: 100%; }
  .auth-visual { padding: 20px 12px; }
  .av-title { font-size: 17px; }
  .av-sub { font-size: 10.5px; margin-bottom: 12px; }
  .av-stats { display: none; }
  .av-brand { font-size: 10px; margin-bottom: 14px; }
  .auth-form-side { padding: 20px 14px; }
  .af-logo { font-size: 22px; }
  .af-head h2 { font-size: 17px; }
}

/* 深色模式微调 */
html.dark .auth-form-side { background: #0f141b; }

/* 登录 / 注册页：去掉为顶部栏预留的 body padding */
body.auth-mode {
  padding-top: 0 !important;
  overflow-x: hidden;
}
body.auth-mode .mobile-bar,
body.auth-mode .sidebar-mask { display: none !important; }

/* ===== 用户头像 + 下拉菜单（顶部栏） ===== */
.mb-user {
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  padding: 3px 4px 3px 12px !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 99px !important;
  cursor: pointer;
  transition: .16s;
  -webkit-tap-highlight-color: transparent;
}
.mb-user:active { transform: scale(.96); }
.mb-user:hover { border-color: var(--brand) !important; }

.mb-uname {
  font-size: 12.5px; font-weight: 700; color: var(--fg-2);
  max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mb-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d6bfe, #3f85ff);
  color: #fff; font-size: 14px; line-height: 1;
  overflow: hidden; flex-shrink: 0;
}
.mb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 下拉菜单 */
.mb-menu {
  position: fixed;
  top: 60px; right: 12px;
  width: 196px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(16,26,48,.16);
  padding: 6px;
  z-index: 160;
  opacity: 0;
  transform: translateY(-8px) scale(.97);
  pointer-events: none;
  transition: opacity .18s, transform .18s cubic-bezier(.4,0,.2,1);
}
.mb-menu.on { opacity: 1; transform: none; pointer-events: auto; }

.mb-menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.mb-menu-name { font-size: 13.5px; font-weight: 800; color: var(--fg-1); }
.mb-menu-role { font-size: 11.5px; color: var(--fg-3); margin-top: 2px; }

.mb-menu-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 10px 12px;
  border: none; background: none; border-radius: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--fg-2);
  text-align: left; cursor: pointer; transition: .14s;
}
.mb-menu-item:hover { background: var(--bg-secondary); color: var(--fg-1); }
.mb-menu-danger { color: var(--danger, #e5484d) !important; }
.mb-menu-danger:hover { background: rgba(229,72,77,.09) !important; }

/* 桌面端隐藏 */
@media (min-width: 861px) {
  .mb-menu { display: none; }
}

.sidebar .avatar {
  overflow: hidden;
  padding: 0;
}
.sidebar .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* 侧栏退出按钮：更明确 */
.sidebar .sidebar-foot .btn { justify-content: center; }
.sidebar .sidebar-foot #logout-btn {
  color: var(--danger, #e5484d) !important;
  border-color: rgba(229,72,77,.3) !important;
}
.sidebar .sidebar-foot #logout-btn:hover {
  background: rgba(229,72,77,.08) !important;
  border-color: var(--danger, #e5484d) !important;
}

/* ============================================================
 * 侧栏统一布局（桌面 + 移动共用一套 flex 规则）
 * 核心：品牌固定 / 导航滚动 / 底部固定
 * ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.sidebar > .brand {
  flex: 0 0 auto;
}
.sidebar > .sidebar-nav {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.sidebar > .sidebar-foot {
  flex: 0 0 auto;
  margin-top: 0;
}

/* ============================================================
 * 移动端抽屉：底部用绝对定位（最稳，不依赖 flex）
 * ============================================================ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 84vw !important;
    height: auto !important;        /* 强制清掉 height */
    padding: 0 !important;
    display: block !important;      /* 不用 flex，避免各种坑 */
    overflow: hidden !important;
    background: var(--card) !important;
  }

  .sidebar > .brand {
    position: absolute !important;
    top: 0; left: 0; right: 0;
    height: 76px;
    padding: 14px 16px !important;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .sidebar > .sidebar-nav {
    position: absolute !important;
    top: 76px;
    bottom: 112px;              /* 给底部留 112px */
    left: 0; right: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 8px 8px 4px !important;
  }

  .sidebar > .sidebar-foot {
    position: absolute !important;
    bottom: 0; left: 0; right: 0;
    height: 112px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--border) !important;
    background: var(--card) !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    z-index: 3;
    margin: 0 !important;
    box-sizing: border-box;
  }
  .sidebar > .sidebar-foot .user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: 10px;
    border: 1px solid var(--border); font-size: 12.5px;
  }
  .sidebar > .sidebar-foot .user-chip .avatar {
    width: 30px; height: 30px;
  }
  .sidebar > .sidebar-foot > div:last-child {
    display: flex; gap: 8px;
  }
  .sidebar > .sidebar-foot .btn {
    flex: 1; padding: 9px 8px; font-size: 13px;
  }
}

/* 深色模式：换成睡衣版 + 深色背景（夜晚感觉） */
html.dark .auth-visual {
  background-image: url('/console/assets/mascot-login.jpg') !important;
  background-size: cover !important;
  background-position: center 6% !important;
  background-repeat: no-repeat !important;
  background-color: #121a2e !important;
}
html.dark .auth-visual::after {
  background: linear-gradient(100deg,
    rgba(10, 16, 28, .9) 0%,
    rgba(12, 20, 36, .84) 34%,
    rgba(14, 24, 44, .62) 54%,
    rgba(16, 28, 50, .42) 74%,
    rgba(18, 30, 54, .3) 100%) !important;
  opacity: 1 !important;
}
html.dark .av-title { color: #eef4ff; }
html.dark .av-sub { color: #9aabc4; }
html.dark .av-brand { color: #8fa3c2; }
html.dark .av-feats li { color: #c5d4e8; }
html.dark .av-stats { border-top-color: rgba(255,255,255,.12); }
html.dark .av-stats span { color: #7d8fa8; }
html.dark .av-foot { color: #6b7d96; }
html.dark .av-orb { opacity: .34; }

/* ===== 登录/注册页：夜间模式切换按钮 ===== */
.auth-theme {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 60;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid rgba(77, 107, 254, .22);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(30, 50, 100, .14);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.auth-theme:hover {
  transform: scale(1.06) rotate(8deg);
  box-shadow: 0 6px 22px rgba(77, 107, 254, .28);
}
.auth-theme:active { transform: scale(.94); }

/* 深色模式下的按钮 */
html.dark .auth-theme {
  background: rgba(24, 32, 48, .82);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}

/* 小屏适配 */
@media (max-width: 760px) {
  .auth-theme {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
}

/* 深色模式：立绘柔光衬托（避免白衣服变成硬剪影） */
@media (prefers-color-scheme: dark) {}
/* 在立绘区域叠加一层淡蓝柔光 */
html.dark .auth-visual::before {
  content: '';
  position: absolute;
  right: 4%;
  bottom: 2%;
  width: 62%;
  height: 78%;
  background: radial-gradient(ellipse at 50% 60%,
    rgba(110, 150, 255, .16) 0%,
    rgba(90, 130, 240, .08) 40%,
    transparent 72%);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
}

/* 浅色模式也给一点柔和感 */
.auth-visual::before {
  content: '';
  position: absolute;
  right: 4%;
  bottom: 2%;
  width: 62%;
  height: 78%;
  background: radial-gradient(ellipse at 50% 60%,
    rgba(120, 160, 255, .12) 0%,
    transparent 70%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 1;
}

/* 薄遮罩下保证文字可读 */
.av-title {
  text-shadow: 0 1px 2px rgba(255, 255, 255, .9), 0 0 12px rgba(255, 255, 255, .7);
}
.av-sub, .av-feats li {
  text-shadow: 0 1px 2px rgba(255, 255, 255, .85);
}
.av-brand {
  text-shadow: 0 1px 2px rgba(255, 255, 255, .8);
}
html.dark .av-title {
  text-shadow: 0 1px 3px rgba(6, 10, 18, .95), 0 0 16px rgba(6, 10, 18, .8);
}
html.dark .av-sub, html.dark .av-feats li {
  text-shadow: 0 1px 2px rgba(6, 10, 18, .9);
}
html.dark .av-brand {
  text-shadow: 0 1px 2px rgba(6, 10, 18, .85);
}

/* ===== 立绘定位：按屏幕比例调整 ===== */
/* 宽屏（PC/横屏）：偏上，显示头部与上半身 */
@media (min-aspect-ratio: 1/1) {
  .auth-visual { background-position: center 8% !important; }
  html.dark .auth-visual { background-position: center 6% !important; }
}
/* 竖屏（手机）：偏下，显示全身 */
@media (max-aspect-ratio: 1/1) {
  .auth-visual { background-position: center 22% !important; }
  html.dark .auth-visual { background-position: center 20% !important; }
}

/* ★ 深色主题 */
[data-theme="dark"] {
  --ink: hsl(210 20% 92%);
  --ink-2: hsl(210 14% 72%);
  --ink-3: hsl(210 12% 56%);
  --line: hsl(215 20% 26%);
  --card: hsl(215 25% 14% / .86);
  --card-solid: hsl(215 25% 13% / .96);
  --card-line: hsl(215 20% 24%);
  --fg-1: hsl(210 20% 92%);
  --fg-2: hsl(210 14% 72%);
  --fg-3: hsl(210 12% 56%);
  --bg-secondary: hsl(215 25% 12%);
  --nav-bg: hsl(215 25% 12% / .9);
  --border: hsl(215 20% 26%);
}

/* ---------- 分组页 tab ---------- */
.lutabs {
  display: flex; gap: 4px; margin: 0 0 18px;
  border-bottom: 1px solid rgba(128, 128, 128, .22);
}
.lutab {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 9px 15px; font-size: 13.5px; cursor: pointer;
  color: #7d879b; border-radius: 7px 7px 0 0; transition: color .15s, background .15s;
}
.lutab:hover { color: #cfd7e6; background: rgba(128, 128, 128, .07); }
.lutab.on { color: #4c8dff; border-bottom-color: #4c8dff; font-weight: 600; }
.lutab-body { animation: lutabIn .18s ease-out; }
@keyframes lutabIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- 提高次要按钮对比度 ---------- */
.btn-ghost {
  background: hsl(210 40% 97%) !important;
  border: 1px solid hsl(215 20% 76%) !important;
  color: hsl(215 30% 24%) !important;
}
.btn-ghost:hover {
  background: hsl(210 85% 94%) !important;
  border-color: hsl(210 80% 62%) !important;
  color: hsl(210 85% 32%) !important;
}
html.dark .btn-ghost {
  background: hsl(217 28% 24%) !important;
  border-color: hsl(217 20% 40%) !important;
  color: hsl(210 30% 92%) !important;
}
html.dark .btn-ghost:hover {
  background: hsl(217 32% 30%) !important;
  border-color: hsl(210 80% 58%) !important;
  color: #fff !important;
}

/* ---------- 配置文件列表 ---------- */
.lu-file {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 12.5px; cursor: pointer;
  border-bottom: 1px solid rgba(128,128,128,.16);
  transition: background .12s;
}
.lu-file:last-child { border-bottom: none; }
.lu-file:hover { background: rgba(128,128,128,.08); }
.lu-file.on { background: rgba(76,141,255,.12); color: #4c8dff; }

/* ============================================================
   外壳 v2 —— 提对比度、去玻璃、统一层级
   ============================================================ */

/* 1. 背景：全屏图关掉，改固定纯渐变 */
#bg { display: none !important; }
body { background: hsl(214 28% 96%) !important; }
html.dark body { background: hsl(222 40% 10%) !important; }

/* 2. 卡片：实底 + 细边，玻璃效果去掉 */
:root {
  --card: #ffffff;
  --card-solid: #ffffff;
  --card-line: hsl(214 26% 90%);
  --line: hsl(214 26% 88%);
  --ink: hsl(222 47% 13%);
  --ink-2: hsl(215 24% 34%);
  --ink-3: hsl(216 16% 48%);
  --shadow: 0 1px 3px hsl(215 40% 25% / .06), 0 1px 2px hsl(215 40% 25% / .04);
  --shadow-lg: 0 8px 24px hsl(215 40% 25% / .10);
}
html.dark {
  --card: hsl(222 38% 14%);
  --card-solid: hsl(222 38% 14%);
  --card-line: hsl(217 26% 24%);
  --line: hsl(217 26% 25%);
  --ink: hsl(210 38% 96%);
  --ink-2: hsl(214 24% 76%);
  --ink-3: hsl(215 16% 60%);
  --shadow: 0 1px 3px hsl(0 0% 0% / .28);
  --shadow-lg: 0 10px 28px hsl(0 0% 0% / .38);
}
.card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 12px !important;
  padding: 20px !important;
}

/* 3. 侧栏：实底，去掉毛玻璃 */
.sidebar {
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-right: 1px solid var(--line) !important;
}
html.dark .sidebar { background: hsl(222 40% 12%) !important; }

/* 4. 按钮：次要按钮实底可读 */
.btn { border-radius: 9px !important; font-weight: 500; }
.btn-ghost {
  background: hsl(214 30% 96%) !important;
  border: 1px solid hsl(214 24% 82%) !important;
  color: hsl(215 32% 26%) !important;
}
.btn-ghost:hover {
  background: hsl(212 90% 95%) !important;
  border-color: hsl(212 88% 62%) !important;
  color: hsl(212 88% 34%) !important;
}
html.dark .btn-ghost {
  background: hsl(217 26% 22%) !important;
  border-color: hsl(217 22% 34%) !important;
  color: hsl(210 30% 92%) !important;
}
html.dark .btn-ghost:hover {
  background: hsl(217 30% 28%) !important;
  border-color: hsl(212 82% 60%) !important;
  color: #fff !important;
}

/* 5. 表头 / 分隔线统一 */
table.tbl thead th {
  background: hsl(214 30% 96%);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 12.5px;
}
html.dark table.tbl thead th { background: hsl(222 34% 17%); }

/* 6. 字号统一三档 */
body { font-size: 14px; }
.card, .tbl, .input, .btn { font-size: 13.5px; }
.stat-label, .feat-desc, .section-sub { font-size: 12.5px; }
h1 { font-size: 26px !important; }
