/* ==========================================================================
   LX API Server · Web 界面样式
   暖色、克制、以排版为主的风格：米白底、陶土色点缀、衬线标题、细描边、轻阴影
   浅色 / 深色两套配色，桌面与手机共用一套布局，按断点自适应
   ========================================================================== */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "STSong",
    "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Noto Sans Mono", monospace;

  /* 陶土色：--clay 用于装饰(标志、强调线)，--accent 用于带白字的按钮(对比度 >= 4.5)，--accent-text 用于文字和图标 */
  --clay: #d97757;
  --accent: #bc5a3b;
  --accent-hover: #a94e33;
  --accent-ink: #ffffff;
  --accent-text: #b5512f;
  --accent-soft: rgba(201, 100, 66, 0.1);
  --accent-ring: rgba(201, 100, 66, 0.24);

  --ok: #3f7a45;
  --ok-soft: rgba(63, 122, 69, 0.1);
  --warn: #9a6312;
  --warn-soft: rgba(184, 128, 32, 0.13);
  --bad: #b4412c;
  --bad-soft: rgba(180, 65, 44, 0.09);
  --off: #73716a;
  --off-soft: rgba(115, 113, 106, 0.12);

  --chart-ok: #5b8dc9;
  --chart-bad: #d97757;

  --bg: #faf9f5;
  --sidebar-bg: #f5f4ed;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --surface-3: #efede5;
  --hover: rgba(31, 30, 29, 0.05);
  --active: rgba(31, 30, 29, 0.08);
  --border: #e8e6dc;
  --border-strong: #d6d3c7;
  --text: #1f1e1d;
  --text-2: #5e5d59;
  --text-3: #73716a;
  --overlay: rgba(31, 30, 29, 0.32);
  --ink: #1f1e1d; /* 深色块(保存栏、提示框)的底色 */
  --ink-text: #faf9f5;

  --shadow-sm: 0 1px 2px rgba(31, 30, 29, 0.04);
  --shadow: 0 2px 6px rgba(31, 30, 29, 0.05), 0 8px 24px -12px rgba(31, 30, 29, 0.12);
  --shadow-lg: 0 4px 12px rgba(31, 30, 29, 0.06), 0 24px 56px -20px rgba(31, 30, 29, 0.25);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --sidebar-w: 256px;
  --topbar-h: 56px;
  --bottom-nav-h: 62px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --clay: #d97757;
  --accent: #c15f3c;
  --accent-hover: #cf6c48;
  --accent-text: #e5937a;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --accent-ring: rgba(217, 119, 87, 0.32);

  --ok: #7fb37a;
  --ok-soft: rgba(127, 179, 122, 0.13);
  --warn: #e0a84f;
  --warn-soft: rgba(224, 168, 79, 0.13);
  --bad: #ee8a75;
  --bad-soft: rgba(238, 138, 117, 0.13);
  --off: #9a988f;
  --off-soft: rgba(154, 152, 143, 0.15);

  --chart-ok: #4f89d9;
  --chart-bad: #db7350;

  --bg: #262624;
  --sidebar-bg: #1f1e1d;
  --surface: #30302e;
  --surface-2: #2b2b29;
  --surface-3: #3a3a37;
  --hover: rgba(250, 249, 245, 0.06);
  --active: rgba(250, 249, 245, 0.1);
  --border: #3d3c38;
  --border-strong: #4c4b46;
  --text: #f2f1ec;
  --text-2: #c3c1b8;
  --text-3: #9a988f;
  --overlay: rgba(10, 10, 9, 0.55);
  --ink: #f2f1ec;
  --ink-text: #1f1e1d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 10px 28px -12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.3), 0 28px 64px -20px rgba(0, 0, 0, 0.7);

  color-scheme: dark;
}

/* ---------- 基础 ---------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(201, 100, 66, 0.2); }

:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.noscript { padding: 40px; text-align: center; color: var(--text-2); }

.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 6px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

svg.icon { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; }
svg.icon.fill { fill: currentColor; stroke: none; }

/* ---------- 启动画面 ---------- */

.boot { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; }
.boot-logo { width: 40px; height: 40px; border-radius: 11px; background: var(--clay);
  animation: breathe 1.6s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.45; transform: scale(0.94); } 50% { opacity: 1; transform: none; } }

