/* =========================================================================
   YU 卡密管理面板 · 样式
   主题：深色透明玻璃（默认）/ 浅色玻璃（[data-theme=light]）
   动效开关：html.rm 或 html.reduce-motion 或 prefers-reduced-motion
   约定给 app.js 使用的动态 class（fx.js 也会用到）：
     .enter(+ --i)  错开入场      .is-on / .is-active  选中
     .is-selected   表格选中行     .row-new  新插入行高亮
     .skeleton/.sk  骨架屏         .error-card / .empty-state
     .toast-*       toast          .is-loading/.is-success/.is-error 按钮状态
     .drawer-open   (html) 手机抽屉打开   .sb-collapsed (html) 侧边栏折叠
   ========================================================================= */

/* ---------- 变量 ---------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07060b;
  --bg-2: #0d0b16;
  --bg-3: #141022;
  --text: rgba(246, 244, 255, .93);
  --text-2: rgba(226, 222, 245, .72);
  --muted: rgba(210, 204, 235, .5);
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .085);
  --glass-3: rgba(255, 255, 255, .12);
  --glass-solid: rgba(16, 13, 26, .72);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --line-hi: rgba(255, 255, 255, .26);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .12);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .75), 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 4px 18px rgba(0, 0, 0, .4);
  --white-glow: rgba(236, 236, 255, .55);
  --pink: #ff5fa2;
  --pink-2: #ff8cc0;
  --pink-glow: rgba(255, 95, 162, .42);
  --pink-soft: rgba(255, 95, 162, .14);
  --violet: #9c8cff;
  --ok: #62f0b8;
  --ok-glow: rgba(98, 240, 184, .4);
  --err: #ff6b8e;
  --err-glow: rgba(255, 107, 142, .42);
  --warn: #ffc66e;
  --info: #a9bfff;
  --info-glow: rgba(169, 191, 255, .38);
  --input-bg: rgba(255, 255, 255, .04);
  --sheen: rgba(255, 255, 255, .09);
  --spot: rgba(255, 255, 255, .085);
  --scrim: rgba(4, 3, 8, .55);
  --sk-a: rgba(255, 255, 255, .05);
  --sk-b: rgba(255, 255, 255, .11);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --sbw: 248px;
  --sbw-c: 78px;
  --topbar-h: 66px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --blur: blur(22px) saturate(140%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0f8;
  --bg-2: #e9e6f3;
  --bg-3: #ffffff;
  --text: #1c1828;
  --text-2: rgba(28, 24, 40, .74);
  --muted: rgba(40, 34, 60, .5);
  --glass: rgba(255, 255, 255, .5);
  --glass-2: rgba(255, 255, 255, .66);
  --glass-3: rgba(255, 255, 255, .82);
  --glass-solid: rgba(250, 249, 255, .78);
  --line: rgba(40, 24, 80, .09);
  --line-2: rgba(40, 24, 80, .14);
  --line-hi: rgba(255, 255, 255, .95);
  --inset: inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow: 0 18px 44px -20px rgba(60, 40, 110, .28), 0 2px 8px rgba(60, 40, 110, .07);
  --shadow-lg: 0 40px 80px -30px rgba(60, 40, 110, .38), 0 4px 16px rgba(60, 40, 110, .1);
  --white-glow: rgba(140, 120, 220, .35);
  --pink: #f0438c;
  --pink-2: #ff6fa8;
  --pink-glow: rgba(240, 67, 140, .3);
  --pink-soft: rgba(240, 67, 140, .1);
  --violet: #6f5cf0;
  --ok: #10b77f;
  --ok-glow: rgba(16, 183, 127, .28);
  --err: #e5386a;
  --err-glow: rgba(229, 56, 106, .28);
  --warn: #d98a12;
  --info: #4d6ee8;
  --info-glow: rgba(77, 110, 232, .25);
  --input-bg: rgba(255, 255, 255, .6);
  --sheen: rgba(255, 255, 255, .55);
  --spot: rgba(255, 255, 255, .7);
  --scrim: rgba(60, 50, 90, .25);
  --sk-a: rgba(40, 24, 80, .05);
  --sk-b: rgba(40, 24, 80, .1);
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .5s var(--ease), color .4s var(--ease);
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 600; }
a { color: var(--pink-2); }
::selection { background: var(--pink-soft); color: var(--text); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic-xs { width: 14px; height: 14px; }
.mono, code, kbd { font-family: var(--mono); }
.num, .kpi-value, .table td, .pager, .pop-count, .nav-badge { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-size: 13px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--glass-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 背景 ---------- */
.bg-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  filter: blur(36px) saturate(120%); transform: scale(1.08); opacity: .95;
  transition: opacity .6s var(--ease);
}
[data-theme="light"] .bg-canvas { opacity: .7; }
body::before { /* canvas 未就绪 / 减少动效时的静态光斑 */
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40vw 40vw at 15% 20%, rgba(156, 140, 255, .14), transparent 70%),
    radial-gradient(35vw 35vw at 85% 75%, rgba(255, 95, 162, .08), transparent 70%),
    radial-gradient(45vw 45vw at 60% 10%, rgba(255, 255, 255, .05), transparent 70%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(40vw 40vw at 15% 20%, rgba(156, 140, 255, .22), transparent 70%),
    radial-gradient(35vw 35vw at 85% 75%, rgba(255, 140, 190, .16), transparent 70%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.view { position: relative; z-index: 2; }

/* ---------- 玻璃 ---------- */
.glass, .glass-solid {
  position: relative; border-radius: var(--radius); isolation: isolate;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--inset), var(--shadow);
}
.glass-solid { background: var(--glass-solid); }
/* 上沿更亮的渐变 1px 描边 */
.glass::before, .glass-solid::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, var(--line-hi), var(--line) 40%, rgba(255, 255, 255, .03));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
[data-theme="light"] .glass::before, [data-theme="light"] .glass-solid::before {
  background: linear-gradient(180deg, #fff, rgba(40, 24, 80, .1) 55%, rgba(40, 24, 80, .06));
}
.glass > *, .glass-solid > * { position: relative; z-index: 1; }

/* 鼠标跟随光斑：fx.js 写 --mx/--my（px，相对元素） */
.spot::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none; border-radius: inherit; inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, -300px), var(--spot), transparent 62%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.spot:hover::after, .spot.spot-on::after { opacity: 1; }

/* 流光扫过：fx.js 向 .sheen 注入 <i class="sheen-ray">，只动 transform */
.sheen { overflow: hidden; }
.sheen > .sheen-ray {
  position: absolute; top: -30%; bottom: -30%; left: 0; width: 38%; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, var(--sheen) 50%, transparent 80%);
  transform: translateX(-170%) skewX(-14deg); will-change: transform;
  animation: sheen 9s var(--ease) infinite; animation-delay: calc(var(--i, 0) * .7s);
}
@keyframes sheen { 0%, 60% { transform: translateX(-170%) skewX(-14deg); } 100% { transform: translateX(380%) skewX(-14deg); } }

