/* ============================================================
   admin.css — 北辰韵染 Ray · 后台控制台
   依赖 tokens.css（只读，不改）；本文件只新增 --adm-* 私有变量。
   风格：静默暗色 + 液态玻璃。后台不引 WebGL（要轻、要稳）。
   ============================================================ */

/* ---------- 本页私有变量 ---------- */
:root {
  --adm-side: 262px;
  --adm-maxw: 1180px;
  --adm-danger: #ff7285;
  --adm-danger-soft: rgba(255, 114, 133, .16);
  --adm-ok: #6fe3b4;
  --adm-ok-soft: rgba(111, 227, 180, .14);
  --adm-warn: #ffc46b;
  --adm-warn-soft: rgba(255, 196, 107, .14);
  --adm-line: var(--wash-c);
  --adm-line-hi: var(--wash-d);
  --adm-fill: var(--wash-a);
  --adm-fill-hi: var(--wash-c);
  --adm-radius: 14px;
  --adm-topbar: 0px;
}

/* ============================================================
   0. 基础重置 / 页面骨架
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  /* 移动端不允许横向滚动：任何溢出都在此被切断 */
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 12% -10%, var(--bg2) 0%, transparent 58%),
    radial-gradient(90% 70% at 100% 0%, color-mix(in oklab, var(--acc2) 16%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 52%, var(--bg0));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

/* 全局焦点环（tokens.css 已给 :focus-visible 兜底，这里补形状贴合） */
:focus-visible {
  outline-offset: 2px;
}

/* 内联 SVG 统一描边风格 */
.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 关键：下列元素自带 display 声明，会覆盖 [hidden] 的 UA 样式，
   必须显式兜底，否则隐藏的模态层会变成拦截全页点击的隐形遮罩。 */
.modal-root[hidden],
.console[hidden],
.panel[hidden],
.ban[hidden],
#ban-precise[hidden],
.field__hint[hidden],
.form__error[hidden] { display: none !important; }

/* 无障碍：屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   1. 静默暗色背景层：极光 + 暗角 + 噪点
   （纯 CSS，无 WebGL / 无 canvas，后台保持轻量）
   ============================================================ */

.bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(200deg, var(--bg1), var(--bg0) 62%, #04060c);
}

/* 两团极缓慢呼吸的极光，只做 opacity/transform 动画 */
.bg__aurora {
  position: absolute;
  inset: -22%;
  background:
    radial-gradient(38% 42% at 22% 18%, color-mix(in oklab, var(--acc1) 30%, transparent) 0%, transparent 62%),
    radial-gradient(34% 38% at 82% 12%, color-mix(in oklab, var(--acc2) 26%, transparent) 0%, transparent 62%),
    radial-gradient(44% 44% at 62% 92%, color-mix(in oklab, var(--acc3) 14%, transparent) 0%, transparent 66%);
  filter: blur(28px) saturate(120%);
  opacity: .55;
  animation: adm-aurora 26s var(--ease-out) infinite alternate;
  will-change: transform, opacity;
}

@keyframes adm-aurora {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); opacity: .42; }
  to   { transform: translate3d(1.8%, 1.4%, 0) scale(1.08); opacity: .62; }
}

/* 柔和暗角，把注意力收回中央 */
.bg__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 100% at 50% 40%, transparent 34%, rgba(2, 4, 10, .55) 78%, rgba(1, 2, 6, .88) 100%);
}

/* 细噪点：与主站的玻璃质感同源 */
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='.5'/%3E%3C/svg%3E");
}

