/* ==========================================================================
   世界锁网站 · 界面设计系统 v3
   --------------------------------------------------------------------------
   分层：tokens → 基础 → 背景特效 → 布局骨架 → 组件 → 响应式 → 动效
   规则：所有颜色/圆角/间距走变量；主题与密度由 body 上的 data-* 切换。
   ========================================================================== */

/* ---------------------------------------------------------------- 1. Tokens */
:root {
  /* 字体 */
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Cascadia Code", "JetBrains Mono", Consolas, "Microsoft YaHei", monospace;

  /* 底色与表面 */
  --bg-1: #eef3ff;
  --bg-2: #f7f1ff;
  --bg-3: #e9faff;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-2: rgba(255, 255, 255, 0.55);
  --surface-3: rgba(255, 255, 255, 0.35);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --glass-input: rgba(255, 255, 255, 0.82);

  /* 描边与文字 */
  --stroke: rgba(122, 140, 200, 0.24);
  --stroke-strong: rgba(122, 140, 200, 0.44);
  --text: #0f1c33;
  --text-2: #33456a;
  --muted: #67799c;
  --on-accent: #ffffff;

  /* 主色（--accent-rgb 供 rgba() 拼装，避免 color-mix 兼容问题） */
  --accent: #3b82f6;
  --accent-rgb: 59, 130, 246;
  --accent-2: #8b5cf6;
  --accent-2-rgb: 139, 92, 246;
  --cyan: #22d3ee;
  --cyan-rgb: 34, 211, 238;

  /* 语义色 */
  --ok: #10b981;
  --ok-rgb: 16, 185, 129;
  --bad: #ef4444;
  --bad-rgb: 239, 68, 68;
  --warn: #f59e0b;
  --warn-rgb: 245, 158, 11;

  /* 光斑 */
  --blob-a: #8fbcff;
  --blob-b: #cbb2ff;
  --blob-c: #86eaff;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(24, 40, 90, 0.06);
  --shadow-sm: 0 4px 14px rgba(24, 40, 90, 0.08);
  --shadow: 0 12px 34px rgba(24, 40, 90, 0.12);
  --shadow-lg: 0 26px 60px rgba(18, 30, 70, 0.20);
  --shadow-glow: 0 10px 30px rgba(var(--accent-rgb), 0.32);

  /* 圆角 */
  --radius-xl: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-inner: 12px;
  --radius-xs: 9px;
  --radius-pill: 999px;

  /* 密度（body[data-density] 覆盖） */
  --pad-card: 20px;
  --gap: 16px;
  --row-pad: 11px 13px;

  /* 骨架尺寸 */
  --sidebar-w: 252px;
  --topbar-h: 62px;
  --ring: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}

/* 黑夜模式 */
body[data-theme="dark"] {
  --bg-1: #070c18;
  --bg-2: #100d24;
  --bg-3: #04141c;
  --surface: rgba(19, 27, 45, 0.72);
  --surface-2: rgba(19, 27, 45, 0.55);
  --surface-3: rgba(19, 27, 45, 0.35);
  --glass: rgba(15, 22, 38, 0.72);
  --glass-strong: rgba(12, 18, 32, 0.9);
  --glass-input: rgba(20, 28, 48, 0.82);
  --stroke: rgba(148, 163, 204, 0.20);
  --stroke-strong: rgba(148, 163, 204, 0.38);
  --text: #e9f0fb;
  --text-2: #c2cee4;
  --muted: #8fa2c2;
  --blob-a: #1f3b78;
  --blob-b: #3d2a68;
  --blob-c: #0b4356;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.6);
}