/* ---------- Logo ---------- */
.logo-yu {
  position: relative; display: inline-block; font-weight: 200; letter-spacing: .14em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .85);
  background: linear-gradient(110deg, rgba(255, 255, 255, .15) 30%, #fff 45%, var(--pink-2) 52%, rgba(255, 255, 255, .15) 66%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 0 18px rgba(236, 236, 255, .35);
  animation: logoFlow 7s linear infinite;
}
[data-theme="light"] .logo-yu { -webkit-text-stroke-color: rgba(40, 24, 80, .7); text-shadow: 0 0 14px rgba(140, 120, 220, .3);
  background-image: linear-gradient(110deg, rgba(60, 40, 120, .12) 30%, #6f5cf0 45%, var(--pink) 52%, rgba(60, 40, 120, .12) 66%); }
@keyframes logoFlow { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.logo-sm { font-size: 26px; }
.logo-md { font-size: 44px; }
.logo-lg { font-size: 64px; }

/* ---------- 线稿图融合 ---------- */
.lineart { position: relative; isolation: auto; }
.lineart img {
  width: 100%; height: auto; user-select: none; pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, rgba(0, 0, 0, .55) 78%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 58%, rgba(0, 0, 0, .55) 78%, transparent 100%);
}
[data-theme="light"] .lineart img { filter: invert(1) contrast(.9); mix-blend-mode: multiply; opacity: .82; }
/* 光晕呼吸：伪元素 opacity 动画 */
.lineart::before {
  content: ""; position: absolute; inset: 12%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(236, 236, 255, .22), transparent 70%);
  animation: breathe 5.5s ease-in-out infinite;
}
.lineart-devil::before { background: radial-gradient(closest-side, rgba(255, 95, 162, .26), rgba(255, 95, 162, .06) 55%, transparent 72%); animation: pinkPulse 4.2s ease-in-out infinite; }
[data-theme="light"] .lineart::before { background: radial-gradient(closest-side, rgba(156, 140, 255, .28), transparent 70%); }
[data-theme="light"] .lineart-devil::before { background: radial-gradient(closest-side, rgba(240, 67, 140, .2), transparent 70%); }
@keyframes breathe { 0%, 100% { opacity: .45; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes pinkPulse { 0%, 100% { opacity: .35; } 45% { opacity: 1; } 60% { opacity: .7; } }
.float-slow { animation: floatY 7s ease-in-out infinite; }
.float-slow.delay { animation-delay: -3.5s; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
[data-parallax] { transform: translate3d(var(--px, 0px), var(--py, 0px), 0); transition: transform .5s var(--ease); will-change: transform; }

/* ---------- 按钮 ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 12px; font-weight: 500; font-size: 14px; white-space: nowrap;
  overflow: hidden; isolation: isolate; color: var(--text); user-select: none;
  transition: transform .45s var(--spring), box-shadow .3s var(--ease), background-color .3s var(--ease), border-color .3s, color .3s, opacity .3s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.96); transition-duration: .12s; }
.btn[disabled], .btn.is-loading { cursor: default; }
.btn[disabled]:not(.is-loading) { opacity: .5; transform: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-glass { background: var(--glass-2); box-shadow: var(--inset), 0 0 0 1px var(--line-2); }
.btn-glass:hover { background: var(--glass-3); box-shadow: var(--inset), 0 0 0 1px var(--line-hi), 0 0 22px -6px var(--white-glow); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--glass); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .06)), linear-gradient(135deg, #2a2240, #1a1428);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 26px -10px var(--pink-glow), 0 0 0 0 var(--pink-glow);
}
[data-theme="light"] .btn-primary { background: linear-gradient(135deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0)), linear-gradient(135deg, #3a2f5c, #241c3a); }
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px rgba(255, 255, 255, .4), 0 10px 32px -8px var(--pink-glow), 0 0 26px -4px var(--pink-glow); }
.btn-primary:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 0 1px var(--pink), 0 0 0 8px var(--pink-soft); }
/* 主按钮周期流光 */
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: translateX(-140%) skewX(-18deg); animation: btnSheen 4.8s var(--ease) infinite;
}
@keyframes btnSheen { 0%, 70% { transform: translateX(-140%) skewX(-18deg); } 100% { transform: translateX(330%) skewX(-18deg); } }
.btn-danger { color: var(--err); background: rgba(255, 107, 142, .08); box-shadow: inset 0 0 0 1px rgba(255, 107, 142, .28); }
.btn-danger:hover { background: rgba(255, 107, 142, .14); box-shadow: inset 0 0 0 1px rgba(255, 107, 142, .5), 0 0 22px -6px var(--err-glow); }
.btn-danger-solid { color: #fff; background: linear-gradient(135deg, #ff6b8e, #d93a74); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 24px -8px var(--err-glow); }
.btn-danger-solid:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 30px -6px var(--err-glow); }

/* 异步状态：fx.btnState */
.btn .btn-label { transition: opacity .2s, transform .3s var(--ease); }
.btn-state { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.btn.is-loading > :not(.btn-state):not(.ripple), .btn.is-success > :not(.btn-state):not(.ripple), .btn.is-error > :not(.btn-state):not(.ripple) { opacity: 0; }
.btn.is-loading .btn-state, .btn.is-success .btn-state, .btn.is-error .btn-state { opacity: 1; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check-draw { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .05s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.btn.is-success { color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 1px var(--ok), 0 0 28px -4px var(--ok-glow); }
.btn.is-success .btn-state { color: var(--ok); }
.btn-primary.is-success .btn-state, .btn-danger-solid.is-success .btn-state { color: #fff; }
.btn.is-error { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 0 1px var(--err), 0 0 28px -4px var(--err-glow); }
.btn.is-error .btn-state { color: var(--err); }
.btn-primary.is-error .btn-state { color: #fff; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--text-2); overflow: hidden; isolation: isolate;
  transition: transform .45s var(--spring), background-color .25s, color .25s, box-shadow .3s;
}
.icon-btn:hover { color: var(--text); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 18px -6px var(--white-glow); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); transition-duration: .12s; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--err); box-shadow: inset 0 0 0 1px rgba(255, 107, 142, .35), 0 0 18px -6px var(--err-glow); }
.icon-btn.is-done { color: var(--ok); }
.link-btn { color: var(--text-2); font-size: 13px; border-radius: 6px; padding: 2px 4px; transition: color .2s, text-shadow .2s; }
.link-btn:hover { color: var(--text); text-shadow: 0 0 12px var(--white-glow); }
.link-btn:active { transform: scale(.96); }

/* focus-visible 光环 */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink), 0 0 20px 2px var(--pink-glow) !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: none !important; }

/* 涟漪（fx 注入 span.ripple） */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  width: var(--rs, 100px); height: var(--rs, 100px); left: var(--rx, 50%); top: var(--ry, 50%);
  margin: calc(var(--rs, 100px) / -2) 0 0 calc(var(--rs, 100px) / -2);
  background: radial-gradient(circle, rgba(255, 255, 255, .38), rgba(255, 255, 255, .12) 45%, transparent 70%);
  transform: scale(0); opacity: 1; animation: ripple .65s var(--ease) forwards;
}
[data-theme="light"] .ripple { background: radial-gradient(circle, rgba(111, 92, 240, .22), rgba(111, 92, 240, .08) 45%, transparent 70%); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.ripple-host { position: relative; overflow: hidden; }

/* 抖动 */
.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }

/* 复制气泡 */
.copied-tip {
  position: fixed; z-index: 1200; pointer-events: none; padding: 4px 10px; border-radius: 8px; font-size: 12px;
  color: var(--text); background: var(--glass-solid); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 0 18px -4px var(--ok-glow); display: inline-flex; gap: 4px; align-items: center;
  transform: translate(-50%, -100%); animation: tipIn .9s var(--ease) forwards;
}
.copied-tip .ic { width: 13px; height: 13px; color: var(--ok); }
@keyframes tipIn { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.9); } 20% { opacity: 1; transform: translate(-50%, -110%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -140%); } }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; color: var(--text-2); letter-spacing: .02em; }
.field-hint { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field > input, .input-wrap input, .select, textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px; border: 0;
  background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text);
  transition: box-shadow .25s var(--ease), background-color .25s;
}
.field > input::placeholder, .input-wrap input::placeholder { color: var(--muted); }
.field > input:hover, .input-wrap input:hover, .select:hover { box-shadow: inset 0 0 0 1px var(--line-hi); }
.field > input:focus, .input-wrap input:focus, .select:focus {
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--pink), 0 0 0 4px var(--pink-soft), 0 0 22px -6px var(--pink-glow);
}
.field > input.is-invalid, .input-wrap.is-invalid input, input.is-invalid {
  box-shadow: inset 0 0 0 1px var(--err), 0 0 0 4px rgba(255, 107, 142, .14), 0 0 20px -6px var(--err-glow);
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; transition: color .2s; }
.input-wrap input { padding-left: 40px; }
.input-wrap:focus-within > .ic { color: var(--pink-2); }
.input-wrap .input-suffix { position: absolute; right: 5px; }
.input-wrap:has(.input-suffix) input { padding-right: 44px; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
.select-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; }
.select option { background: var(--bg-3); color: var(--text); }
.select-wrap > .ic { position: absolute; right: 12px; color: var(--muted); pointer-events: none; transition: transform .3s var(--spring); }
.select-wrap:focus-within > .ic { transform: rotate(180deg); color: var(--pink-2); }
.select-sm .select { height: 32px; font-size: 13px; border-radius: 10px; }