/* ============================================================
   2. 通用控件：按钮 / 输入 / 开关 / 搜索
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: var(--adm-fill);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(var(--blur-soft));
  backdrop-filter: blur(var(--blur-soft));
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-spring),
    box-shadow var(--dur-1) var(--ease-out),
    opacity var(--dur-1) var(--ease-out);
}

.btn:hover {
  background: var(--adm-fill-hi);
  border-color: var(--glass-border-hi);
}

.btn:active { transform: translateY(1px) scale(.988); }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  border-color: color-mix(in oklab, var(--acc1) 42%, transparent);
  background:
    linear-gradient(180deg, var(--wash-d), var(--wash-a)),
    color-mix(in oklab, var(--acc1) 26%, var(--wash-b));
  color: #f6fbff;
  box-shadow:
    0 10px 26px -14px color-mix(in oklab, var(--acc1) 78%, transparent),
    inset 0 1px 0 var(--wash-e);
  font-weight: 600;
}

.btn--primary:hover {
  background:
    linear-gradient(180deg, var(--wash-e), var(--wash-b)),
    color-mix(in oklab, var(--acc1) 34%, var(--wash-c));
  border-color: color-mix(in oklab, var(--acc1) 62%, transparent);
}

.btn--ghost {
  background: transparent;
  border-color: var(--adm-line);
  color: var(--ink-dim);
}

.btn--ghost:hover {
  color: var(--ink);
  background: var(--adm-fill);
  border-color: var(--adm-line-hi);
}

.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.btn--sm .ico { width: 16px; height: 16px; }

.btn--block { width: 100%; }

/* loading 态：字隐掉，环形 spinner 居中（按钮本身不禁用，靠 flag 防连点） */
.btn .spinner {
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-1) var(--ease-out);
}

.btn { position: relative; }

.btn[aria-busy="true"] .spinner { opacity: .9; animation: adm-spin .72s linear infinite; }
.btn[aria-busy="true"] .btn__label { opacity: 0; }
.btn[aria-busy="true"] { cursor: progress; }

@keyframes adm-spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  transition:
    color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out);
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--adm-fill-hi);
  border-color: var(--adm-line);
}

.icon-btn--danger:hover {
  color: var(--adm-danger);
  background: var(--adm-danger-soft);
  border-color: color-mix(in oklab, var(--adm-danger) 34%, transparent);
}

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field__label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--ink-dim);
}

.field__label .req { color: var(--acc3); }

.field__hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.field__hint--warn { color: var(--adm-warn); }
.field__hint--bad { color: var(--adm-danger); }

.input {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-line);
  background: rgba(6, 10, 20, .34);
  color: var(--ink);
  font-size: 14.5px;
  /* 输入内容保持原样，不做任何大小写转换 */
  text-transform: none;
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out);
}

.input::placeholder { color: var(--ink-faint); }

.input:hover { border-color: var(--adm-line-hi); }

.input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--acc1) 58%, transparent);
  background: rgba(8, 14, 28, .52);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--acc1) 16%, transparent);
}

.input--area {
  min-height: 88px;
  padding-top: 11px;
  resize: vertical;
  line-height: 1.6;
}

.input--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a9bcd8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.input--select option {
  background: #0b1220;
  color: #eaf2ff;
}

/* 密码输入 + 眼睛按钮 */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input { padding-right: 48px; }

.input-wrap__eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
}

/* 开关 */
.field--switches {
  justify-content: flex-start;
  gap: 10px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  color: var(--ink-dim);
}

/* 原生 checkbox 透明覆盖整个开关：既保留键盘可达性，又让点击热区命中真实控件 */
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  border-radius: var(--r-pill);
  border: 1px solid var(--adm-line);
  background: rgba(0, 0, 0, .34);
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}

.switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2) var(--ease-out);
}

.switch input:checked + .switch__track {
  background: color-mix(in oklab, var(--acc1) 44%, transparent);
  border-color: color-mix(in oklab, var(--acc1) 62%, transparent);
}

.switch input:checked + .switch__track .switch__knob {
  transform: translateX(18px);
  background: #fff;
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid color-mix(in oklab, var(--acc1) 78%, white);
  outline-offset: 3px;
}

.switch input:checked ~ .switch__text { color: var(--ink); }

/* 搜索框 */
.search {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--ink-faint);
}

.search .ico {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search input {
  width: 190px;
  min-height: 36px;
  padding: 6px 12px 6px 36px;
  border-radius: var(--r-pill);
  border: 1px solid var(--adm-line);
  background: rgba(6, 10, 20, .3);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color var(--dur-1) var(--ease-out), width var(--dur-2) var(--ease-out);
}

.search input::placeholder { color: var(--ink-faint); }
.search input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--acc1) 50%, transparent);
  width: 220px;
}