/* 主题色预设 */
body[data-accent="purple"] {
  --accent: #8b5cf6; --accent-rgb: 139, 92, 246;
  --accent-2: #ec4899; --accent-2-rgb: 236, 72, 153;
  --cyan: #a78bfa; --cyan-rgb: 167, 139, 250;
  --blob-a: #a78bfa; --blob-b: #f0abfc; --blob-c: #c4b5fd;
}
body[data-accent="cyan"] {
  --accent: #06b6d4; --accent-rgb: 6, 182, 212;
  --accent-2: #3b82f6; --accent-2-rgb: 59, 130, 246;
  --cyan: #22d3ee; --cyan-rgb: 34, 211, 238;
  --blob-a: #67e8f9; --blob-b: #8fbcff; --blob-c: #5eead4;
}
body[data-accent="pink"] {
  --accent: #ec4899; --accent-rgb: 236, 72, 153;
  --accent-2: #8b5cf6; --accent-2-rgb: 139, 92, 246;
  --cyan: #f472b6; --cyan-rgb: 244, 114, 182;
  --blob-a: #f9a8d4; --blob-b: #cbb2ff; --blob-c: #fda4af;
}
body[data-accent="green"] {
  --accent: #10b981; --accent-rgb: 16, 185, 129;
  --accent-2: #06b6d4; --accent-2-rgb: 6, 182, 212;
  --cyan: #34d399; --cyan-rgb: 52, 211, 153;
  --blob-a: #6ee7b7; --blob-b: #67e8f9; --blob-c: #a7f3d0;
}
body[data-accent="amber"] {
  --accent: #f59e0b; --accent-rgb: 245, 158, 11;
  --accent-2: #ef4444; --accent-2-rgb: 239, 68, 68;
  --cyan: #fbbf24; --cyan-rgb: 251, 191, 36;
  --blob-a: #fcd34d; --blob-b: #fca5a5; --blob-c: #fdba74;
}

/* 密度 */
body[data-density="compact"] {
  --pad-card: 14px;
  --gap: 12px;
  --row-pad: 8px 11px;
  --radius: 15px;
}

/* ------------------------------------------------------------- 2. 基础层 */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.62;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 10% -12%, var(--blob-a) 0%, transparent 58%),
    radial-gradient(1050px 560px at 102% -4%, var(--blob-b) 0%, transparent 58%),
    radial-gradient(960px 640px at 52% 112%, var(--blob-c) 0%, transparent 58%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .4s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: .2px; }
p { margin: 0 0 10px; }
code, kbd, pre { font-family: var(--font-mono); }

/* 统一键盘焦点环 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(130, 150, 200, 0.34);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(130, 150, 200, 0.6); background-clip: content-box; }

/* 统一选中/隐藏语义 */
[hidden] { display: none !important; }
::selection { background: rgba(var(--accent-rgb), 0.28); }

/* --------------------------------------------------- 3. 动态背景特效层 */
.bg-fx { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }

.bg-fx .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(78px);
  opacity: .52;
  will-change: transform;
  transition: background .5s ease;
  animation: drift 22s ease-in-out infinite;
}
.bg-fx .orb.o1 { width: 460px; height: 460px; left: -110px; top: -90px; background: var(--blob-a); }
.bg-fx .orb.o2 { width: 400px; height: 400px; right: -90px; top: 6%; background: var(--blob-b); animation-delay: -7s; }
.bg-fx .orb.o3 { width: 360px; height: 360px; left: 32%; bottom: -120px; background: var(--blob-c); animation-delay: -14s; }

/* 科技网格 */
.bg-fx .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.10) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(760px 520px at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(760px 520px at 50% 0%, #000 0%, transparent 78%);
  opacity: .55;
}

/* 顶部光束 */
.bg-fx .beam {
  position: absolute; left: 50%; top: -220px;
  width: 900px; height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.28), transparent 72%);
  filter: blur(28px);
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(46px, 34px, 0) scale(1.09); }
  66% { transform: translate3d(-34px, 22px, 0) scale(.93); }
}

/* 动效强度：off 全静止 / soft 低速 / live 全开 */
body[data-fx="off"] .bg-fx .orb { animation: none; opacity: .34; }
body[data-fx="off"] .bg-fx .grid { opacity: .3; }
body[data-fx="soft"] .bg-fx .orb { animation-duration: 40s; opacity: .42; }

/* ------------------------------------------------------- 4. 布局骨架 */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
}

/* ---- 侧边栏 ---- */
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 16px 14px 14px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-right: 1px solid var(--stroke);
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 14px;
  font-weight: 800; font-size: 17px; letter-spacing: .4px;
  white-space: nowrap;
}
.brand .mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-glow);
}
.brand .txt {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .6px; }

