/* ---------- 基础 ---------- */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e6e9f0;
  --border-strong: #d5dae4;
  --text: #101828;
  --muted: #667085;
  --faint: #98a2b3;
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-50: #eef2ff;
  --success: #067647;
  --success-bg: #ecfdf3;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -24px rgba(16, 24, 40, .18);
  --shadow-md: 0 24px 60px -30px rgba(16, 24, 40, .28);
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .92em;
}
h1, h2, h3, p { margin: 0; }
svg { flex: none; }

:focus-visible {
  outline: 2px solid rgba(79, 70, 229, .55);
  outline-offset: 2px;
}

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .7);
}
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: #344054;
}
.btn-ghost:hover { background: #f8fafc; border-color: #c3cad6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; height: 44px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: #f2f4f7; color: #475467; }
.icon-btn.on-dark { color: #94a3b8; }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel-head p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.panel-body { padding: 22px; }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 22px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}

.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}
.req { color: var(--danger); }
.input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #b4bbc8; }
.input:hover { border-color: #c3cad6; }
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}
.help { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--faint); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
}
.switch-row strong { font-size: 13px; font-weight: 600; }
.switch-row .help { margin-top: 2px; }
.switch { position: relative; display: inline-flex; flex: none; width: 42px; height: 24px; }
.switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch span {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d0d5dd;
  transition: background .18s ease;
}
.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .2);
  transition: transform .18s ease;
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(79, 70, 229, .22); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; }
.pill-on { background: var(--success-bg); color: var(--success); }
.pill-on i { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .12); }
.pill-off { background: #f2f4f7; color: #667085; }
.pill-off i { background: #98a2b3; }

/* ---------- 壳层与侧栏 ---------- */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 236px;
  padding: 22px 16px 18px;
  color: #cbd5e1;
  background:
    radial-gradient(420px 220px at 20% 0%, rgba(99, 102, 241, .22), transparent 70%),
    linear-gradient(180deg, #0d1424 0%, #0b1220 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, #6366f1, #4338ca);
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .9), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.brand-text small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
  color: #8b93a7;
}
.sidebar .brand { color: #fff; padding: 2px 6px; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: #98a2b3;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { color: #7c8599; transition: color .15s ease; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #e2e8f0; }
.nav-item:hover svg { color: #cbd5e1; }
.nav-item.active {
  background: rgba(99, 102, 241, .18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .28);
}
.nav-item.active svg { color: #a5b4fc; }

.sidebar-tip {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding: 12px;
  border: 1px dashed rgba(148, 163, 184, .22);
  border-radius: 12px;
  color: #7f8aa0;
  font-size: 11.5px;
  line-height: 1.6;
}
.sidebar-tip-icon { color: #818cf8; margin-top: 1px; }
.sidebar-tip p { margin: 0; }

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.side-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(99, 102, 241, .22);
  color: #c7d2fe;
  font-size: 12px;
  font-weight: 700;
}
.side-user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-user-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-user-meta small { font-size: 10.5px; color: #7f8aa0; }

.main { margin-left: 236px; min-height: 100vh; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 32px;
  background: rgba(246, 247, 251, .82);
  border-bottom: 1px solid rgba(230, 233, 240, .9);
  backdrop-filter: blur(12px);
}
.topbar-title { font-size: 13.5px; font-weight: 600; color: #475467; }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #667085;
  font-size: 11.5px;
  font-weight: 500;
}
.domain-pill i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .14); }
.menu-btn { display: none; }

.content {
  width: 100%;
  max-width: 1320px;
  min-width: 0;
  margin: 0 auto;
  padding: 26px 32px 64px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------- 页面头部 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
.page-head > div > p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.page-head .btn { flex: none; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-row h1 { font-size: 23px; }
.head-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: color .15s ease;
}
.back-link:hover { color: var(--brand); }

/* ---------- 概览统计 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.stat-icon.indigo { background: var(--brand-50); color: var(--brand); }
.stat-icon.green { background: #ecfdf3; color: #079455; }
.stat-icon.amber { background: #fffaeb; color: #dc6803; }
.stat-icon.cyan { background: #ecfdff; color: #0e9384; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-value {
  margin-top: 1px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ---------- 搜索与表格 ---------- */
.search { position: relative; width: 280px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 34px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input::placeholder { color: #b4bbc8; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--faint);
}
.search-clear:hover { background: #f2f4f7; color: #475467; }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 900px; }
.table th {
  padding: 11px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  color: #667085;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f6;
  vertical-align: middle;
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table .actions { text-align: right; }
.table .qr-col { width: 86px; }
.table .target-col { width: 26%; }
.table th.num { width: 68px; }
.table th.actions { width: 164px; }
.table th.nowrap { width: 116px; }

.qr-thumb {
  display: inline-flex;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qr-thumb:hover { border-color: #c7cbe0; box-shadow: 0 6px 14px -8px rgba(16, 24, 40, .25); }
.qr-thumb img { width: 44px; height: 44px; border-radius: 5px; }

.code-title {
  display: block;
  overflow: hidden;
  color: #101828;
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-title:hover { color: var(--brand); }
.code-meta { margin-top: 4px; }
.code-meta code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: #f4f5f8;
  color: #667085;
  font-size: 11px;
}
.target-link {
  display: block;
  overflow: hidden;
  color: #475467;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-link:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fcfcfe;
}
.pagination-info { font-size: 12px; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; }
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #475467;
  font-size: 12.5px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}
.page-btn:hover { background: #f2f4f7; }
.page-btn.current { background: var(--brand); color: #fff; font-weight: 600; }
.page-btn.disabled { color: #c3cad6; cursor: default; }
.page-btn.disabled:hover { background: transparent; }
.page-ellipsis { padding: 0 3px; color: var(--faint); }

.empty { padding: 56px 24px; text-align: center; }
.empty-art {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: var(--brand-50);
  color: var(--brand);
}
.empty-art.small { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 12px; }
.empty h3 { font-size: 16px; font-weight: 700; }
.empty p { margin: 6px 0 18px; color: var(--muted); font-size: 12.5px; }
.empty.small { padding: 32px 20px; }
.empty.small h3 { font-size: 14px; }
.empty.small p { margin-bottom: 0; font-size: 12px; }

/* ---------- 新建活码 ---------- */
.create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 20px;
  align-items: start;
  min-width: 0;
}
.create-grid > * { min-width: 0; }
.preview-panel {
  background: linear-gradient(180deg, #fcfcff 0%, #f7f8fe 100%);
  position: sticky;
  top: 88px;
}
.preview-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: #475467;
}
.preview-body { padding: 22px; }
.qr-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  height: 218px;
  border: 2px dashed #d9dced;
  border-radius: 16px;
  background:
    linear-gradient(45deg, #f8f9ff 25%, transparent 25%, transparent 75%, #f8f9ff 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, #f8f9ff 25%, #fff 25%, #fff 75%, #f8f9ff 75%) 9px 9px / 18px 18px;
  color: #c3c8e8;
}
.qr-placeholder-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: #667085;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.preview-title { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.preview-title strong { color: var(--text); font-size: 13.5px; }
.tips { margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); list-style: none; }
.tips li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 9px;
  color: #667085;
  font-size: 11.5px;
  line-height: 1.6;
}
.tips li:last-child { margin-bottom: 0; }
.tips li svg { margin-top: 2px; color: #12b76a; }
.tips code { background: #eef2ff; color: #4338ca; padding: 1px 5px; border-radius: 4px; }

/* ---------- 活码详情 ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 342px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}
.detail-grid > * { min-width: 0; }
.qr-panel { position: sticky; top: 88px; padding: 24px; }
.qr-frame {
  display: flex;
  justify-content: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 40px -26px rgba(16, 24, 40, .4);
}
.qr-frame img { width: 100%; max-width: 260px; height: auto; border-radius: 4px; }
.qr-caption { margin-top: 18px; text-align: left; }
.qr-label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.copy-line {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8f9fc;
}
.copy-line code {
  flex: 1;
  overflow: hidden;
  color: #475467;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qr-actions { display: flex; gap: 8px; margin-top: 12px; }
.qr-actions .btn { flex: 1; }
.qr-hint { margin: 14px 0 0; color: var(--faint); font-size: 11px; line-height: 1.65; }

.detail-side { display: grid; gap: 20px; min-width: 0; }
.detail-side > * { min-width: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-stat {
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}
.mini-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; }
.mini-label svg { color: var(--faint); }
.mini-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.mini-stat .mini-time { font-size: 13.5px; font-weight: 600; letter-spacing: 0; }

.detail-bottom {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  min-width: 0;
}
.detail-bottom > * { min-width: 0; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 186px; padding: 20px 22px 16px; }
.chart-col { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart-value { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-bar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 34px;
  height: 108px;
  border-radius: 6px;
  background: #f2f4f7;
  overflow: hidden;
}
.chart-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 6px;
  background: linear-gradient(180deg, #818cf8, #4f46e5);
  transition: height .35s ease;
}
.chart-label { color: var(--faint); font-size: 10.5px; }

.table-compact { min-width: 0; table-layout: auto; }
.table-compact th, .table-compact td { padding: 10px 16px; }
.table-compact td { font-size: 12px; }
.ua-cell { max-width: 360px; overflow: hidden; color: #667085; text-overflow: ellipsis; white-space: nowrap; }
.table-compact td code { color: #475467; font-size: 11.5px; }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px solid #fecdca;
  border-radius: var(--radius);
  background: #fffbfa;
}
.danger-zone strong { color: #b42318; font-size: 13.5px; }
.danger-zone p { margin-top: 3px; color: #667085; font-size: 12px; }

/* ---------- 登录 ---------- */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 8% 0%, #eef2ff 0%, transparent 62%),
    radial-gradient(900px 520px at 100% 100%, #ecfeff 0%, transparent 58%),
    #f7f8fc;
}
.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  width: min(980px, 100%);
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 40px 100px -48px rgba(16, 24, 40, .45);
  overflow: hidden;
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 40px 40px 38px;
  color: #fff;
  background:
    radial-gradient(460px 300px at 85% 15%, rgba(99, 102, 241, .38), transparent 70%),
    linear-gradient(150deg, #0f172a 0%, #1e1b4b 55%, #312e81 100%);
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(99, 102, 241, .22);
  filter: blur(50px);
}
.brand-light { color: #fff; position: relative; z-index: 1; }
.brand-light .brand-text small { color: #a5b4fc; }
.auth-brand-body { position: relative; z-index: 1; margin-top: 46px; }
.auth-brand-body h1 { font-size: 31px; font-weight: 700; letter-spacing: -.03em; line-height: 1.28; }
.auth-brand-body > p { margin-top: 15px; max-width: 340px; color: #c7d2fe; font-size: 13px; line-height: 1.8; opacity: .82; }
.feature-list { margin: 26px 0 0; padding: 0; list-style: none; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  color: #e0e7ff;
  font-size: 12.5px;
}
.feature-list li svg { color: #a5b4fc; }
.auth-visual { position: relative; z-index: 1; align-self: flex-end; margin-top: auto; padding-top: 34px; }
.auth-qr {
  width: 130px;
  padding: 9px;
  border-radius: 14px;
  background: #fff;
  transform: rotate(-6deg);
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, .65);
}
.auth-qr img { width: 100%; border-radius: 4px; }
.float-tag {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  color: #101828;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .55);
}
.float-tag i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; }

.auth-form { display: grid; place-items: center; min-width: 0; padding: 46px 44px; }
.auth-form-inner { width: 100%; max-width: 336px; min-width: 0; }
.auth-form h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { margin-top: 6px; color: var(--muted); font-size: 13px; }
.auth-fields { margin-top: 26px; }
.input-wrap { position: relative; }
.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.input.with-icon { padding-left: 38px; }
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.check-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.auth-fields .btn-block { margin-top: 2px; }
.auth-foot { margin-top: 30px; text-align: center; color: #b0b7c5; font-size: 11px; }

/* ---------- 提示与浮层 ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 10px;
  font-size: 12.5px;
  transition: opacity .25s ease, transform .25s ease;
}
.flash.out { opacity: 0; transform: translateY(-4px); }
.flash-icon { display: inline-flex; }
.flash-success { background: var(--success-bg); border-color: #abefc6; color: var(--success); }
.flash-error { background: var(--danger-bg); border-color: #fecdca; color: #b42318; }
.flash-warning { background: #fffaeb; border-color: #fedf89; color: #b54708; }
.flash-info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.flash-close {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: currentColor;
  opacity: .55;
  cursor: pointer;
}
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, .05); }

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 18px 40px -18px rgba(16, 24, 40, .7);
  animation: toast-in .18s ease;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 错误页 ---------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 32px;
  background:
    radial-gradient(900px 460px at 20% 0%, #eef2ff 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 100%, #ecfeff 0%, transparent 55%),
    #f8f9fc;
}
.error-wrap { max-width: 520px; text-align: center; }
.error-wrap .brand { justify-content: center; }
.error-code {
  margin: 34px 0 6px;
  font-size: 86px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.06em;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-wrap h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.error-wrap > p { margin: 9px auto 0; max-width: 400px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.brand-dark { color: var(--text); }
.brand-dark .brand-text small { color: var(--faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-bottom { grid-template-columns: 1fr; }
  .create-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
  .qr-panel { position: static; }
  .qr-panel .qr-frame img { max-width: 240px; }
  .create-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .preview-body { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
  .qr-placeholder { width: 180px; height: 180px; flex: none; }
  .preview-title { margin-top: 0; text-align: left; }
  .tips { flex: 1; min-width: 240px; margin-top: 0; padding-top: 0; border-top: 0; }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 24px 0 60px -30px rgba(15, 23, 42, .6); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .content { padding: 22px 20px 56px; }
  .topbar { padding: 0 20px; }
  .auth-card { grid-template-columns: 1fr; max-width: 480px; }
  .auth-brand { padding: 28px 30px; }
  .auth-brand-body { margin-top: 24px; }
  .auth-brand-body h1 { font-size: 25px; }
  .auth-brand-body h1 br { display: none; }
  .auth-brand-body > p { margin-top: 10px; }
  .feature-list, .auth-visual { display: none; }
  .auth-form { padding: 32px 30px 38px; }
}

@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-head .btn { align-self: stretch; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .stat-grid { gap: 12px; }
  .stat-card { padding: 15px 16px; gap: 11px; }
  .stat-icon { width: 38px; height: 38px; border-radius: 10px; }
  .stat-value { font-size: 21px; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .mini-stat:last-child { grid-column: span 2; }
  .panel-head { flex-wrap: wrap; }
  .search { width: 100%; }
  .pagination { flex-direction: column; align-items: flex-start; }
  .domain-pill { display: none; }
  .topbar { height: 58px; }
  .content { padding: 18px 14px 48px; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .danger-zone form, .danger-zone .btn { width: 100%; }
  .preview-body { display: block; }
  .qr-placeholder { width: 100%; height: 190px; }
  .preview-title { margin-top: 16px; text-align: center; }
  .tips { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
  .auth { padding: 14px; }
  .auth-card { border-radius: 20px; }
  .auth-form { padding: 28px 22px 34px; }
  .error-code { font-size: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