/* 标签 chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--adm-line-hi);
  background: var(--adm-fill);
  font-size: 12.5px;
  color: var(--ink);
  animation: adm-chip-in var(--dur-2) var(--ease-spring);
}

@keyframes adm-chip-in {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}

.chip__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
}

.chip__x:hover { color: var(--adm-danger); background: var(--adm-danger-soft); }
.chip__x .ico { width: 12px; height: 12px; stroke-width: 2.2; }

/* ============================================================
   3. 登录门
   ============================================================ */

.app {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  min-height: 100dvh;
}

.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(20px, 5vw, 48px) var(--gutter);
}

.gate__inner {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.gate-card {
  width: 100%;
  padding: clamp(26px, 5vw, 40px) clamp(22px, 5vw, 36px) clamp(22px, 4vw, 30px);
  border-radius: var(--r-xl);
  text-align: center;
  animation: adm-gate-in var(--dur-3) var(--ease-spring) both;
}

@keyframes adm-gate-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 抖动：密码错误 */
.gate-card.is-shake {
  animation: adm-shake .46s cubic-bezier(.36, .07, .19, .97);
}

@keyframes adm-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.gate-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid var(--glass-border-hi);
  background:
    linear-gradient(180deg, var(--wash-d), var(--wash-a));
  color: color-mix(in oklab, var(--acc1) 84%, white);
  box-shadow:
    0 12px 30px -14px color-mix(in oklab, var(--acc1) 70%, transparent),
    inset 0 1px 0 var(--wash-e);
}

.gate-card__mark .ico { width: 24px; height: 24px; }

.gate-card__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: .32em;
  font-family: var(--font-display);
  font-size: clamp(21px, 5.4vw, 27px);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
  color: var(--ink-strong);
}

.gate-card__dot { color: var(--ink-faint); font-weight: 400; }

.gate-card__sub {
  margin-top: 8px;
  font-size: 12.5px;
  letter-spacing: .18em;
  color: var(--ink-faint);
}

.gate-form {
  margin-top: 24px;
  text-align: left;
}

.gate-form .field { gap: 8px; }

.gate-form__submit {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  font-size: 15px;
}

.gate-msg {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink-dim);
}

.gate-msg--bad { color: var(--adm-danger); }
.gate-msg--ok { color: var(--adm-ok); }

.gate-card__hair {
  margin: 22px 0 14px;
  opacity: .7;
}

.gate-card__foot {
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

.gate__note {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  text-align: center;
}

/* 封禁卡片 */
.ban {
  margin-top: 20px;
  padding: 18px 16px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklab, var(--adm-danger) 34%, transparent);
  background: var(--adm-danger-soft);
  text-align: left;
  animation: adm-ban-in var(--dur-2) var(--ease-spring) both;
}

@keyframes adm-ban-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ban__head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ban__ico { color: var(--adm-danger); width: 19px; height: 19px; }

.ban__title {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffd9de;
}

.ban__text {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 226, 230, .78);
}

.ban__timer {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 12px;
}

.ban__label {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: rgba(255, 226, 230, .6);
}

.ban__count {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.ban__hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 226, 230, .58);
}

.ban__precise {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: rgba(255, 226, 230, .5);
}

/* 门与台切换 */
body[data-view="gate"] .console { display: none; }
body[data-view="console"] .gate { display: none; }

/* ============================================================
   4. 控制台布局
   ============================================================ */

.console {
  display: grid;
  grid-template-columns: var(--adm-side) minmax(0, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
  width: 100%;
  max-width: var(--adm-maxw);
  margin: 0 auto;
  padding: clamp(16px, 2.4vw, 26px) var(--gutter) clamp(26px, 4vw, 44px);
  align-items: start;
}

/* ---------- 侧边栏 ---------- */
.side {
  position: sticky;
  top: clamp(16px, 2.4vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 16px;
  border-radius: var(--r-xl);
  max-height: calc(100dvh - 2 * clamp(16px, 2.4vw, 26px));
}

.side__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px 0;
  min-width: 0;
}

.side__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--glass-border-hi);
  background: linear-gradient(180deg, var(--wash-d), var(--wash-a));
  color: color-mix(in oklab, var(--acc1) 82%, white);
}