.side-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.nav-group { margin-bottom: 14px; }
.nav-group > .t {
  padding: 6px 12px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.1px;
  color: var(--muted); text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 14px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .16s ease;
}
.nav-item .ic { width: 18px; text-align: center; font-size: 15px; flex: none; }
.nav-item .cnt {
  margin-left: auto;
  padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--muted);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  color: var(--text); border-color: var(--stroke);
  background: linear-gradient(100deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-2-rgb), .08));
  box-shadow: var(--shadow-xs);
}
.nav-item.active::before {
  content: ""; position: absolute; left: 3px; top: 50%;
  width: 3px; height: 18px; transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), .85);
}

.side-foot {
  border-top: 1px solid var(--stroke);
  padding-top: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.side-tip {
  display: block;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed var(--stroke-strong);
  font-size: 12px; line-height: 1.55; color: var(--muted);
}
.side-tip b { color: var(--text-2); }

/* ---- 主列 ---- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 35;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  min-height: var(--topbar-h);
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--stroke);
}
.topbar .spacer { flex: 1; }
.page-title { font-size: 15px; font-weight: 700; }
.page-title small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); }

/* 搜索 / 命令面板触发器 */
.search-trigger {
  display: flex; align-items: center; gap: 9px;
  min-width: 220px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--glass-input);
  border: 1px solid var(--stroke);
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--shadow-xs); }
.search-trigger kbd {
  margin-left: auto;
  padding: 2px 7px; border-radius: 7px; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--muted);
}

.icon-btn {
  width: 38px; height: 38px; padding: 0; flex: none;
  border-radius: var(--radius-sm);
  display: grid; place-items: center; font-size: 17px;
  background: var(--glass-input); border: 1px solid var(--stroke); color: var(--text);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.menu-btn { display: none; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--glass-input);
  border: 1px solid var(--stroke); border-radius: var(--radius-pill);
}
.user-chip:hover { border-color: var(--accent); box-shadow: var(--shadow-xs); }
.avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), .4);
}
.avatar.big { width: 46px; height: 46px; font-size: 20px; }
.chip-name { font-weight: 700; font-size: 14px; }

/* ---- 内容区 ---- */
.content {
  width: 100%; max-width: 1240px;
  margin: 0 auto;
  padding: 22px 24px 110px;
  display: flex; flex-direction: column; gap: 18px;
}

/* 区块标题 */
.sec { display: flex; flex-direction: column; gap: var(--gap); scroll-margin-top: 76px; }
.sec-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.sec-head h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.sec-head h2 .ic {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; font-size: 15px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .18), rgba(var(--accent-2-rgb), .14));
  border: 1px solid var(--stroke);
}
.sec-head p { color: var(--muted); font-size: 13px; margin: 0; }
.sec-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.grp-head {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
}
.grp-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--stroke-strong), transparent); }

/* --------------------------------------------------------- 5. 卡片 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--gap);
}
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
/* 两列网格里落单的奇数张卡片铺满整行，避免右下角留空洞 */
.grid.cols-2 > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.card {
  position: relative;
  padding: var(--pad-card);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-xs);
  transition: transform .26s cubic-bezier(.2, 0, 0, 1), box-shadow .26s ease, border-color .26s ease;
}
/* 悬停时的渐变描边光环（不参与布局） */
.card::after {
  content: ""; position: absolute; inset: -1px;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .75), transparent 45%, rgba(var(--accent-2-rgb), .7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover::after { opacity: 1; }

/* 卡片头（图标 + 标题 + 说明 + 右侧操作） */
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head .tile {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center; font-size: 19px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .92), rgba(var(--accent-2-rgb), .92));
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), .34);
}
.card-head .tt { min-width: 0; flex: 1; }
.card-head .tt h3 { font-size: 15.5px; font-weight: 750; }
.card-head .tt p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-head .ops { display: flex; align-items: center; gap: 6px; flex: none; }

/* 兼容旧写法：直接放在卡片里的 h3 */
.card > h3 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--stroke);
  font-size: 15.5px; font-weight: 750;
}