/* 复选框 */
.check-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 18px; height: 18px; margin: 0; border-radius: 6px; cursor: pointer;
  background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--line-hi);
  transition: background-color .2s, box-shadow .25s, transform .4s var(--spring);
}
.check::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .35s var(--spring);
}
.check:hover { box-shadow: inset 0 0 0 1px var(--pink-2), 0 0 12px -2px var(--pink-glow); }
.check:active { transform: scale(.86); }
.check:checked, .check:indeterminate { background: var(--pink); box-shadow: inset 0 0 0 1px var(--pink-2), 0 0 14px -2px var(--pink-glow); }
.check:checked::after { transform: rotate(45deg) scale(1); }
.check:indeterminate::after { left: 4px; top: 7.5px; width: 8px; height: 0; border-width: 0 0 2px 0; transform: none; }
.check:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink) !important; }

/* 开关 */
.switch {
  position: relative; flex: none; width: 46px; height: 26px; border-radius: 99px; overflow: hidden; isolation: isolate;
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 3px rgba(0, 0, 0, .25);
  transition: background .35s var(--ease), box-shadow .35s var(--ease);
}
.switch::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .35s var(--ease);
  background: linear-gradient(90deg, rgba(255, 95, 162, .55), rgba(255, 140, 192, .9));
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(0, 0, 0, .08);
  transition: transform .5s var(--spring), width .2s var(--ease);
}
.switch:active .switch-thumb { width: 25px; }
.switch[aria-checked="true"] { box-shadow: inset 0 0 0 1px var(--pink-2), 0 0 18px -3px var(--pink-glow); }
.switch[aria-checked="true"]::before { opacity: 1; }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(20px); }
.switch[aria-checked="true"]:active .switch-thumb { transform: translateX(15px); }
.switch[disabled] { opacity: .5; cursor: default; }

/* Chips */
.chips, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { padding: 3px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); flex-wrap: nowrap; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 99px;
  font-size: 13px; color: var(--text-2); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden; isolation: isolate; white-space: nowrap;
  transition: transform .45s var(--spring), color .2s, background-color .25s, box-shadow .3s;
}
.seg .chip { height: 28px; border-radius: 9px; background: transparent; box-shadow: none; }
.chip:hover { color: var(--text); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip:active { transform: scale(.94); }
.chip.is-on, .chip[aria-pressed="true"] {
  color: var(--text); background: var(--glass-3);
  box-shadow: inset 0 0 0 1px rgba(255, 95, 162, .55), 0 0 16px -4px var(--pink-glow);
}
.chip-count { font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--glass-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.is-on .chip-count { color: var(--pink-2); background: var(--pink-soft); }

/* 徽标 / 状态 */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; white-space: nowrap;
  background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.plain::before { display: none; }
.badge-unused, .badge-info { color: var(--info); }
.badge-active, .badge-success, .badge-ok { color: var(--ok); }
.badge-expired, .badge-warn { color: var(--warn); }
.badge-disabled, .badge-fail, .badge-error { color: var(--err); }
.badge-pink { color: var(--pink-2); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; background: var(--glass-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- 登录页 ---------- */
.view-login {
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr minmax(340px, 420px) 1fr;
  align-items: center; gap: clamp(16px, 3vw, 48px); padding: 32px clamp(16px, 4vw, 64px); overflow: hidden;
}
.login-art { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-art .lineart { width: min(100%, 440px); }
.login-art-cap { font-size: 12px; letter-spacing: .4em; color: var(--muted); text-shadow: 0 0 12px var(--white-glow); }
.login-devil .login-art-cap { color: rgba(255, 140, 192, .7); text-shadow: 0 0 12px var(--pink-glow); }
.login-center { display: flex; justify-content: center; }
.login-card { width: 100%; padding: 36px 32px 28px; display: flex; flex-direction: column; gap: 18px; animation: cardIn .9s var(--spring) both; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-tag { color: var(--text-2); font-size: 13px; letter-spacing: .3em; }
.login-row { display: flex; align-items: center; justify-content: space-between; }
.login-hint { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 12px; color: var(--muted); }
.login-hint .ic { width: 14px; height: 14px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.view-login.is-leaving { animation: viewOut .6s var(--ease) forwards; }
@keyframes viewOut { to { opacity: 0; transform: scale(1.04); filter: blur(6px); } }

/* ---------- 全屏加载 ---------- */
.view-loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; animation: fadeIn .4s var(--ease); }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loader-art { width: 240px; }
.loader-text { color: var(--text-2); font-size: 13px; letter-spacing: .1em; }
.loader-bar { width: 220px; height: 3px; border-radius: 3px; background: var(--glass-2); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 100%; border-radius: inherit; transform-origin: left; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, rgba(255, 255, 255, .5), var(--pink-2)); box-shadow: 0 0 12px var(--pink-glow); transition: transform .4s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 应用壳 ---------- */
.view-app { display: flex; min-height: 100vh; min-height: 100dvh; animation: fadeIn .6s var(--ease); }
.sidebar {
  position: sticky; top: 12px; z-index: 30; flex: none; display: flex; flex-direction: column; gap: 10px;
  width: var(--sbw); height: calc(100vh - 24px); height: calc(100dvh - 24px); margin: 12px 0 12px 12px; padding: 18px 12px;
  transition: width .5s var(--ease), transform .5s var(--ease);
}
.sb-brand { display: flex; align-items: baseline; gap: 10px; padding: 4px 12px 14px; white-space: nowrap; overflow: hidden; }
.sb-brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; transition: opacity .3s; }
.sb-close { display: none; margin-left: auto; align-self: center; }
.sb-nav { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 12px;
  color: var(--text-2); white-space: nowrap; overflow: hidden; isolation: isolate; text-align: left; width: 100%;
  transition: color .25s, background-color .25s, transform .45s var(--spring);
}
.nav-item:hover { color: var(--text); background: var(--glass); }
.nav-item:active { transform: scale(.97); }
.nav-item.is-active { color: var(--text); }
.nav-item.is-active .ic { color: var(--pink-2); filter: drop-shadow(0 0 6px var(--pink-glow)); }
.nav-label { transition: opacity .3s var(--ease); }
.nav-badge { margin-left: auto; min-width: 22px; padding: 0 7px; height: 20px; border-radius: 99px; font-size: 11px; line-height: 20px; text-align: center;
  background: var(--pink-soft); color: var(--pink-2); box-shadow: inset 0 0 0 1px rgba(255, 95, 162, .3); transition: opacity .3s; }
.nav-badge:empty { display: none; }
/* 导航滑动指示条：app.js 写 --ny / --nh */
.nav-indicator {
  position: absolute; left: 0; right: 0; top: 0; height: var(--nh, 44px); z-index: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(90deg, var(--glass-3), var(--glass)); box-shadow: inset 0 0 0 1px var(--line-2);
  transform: translateY(var(--ny, 0px)); transition: transform .55s var(--spring), height .3s, opacity .3s; opacity: var(--no, 1);
}
.nav-indicator::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--pink); box-shadow: 0 0 10px var(--pink), 0 0 20px var(--pink-glow);
}
.sb-foot { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; overflow: hidden; position: relative;
  transition: background-color .25s, transform .45s var(--spring); }
.sb-user:hover { background: var(--glass); }
.sb-user:active { transform: scale(.97); }
.sb-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; white-space: nowrap; transition: opacity .3s; }
.sb-user-text small { color: var(--muted); font-size: 12px; }
.sb-collapse .ic { transition: transform .5s var(--spring); }

/* 侧边栏折叠 */
.sb-collapsed .sidebar { width: var(--sbw-c); }
.sb-collapsed .nav-label, .sb-collapsed .sb-brand-sub, .sb-collapsed .sb-user-text, .sb-collapsed .nav-badge { opacity: 0; pointer-events: none; }
.sb-collapsed .sb-brand { padding-left: 14px; }
.sb-collapsed .sb-collapse .ic { transform: rotate(180deg); }

/* 头像 */
.avatar { position: relative; flex: none; display: inline-block; border-radius: 50%; isolation: isolate; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), inset 0 0 0 1px rgba(255, 255, 255, .2); }
[data-theme="light"] .avatar img { filter: invert(1) contrast(.95); box-shadow: 0 0 0 1px rgba(40, 24, 80, .15); }
.avatar::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; z-index: -1; pointer-events: none;
  box-shadow: 0 0 14px 2px var(--white-glow); animation: breathe 4.5s ease-in-out infinite; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; }