/* ---------- 按钮 ---------- */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 500; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease),
    opacity 0.15s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { --btn-bg: var(--surface-2); --btn-border: var(--text-3); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.loading { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.loading { cursor: progress; }
.btn.primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-border: var(--accent); }
.btn.primary:hover { --btn-bg: var(--accent-hover); --btn-border: var(--accent-hover); }
.btn.soft { --btn-bg: var(--accent-soft); --btn-fg: var(--accent-text); --btn-border: transparent; }
.btn.soft:hover { --btn-bg: rgba(201, 100, 66, 0.16); --btn-border: transparent; }
.btn.ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--text-2); }
.btn.ghost:hover { --btn-bg: var(--hover); --btn-fg: var(--text); --btn-border: transparent; }
.btn.danger { --btn-bg: var(--bad); --btn-fg: #fff; --btn-border: var(--bad); }
.btn.danger:hover { filter: brightness(0.93); }
:root[data-theme="dark"] .btn.danger { --btn-fg: #1f1e1d; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: var(--radius-xs); gap: 6px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: var(--radius-sm); }
.btn.block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-2); cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--active); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: var(--radius-xs); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 1.75px solid currentColor; border-right-color: transparent; opacity: 0.8;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; color: var(--text); }
.field-help { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }
.field-error { font-size: 12.5px; color: var(--bad); animation: fade-in 0.2s var(--ease); }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select,
.field.has-error .tag-input { border-color: var(--bad); }

.input, .textarea, .select {
  width: 100%; min-height: 38px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.2s var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 0.85; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--accent-soft);
}
.input:disabled { opacity: 0.6; cursor: not-allowed; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.textarea.code { font-family: var(--mono); font-size: 13px; line-height: 1.65; tab-size: 2; white-space: pre; }
.select {
  padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 42px; }
.input-group .icon-btn { position: absolute; right: 4px; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-affix .affix {
  display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-3);
  font-size: 13px; white-space: nowrap;
}
.input-affix.prefix .affix { border-left: 1px solid var(--border-strong); border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm); padding: 0 10px; }
.input-affix.prefix .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* 开关 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; width: 38px; height: 22px; border-radius: 999px; flex: none;
  background: var(--border-strong); transition: background-color 0.2s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s var(--ease-out);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-ring); }
.switch input:disabled + .track { opacity: 0.5; }
.switch-label { font-size: 13.5px; color: var(--text-2); }

/* 选项胶囊 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--clay); color: var(--accent-text); }
.chip.on .icon { animation: fade-in 0.2s var(--ease); }

/* 标签输入 */
.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 38px; padding: 4px 5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  cursor: text; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.tag-input:focus-within { border-color: var(--clay); box-shadow: 0 0 0 3px var(--accent-soft); }
.tag {
  display: inline-flex; align-items: center; gap: 2px; height: 26px; padding: 0 3px 0 9px;
  border-radius: var(--radius-xs); background: var(--surface-3); font-family: var(--mono); font-size: 12.5px;
  animation: fade-in 0.2s var(--ease);
}
.tag button {
  display: grid; place-items: center; width: 20px; height: 20px; border: none; border-radius: 5px;
  background: transparent; color: var(--text-3); cursor: pointer;
}
.tag button:hover { background: var(--bad-soft); color: var(--bad); }
.tag-input input { flex: 1; min-width: 90px; height: 26px; border: none; outline: none; background: transparent;
  padding: 0 6px; font-size: 13.5px; }