/* 工具卡片 */
.tool { display: flex; flex-direction: column; overflow: hidden; }
.tool .body { display: flex; flex-direction: column; gap: 8px; }
.tool form { display: flex; flex-direction: column; gap: 8px; }
.tool .row { display: flex; gap: 8px; }
.tool .row > * { flex: 1; min-width: 0; }
.tool .foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.tool .foot .hint { font-size: 12px; color: var(--muted); }

/* 概览主卡 */
.hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: calc(var(--pad-card) + 4px);
  background:
    linear-gradient(115deg, rgba(var(--accent-rgb), .14), rgba(var(--accent-2-rgb), .10) 46%, transparent 78%),
    var(--surface);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .38), transparent 70%);
  filter: blur(6px); pointer-events: none;
}
.hero .who { flex: 1; min-width: 220px; }
.hero .hello { font-size: 13px; font-weight: 700; letter-spacing: .6px; color: var(--muted); text-transform: uppercase; }
.hero h1 { font-size: 25px; font-weight: 800; margin: 2px 0 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero .sub { font-size: 13px; color: var(--muted); }
.points {
  font-size: 32px; font-weight: 850; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.points.small { font-size: 22px; }
.hero .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 统计小卡 */
.stat {
  position: relative; overflow: hidden;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--stroke-strong); }
.stat .k { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.stat .v {
  margin-top: 2px;
  font-size: 25px; font-weight: 850; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); gap: 10px; }

/* 结果卡（查服/查联机/Ping） */
.result {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, rgba(var(--ok-rgb), .12), transparent 70%), var(--surface-2);
  border: 1px solid rgba(var(--ok-rgb), .4);
  animation: fadeUp .35s ease both;
}
.result.bad { background: linear-gradient(100deg, rgba(var(--bad-rgb), .12), transparent 70%), var(--surface-2); border-color: rgba(var(--bad-rgb), .4); }
.result .val { font-family: var(--font-mono); font-size: 15px; font-weight: 700; word-break: break-all; }
.result .lab { font-size: 12px; color: var(--muted); }

/* Ping 结构化结果 */
.probe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 9px; margin-top: 10px; }
.probe {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 12.5px;
  animation: fadeUp .3s ease both;
}
.probe .dot {
  width: 9px; height: 9px; margin-top: 6px; flex: none; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(120, 140, 200, .16);
}
.probe.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(var(--ok-rgb), .18); }
.probe.bad .dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(var(--bad-rgb), .18); }
.probe.warn .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(var(--warn-rgb), .18); }
.probe .kk { font-weight: 700; color: var(--text-2); font-size: 12px; }
.probe .vv { color: var(--muted); word-break: break-all; }
.probe .vv strong { color: var(--text); }

/* 空状态 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 16px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.empty .ic { font-size: 26px; opacity: .7; }

/* 骨架屏 */
.skeleton { display: flex; flex-direction: column; gap: 9px; padding: 4px 0; }
.sk-line {
  height: 12px; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2), rgba(var(--accent-rgb), .14), var(--surface-2));
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line.w40 { width: 40%; }
.sk-line.w70 { width: 70%; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ------------------------------------------------------ 6. 表单与按钮 */
label { display: block; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin: 8px 0 2px; }

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  margin: 0;
  background: var(--glass-input);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .82; }
input:hover, textarea:hover, select:hover { border-color: var(--stroke-strong); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--glass-strong);
}
textarea { min-height: 82px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 15px top 52%, right 10px top 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

/* 按钮 */
button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px; font-weight: 650;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: var(--glass-input);
  color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease, opacity .2s ease;
}
button:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-xs); }
button:active { transform: scale(.965); }
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .6; transform: none; box-shadow: none; }

.btn, .btn-primary {
  position: relative; overflow: hidden;
  border: none; color: var(--on-accent);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-glow);
}
.btn:hover, .btn-primary:hover {
  color: var(--on-accent);
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), .45);
  transform: translateY(-1px);
}
.btn::after, .btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 22%, rgba(255, 255, 255, .38) 50%, transparent 78%);
  transform: translateX(-110%);
  transition: transform .65s ease;
}
.btn:hover::after, .btn-primary:hover::after { transform: translateX(110%); }
.btn:disabled::after, .btn-primary:disabled::after { display: none; }