/* ---------- 主区 / 顶栏 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 12px; z-index: 20; display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); margin: 12px 12px 0; padding: 0 12px 0 18px;
}
.menu-btn { display: none; }
.crumb { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; }
.crumb-root { color: var(--muted); letter-spacing: .12em; font-size: 12px; }
.crumb .ic { width: 14px; height: 14px; color: var(--muted); }
.crumb b { animation: crumbIn .45s var(--ease); }
@keyframes crumbIn { from { opacity: 0; transform: translateY(4px); } }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; }
.search > .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 64px 0 40px; border: 0; border-radius: 12px; background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s, background-color .25s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--pink), 0 0 0 4px var(--pink-soft); }
.kbd { position: absolute; right: 10px; padding: 1px 6px; font-size: 11px; border-radius: 6px; color: var(--muted); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.live-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 12.5px;
  color: var(--text-2); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  transition: transform .45s var(--spring), box-shadow .3s, color .3s;
}
.live-pill:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 16px -4px var(--ok-glow); }
.live-pill:active { transform: scale(.94); }
.live-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); flex: none; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: livePulse 1.8s var(--ease) infinite; }
@keyframes livePulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }
.live-pill[aria-pressed="false"] .live-dot { background: var(--muted); box-shadow: none; }
.live-pill[aria-pressed="false"] .live-dot::after { animation: none; opacity: 0; }
/* 主题图标 */
#themeToggle .ic { position: absolute; transition: transform .6s var(--spring), opacity .3s; }
#themeToggle .ic-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="light"] #themeToggle .ic-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme="light"] #themeToggle .ic-sun { opacity: 1; transform: none; }
.notif-dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--pink); animation: pinkPulse 2.4s infinite; }
.pop-root { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 4px; border-radius: 99px; color: var(--text-2);
  transition: background-color .25s, box-shadow .3s, transform .45s var(--spring); position: relative; overflow: hidden; }
.user-btn:hover { background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.user-btn:active { transform: scale(.96); }
.user-btn[aria-expanded="true"] .ic-xs { transform: rotate(180deg); }
.user-btn .ic-xs { transition: transform .35s var(--spring); }
.user-btn-name { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 弹出层 */
.popover {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; min-width: 220px; padding: 6px;
  box-shadow: var(--inset), var(--shadow-lg); transform-origin: top right; animation: popIn .32s var(--spring);
}
.popover.is-closing { animation: popOut .18s var(--ease) forwards; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.95); } }
@keyframes popOut { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
.search-pop { left: 0; right: 0; transform-origin: top center; max-height: 420px; overflow: auto; }
.notif-pop { width: 340px; }
.user-pop { width: 240px; }
.menu-pop { min-width: 180px; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-head .link-btn { margin-left: auto; }
.pop-count { font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--pink-soft); color: var(--pink-2); }
.pop-count:empty { display: none; }
.notif-list { max-height: 360px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; font-size: 13px; position: relative; overflow: hidden; text-align: left; width: 100%;
  transition: background-color .2s; }
.notif-item:hover { background: var(--glass-2); }
.notif-item .ic { color: var(--text-2); margin-top: 2px; }
.notif-item small { display: block; color: var(--muted); font-size: 12px; }
.notif-item.is-unread::after { content: ""; position: absolute; right: 10px; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.user-pop-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop-head div { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.user-pop-head small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.menu-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-2); text-align: left; overflow: hidden; transition: background-color .2s, color .2s, padding-left .3s var(--ease); }
.menu-item:hover, .menu-item.is-hl { background: var(--glass-2); color: var(--text); padding-left: 14px; }
.menu-item.danger { color: var(--err); }
.menu-item.danger:hover { background: rgba(255, 107, 142, .1); }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: left; font-size: 13px; color: var(--text-2); position: relative; overflow: hidden; }
.search-item:hover, .search-item.is-hl { background: var(--glass-2); color: var(--text); }
.search-item small { margin-left: auto; color: var(--muted); font-size: 12px; }
.search-group { padding: 8px 10px 4px; font-size: 11px; letter-spacing: .12em; color: var(--muted); }
.search-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
mark { background: var(--pink-soft); color: var(--pink-2); border-radius: 3px; padding: 0 1px; }