.side__badge .ico { width: 17px; height: 17px; }

.side__ident { min-width: 0; }

.side__name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side__role {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-faint);
}

.side__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 13.5px;
  text-align: left;
  transition:
    color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out);
}

.tab:hover { color: var(--ink); background: var(--adm-fill); }

.tab[aria-selected="true"] {
  color: #fff;
  border-color: color-mix(in oklab, var(--acc1) 30%, transparent);
  background:
    linear-gradient(180deg, var(--wash-d), var(--wash-a)),
    color-mix(in oklab, var(--acc1) 12%, transparent);
  box-shadow: inset 0 1px 0 var(--wash-d);
}

.tab[aria-selected="true"] .ico { color: color-mix(in oklab, var(--acc1) 86%, white); }

.tab__count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--adm-line);
  background: rgba(0, 0, 0, .26);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  color: var(--ink-dim);
}

.side__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--adm-line);
}

.side__meta {
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--ink-faint);
}

/* ---------- 主内容 ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.6vw, 18px);
}

.main:focus { outline: none; }

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 2px 4px;
}

.topbar__text { min-width: 0; }

.topbar__title {
  font-family: var(--font-display);
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-strong);
}

.topbar__sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 调试预览横幅（仅 ?preview=1） */
.preview-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in oklab, var(--acc1) 34%, transparent);
  background: color-mix(in oklab, var(--acc1) 12%, transparent);
  font-size: 12.5px;
  color: color-mix(in oklab, var(--acc1) 24%, white);
}

.preview-banner[hidden] { display: none !important; }
.preview-banner .ico { width: 15px; height: 15px; flex: none; }

/* ---------- 面板 ---------- */
.panel {
  padding: clamp(14px, 2vw, 22px);
  border-radius: var(--r-xl);
  animation: adm-panel-in var(--dur-3) var(--ease-out) both;
}

@keyframes adm-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel__titles { min-width: 0; }

.panel__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink);
}

.panel__hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-faint);
}

.panel__tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

/* ---------- 列表行（站点 / 分类） ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-line);
  background: var(--wash-a);
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
  min-width: 0;
}

.row:hover {
  border-color: var(--adm-line-hi);
  background: var(--wash-b);
}

.row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  border: 1px solid var(--adm-line);
  background: var(--wash-b);
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  color: color-mix(in oklab, var(--acc1) 80%, white);
}

.row__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.row__main { min-width: 0; flex: 1 1 auto; }

.row__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  min-width: 0;
}

.row__title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__url {
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.row__desc {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--adm-line);
  background: var(--wash-b);
  font-size: 11px;
  line-height: 17px;
  letter-spacing: .02em;
  color: var(--ink-dim);
  white-space: nowrap;
}

.badge .ico { width: 11px; height: 11px; stroke-width: 2; }

.badge--cat {
  border-color: color-mix(in oklab, var(--acc2) 34%, transparent);
  background: color-mix(in oklab, var(--acc2) 14%, transparent);
  color: color-mix(in oklab, var(--acc2) 32%, white);
}

.badge--pin {
  border-color: color-mix(in oklab, var(--acc1) 40%, transparent);
  background: color-mix(in oklab, var(--acc1) 15%, transparent);
  color: color-mix(in oklab, var(--acc1) 30%, white);
}

.badge--hidden {
  border-color: var(--adm-line-hi);
  background: rgba(0, 0, 0, .3);
  color: var(--ink-faint);
}

.badge--sort {
  font-family: var(--font-mono);
}

.tag {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--wash-b);
  font-size: 11px;
  line-height: 17px;
  color: var(--ink-dim);
}

.row__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.row--cat .row__main { display: flex; align-items: center; gap: 10px; }

.cat__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空状态 / 骨架 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 16px;
  border-radius: var(--adm-radius);
  border: 1px dashed var(--adm-line);
  text-align: center;
}

.empty__title { font-size: 13.5px; color: var(--ink-dim); }
.empty__hint { font-size: 12px; color: var(--ink-faint); }

.skeleton {
  height: 62px;
  border-radius: var(--adm-radius);
  border: 1px solid var(--adm-line);
  background: linear-gradient(100deg, var(--wash-a) 20%, var(--wash-c) 40%, var(--wash-a) 60%);
  background-size: 260% 100%;
  animation: adm-shimmer 1.5s linear infinite;
}

@keyframes adm-shimmer {
  from { background-position: 140% 0; }
  to   { background-position: -60% 0; }
}

/* ============================================================
   5. 个人资料表单
   ============================================================ */