.btn-ghost { background: transparent; border-color: var(--stroke-strong); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--accent); }
.btn-soft {
  border: none; color: var(--accent);
  background: rgba(var(--accent-rgb), .12);
}
.btn-soft:hover { background: rgba(var(--accent-rgb), .2); color: var(--accent); }
.btn-block { width: 100%; }
.btn-small { padding: 5px 11px; font-size: 12.5px; border-radius: var(--radius-xs); }
.danger, .btn-small.danger, .btn-danger {
  background: linear-gradient(120deg, #ef4444, #f97316);
  color: #fff; border: none;
}
.danger:hover, .btn-small.danger:hover, .btn-danger:hover { color: #fff; box-shadow: 0 10px 24px rgba(var(--bad-rgb), .4); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); color: var(--accent); border-color: var(--stroke); }

/* 加载中的按钮 */
button[data-loading="1"] { position: relative; color: transparent !important; pointer-events: none; }
button[data-loading="1"]::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
button[data-loading="1"]:not(.btn):not(.btn-primary)::before { border-color: rgba(var(--accent-rgb), .3); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input, .inline select { width: auto; min-width: 96px; }
.inline button { flex: none; }

.checkbox { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); font-weight: 600; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); flex: none; }

/* 分段控件 */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--stroke);
  border-radius: var(--radius-pill);
}
.seg button {
  border: none; background: transparent; color: var(--muted);
  padding: 5px 13px; font-size: 12.5px; font-weight: 650; border-radius: var(--radius-pill);
}
.seg button:hover { color: var(--text); background: var(--surface-3); box-shadow: none; }
.seg button.on { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--shadow-xs); }

/* 色板 */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 2px solid transparent; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.swatch:hover { transform: scale(1.12); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .25); }

/* 表单里的辅助文本 */
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.out {
  margin-top: 10px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; color: var(--text-2); min-height: 42px;
}
.out:empty { display: none; }

/* ---------------------------------------------------------- 7. 数据表 */
.table-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.table-tools .filter { flex: 1; min-width: 160px; }
.table-tools .filter input { padding: 8px 12px; border-radius: var(--radius-pill); font-size: 13px; }
.count-pill {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  background: rgba(var(--accent-rgb), .12); color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), .28);
}

.table-wrap {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  max-height: 520px;
  overflow: auto;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 10px 13px;
  text-align: left;
  font-size: 11.5px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase;
  color: var(--muted);
  background: var(--glass-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}
tbody td {
  padding: var(--row-pad);
  border-bottom: 1px solid var(--stroke);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(var(--accent-rgb), .07); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td code {
  padding: 2px 7px; border-radius: 7px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--text-2);
}
.cell-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cell-ops form { display: inline-flex; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* 徽章 / 状态点 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--muted);
  white-space: nowrap;
}
.badge.ok { color: var(--ok); border-color: rgba(var(--ok-rgb), .4); background: rgba(var(--ok-rgb), .1); }
.badge.bad { color: var(--bad); border-color: rgba(var(--bad-rgb), .4); background: rgba(var(--bad-rgb), .1); }
.badge.warn { color: var(--warn); border-color: rgba(var(--warn-rgb), .4); background: rgba(var(--warn-rgb), .1); }
.badge.super { color: var(--accent-2); border-color: rgba(var(--accent-2-rgb), .4); background: rgba(var(--accent-2-rgb), .1); }
.badge.accent { color: var(--accent); border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .1); }

/* tag / 键帽 */
.kbd {
  display: inline-block; padding: 1px 7px; border-radius: 7px;
  font-size: 11px; font-family: var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--stroke); color: var(--muted);
}

/* --------------------------------------------------------- 8. 提示条 */
.toasts {
  position: fixed; top: 14px; right: 14px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
  width: min(380px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--glass-strong);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  white-space: pre-line;
  overflow: hidden;
  animation: toastIn .32s cubic-bezier(.2, 0, 0, 1) both;
}
.toast::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.toast.ok::before { background: var(--ok); }
.toast.error::before { background: var(--bad); }
.toast.info::before { background: var(--accent); }
.toast .ic { font-size: 15px; line-height: 1.4; flex: none; }
.toast.ok .ic { color: var(--ok); }
.toast.error .ic { color: var(--bad); }
.toast .msg { flex: 1; min-width: 0; word-break: break-word; }
.toast .x {
  flex: none; border: none; background: transparent; color: var(--muted);
  padding: 0 2px; font-size: 15px; line-height: 1;
}
.toast .x:hover { color: var(--bad); box-shadow: none; }
.toast.out { animation: toastOut .25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px) scale(.97); } }