/* ---------- 内容区 / 页面 ---------- */
.content { flex: 1; padding: 22px 12px 40px 22px; padding-right: 12px; display: flex; flex-direction: column; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 20px; animation: pageIn .55s var(--ease) both; }
.page.is-leaving { animation: pageOut .22s var(--ease) forwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pageOut { to { opacity: 0; transform: translateY(-8px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: .02em; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 错开入场：元素加 .enter 并设置 style="--i:n" */
.enter { animation: enterUp .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes enterUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 卡片 */
.card { padding: 20px 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15.5px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-foot .muted { margin-right: auto; }
.card-foot .muted.is-dirty { color: var(--pink-2); }

/* 横幅 */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 220px; padding: 28px 32px; overflow: hidden; }
.banner-text { display: flex; flex-direction: column; gap: 10px; max-width: 620px; }
.banner-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); letter-spacing: .06em; }
.banner-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: .02em; text-shadow: 0 0 24px var(--white-glow); }
.banner-sub { color: var(--text-2); font-size: 14px; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.banner-art { flex: none; width: 260px; margin: -40px -10px -50px 0; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-2); font-size: 13px; }
.kpi-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.kpi-value { position: relative; font-size: 30px; font-weight: 600; letter-spacing: .01em; line-height: 1.15; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.trend-up, .delta-up { color: var(--ok); }
.trend-down, .delta-down { color: var(--err); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; }
.delta .ic { width: 13px; height: 13px; }
/* countTo 变化时：数字闪白光 + 箭头 */
.num-flash { animation: numFlash .9s var(--ease); }
@keyframes numFlash { 0% { text-shadow: 0 0 0 transparent; } 25% { text-shadow: 0 0 18px #fff, 0 0 30px var(--white-glow); } 100% { text-shadow: 0 0 0 transparent; } }
.num-arrow { display: inline-flex; vertical-align: middle; margin-left: 6px; animation: arrowPop 1.4s var(--ease) forwards; }
.num-arrow .ic { width: 16px; height: 16px; }
.num-arrow.up { color: var(--ok); }
.num-arrow.down { color: var(--err); }
@keyframes arrowPop { 0% { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* 图表 */
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.chart-body { position: relative; height: 280px; }
.chart-body canvas { max-width: 100%; }
.donut-body { display: flex; align-items: center; justify-content: center; }
.chart-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.chart-fallback .ic { width: 28px; height: 28px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.bar-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 44px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 6px; border-radius: 6px; background: var(--glass-2); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(255, 255, 255, .5), var(--pink-2)); transform-origin: left; transition: transform .8s var(--ease); }

/* ---------- 表格 ---------- */
.table-card { padding: 18px 0 0; overflow: hidden; }
.table-card > .card-head, .table-card > .filter-bar, .table-card > .bulk-bar { padding-left: 22px; padding-right: 22px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { position: sticky; top: 0; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--text-2); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr { position: relative; transition: background-color .2s; }
.table tbody tr:last-child td { border-bottom: 0; }
/* 悬停玻璃光带 */
.table tbody tr:hover td { background: linear-gradient(90deg, var(--glass), var(--glass-2) 50%, var(--glass)); color: var(--text); }
/* 选中：粉色左边缘发光 */
.table tbody tr.is-selected td { background: linear-gradient(90deg, rgba(255, 95, 162, .1), var(--glass) 40%); color: var(--text); }
.table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--pink), inset 14px 0 18px -14px var(--pink-glow); }
/* 新插入行 */
.table tbody tr.row-new td { animation: rowNew 1.8s var(--ease); }
.table tbody tr.row-new { animation: rowSlide .55s var(--ease); }
@keyframes rowSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes rowNew { 0%, 30% { background: rgba(255, 95, 162, .12); } 100% { background: transparent; } }
.table tbody tr.enter { animation-duration: .5s; }
.col-check { width: 44px; }
.col-acts { text-align: right !important; }
.table td.col-acts { text-align: right; }
.row-acts { display: inline-flex; gap: 2px; justify-content: flex-end; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; letter-spacing: inherit; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; transition: color .2s; }
.th-sort:hover { color: var(--text); }
.th-sort.is-asc, .th-sort.is-desc { color: var(--pink-2); }
.th-sort .ic { transition: transform .35s var(--spring); }
.th-sort.is-asc .ic { transform: scaleY(-1); }
.key-cell { display: inline-flex; align-items: center; gap: 6px; }
.key-text { font-family: var(--mono); font-size: 12.5px; color: var(--text); letter-spacing: .02em; cursor: pointer; border-radius: 6px; padding: 2px 6px; margin-left: -6px; transition: background-color .2s, text-shadow .3s; }
.key-text:hover { background: var(--glass-2); }
.key-text.is-revealed { text-shadow: 0 0 10px var(--white-glow); }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); }
.res-ok { color: var(--ok); }
.res-fail { color: var(--err); }

/* 筛选条 / 批量条 / 表尾 */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; }
.filter-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-right .select-wrap { min-width: 130px; }
.filter-right .select { height: 36px; border-radius: 11px; font-size: 13px; }
.search-input { min-width: 220px; }
.search-input input { height: 36px; border-radius: 11px; font-size: 13px; }
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; overflow: hidden;
  max-height: 0; opacity: 0; transform: translateY(-6px); padding-top: 0; padding-bottom: 0;
  transition: max-height .4s var(--ease), opacity .3s, transform .4s var(--spring), padding .3s;
}
.bulk-bar.is-on, .bulk-bar[aria-hidden="false"] {
  max-height: 120px; opacity: 1; transform: none; padding-top: 10px; padding-bottom: 10px;
  background: linear-gradient(90deg, rgba(255, 95, 162, .1), transparent 60%); box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
}
.bulk-info { font-size: 13px; color: var(--pink-2); margin-right: 6px; font-variant-numeric: tabular-nums; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }
.table-summary { font-size: 12.5px; color: var(--muted); }
.pager-wrap { display: flex; align-items: center; gap: 10px; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager button, .page-btn {
  position: relative; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; font-size: 13px; color: var(--text-2); overflow: hidden;
  display: inline-grid; place-items: center; transition: background-color .2s, color .2s, box-shadow .3s, transform .4s var(--spring);
}
.pager button:hover:not([disabled]) { background: var(--glass-2); color: var(--text); }
.pager button:active:not([disabled]) { transform: scale(.9); }
.pager button.is-on, .pager button[aria-current="page"] { color: var(--text); background: var(--glass-3); box-shadow: inset 0 0 0 1px rgba(255, 95, 162, .5), 0 0 14px -4px var(--pink-glow); }
.pager button[disabled] { opacity: .35; cursor: default; }
.pager .ellipsis { color: var(--muted); padding: 0 4px; }

/* ---------- 应用卡片 ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.app-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; transition: transform .5s var(--spring), box-shadow .35s; }
.app-card:hover { transform: translateY(-3px); box-shadow: var(--inset), var(--shadow-lg), 0 0 30px -12px var(--white-glow); }
.app-card.is-disabled { opacity: .62; }
.app-card-head { display: flex; align-items: center; gap: 12px; }
.app-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; font-weight: 600; font-size: 17px;
  background: linear-gradient(135deg, var(--glass-3), var(--glass)); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 18px -6px var(--white-glow); }
.app-name { font-weight: 600; font-size: 15px; }
.app-meta { font-size: 12px; color: var(--muted); }
.app-desc { font-size: 13px; color: var(--text-2); min-height: 2.6em; }
.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-stat { padding: 10px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.app-stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.app-stat small { font-size: 11.5px; color: var(--muted); }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.app-card-foot .row-acts { gap: 4px; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.card-head + .setting-row { border-top: 0; padding-top: 4px; }
.setting-title { font-size: 14px; }
.setting-desc { font-size: 12.5px; color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.profile-head div { display: flex; flex-direction: column; line-height: 1.4; }
.profile-head small { color: var(--muted); font-size: 12.5px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fadeIn .3s var(--ease); }
.modal-panel {
  position: relative; width: min(680px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto;
  padding: 24px 26px; box-shadow: var(--inset), var(--shadow-lg);
  transform-origin: var(--ox, 50%) var(--oy, 50%); animation: modalIn .5s var(--spring) both;
}
.modal-sm .modal-panel { width: min(480px, 100%); }
.modal-xs .modal-panel { width: min(400px, 100%); text-align: center; }
.modal.is-closing .modal-backdrop { animation: fadeOut .25s var(--ease) forwards; }
.modal.is-closing .modal-panel { animation: modalOut .25s var(--ease) forwards; }
@keyframes modalIn { from { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, 20px)) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translate(var(--dx, 0px), var(--dy, 20px)) scale(.6); } }
@keyframes fadeOut { to { opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-text { color: var(--text-2); font-size: 14px; margin: 8px 0 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-foot.center { justify-content: center; }
.confirm-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 4px auto 14px; border-radius: 50%; color: var(--err);
  background: rgba(255, 107, 142, .1); box-shadow: inset 0 0 0 1px rgba(255, 107, 142, .3), 0 0 30px -6px var(--err-glow); }
.confirm-icon .ic { width: 26px; height: 26px; }
.confirm-icon.info { color: var(--info); background: rgba(169, 191, 255, .1); box-shadow: inset 0 0 0 1px rgba(169, 191, 255, .3), 0 0 30px -6px var(--info-glow); }
.burst-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5 !important; }
.preview-key { height: 46px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), inset 0 0 24px -12px var(--pink-glow); }
.preview-key .mono { font-size: 14px; letter-spacing: .06em; color: var(--text); text-shadow: 0 0 12px var(--white-glow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(98, 240, 184, .07); box-shadow: inset 0 0 0 1px rgba(98, 240, 184, .25); color: var(--text); font-size: 13.5px; margin-bottom: 14px; }
.gen-summary .ic { color: var(--ok); }
.key-list { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow: auto; border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); counter-reset: k; }
.key-list li { counter-increment: k; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; font-family: var(--mono); font-size: 13px; color: var(--text);
  animation: enterUp .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.key-list li::before { content: counter(k, decimal-leading-zero); color: var(--muted); font-size: 11px; width: 26px; }
.key-list li:hover { background: var(--glass-2); }
.key-list li .icon-btn { margin-left: auto; }
.detail { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 14px; font-size: 13.5px; }
.detail dt, .detail .dt { color: var(--muted); }
.detail dd, .detail .dd { margin: 0; color: var(--text); word-break: break-all; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast {
  position: relative; pointer-events: auto; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 16px 18px; overflow: hidden;
  border-radius: 16px; background: var(--glass-solid); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--inset), inset 0 0 0 1px var(--line-2), var(--shadow-lg);
  animation: toastIn .55s var(--spring) both;
}
.toast.is-leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(.96); } }
.toast::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--tc); box-shadow: 0 0 12px var(--tc); }
.toast-icon { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--tc);
  background: color-mix(in srgb, var(--tc) 14%, transparent); box-shadow: 0 0 18px -4px var(--tg); }
.toast-icon .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; font-size: 14px; color: var(--text); }
.toast-msg { font-size: 12.5px; color: var(--text-2); margin-top: 2px; word-break: break-word; }
.toast-close { flex: none; color: var(--muted); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.toast-close:hover { color: var(--text); background: var(--glass-2); }
.toast-close .ic { width: 14px; height: 14px; }
.toast-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--tc); opacity: .7; transform-origin: left;
  animation: toastProg var(--td, 4s) linear forwards; }
.toast:hover .toast-progress { animation-play-state: paused; }
@keyframes toastProg { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-success { --tc: var(--ok); --tg: var(--ok-glow); }
.toast-error { --tc: var(--err); --tg: var(--err-glow); }
.toast-error .toast-icon { animation: shake .5s .2s both; }
.toast-info { --tc: var(--info); --tg: var(--info-glow); }

/* ---------- 骨架屏 ---------- */
.skeleton, .sk { position: relative; overflow: hidden; border-radius: 10px; background: var(--sk-a); }
.skeleton::after, .sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--sk-b), transparent); animation: skFlow 1.4s ease-in-out infinite;
}
@keyframes skFlow { to { transform: translateX(100%); } }
.sk-line { height: 12px; margin: 6px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-title { height: 30px; width: 55%; margin: 6px 0; }
.sk-circle { border-radius: 50%; width: 34px; height: 34px; }
.sk-chart { position: absolute; inset: 0; border-radius: 14px; }
.sk-row td { padding: 14px; }
.sk-card { min-height: 220px; }

/* ---------- 错误卡 / 空状态 ---------- */
.error-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 20px; text-align: center; animation: enterUp .5s var(--ease) both; }
.error-card .err-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--err);
  background: rgba(255, 107, 142, .1); box-shadow: inset 0 0 0 1px rgba(255, 107, 142, .3), 0 0 30px -6px var(--err-glow); }