.form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

.form__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form__msg {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-dim);
}

.form__msg--bad { color: var(--adm-danger); }
.form__msg--ok { color: var(--adm-ok); }

.form__error {
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid color-mix(in oklab, var(--adm-danger) 36%, transparent);
  background: var(--adm-danger-soft);
  font-size: 12.5px;
  color: #ffd9de;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* 外链编辑行 */
.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(90px, .8fr) minmax(0, 1.6fr) auto;
  gap: 8px;
  align-items: center;
}

.link-row__del { width: 34px; height: 34px; }
.link-row__del .ico { width: 15px; height: 15px; }

/* ============================================================
   6. 模态（玻璃 + 模糊遮罩 + 移动端全屏）
   ============================================================ */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-root__scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, .58);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  animation: adm-fade-in var(--dur-2) var(--ease-out) both;
}

@keyframes adm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86dvh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  animation: adm-modal-in var(--dur-2) var(--ease-spring) both;
  overflow: hidden;
}

.modal--sm { width: min(430px, 100%); }

@keyframes adm-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px 20px;
  flex: none;
}

.modal__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-strong);
}

.modal__close { width: 34px; height: 34px; flex: none; }

/* 模态内的表单本身就是撑满的纵向 flex：正文可滚动，底部按钮永远钉在视口内 */
.modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 6px 20px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 18px;
  flex: none;
}

.modal .modal__foot { border-top: 1px solid var(--adm-line); margin-top: 14px; }

.confirm__msg {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-dim);
  padding: 2px 0 6px;
}

/* ============================================================
   7. Toast
   ============================================================ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: calc(var(--z-modal) + 10);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  pointer-events: none;
  transition: top var(--dur-2) var(--ease-out), bottom var(--dur-2) var(--ease-out);
}

/* 模态打开时 toast 整体移到顶部：不遮挡模态底部的「取消/保存」按钮 */
body.is-modal .toasts {
  bottom: auto;
  top: max(16px, env(safe-area-inset-top, 0px));
}

body.is-modal .toast {
  animation: adm-toast-in-top var(--dur-2) var(--ease-spring) both;
}

@keyframes adm-toast-in-top {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-border-hi);
  background: rgba(12, 18, 32, .82);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
  color: var(--ink);
  animation: adm-toast-in var(--dur-2) var(--ease-spring) both;
}

.toast.is-out { animation: adm-toast-out var(--dur-2) var(--ease-out) both; }

@keyframes adm-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes adm-toast-out {
  to { opacity: 0; transform: translateY(8px) scale(.97); }
}

.toast .ico { width: 16px; height: 16px; }
.toast--ok .ico { color: var(--adm-ok); }
.toast--bad .ico { color: var(--adm-danger); }
.toast--info .ico { color: var(--acc1); }

/* ============================================================
   8. 响应式
   ============================================================ */

/* 中等屏：侧边栏收窄 */
@media (max-width: 1080px) {
  :root { --adm-side: 228px; }
  .search input { width: 150px; }
  .search input:focus { width: 180px; }
}