/* ------------------------------------------------- 9. 下拉面板 */
.pop-panel {
  position: absolute; top: calc(var(--topbar-h) - 4px); right: 16px; z-index: 60;
  width: 300px; max-width: calc(100vw - 28px);
  padding: 14px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  animation: panelIn .22s cubic-bezier(.2, 0, 0, 1) both;
}
.pop-panel[hidden] { display: none; }
.pop-panel h3 { font-size: 14px; margin-bottom: 4px; }
@keyframes panelIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--stroke); }
.panel-head .name { font-weight: 800; font-size: 15px; }
.panel-points {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 0; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, rgba(var(--accent-rgb), .12), transparent 80%), var(--surface-2);
  font-size: 12.5px; color: var(--muted); font-weight: 650;
}
.panel-points strong { font-size: 20px; color: var(--text); }
.panel-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 8px; padding: 10px;
  border-radius: var(--radius-xs);
  font-weight: 650; color: var(--accent);
  background: transparent; border: 1px solid var(--stroke);
}
.panel-link:hover { background: rgba(var(--accent-rgb), .1); color: var(--accent); }
.panel-link.danger-text { color: var(--bad); }
.panel-link.danger-text:hover { background: rgba(var(--bad-rgb), .1); color: var(--bad); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 13px 0; }
.set-row > label { margin: 0; font-size: 12.5px; color: var(--muted); font-weight: 650; }

/* 移动端抽屉遮罩 */
.scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(8, 12, 24, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .2s ease both;
}
.scrim[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------------------------- 10. 命令面板 Ctrl+K */
.cmdk {
  position: fixed; inset: 0; z-index: 95;
  display: flex; justify-content: center;
  padding: 11vh 12px 12px;
  background: rgba(8, 12, 24, .44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .18s ease both;
}
.cmdk[hidden] { display: none; }
.cmdk-box {
  width: min(620px, 100%);
  max-height: 74vh;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn .22s cubic-bezier(.2, 0, 0, 1) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
.cmdk-input {
  width: 100%; padding: 16px 18px;
  border: none; border-bottom: 1px solid var(--stroke);
  background: transparent; font-size: 15px;
}
.cmdk-input:focus { box-shadow: none; background: transparent; }
.cmdk-list { overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2);
}
.cmdk-item .ic { font-size: 15px; width: 20px; text-align: center; }
.cmdk-item .d { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: auto; }
.cmdk-item.sel, .cmdk-item:hover { background: rgba(var(--accent-rgb), .14); color: var(--text); }
.cmdk-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 16px; border-top: 1px solid var(--stroke);
  font-size: 11.5px; color: var(--muted);
}

/* ---------------------------------------------------- 11. 弹窗（用户详情等） */
.modal {
  position: fixed; inset: 0; z-index: 96;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(8, 12, 24, .46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .18s ease both;
}
.modal-box {
  width: min(580px, 100%); max-height: 88vh; overflow-y: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg);
  animation: popIn .22s cubic-bezier(.2, 0, 0, 1) both;
}
.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head .tt { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; text-align: right; word-break: break-all; }
.op-block {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}
.op-block > .t { font-size: 12px; font-weight: 750; color: var(--muted); letter-spacing: .4px; margin-bottom: 8px; }
.op-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.op-num { width: 84px; padding: 8px 10px; text-align: center; }
.op-sel { width: auto; min-width: 108px; padding: 8px 28px 8px 10px; }

/* ---------------------------------------------------- 12. 认证页 */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.06fr .94fr; }