.error-card .err-icon .ic { width: 24px; height: 24px; }
.error-card b { font-size: 15px; }
.error-card p { color: var(--text-2); font-size: 13px; max-width: 360px; }
.error-card .btn { margin-top: 6px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px 36px; text-align: center; color: var(--text-2); animation: enterUp .5s var(--ease) both; }
.empty-state .lineart { width: 150px; }
.empty-state b { color: var(--text); font-size: 15px; }
.empty-state p { font-size: 13px; color: var(--muted); }
td.cell-full { padding: 0 !important; white-space: normal !important; }
.app-grid > .empty-state, .app-grid > .error-card, .kpi-grid > .error-card { grid-column: 1 / -1; }

/* ---------- 主题切换揭幕 ---------- */
.theme-reveal { position: fixed; inset: 0; z-index: 2000; pointer-events: none; opacity: 0; display: grid; place-items: center;
  background: var(--reveal-bg, #07060b); clip-path: circle(0 at var(--rx, 50%) var(--ry, 50%)); }
.theme-reveal.is-run { opacity: 1; animation: revealGrow .7s cubic-bezier(.7, 0, .3, 1) forwards; }
.theme-reveal.is-fade { opacity: 1; clip-path: circle(150% at var(--rx, 50%) var(--ry, 50%)); animation: fadeOut .55s var(--ease) forwards; }
@keyframes revealGrow { from { clip-path: circle(0 at var(--rx, 50%) var(--ry, 50%)); } to { clip-path: circle(150% at var(--rx, 50%) var(--ry, 50%)); } }
.theme-reveal-art { width: min(320px, 60vw); opacity: 0; animation: none; }
.theme-reveal.is-run .theme-reveal-art { animation: revealArt .7s var(--ease) forwards; }
.theme-reveal-art img { width: 100%; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); }
.theme-reveal.to-light .theme-reveal-art img { filter: invert(1); mix-blend-mode: multiply; }
@keyframes revealArt { 0% { opacity: 0; transform: scale(.85); } 60% { opacity: .9; } 100% { opacity: .9; transform: scale(1); } }

/* ---------- 抽屉遮罩 ---------- */
.scrim { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .view-login { grid-template-columns: 1fr minmax(320px, 400px) 1fr; }
}
@media (max-width: 1024px) {
  :root { --sbw: 78px; }
  .sidebar { width: var(--sbw-c); }
  .nav-label, .sb-brand-sub, .sb-user-text, .nav-badge { opacity: 0; pointer-events: none; }
  .sb-collapse { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .banner-art { width: 200px; }
  .search { max-width: 320px; }
  .user-btn-name, .kbd { display: none; }
}
@media (max-width: 860px) {
  .view-login { grid-template-columns: 1fr; justify-items: center; padding-top: 24px; }
  .login-art { position: absolute; top: 4%; width: 46vw; opacity: .55; z-index: -1; }
  .login-angel { left: -6vw; }
  .login-devil { right: -6vw; }
  .login-art-cap { display: none; }
  .login-center { width: 100%; max-width: 420px; }
}
/* 手机：侧边栏变抽屉 */
@media (max-width: 760px) {
  :root { --topbar-h: 58px; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100%; margin: 0; width: min(280px, 82vw) !important;
    border-radius: 0 20px 20px 0; transform: translateX(-105%); z-index: 90; transition: transform .5s var(--ease);
  }
  .drawer-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar .nav-label, .sidebar .sb-brand-sub, .sidebar .sb-user-text, .sidebar .nav-badge { opacity: 1 !important; pointer-events: auto !important; }
  .sb-close { display: inline-grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 80; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .topbar { margin: 8px 8px 0; padding: 0 8px; gap: 6px; top: 8px; }
  .crumb-root, .crumb > .ic { display: none; }
  .search { position: static; max-width: none; flex: 1; }
  .search input { height: 36px; padding-right: 12px; }
  .search-pop { left: 8px; right: 8px; top: calc(var(--topbar-h) + 4px); position: absolute; }
  .live-text { display: none; }
  .live-pill { padding: 0 10px; }
  .top-actions { gap: 2px; }
  .icon-btn { width: 36px; height: 36px; }
  .notif-pop, .user-pop { position: fixed; top: calc(var(--topbar-h) + 16px); right: 8px; left: 8px; width: auto; }
  .content { padding: 16px 8px 32px; }
  .page { gap: 14px; }
  .page-head h1 { font-size: 22px; }
  .banner { flex-direction: column-reverse; align-items: flex-start; padding: 22px 20px; min-height: 0; }
  .banner-art { position: absolute; right: -40px; top: -30px; width: 190px; margin: 0; opacity: .6; z-index: 0 !important; }
  .banner-actions .btn { flex: 1 1 auto; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .card { padding: 16px; }
  .table-card { padding-top: 14px; }
  .table-card > .card-head, .table-card > .filter-bar, .table-card > .bulk-bar { padding-left: 14px; padding-right: 14px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .filter-right, .filter-right .select-wrap, .search-input { width: 100%; min-width: 0; }
  .filter-right .select-wrap { flex: 1 1 40%; width: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .table-foot { padding: 12px 14px; justify-content: center; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: end; }
  .modal-panel { width: 100% !important; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; max-height: 92dvh; }
  .modal-foot .btn { flex: 1 1 auto; }
  .toast-stack { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .app-grid { grid-template-columns: 1fr; }
  .chart-body { height: 230px; }
  .login-card { padding: 28px 20px 22px; }
  .logo-lg { font-size: 52px; }
}

/* ---------- 减少动效 ---------- */
html.rm *, html.rm *::before, html.rm *::after,
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important;
  transition-duration: .001ms !important; scroll-behavior: auto !important;
}
html.rm .bg-canvas, html.reduce-motion .bg-canvas,
html.rm .sheen-ray, html.reduce-motion .sheen-ray,
html.rm .btn-primary::after, html.reduce-motion .btn-primary::after,
html.rm .ripple, html.reduce-motion .ripple,
html.rm .skeleton::after, html.rm .sk::after, html.reduce-motion .skeleton::after, html.reduce-motion .sk::after { display: none !important; }
html.rm [data-parallax], html.reduce-motion [data-parallax] { transform: none !important; }
html.rm .spinner, html.reduce-motion .spinner { animation: spin .7s linear infinite !important; animation-duration: .7s !important; animation-iteration-count: infinite !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .bg-canvas, .sheen-ray, .btn-primary::after, .ripple, .skeleton::after, .sk::after { display: none !important; }
  [data-parallax] { transform: none !important; }
  .spinner { animation: spin .7s linear infinite !important; }
}

/* ========================================================================
   响应式补充：手机底部标签栏 + 表格卡片化 + 触屏反馈
   ======================================================================== */

.mobile-tabbar { display: none; }
/* 手机底部标签栏（≤760px 显示） */
@media (max-width: 760px) {
  .mobile-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    display: flex; justify-content: space-around; align-items: center;
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass-solid); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
    box-shadow: var(--inset), 0 -4px 24px -8px rgba(0, 0, 0, .35);
  }
  .mobile-tabbar::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    border-top: 1px solid var(--line-hi);
  }
  .tab-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    flex: 1; height: 56px; color: var(--text-2); font-size: 11px; letter-spacing: .02em; z-index: 1;
    transition: color .2s, transform .3s var(--spring);
  }
  .tab-item:active { transform: scale(.9); }
  .tab-item.is-active { color: var(--text); }
  .tab-item.is-active .ic { color: var(--pink-2); filter: drop-shadow(0 0 8px var(--pink-glow)); }
  .tab-item .ic { width: 22px; height: 22px; transition: color .2s, filter .3s; }
  .tab-item::after {
    content: ""; position: absolute; top: -2px; left: 50%; transform: translateX(-50%); width: 32px; height: 3px; border-radius: 3px;
    background: var(--pink); box-shadow: 0 0 10px var(--pink); opacity: 0; transition: opacity .3s;
  }
  .tab-item.is-active::after { opacity: 1; }

  /* 为底部标签栏腾出空间 */
  .content { padding-bottom: calc(56px + env(safe-area-inset-bottom) + 32px); }

  /* 表格在手机上改为卡片式列表 */
  .table-cards { display: block; }
  .table-cards thead { display: none; }
  .table-cards tbody, .table-cards tr { display: block; }
  .table-cards tr {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 10px;
    border-radius: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line);
    border: 0 !important;
  }
  .table-cards tr.is-selected {
    background: linear-gradient(135deg, rgba(255, 95, 162, .12), var(--glass));
    box-shadow: inset 0 0 0 1px rgba(255, 95, 162, .5), 0 0 16px -4px var(--pink-glow);
  }
  .table-cards tr.is-selected td:first-child { box-shadow: none; }
  .table-cards td {
    display: flex; align-items: center; justify-content: space-between; padding: 0 !important; border: 0 !important;
    white-space: normal !important; word-break: break-word;
  }
  .table-cards td::before {
    content: attr(data-label); font-weight: 500; font-size: 12px; color: var(--muted); min-width: 70px; flex: none;
  }
  .table-cards td:first-child { order: -1; justify-content: flex-end; }
  .table-cards td:first-child::before { display: none; }
  .table-cards .col-acts { justify-content: flex-end; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line) !important; }
  .table-cards .col-acts::before { display: none; }
  .table-cards .key-cell { flex-direction: column; align-items: flex-start; gap: 6px; }
  .table-cards .cell-sub { display: block; }

  /* 常规表格（日志）横向滚动 */
  .table:not(.table-cards) { min-width: 700px; }

  /* 所有可点击区域 ≥44px */
  .btn, .icon-btn, .chip, .nav-item, .tab-item, .menu-item, .search-item, .notif-item, .user-btn, .check-label, .switch, .page-btn {
    min-height: 44px;
  }
  .icon-btn { min-width: 44px; }
  .btn-sm, .icon-btn.sm { min-height: 38px; min-width: 38px; }
}