/* 平板 / 手机：侧边栏 → 顶部横向 tab */
@media (max-width: 860px) {
  .console {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-top: 12px;
  }

  .side {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    flex-direction: column;
    gap: 10px;
    max-height: none;
    padding: 10px 10px 8px;
    border-radius: var(--r-lg);
    /* 顶部 tab 需要压住滚动内容，玻璃要更实一点 */
    background:
      linear-gradient(180deg, var(--wash-c), var(--wash-a)),
      rgba(10, 14, 26, .72);
  }

  .side__brand { padding: 0 4px 2px; }

  .side__badge { width: 30px; height: 30px; border-radius: 10px; }
  .side__badge .ico { width: 15px; height: 15px; }
  .side__name { font-size: 13px; }
  .side__role { font-size: 10px; letter-spacing: .14em; }

  .side__nav {
    flex-direction: row;
    gap: 4px;
    /* 三个 tab 在 390px 内必须放得下，不分页不滚动 */
    width: 100%;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    justify-content: center;
    padding: 0 6px;
    gap: 6px;
    font-size: 12.5px;
    text-align: center;
  }

  .tab > span:not(.tab__count) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab__count { display: none; }

  .side__foot { display: none; }

  .preview-banner { font-size: 12px; padding: 7px 12px; border-radius: var(--r-md); }

  .topbar { align-items: center; }
  .topbar__title { font-size: 20px; }
  .topbar__sub { display: none; }
  .topbar__actions { gap: 6px; }

  .topbar__actions .btn--sm {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12.5px;
  }

  .topbar__actions .btn--sm .ico { width: 15px; height: 15px; }

  .panel { padding: 13px; border-radius: var(--r-lg); }

  .panel__head { gap: 10px; margin-bottom: 12px; }

  .panel__tools { width: 100%; }

  .search { flex: 1 1 auto; min-width: 0; }
  .search input,
  .search input:focus { width: 100%; }

  .panel__tools .btn { flex: none; }

  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }

  .link-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) auto; }

  /* 模态全屏化 */
  .modal-root { padding: 0; align-items: flex-end; }

  .modal {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  /* 短内容模态（分类/确认）不撑满整屏：底部吸附、高度自适应内容，
     否则一屏空白很难看。表单长模态仍全屏，保证底部按钮永远可达。 */
  .modal--sm {
    width: 100%;
    height: auto;
    max-height: min(88dvh, 620px);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 0;
    animation-name: adm-modal-sheet;
  }

  @keyframes adm-modal-sheet {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .modal__head { padding: 14px 12px 8px 16px; }
  .modal__form { flex: 1 1 auto; min-height: 0; }
  .modal__body { padding: 4px 16px 12px; }
  .modal__foot {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    justify-content: stretch;
  }
  .modal__foot .btn { flex: 1 1 0; }

  .toasts {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    transform: none;
    width: auto;
    max-width: none;
  }

  .toast { width: 100%; justify-content: center; }
}

/* 小手机：390px 级别 */
@media (max-width: 430px) {
  :root { --gutter: 14px; }

  .console { padding-left: 12px; padding-right: 12px; }

  .tab { font-size: 12px; gap: 5px; padding: 0 4px; }
  .tab .ico { width: 15px; height: 15px; }

  .gate { padding-left: 14px; padding-right: 14px; }

  .gate-card { border-radius: var(--r-lg); }

  .gate-card__title { font-size: 20px; }

  .row { gap: 10px; padding: 10px; }
  .row__icon { width: 34px; height: 34px; }
  .row__desc { -webkit-line-clamp: 2; }

  /* 行内操作在窄屏改成竖向更省宽度 */
  .row__actions { flex-direction: column; }

  .row__actions .icon-btn { width: 30px; height: 30px; }
}

/* 极窄屏兜底（320px） */
@media (max-width: 350px) {
  .tab .ico { display: none; }
  .link-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
}

/* 高度很矮的横屏，避免登录卡被裁 */
@media (max-height: 560px) and (min-width: 700px) {
  .gate { align-items: flex-start; }
}

/* ============================================================
   9. 动效降级 & 打印
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .bg__aurora { animation: none; opacity: .5; }
  .skeleton { animation: none; background: var(--wash-a); }
  .gate-card,
  .panel,
  .modal,
  .toast,
  .chip,
  .ban { animation: none !important; }
  .gate-card.is-shake { animation: none !important; }
}

@media print {
  .bg,
  .side,
  .topbar__actions,
  .toasts,
  .modal-root { display: none !important; }
}