.auth-side {
  position: relative; overflow: hidden;
  padding: 46px 52px;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
  border-right: 1px solid var(--stroke);
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(var(--accent-rgb), .26), transparent 62%),
    radial-gradient(760px 480px at 88% 96%, rgba(var(--accent-2-rgb), .24), transparent 62%),
    var(--surface-3);
}
.auth-side .glow {
  position: absolute; right: -120px; bottom: -140px;
  width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), .35);
  box-shadow: 0 0 90px rgba(var(--accent-rgb), .28) inset;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.06); opacity: 1; } }
.auth-side h1 { font-size: 34px; font-weight: 850; letter-spacing: .3px; }
.auth-side .lead { font-size: 15px; color: var(--text-2); max-width: 42ch; }
.auth-feats { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.auth-feat { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.auth-feat .ic {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; border-radius: 11px; font-size: 16px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .2), rgba(var(--accent-2-rgb), .16));
  border: 1px solid var(--stroke);
}
.auth-main { display: flex; align-items: center; justify-content: center; padding: 34px 20px; }
.auth-box {
  width: 100%; max-width: 408px;
  padding: 30px 28px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  animation: fadeUp .5s cubic-bezier(.2, 0, 0, 1) both;
}
.auth-box .head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-box h2 { font-size: 22px; font-weight: 800; }
.auth-box .hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.auth-box form { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.auth-box .btn-primary { margin-top: 16px; padding: 12px; }
.auth-box .alt { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.pw-field { position: relative; }
.pw-field input { padding-right: 44px; }
.pw-field .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--muted); font-size: 15px;
}
.pw-field .eye:hover { color: var(--accent); background: transparent; box-shadow: none; }
.strength { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.strength i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--bad), var(--warn), var(--ok)); transition: width .25s ease; }

/* 认证页右上角工具栏（设置主题等） */
.auth-tools { position: fixed; top: 14px; right: 14px; z-index: 60; display: flex; gap: 8px; align-items: center; }
.auth-tools .pop-panel { top: 46px; right: 0; }