/* 触屏设备（@media (hover: none)）：hover 改为 :active 按下反馈 */
@media (hover: none) {
  .btn:active { transform: scale(.96); }
  .icon-btn:active, .chip:active { transform: scale(.92); }
  .nav-item:active, .menu-item:active, .search-item:active, .notif-item:active { background: var(--glass-2); }
  .user-btn:active, .live-pill:active { background: var(--glass-2); transform: scale(.96); }
  .link-btn:active { transform: scale(.96); color: var(--text); }
  .key-text:active { background: var(--glass-2); }
  .app-card:active { transform: translateY(-2px); }
  .pager button:active:not([disabled]) { transform: scale(.9); background: var(--glass-2); }
  .th-sort:active { color: var(--text); }
}

/* 平板横屏优化（1024–1200px） */
@media (min-width: 1024px) and (max-width: 1200px) {
  .chart-body { height: 250px; }
  .banner-art { width: 220px; }
}

/* 平板竖屏优化（768–1023px） */
@media (min-width: 768px) and (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 确保全局不横向溢出 */
html, body { overflow-x: hidden; max-width: 100vw; }
.table-scroll { max-width: 100%; }

/* 图片比例保持：绝不同时固定 width 和 height 而不加 object-fit */
.lineart img, .avatar img, .banner-art img, .loader-art img, .login-art img, .empty-state img, .theme-reveal-art img {
  width: 100%; height: auto; object-fit: contain;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ========================================================================
   接手方修正（非 Claude）：表格列自适应、手机卡片式卡密列表、触屏 44px、手机顶栏
   ======================================================================== */
@media (max-width: 1560px) { .table .col-note { display: none; } }
@media (max-width: 1320px) { .table .col-created { display: none; } }

/* 触屏（平板/手机）点击区域 ≥44px */
@media (pointer: coarse), (max-width: 1023px) {
  .btn, .icon-btn, .chip, .user-btn, .live-pill, .seg button, .seg-btn, .page-btn, .th-sort, .link-btn, .tab-item { min-height: 44px; }
  .icon-btn, .icon-btn.sm, .page-btn { min-width: 44px; min-height: 44px; }
  .btn-sm { min-height: 44px; }
  .check-label { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .switch { min-height: 44px; display: inline-flex; align-items: center; }
  #loginPassToggle { width: 44px; height: 44px; }
  .live-pill { min-width: 44px; justify-content: center; }
  .key-text { min-height: 44px; display: inline-flex; align-items: center; }
  #loginForgot, .remember, label[for="loginRemember"] { min-height: 44px; display: inline-flex; align-items: center; }
}

/* 卡密列表：≤900px 改为卡片式（覆盖上面的 table-cards 规则） */
@media (max-width: 900px) {
  .table-cards, .table-cards tbody { display: block; width: 100%; }
  .table-cards thead { display: none; }
  .table-cards tbody tr {
    display: grid !important; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 10px;
    grid-template-areas: "chk key status" "chk meta meta" "chk dates dates" "acts acts acts";
    margin: 0 14px 12px; padding: 12px 12px 10px 6px; border-radius: 16px;
    background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.08);
  }
  .table-cards tbody tr td { display: block; padding: 0 !important; border: 0 !important; background: none !important; white-space: normal; text-align: left; }
  .table-cards tbody tr td::before { content: none !important; display: none !important; }
  .table-cards tbody tr:hover td { background: none !important; }
  .table-cards tbody tr.is-selected { box-shadow: inset 3px 0 0 var(--pink), inset 0 0 0 1px rgba(255,95,162,.45), 0 0 18px -6px var(--pink-glow); }
  .table-cards tbody tr.is-selected td:first-child { box-shadow: none !important; }
  .table-cards .col-check { grid-area: chk; align-self: start; }
  .table-cards .col-key { grid-area: key; min-width: 0; }
  .table-cards .key-cell { display: flex; flex-direction: row; align-items: center; gap: 4px; min-width: 0; }
  .table-cards .key-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; font-size: 12.5px; }
  .table-cards .col-status { grid-area: status; align-self: center; }
  .table-cards .col-type, .table-cards .col-app, .table-cards .col-dev { grid-area: meta; font-size: 12px; color: var(--muted); }
  .table-cards .col-type { justify-self: start; }
  .table-cards .col-app { justify-self: center; }
  .table-cards .col-dev { justify-self: end; }
  .table-cards .col-created, .table-cards .col-expire { grid-area: dates; font-size: 12px; color: var(--muted); display: block !important; }
  .table-cards .col-created::before, .table-cards .col-expire::before { content: attr(data-label) " " !important; display: inline !important; opacity: .7; }
  .table-cards .col-expire { justify-self: end; }
  .table-cards .col-note { display: none; }
  .table-cards .col-acts { grid-area: acts; border-top: 1px solid var(--line) !important; padding-top: 6px !important; }
  .table-cards .row-acts { display: flex; justify-content: flex-end; gap: 6px; }
  .table-cards tbody tr td.cell-full { grid-column: 1 / -1; }
  .table-cards tbody tr:has(td.cell-full) { display: block !important; background: none; box-shadow: none; }
}

/* 手机顶栏：搜索框换到第二行，避免挤压 */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .topbar #searchRoot, .topbar .search { order: 10; flex: 1 1 100%; max-width: none; width: 100%; }
  .topbar #searchRoot kbd, .topbar .search kbd { display: none; }
  .chips, .chip-row, #statusChips, #logChips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar, #statusChips::-webkit-scrollbar, #logChips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* 手机顶栏两行时高度自适应 */
@media (max-width: 760px) {
  .topbar { height: auto; min-height: var(--topbar-h); padding-top: 8px; padding-bottom: 10px; }
  .table-cards .key-text { white-space: normal; word-break: break-all; letter-spacing: 0; font-size: 12px; line-height: 1.35; }
  /* 激活日志：手机改卡片式 */
  .table-logs { min-width: 0 !important; display: block; }
  .table-logs thead { display: none; }
  .table-logs tbody { display: block; }
  .table-logs tbody tr { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 10px; margin: 0 14px 10px; padding: 12px 14px; border-radius: 14px;
    background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.08); }
  .table-logs tbody td { display: block; padding: 0 !important; border: 0 !important; background: none !important; white-space: normal; font-size: 12px; color: var(--muted); }
  .table-logs .lg-key { grid-column: 1; grid-row: 1; color: var(--text); word-break: break-all; }
  .table-logs .lg-res { grid-column: 2; grid-row: 1; justify-self: end; }
  .table-logs .lg-time { grid-column: 1; grid-row: 3; }
  .table-logs .lg-act { grid-column: 2; grid-row: 2; justify-self: end; color: var(--text-2); }
  .table-logs .lg-app { grid-column: 1; grid-row: 2; }
  .table-logs .lg-dev, .table-logs .lg-ip { display: none; }
  .table-logs .lg-msg { grid-column: 2; grid-row: 3; justify-self: end; }
  .table-logs td.cell-full { grid-column: 1 / -1; }
}
/* 平板竖屏：卡密卡片两列 */
@media (min-width: 761px) and (max-width: 900px) {
  .table-cards tbody { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 14px 12px; }
  .table-cards tbody tr { margin: 0 !important; }
  .table-cards .col-type, .table-cards .col-app, .table-cards .col-dev { font-size: 11.5px; }
  .table-cards .col-dev { display: none; }
}

