/* ============================================================
   LC Auth —— 界面样式（无构建、无外部字体、无第三方依赖）
   设计语言：深空底 + 信号青，细线分层、等宽标识、克制的动效
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #05070a;
  --bg-elev: #090c11;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-3: #0b0f14;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);

  --ink: #e9eff4;
  --ink-2: #98a6b5;
  --ink-3: #697687;

  --accent: #2fe3b4;
  --accent-2: #5f9dff;
  --accent-ink: #04140f;
  --accent-soft: rgba(47, 227, 180, 0.14);
  --accent-line: rgba(47, 227, 180, 0.35);

  --ok: #3ddc97;
  --warn: #ffc861;
  --danger: #ff7085;
  --danger-soft: rgba(255, 112, 133, 0.12);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px -35px rgba(0, 0, 0, 0.95);
  --ring: 0 0 0 3px rgba(47, 227, 180, 0.18);

  --font: "Segoe UI Variable Text", "Segoe UI", Inter, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Consolas, monospace;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6f9;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: #f0f3f7;
  --surface-3: #ffffff;
  --line: rgba(16, 24, 36, 0.1);
  --line-strong: rgba(16, 24, 36, 0.18);

  --ink: #0d141c;
  --ink-2: #4d5b6c;
  --ink-3: #74839a;

  --accent: #0aa887;
  --accent-2: #2f6fed;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 168, 135, 0.1);
  --accent-line: rgba(10, 168, 135, 0.35);

  --ok: #0f9f6b;
  --warn: #b97400;
  --danger: #d63a52;
  --danger-soft: rgba(214, 58, 82, 0.08);

  --shadow: 0 24px 60px -40px rgba(15, 23, 42, 0.5);
  --ring: 0 0 0 3px rgba(10, 168, 135, 0.16);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-color: var(--accent-line) !important;
}

/* ---------- 通用组件 ---------- */

.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--accent), var(--accent-2));
  --btn-fg: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 24px -14px var(--accent);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.btn-ghost { --btn-bg: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}
html[data-theme="light"] .card {
  background: var(--surface);
  box-shadow: 0 18px 44px -36px rgba(15, 23, 42, 0.45);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.card-title { font-size: 13px; font-weight: 650; letter-spacing: 0.01em; }
.card-sub { font-size: 12px; color: var(--ink-3); }
.card-body { padding: 18px; }
.card-body.stack > .btn { justify-content: flex-start; }

/* 卡片顶部一道极细的信号线，给深色界面一点“设备感” */
.card { position: relative; }
.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0.65;
  pointer-events: none;
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea { background: #fff; }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: var(--ring);
  background: rgba(0, 0, 0, 0.26);
}
html[data-theme="light"] .input:focus,
html[data-theme="light"] .textarea:focus { background: #fff; }

.field { margin-bottom: 14px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.error-text { margin-top: 6px; font-size: 12px; color: var(--danger); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.chip-accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.chip-danger { border-color: rgba(255, 112, 133, 0.35); background: var(--danger-soft); color: var(--danger); }
.chip-warn { border-color: rgba(255, 200, 97, 0.35); background: rgba(255, 200, 97, 0.1); color: var(--warn); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.14); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 200, 97, 0.14); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 112, 133, 0.14); }

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
}
.banner-danger { border-color: rgba(255, 112, 133, 0.32); background: var(--danger-soft); color: var(--danger); }
.banner-accent { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.divider { height: 1px; background: var(--line); margin: 18px 0; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- 登录 / 提示页 ---------- */

.auth {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 40px;
  overflow: hidden;
  background:
    radial-gradient(1000px 700px at 12% -12%, rgba(47, 227, 180, 0.16), transparent 62%),
    radial-gradient(900px 760px at 108% 112%, rgba(95, 157, 255, 0.18), transparent 58%),
    var(--bg);
}
html[data-theme="light"] .auth {
  background:
    radial-gradient(1000px 700px at 12% -12%, rgba(10, 168, 135, 0.12), transparent 62%),
    radial-gradient(900px 760px at 108% 112%, rgba(47, 111, 237, 0.14), transparent 58%),
    var(--bg);
}
.auth::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 72%);
  pointer-events: none;
}
html[data-theme="light"] .auth::before {
  background-image:
    linear-gradient(rgba(16, 24, 36, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 36, 0.05) 1px, transparent 1px);
}
.auth-inner { position: relative; width: 100%; max-width: 408px; }

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--accent-line);
  background: linear-gradient(150deg, rgba(47, 227, 180, 0.22), rgba(95, 157, 255, 0.16));
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  box-shadow: 0 0 26px -10px var(--accent);
}
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
.brand-tag { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

.auth-card { padding: 26px; }
.auth-title { margin: 0 0 4px; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.auth-sub { margin: 0 0 20px; font-size: 13px; color: var(--ink-2); }

.auth-target {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--ink-2);
}
.auth-target .mono { color: var(--ink); }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-2); color: var(--ink); }