/* 分段选择 */
.segmented {
  position: relative; display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 10px; background: var(--surface-3); max-width: 100%; overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border: none; border-radius: 7px; background: transparent;
  color: var(--text-2); font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: color 0.15s var(--ease); -webkit-tap-highlight-color: transparent;
}
.segmented button:hover { color: var(--text); }
.segmented button.on { color: var(--text); }
.segmented .thumb {
  position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; border-radius: 7px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(31, 30, 29, 0.08), 0 0 0 0.5px rgba(31, 30, 29, 0.06);
  transition: transform 0.28s var(--ease-out), width 0.28s var(--ease-out);
}
:root[data-theme="dark"] .segmented .thumb { background: #4a4945; }
.segmented.block { display: flex; width: 100%; }
.segmented.block button { flex: 1; justify-content: center; }

/* ---------- 卡片与通用块 ---------- */

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); min-width: 0;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.3s var(--ease);
}
.card.hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px 0; min-height: 50px;
}
.card-header + .card-body { padding-top: 14px; }
.card-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.card-icon {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); flex: none;
  background: var(--surface-3); color: var(--text-2);
}
.card-icon.ok { background: var(--ok-soft); color: var(--ok); }
.card-icon.warn { background: var(--warn-soft); color: var(--warn); }
.card-icon.bad { background: var(--bad-soft); color: var(--bad); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.span-2 { grid-column: span 2; }

.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius);
  font-size: 13.5px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  line-height: 1.6; animation: fade-up 0.25s var(--ease-out) both;
}
.notice > .icon { color: var(--text-3); margin-top: 2px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; }
.notice.warn > .icon { color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: transparent; }
.notice.bad > .icon { color: var(--bad); }
.notice.ok { background: var(--ok-soft); border-color: transparent; }
.notice.ok > .icon { color: var(--ok); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px;
  color: var(--text-3); text-align: center;
}
.empty .empty-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--surface-3); color: var(--text-3);
}
.empty .empty-icon .icon { width: 22px; height: 22px; }
.empty .empty-title { color: var(--text-2); font-weight: 500; }
.empty .empty-icon.ok-icon { background: var(--ok-soft); color: var(--ok); }
.no-anim, .no-anim * { animation: none !important; }

.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 600; font-size: 14px;
  text-transform: uppercase; font-family: var(--serif);
}
.avatar.lg { width: 48px; height: 48px; font-size: 20px; }

.code-box {
  display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; min-height: 38px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12.5px;
}
.code-box .value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-box .value.wrap { white-space: normal; word-break: break-all; }

/* 状态胶囊 */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--off-soft); color: var(--off);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--accent-soft); color: var(--accent-text); }
.pill.live .dot { position: relative; }
.pill.live .dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid currentColor;
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- 统计数字 ---------- */

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.stat-label .icon { color: var(--text-3); width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25;
  font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-foot { font-size: 12.5px; color: var(--text-3); }
.stat.ok .stat-label .icon { color: var(--ok); }
.stat.warn .stat-label .icon { color: var(--warn); }
.stat.bad .stat-label .icon { color: var(--bad); }
.stat .progress { margin-top: 8px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span {
  display: block; height: 100%; border-radius: inherit; background: var(--clay);
  transform-origin: left; animation: grow-x 0.8s var(--ease-out) both;
}
.progress.ok > span { background: var(--ok); }
@keyframes grow-x { from { transform: scaleX(0); } }

/* ---------- 图表 ---------- */

.chart-wrap { position: relative; width: 100%; min-height: 220px; }
.chart-empty { position: absolute; inset: 0 0 26px 34px; display: grid; place-items: center; color: var(--text-3);
  font-size: 13px; pointer-events: none; }
.chart { display: block; overflow: visible; max-width: 100%; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar-ok { fill: var(--chart-ok); }
.chart .bar-bad { fill: var(--chart-bad); }
.chart .bar-group { transform-box: fill-box; transform-origin: bottom; animation: grow-y 0.6s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms); transition: opacity 0.15s var(--ease); }
.chart.focus .bar-group:not(.on) { opacity: 0.45; } /* 悬停时突出当前的柱子 */
.chart .hit { fill: transparent; cursor: default; }
@keyframes grow-y { from { transform: scaleY(0); } }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
  vertical-align: -1px; background: var(--chart-ok); }
.chart-legend i.bad { background: var(--chart-bad); }
.chart-tip {
  position: fixed; z-index: 90; pointer-events: none; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--ink-text); font-size: 12px; line-height: 1.55; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; animation: fade-in 0.12s var(--ease);
}
.chart-tip .key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.chart-tip .key.ok { background: var(--chart-ok); }
.chart-tip .key.bad { background: var(--chart-bad); }

.hbar { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hbar + .hbar { margin-top: 12px; }
.hbar .track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: inherit; background: var(--clay);
  transform-origin: left; animation: grow-x 0.8s var(--ease-out) both; }
.hbar .num { font-variant-numeric: tabular-nums; color: var(--text-2); }