@media (max-width: 900px) {
  .table-cards .key-text { white-space: normal; word-break: break-all; letter-spacing: 0; font-size: 12px; line-height: 1.35; overflow: visible; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .table-cards .col-created::before { content: "" !important; }
  .table-cards .col-created, .table-cards .col-expire { font-size: 11px; }
}
/* 平板竖屏登录页：整体垂直居中，线稿放大 */
@media (min-width: 700px) and (max-width: 1023px) and (orientation: portrait) {
  .view-login { align-content: center; }
}

/* ========================================================================
   持卡人姓名（选填）：列、手机卡片、生成表单标签、详情内联编辑
   ======================================================================== */
.label-opt { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); vertical-align: 1px; }
.table .col-holder { max-width: 150px; }
.table .col-holder .holder-name { display: inline-block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--text); font-weight: 500; }
.cell-empty { color: var(--muted); }
.holder-edit { display: flex; gap: 8px; align-items: center; min-width: 0; width: 100%; margin: 0; }
.detail dt label { cursor: pointer; }
.detail dt:has(+ dd .holder-edit) { align-self: center; }
.holder-edit input {
  flex: 1 1 auto; min-width: 0; width: auto; height: 38px; padding: 0 12px; border-radius: 10px; border: 0;
  background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: inherit;
  transition: box-shadow .25s var(--ease), background-color .25s;
}
.holder-edit input::placeholder { color: var(--muted); }
.holder-edit input:hover { box-shadow: inset 0 0 0 1px var(--line-hi); }
.holder-edit input:focus { outline: none; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--pink), 0 0 0 4px var(--pink-soft), 0 0 22px -6px var(--pink-glow); }
.holder-edit .btn { flex: none; }
@media (pointer: coarse), (max-width: 1023px) {
  .holder-edit input { height: 44px; font-size: 16px; } /* 16px 防 iOS 聚焦缩放 */
  .field > input, .input-wrap input, .select { height: 44px; } /* 触屏表单输入框 ≥44px */
}
@media (max-width: 900px) {
  .table-cards tbody tr { grid-template-areas: "chk key status" "chk holder holder" "chk meta meta" "chk dates dates" "acts acts acts"; }
  .table-cards .col-holder { grid-area: holder; display: block !important; max-width: none; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table-cards .col-holder::before { content: "姓名" !important; display: inline !important; margin-right: 6px; color: var(--muted); font-size: 12px; opacity: .7; }
  .table-cards .col-holder .holder-name { max-width: none; display: inline; }
}