.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.auth-outside { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--ink-3); }

.code-inputs { display: flex; gap: 8px; }
.code-cell {
  width: 100%;
  height: 52px;
  text-align: center;
  font-family: var(--mono);
  font-size: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
html[data-theme="light"] .code-cell { background: #fff; }
.code-cell:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }

.otp-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; color: var(--ink-2); }

/* ---------- 控制台骨架 ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 244px;
  flex: none;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 13, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}
html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.8); }

.sidebar .brand { margin: 2px 4px 18px; }
.sidebar .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.sidebar .brand-name { font-size: 13.5px; }

.nav-group { margin-bottom: 12px; }
.nav-label {
  padding: 0 10px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-item:hover { background: var(--surface); color: var(--ink); }
.nav-item.active {
  background: linear-gradient(90deg, var(--accent-soft), rgba(47, 227, 180, 0.02));
  color: var(--ink);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-item .icon { color: currentColor; opacity: 0.85; }
.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.user-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--accent-soft), rgba(95, 157, 255, 0.18));
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
}
.page-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.page-sub { font-size: 12px; color: var(--ink-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: clamp(18px, 3vw, 34px); max-width: 1180px; width: 100%; }

.mobile-only { display: none; }
.hamburger { display: none; }

/* ---------- 数据展示 ---------- */

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

.stat { padding: 16px 18px; }
.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.stat-value { margin-top: 8px; font-size: 30px; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.stat-foot { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.stat-accent .stat-value { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background 0.14s ease; }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-actions { text-align: right; white-space: nowrap; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 240px; max-width: 340px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 32px; height: 34px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.seg button.active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; font-size: 12px; color: var(--ink-3); }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); flex: none; padding-top: 1px; white-space: nowrap; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; }

.copyable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  text-align: left;
}
.copyable:hover { background: var(--surface-2); color: var(--ink); }
.copyable .icon { opacity: 0.5; flex: none; }

/* ---------- 弹层 ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(3, 5, 8, 0.66);
  backdrop-filter: blur(6px);
  animation: fade 0.16s ease;
}
html[data-theme="light"] .backdrop {
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9);
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-title { font-size: 15px; font-weight: 660; }
.modal-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.modal-body { padding: 4px 20px 8px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

.drawer {
  position: fixed;
  z-index: 61;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-strong);
  background: var(--surface-3);
  box-shadow: -30px 0 90px -40px rgba(0, 0, 0, 0.9);
  animation: slide 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--surface-3);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in 0.2s ease;
}
.toast-error { border-left-color: var(--danger); }

/* ---------- 动效 ---------- */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes slide { from { transform: translateX(24px); opacity: 0.4; } to { transform: translateX(0); opacity: 1; } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes shimmer { from { background-position: -320px 0; } to { background-position: 320px 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.page { animation: page-in 0.2s ease; }

.skeleton {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 640px 100%;
  animation: shimmer 1.1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

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

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

@media (max-width: 860px) {
  .hamburger { display: inline-flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
    box-shadow: 30px 0 80px -40px rgba(0, 0, 0, 0.9);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .shell.nav-open .nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(3, 5, 8, 0.6); backdrop-filter: blur(3px); }
  .topbar { padding: 0 14px; min-height: 56px; }
  .content { padding: 16px 14px 40px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .stat { padding: 14px; }
  .stat-value { font-size: 26px; }
  .toolbar { padding: 12px 12px; gap: 8px; }
  .toolbar .search { flex: 1 1 100%; max-width: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .modal { width: calc(100vw - 20px); max-height: calc(100dvh - 40px); }
  .table .hide-sm { display: none; }
  .auth-card { padding: 22px 18px; }
}

@media (max-width: 480px) {
  .code-inputs { gap: 6px; }
  .code-cell { height: 46px; font-size: 18px; }
  .search { max-width: none; }
  .topbar-actions .btn span { display: none; }
}