/* ---------- 表格(手机上变成卡片列表) ---------- */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  padding: 9px 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.15s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table .actions { display: flex; gap: 2px; justify-content: flex-end; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.search-box { position: relative; width: min(240px, 100%); }
.search-box > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search-box .input { height: 34px; min-height: 34px; padding-left: 34px; }
.key-cell .code-box { max-width: 250px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .select { width: auto; min-width: 118px; height: 34px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.loading-fade { opacity: 0.5; transition: opacity 0.2s var(--ease); pointer-events: none; }
.row-in { animation: fade-up 0.3s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 20ms); }
.log-error .list-sub { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 列表 ---------- */

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-title { font-weight: 500; font-size: 13.5px; }
.list-sub { font-size: 12.5px; color: var(--text-3); }

/* ---------- 骨架屏 ---------- */

.skeleton { position: relative; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-3); min-height: 14px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.4s infinite;
}
:root[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton.title { height: 20px; width: 40%; }
.skeleton.line { height: 12px; }
.skeleton.block { height: 120px; border-radius: var(--radius-lg); }

/* ---------- 动画 ---------- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: scale(0.96); } }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); }
}
.page-enter { animation: fade-up 0.3s var(--ease-out) both; }
.stagger > * { animation: fade-up 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 35ms); }
.shake { animation: shake 0.4s var(--ease); }

/* ---------- 管理后台布局 ---------- */

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w); display: flex; flex-direction: column;
  padding: 16px 12px; background: var(--sidebar-bg); border-right: 1px solid var(--border);
  transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--clay); color: #fff;
}
.brand-mark .icon { width: 18px; height: 18px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; overflow-y: auto; }
.nav-section { padding: 16px 10px 6px; font-size: 12px; color: var(--text-3); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 500; }
.nav-item.active .icon { color: var(--accent-text); }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid;
  place-items: center; background: var(--clay); color: #fff; font-size: 11px; font-weight: 600;
}

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px 2px 6px; }
.user-chip .avatar { width: 30px; height: 30px; font-size: 13px; background: var(--ink); color: var(--ink-text); }
.user-chip .name { font-weight: 500; font-size: 13.5px; }
.user-chip .role { font-size: 12px; color: var(--text-3); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 32px; background: var(--bg);
  border-bottom: 1px solid transparent; transition: border-color 0.2s var(--ease), background-color 0.3s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .menu-btn { display: none; }
.topbar-title { font-family: var(--serif); font-size: 16px; font-weight: 600; margin: 0; opacity: 0;
  transform: translateY(4px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.topbar.scrolled .topbar-title { opacity: 1; transform: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 4px 32px 56px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; }
.page-head h2 { margin: 0; font-family: var(--serif); font-size: 28px; font-weight: 500; letter-spacing: -0.015em;
  line-height: 1.25; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section-gap { height: 16px; }

.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------- 配置页 ---------- */

.config-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start;
  padding-bottom: 64px; /* 给底部的保存栏留出位置 */ }
.config-tabs { position: sticky; top: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 1px; }
.config-tab {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: none;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-2); font-size: 14px;
  text-align: left; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.config-tab .icon { width: 17px; height: 17px; }
.config-tab:hover { background: var(--hover); color: var(--text); }
.config-tab.on { background: var(--active); color: var(--text); font-weight: 500; }
.config-tab.on .icon { color: var(--accent-text); }
.config-tab .count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid;
  place-items: center; background: var(--clay); color: #fff; font-size: 11px; font-weight: 600;
  animation: fade-in 0.2s var(--ease);
}
.config-tab .count.err { background: var(--bad); }

/* 设置列表：一行一项，左侧名称与说明，右侧控件 */
.setting-list { padding: 4px 0 6px; }
.setting {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 8px 28px;
  align-items: center; padding: 16px 20px; transition: background-color 0.2s var(--ease);
}
.setting + .setting { border-top: 1px solid var(--border); }
.setting::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 0 2px 2px 0;
  background: var(--clay); transform: scaleY(0); transition: transform 0.2s var(--ease-out);
}
.setting.dirty { background: rgba(201, 100, 66, 0.04); }
.setting.dirty::before { transform: scaleY(1); }
.setting.has-error { background: var(--bad-soft); }
.setting.has-error::before { background: var(--bad); transform: scaleY(1); }
.setting-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.setting-text .field-label { font-size: 14px; }
.setting-control { min-width: 0; }
.setting.toggle { grid-template-columns: minmax(0, 1fr) auto; }
.setting.wide { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.setting.dirty .field-label::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); animation: fade-in 0.2s var(--ease);
}
.setting.has-error .input, .setting.has-error .textarea, .setting.has-error .select,
.setting.has-error .tag-input { border-color: var(--bad); }
/* 从属项：缩进 + 引导线；所依赖的开关关闭时变灰 */
.setting.sub { padding-left: 46px; }
.setting.sub .setting-text::before {
  content: ""; position: absolute; left: 27px; top: 0; height: 50%; width: 11px;
  border-left: 1.5px solid var(--border-strong); border-bottom: 1.5px solid var(--border-strong); border-bottom-left-radius: 7px;
}
.setting.sub.wide .setting-text::before { height: 28px; }
.setting.sub + .setting.sub { border-top-style: dashed; }
.dep-hint { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.dep-hint .icon { width: 13px; height: 13px; }
.setting.off .dep-hint { display: flex; }
.setting.off .field-label, .setting.off .field-help, .setting.off .setting-control { opacity: 0.5; }
.setting.off .setting-control:focus-within { opacity: 1; }
.restart-tag { font-size: 11px; font-weight: 500; color: var(--warn); background: var(--warn-soft); padding: 0 7px;
  border-radius: 999px; line-height: 18px; }

.secret-box {
  display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 3px 4px 3px 12px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2);
}
.secret-box .state { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.secret-box .state .icon { color: var(--ok); }
.secret-box .state.unset .icon { color: var(--text-3); }

.raw-editor { min-height: 420px; }

.save-bar {
  position: fixed; z-index: 35; bottom: 24px; transform: translate(-50%, 140%);
  left: calc(50% + var(--sidebar-w) / 2); display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 14px; background: var(--ink); color: var(--ink-text);
  box-shadow: var(--shadow-lg); transition: transform 0.35s var(--ease-out), opacity 0.25s var(--ease);
  opacity: 0; pointer-events: none; max-width: calc(100vw - 32px);
}
.save-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.save-bar .text { font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.save-bar .btn.ghost { --btn-fg: var(--ink-text); opacity: 0.8; }
.save-bar .btn.ghost:hover { --btn-bg: rgba(127, 127, 127, 0.22); --btn-fg: var(--ink-text); opacity: 1; }

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed; z-index: 100; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: 13.5px; pointer-events: auto; animation: toast-in 0.35s var(--ease-out) both;
}
.toast.out { animation: toast-out 0.25s var(--ease) both; }
.toast .icon { margin-top: 1px; color: var(--text-3); }
.toast.success .icon { color: var(--ok); }
.toast.error .icon { color: var(--bad); }
.toast.warn .icon { color: var(--warn); }
.toast .toast-text { flex: 1; min-width: 0; word-break: break-word; }
.toast .toast-close { margin: -3px -4px -3px 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- 对话框 ---------- */

.modal-root { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade-in 0.2s var(--ease) both; }
.modal {
  position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: rise 0.25s var(--ease-out) both;
}
.modal.wide { width: min(620px, 100%); }
.modal-root.closing .modal { animation: modal-out 0.18s var(--ease) both; }
.modal-root.closing .modal-backdrop { animation: fade-out 0.18s var(--ease) both; }
@keyframes modal-out { to { opacity: 0; transform: scale(0.98); } }
@keyframes fade-out { to { opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 2px; }
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 500; }
.modal-body { padding: 12px 20px; overflow-y: auto; color: var(--text-2); }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }

/* ---------- 登录页 ---------- */

.auth { position: relative; display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.auth-card { position: relative; width: min(380px, 100%); animation: fade-up 0.45s var(--ease-out) both; }
.auth-card .brand-mark { width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 22px; }
.auth-card .brand-mark .icon { width: 22px; height: 22px; }
.auth-card h1 { margin: 0; text-align: center; font-family: var(--serif); font-size: 32px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.2; }
.auth-card .sub { margin: 10px 0 28px; text-align: center; color: var(--text-2); }
.auth-panel { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); }
.auth-theme { position: absolute; top: 16px; right: 16px; z-index: 2; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-3); }
.auth-foot a { color: var(--text-2); }