/* ---------------------------------------------------- 13. 移动底栏 */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 7px max(10px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom));
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--stroke);
}
.tabbar .tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  border: none; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 650;
  border-radius: var(--radius-xs);
}
.tabbar .tab .ic { font-size: 18px; line-height: 1; }
.tabbar .tab.active { color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.tabbar .tab:hover { color: var(--accent); box-shadow: none; }

/* --------------------------------------------------- 14. 工具类 */
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.spread { flex: 1; }
.mb0 { margin-bottom: 0 !important; }
.mt12 { margin-top: 12px; }
.nowrap { white-space: nowrap; }
.rank-medal { font-size: 16px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s cubic-bezier(.2, 0, 0, 1), transform .6s cubic-bezier(.2, 0, 0, 1); }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------- 15. 响应式 */
@media (max-width: 1080px) {
  .search-trigger { min-width: 0; padding: 8px 10px; }
  .search-trigger .srch-txt { display: none; }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 268px; height: 100vh;
    z-index: 55;                       /* 必须高于遮罩(45)与底栏(50) */
    background: var(--glass-strong);
    transform: translateX(-102%);
    transition: transform .3s cubic-bezier(.2, 0, 0, 1);
    box-shadow: var(--shadow-lg);
  }
  /* 抽屉只做导航：账号与搜索入口交给移动底栏的「我的」与顶栏图标 */
  .side-foot { display: none; }
  body[data-drawer="open"] .sidebar { transform: none; }
  .menu-btn { display: grid; }
  .tabbar { display: flex; gap: 4px; }
  .content { padding: 16px 14px calc(94px + env(safe-area-inset-bottom)); gap: 14px; }
  .topbar { padding: 0 14px; }
  .page-title small { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .page-title { display: none; }
  /* 移动端用户面板由底栏「我的」进入，顶栏不再重复放头像 */
  .user-chip { display: none; }
  .content { padding: 14px 12px calc(94px + env(safe-area-inset-bottom)); }
  .card { padding: var(--pad-card); border-radius: var(--radius); }
  .hero { padding: 18px 16px; gap: 14px; }
  .hero h1 { font-size: 21px; }
  .points { font-size: 27px; }
  .sec-head h2 { font-size: 17px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .grid.cols-2, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .pop-panel { left: 12px; right: 12px; width: auto; top: calc(var(--topbar-h) - 2px); }
  .toasts { left: 12px; right: 12px; top: 10px; width: auto; }
  .auth-side { display: none; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-main { padding: 22px 14px; }
  .auth-box { padding: 24px 20px; }
  .cmdk { padding-top: 8vh; }
  .search-trigger kbd { display: none; }
  /* 卡片头右侧带分段控件时（排行榜）让它单独占一行，标题不被挤窄 */
  .card-head:has(.seg) { flex-wrap: wrap; }
  .card-head:has(.seg) .ops { width: 100%; justify-content: flex-end; }
  .table-tools .filter { min-width: 100%; }
}

/* 表格 → 卡片（窄屏） */
@media (max-width: 860px) {
  .table-wrap.md-cards { max-height: none; border: none; background: transparent; overflow: visible; }
  .table-wrap.md-cards table, .table-wrap.md-cards thead, .table-wrap.md-cards tbody,
  .table-wrap.md-cards tr, .table-wrap.md-cards td { display: block; width: 100%; }
  .table-wrap.md-cards thead { display: none; }
  .table-wrap.md-cards tbody tr {
    margin-bottom: 10px; padding: 8px 12px;
    border: 1px solid var(--stroke); border-radius: var(--radius-sm);
    background: var(--surface-2);
    box-shadow: var(--shadow-xs);
  }
  .table-wrap.md-cards tbody tr:hover td:first-child { box-shadow: none; }
  .table-wrap.md-cards tbody td {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 0; border-bottom: 1px dashed var(--stroke);
    text-align: right;
  }
  .table-wrap.md-cards tbody td:last-child { border-bottom: none; }
  .table-wrap.md-cards tbody td::before {
    content: attr(data-label);
    flex: none; min-width: 74px; text-align: left;
    font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px;
  }
  .table-wrap.md-cards tbody td > * { margin-left: auto; }
  .table-wrap.md-cards .cell-ops { justify-content: flex-end; }
}

/* 开发者强制模式 */
body[data-view="phone"] { --sidebar-w: 0px; }
body[data-view="phone"] .app { grid-template-columns: minmax(0, 1fr); }
body[data-view="phone"] .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 268px; height: 100vh; z-index: 55; transform: translateX(-102%); background: var(--glass-strong); box-shadow: var(--shadow-lg); }
body[data-view="phone"] .side-foot { display: none; }
body[data-view="phone"][data-drawer="open"] .sidebar { transform: none; }
body[data-view="phone"] .tabbar { display: flex; gap: 4px; }
body[data-view="phone"] .menu-btn { display: grid; }
body[data-view="phone"] .content { max-width: 560px; padding: 16px 14px calc(94px + env(safe-area-inset-bottom)); }
body[data-view="phone"] .grid, body[data-view="phone"] .grid.cols-2, body[data-view="phone"] .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
body[data-view="phone"] .table-wrap.md-cards { max-height: none; border: none; background: transparent; overflow: visible; }
body[data-view="phone"] .table-wrap.md-cards table,
body[data-view="phone"] .table-wrap.md-cards thead,
body[data-view="phone"] .table-wrap.md-cards tbody,
body[data-view="phone"] .table-wrap.md-cards tr,
body[data-view="phone"] .table-wrap.md-cards td { display: block; width: 100%; }
body[data-view="phone"] .table-wrap.md-cards thead { display: none; }
body[data-view="phone"] .table-wrap.md-cards tbody tr { margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--stroke); border-radius: var(--radius-sm); background: var(--surface-2); }
body[data-view="phone"] .table-wrap.md-cards tbody td { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--stroke); text-align: right; }
body[data-view="phone"] .table-wrap.md-cards tbody td::before { content: attr(data-label); flex: none; min-width: 74px; text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); }
body[data-view="phone"] .table-wrap.md-cards tbody td > * { margin-left: auto; }

body[data-view="pc"] .sidebar { position: sticky; transform: none; height: 100vh; }
body[data-view="pc"] .tabbar, body[data-view="pc"] .menu-btn { display: none; }
body[data-view="pc"] .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

/* --------------------------------------------------- 16. 动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .bg-fx { display: none; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .topbar, .tabbar, .toasts, .bg-fx { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}