/* ---------- 音乐账号登录 ---------- */

.platform-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.platform-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.platform-option:hover { border-color: var(--border-strong); }
.platform-option.on { border-color: var(--clay); box-shadow: 0 0 0 3px var(--accent-soft); }
.platform-option .name { font-weight: 500; }
.platform-option .desc { font-size: 12.5px; color: var(--text-3); }

.qr-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 10px 0 4px; }
.qr-frame {
  position: relative; width: 232px; height: 232px; padding: 12px; border-radius: var(--radius-lg); background: #fff;
  border: 1px solid var(--border); animation: rise 0.35s var(--ease-out) both;
}
:root[data-theme="dark"] .qr-frame { border-color: transparent; }
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; border-radius: 4px; }
.qr-frame.wx img, .qr-frame.wy img { image-rendering: auto; }
.qr-cover {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--radius-lg); text-align: center;
  background: rgba(255, 255, 255, 0.92); color: #1f1e1d; animation: fade-in 0.2s var(--ease);
}
.qr-cover .inner { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 500; }
.qr-cover .big { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: #3f7a45; color: #fff; animation: rise 0.3s var(--ease-out); }
.qr-cover .big.warn { background: #9a6312; }
.qr-cover .big .icon { width: 24px; height: 24px; }
.qr-ring { position: absolute; top: -10px; right: -10px; width: 38px; height: 38px; }
.qr-ring circle { fill: var(--surface); stroke-width: 3; }
.qr-ring .bg { stroke: var(--surface-3); }
.qr-ring .fg { stroke: var(--clay); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center;
  transition: stroke-dashoffset 1s linear; }
.qr-ring text { fill: var(--text-2); font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: central;
  font-family: var(--font); }

.steps { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 420px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.step .num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--surface-3); color: var(--text-3); font-size: 11.5px; font-weight: 600; transition: all 0.25s var(--ease); }
.step .num .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.step.on { color: var(--text); }
.step.on .num { background: var(--clay); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.step.done .num { background: var(--ok); color: #fff; }
.step-line { flex: 1; height: 1.5px; min-width: 12px; border-radius: 2px; background: var(--border-strong); overflow: hidden; }
.step-line span { display: block; height: 100%; width: 0; background: var(--clay); transition: width 0.45s var(--ease-out); }
.step-line.done span { width: 100%; }

.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.choice:hover { border-color: var(--text-3); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .title { font-weight: 500; font-size: 14px; }
.choice .desc { font-size: 12.5px; color: var(--text-3); padding-right: 18px; }
.choice.on { border-color: var(--clay); background: rgba(201, 100, 66, 0.04); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice.on::after {
  content: ""; position: absolute; top: 13px; right: 13px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--clay) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 10px no-repeat;
  animation: fade-in 0.2s var(--ease);
}

.success-burst { display: grid; place-items: center; width: 56px; height: 56px; margin: 4px auto 0; border-radius: 50%;
  background: var(--ok-soft); color: var(--ok); animation: rise 0.4s var(--ease-out) both; }
.success-burst .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.success-burst .icon path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.45s 0.2s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 页面细节 ---------- */

.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.help-list li::marker { color: var(--clay); }
.steps-list li::marker { font-family: var(--serif); font-weight: 600; }
.tight-grid { gap: 12px; }
.dimmed { opacity: 0.62; }
.bad-text { color: var(--bad); }
.task-error span { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strength { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.strength .progress { flex: 1; height: 4px; }
.strength .progress > span { width: 0; animation: none; transition: width 0.3s var(--ease-out), background-color 0.3s var(--ease); }
.strength-text { font-size: 12.5px; min-width: 64px; text-align: right; }
.qr-status { margin: 0; min-height: 22px; color: var(--text-2); text-align: center; }
.steps-holder { display: flex; justify-content: center; width: 100%; }
.center-title { margin: 0; text-align: center; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.center { text-align: center; }
.center-row { justify-content: center; }
.account-row { padding: 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.result-card { animation: fade-up 0.35s var(--ease-out) both; }
.login-grid, .public-grid { align-items: start; }
.phone-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { height: 38px; flex: none; min-width: 112px; }

/* 平台标识 */
.logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none;
  font-weight: 600; font-size: 15px; background: var(--surface-3); color: var(--text-2);
}
.logo.tx { background: rgba(49, 160, 98, 0.12); color: #2a7d4f; }
.logo.kg { background: rgba(47, 127, 209, 0.12); color: #2a6cb0; }
.logo.wy { background: rgba(217, 67, 59, 0.11); color: #c03a32; }
:root[data-theme="dark"] .logo.tx { color: #7fc79c; }
:root[data-theme="dark"] .logo.kg { color: #8bb8ea; }
:root[data-theme="dark"] .logo.wy { color: #f0948c; }

/* ---------- 公开首页 ---------- */

.public { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 20px 56px; }
.public-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.public-nav .brand { padding: 0; }
.hero { position: relative; padding: 36px 0 30px; text-align: center; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 5.2vw, 50px); font-weight: 400;
  letter-spacing: -0.025em; line-height: 1.15; }
.hero h1 .accent { color: var(--accent-text); } /* 中文没有真正的斜体，只用颜色强调 */
.hero p { margin: 16px auto 0; max-width: 540px; color: var(--text-2); font-size: 15.5px; }
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 28px 0 20px; }
.module-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.result-box { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); animation: fade-up 0.3s var(--ease-out) both; }
.public-foot { margin-top: 40px; text-align: center; font-size: 13px; color: var(--text-3); font-family: var(--serif); }

/* ---------- 响应式 ---------- */

@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-104%); box-shadow: var(--shadow-lg); padding-bottom: calc(16px + var(--safe-bottom)); }
  .shell.drawer-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: var(--overlay); opacity: 0;
    pointer-events: none; transition: opacity 0.25s var(--ease); }
  .shell.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px 0 8px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 4px 16px calc(var(--bottom-nav-h) + 32px + var(--safe-bottom)); }
  .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }

  .bottom-nav {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--bottom-nav-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
    background: var(--sidebar-bg); border-top: 1px solid var(--border);
  }
  .bottom-nav a, .bottom-nav button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: none; background: transparent; color: var(--text-3); font-size: 11px; cursor: pointer;
    -webkit-tap-highlight-color: transparent; transition: color 0.15s var(--ease);
  }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .icon { width: 21px; height: 21px; }
  .bottom-nav .active { color: var(--text); font-weight: 500; }
  .bottom-nav .active .icon { color: var(--accent-text); }

  .config-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .config-tabs { position: sticky; top: var(--topbar-h); z-index: 5; flex-direction: row; overflow-x: auto;
    margin: 0 -16px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .config-tabs::-webkit-scrollbar { display: none; }
  .config-tab { flex: none; height: 34px; }
  .save-bar { left: 50%; bottom: calc(var(--bottom-nav-h) + 12px + var(--safe-bottom)); }
}

@media (max-width: 720px) {
  .filters { width: 100%; }
  .filters .select { flex: 1 1 30%; min-width: 0; }
  .search-box { width: 100%; }
  .log-error .list-sub { max-width: 180px; }
  .setting { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 16px; }
  .setting.toggle { grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  .setting.sub { padding-left: 36px; }
  .setting.sub .setting-text::before { left: 18px; height: 24px; width: 10px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-head { margin-bottom: 18px; }
  .page-head h2 { font-size: 24px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px 0; }
  .stat { padding: 14px; }
  .stat-value { font-size: 23px; }
  .choice-cards { grid-template-columns: minmax(0, 1fr); }
  .platform-picker { gap: 8px; }
  .platform-option { padding: 10px 12px; }
  .platform-option .desc { display: none; }
  .toast-stack { top: 12px; right: 16px; left: 16px; width: auto; }
  .modal-root { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-bottom); animation-name: sheet-in; }
  .modal.wide { width: 100%; }
  .modal-root.closing .modal { animation-name: sheet-out; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; height: 44px; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
  @keyframes sheet-out { to { transform: translateY(100%); } }

  /* 表格变卡片 */
  .table-wrap { margin: 0; padding: 0; overflow: visible; }
  table.table.responsive thead { display: none; }
  table.table.responsive, table.table.responsive tbody, table.table.responsive tr, table.table.responsive td { display: block; width: 100%; }
  table.table.responsive tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  table.table.responsive tr:last-child { border-bottom: none; }
  table.table.responsive td { display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 5px 0; border: none; text-align: right; }
  table.table.responsive td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; text-align: left; flex: none; }
  table.table.responsive td.primary { padding-bottom: 8px; justify-content: flex-start; text-align: left; }
  table.table.responsive td.primary::before { display: none; }
  table.table.responsive td.num { text-align: right; }
  table.table.responsive .actions { justify-content: flex-end; }
  table.table.responsive tbody tr:hover { background: transparent; }

  .hbar { grid-template-columns: 76px 1fr auto; }
  .public-nav { margin-bottom: 16px; }
  .hero { padding: 20px 0 12px; }
  .auth-card h1 { font-size: 28px; }
}

@media (max-width: 420px) {
  .qr-frame { width: 212px; height: 212px; }
  .steps .step .txt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
}
