/* ==================================================================
 * UniRecharge Design System
 * 企业级白色主题 · 设计令牌 + 组件库
 * 所有强调色统一走 var(--brand)，由模板运行时注入。
 * ================================================================== */

/* ------------------------------------------------------------------
 * 1. 设计令牌
 * ------------------------------------------------------------------ */
:root {
  /* 中性色阶（略带蓝调的冷灰，避免廉价感） */
  --ink-900: #0a1224;
  --ink-800: #16203a;
  --ink-700: #2a3752;
  --ink-600: #46566f;
  --ink-500: #64748b;
  --ink-400: #8a99ae;
  --ink-300: #aab6c6;
  --ink-200: #cbd5e1;

  --line: #e7ecf4;
  --line-strong: #d7dfeb;
  --line-faint: #f1f4f9;

  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f4f7fb;
  --canvas: #f5f7fb;

  /* 品牌色（默认企业蓝，运行时按模板覆写） */
  --brand: #1d4ed8;
  --brand-ink: #12348f;
  --brand-soft: #eff5ff;
  --brand-soft-2: #dfeaff;
  --brand-line: #cddffd;
  --on-brand: #ffffff;

  /* 语义色 */
  --success: #0f9d63;
  --success-soft: #e9f8f1;
  --warning: #b7791f;
  --warning-soft: #fdf6e6;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --info: #0b7fd4;
  --info-soft: #e8f4fd;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(10, 18, 36, 0.04);
  --shadow-sm: 0 1px 2px rgba(10, 18, 36, 0.04), 0 2px 6px -2px rgba(10, 18, 36, 0.06);
  --shadow-md: 0 2px 4px rgba(10, 18, 36, 0.03), 0 10px 24px -12px rgba(10, 18, 36, 0.14);
  --shadow-lg: 0 4px 8px rgba(10, 18, 36, 0.04), 0 24px 48px -20px rgba(10, 18, 36, 0.22);
  --shadow-brand: 0 8px 24px -10px color-mix(in srgb, var(--brand) 55%, transparent);

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;

  /* 字号 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 21px;
  --fs-2xl: 26px;
  --fs-3xl: 33px;
  --fs-4xl: 44px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.14s;
  --dur: 0.24s;
  --dur-slow: 0.42s;

  /* 布局 */
  --page-max: 1240px;
  --header-h: 68px;
}

/* ------------------------------------------------------------------
 * 2. 基础重置
 * ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 页面背景：极淡的双色光晕 + 网格，避免纯色平板感 */
body.has-ambient {
  background-image:
    radial-gradient(1100px 520px at 12% -8%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 62%),
    radial-gradient(900px 460px at 92% 0%, rgba(120, 150, 220, 0.1), transparent 58%),
    linear-gradient(180deg, #fbfcfe 0%, var(--canvas) 46%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

h1, h2, h3, h4, h5 {
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}

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

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

img,
svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background: color-mix(in srgb, var(--brand) 24%, transparent);
}

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 65%, transparent);
  outline-offset: 2px;
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink-200) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--ink-200);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-full);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--ink-300);
  background-clip: content-box;
}

/* ------------------------------------------------------------------
 * 3. 排版工具
 * ------------------------------------------------------------------ */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.t-xs { font-size: var(--fs-xs); }
.t-sm { font-size: var(--fs-sm); }
.t-md { font-size: var(--fs-md); }
.t-lg { font-size: var(--fs-lg); }
.t-xl { font-size: var(--fs-xl); font-weight: 640; letter-spacing: -0.02em; }
.t-2xl { font-size: var(--fs-2xl); font-weight: 660; letter-spacing: -0.025em; }
.t-3xl { font-size: var(--fs-3xl); font-weight: 680; letter-spacing: -0.03em; }
.t-4xl { font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.035em; }

.muted { color: var(--ink-500); }
.faint { color: var(--ink-400); }
.strong { font-weight: 600; color: var(--ink-900); }
.price { color: #c2410c; font-weight: 680; }
.brand-text { color: var(--brand); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------------
 * 4. 布局
 * ------------------------------------------------------------------ */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-gap-2 { display: flex; align-items: center; gap: var(--sp-2); }
.row-gap-3 { display: flex; align-items: center; gap: var(--sp-3); }
.row-gap-4 { display: flex; align-items: center; gap: var(--sp-4); }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--sp-5); }
.hidden { display: none !important; }

.section {
  padding: var(--sp-9) 0;
}
.section-tight {
  padding: var(--sp-7) 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 640;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
}

/* ------------------------------------------------------------------
 * 5. 卡片 / 表面
 * ------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: var(--sp-6);
}

.card-flush {
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  font-size: var(--fs-lg);
  font-weight: 650;
}

.card-body {
  padding: var(--sp-6);
}

.card-foot {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-5);
}

/* 可交互卡片 */
.card-hover {
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-line);
}

/* ------------------------------------------------------------------
 * 6. 按钮
 * ------------------------------------------------------------------ */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink-800);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--fs-base);
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:hover { border-color: var(--ink-300); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  --btn-bg: var(--brand);
  --btn-fg: var(--on-brand);
  --btn-border: var(--brand);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
}

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

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

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-border: var(--danger);
}
.btn-danger:hover { background: #b42318; border-color: #b42318; }

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

.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn-lg { height: 46px; padding: 0 var(--sp-7); font-size: var(--fs-md); border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

.btn .spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: currentColor transparent currentColor transparent;
}

/* 按钮组 */
.btn-group { display: inline-flex; gap: var(--sp-2); }

/* ------------------------------------------------------------------
 * 7. 表单
 * ------------------------------------------------------------------ */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.label {
  font-size: var(--fs-sm);
  font-weight: 560;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label .req { color: var(--danger); }
.label .hint {
  font-weight: 400;
  color: var(--ink-400);
  font-size: var(--fs-xs);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-900);
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease);
}
.textarea {
  height: auto;
  min-height: 92px;
  padding: var(--sp-3);
  line-height: 1.6;
  resize: vertical;
}
.input::placeholder,
.textarea::placeholder {
  color: var(--ink-400);
}
.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-300);
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-3);
  color: var(--ink-400);
  cursor: not-allowed;
}
.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--danger);
}
.field-error {
  font-size: var(--fs-xs);
  color: var(--danger);
}
.field-hint {
  font-size: var(--fs-xs);
  color: var(--ink-400);
}

.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.input-group .btn {
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  border-left: none;
}
.input-affix {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-left: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-3);
  color: var(--ink-500);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.form-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) {
  .form-grid .span-2 { grid-column: span 1; }
}

/* 开关 */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--r-full);
  background: var(--ink-200);
  transition: background var(--dur) var(--ease);
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease-out);
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.switch-label { font-size: var(--fs-base); color: var(--ink-700); }

/* 单选卡片组 */
.choice-group {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.choice:hover { border-color: var(--ink-300); }
.choice input {
  position: absolute;
  opacity: 0;
}
.choice.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.choice-title {
  font-weight: 600;
  color: var(--ink-900);
  font-size: var(--fs-base);
}
.choice-desc {
  font-size: var(--fs-xs);
  color: var(--ink-500);
}
.choice.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------
 * 8. 徽章 / 标签
 * ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 580;
  line-height: 1;
  background: var(--surface-3);
  color: var(--ink-600);
  white-space: nowrap;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-outline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-600);
}
.badge-lg { height: 26px; padding: 0 12px; font-size: var(--fs-sm); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--ink-600);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: var(--sp-3) var(--sp-4);
  border: none;
  background: none;
  color: var(--ink-500);
  font-size: var(--fs-base);
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.tab:hover { color: var(--ink-800); }
.tab.is-active { color: var(--brand); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: var(--sp-3);
  right: var(--sp-3);
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
}

/* 分段控件 */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}
.segmented button {
  height: 30px;
  padding: 0 var(--sp-4);
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink-500);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink-800); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
}

/* ------------------------------------------------------------------
 * 9. 表格
 * ------------------------------------------------------------------ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  min-width: 100%;
  font-size: var(--fs-base);
}
.table th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line-faint);
  color: var(--ink-700);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--dur-fast) var(--ease);
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table .col-actions {
  text-align: right;
  white-space: nowrap;
}
.table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-compact td {
  padding: var(--sp-3) var(--sp-4);
}

/* ------------------------------------------------------------------
 * 10. 模态 / 抽屉 / 浮层
 * ------------------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 36, 0.42);
  backdrop-filter: blur(3px);
  z-index: 90;
  animation: fadeIn var(--dur) var(--ease);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 91;
  animation: modalIn var(--dur-slow) var(--ease-out);
  overflow: hidden;
}
.modal-lg { width: min(860px, calc(100vw - 32px)); }
.modal-sm { width: min(420px, calc(100vw - 32px)); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
}
.modal-head h3 {
  font-size: var(--fs-xl);
  font-weight: 650;
}
.modal-head .sub {
  margin-top: 3px;
  font-size: var(--fs-sm);
  color: var(--ink-500);
}
.modal-body {
  padding: 0 var(--sp-6) var(--sp-5);
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 91;
  animation: drawerIn var(--dur-slow) var(--ease-out);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line);
}
.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--sp-6);
}
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes drawerIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

/* 关闭按钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  flex: none;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink-800);
}

/* Toast */
.toast-stack {
  position: fixed;
  top: var(--sp-6);
  right: var(--sp-6);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-width: 260px;
  max-width: 400px;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--dur-slow) var(--ease-out);
  pointer-events: auto;
}
.toast.is-out {
  animation: toastOut var(--dur) var(--ease) forwards;
}
.toast-icon {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
}
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warn .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-title {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink-900);
}
.toast-msg {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  margin-top: 2px;
  word-break: break-word;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* 下拉菜单 */
.menu {
  position: absolute;
  min-width: 180px;
  padding: var(--sp-2);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  animation: fadeIn var(--dur-fast) var(--ease);
}
.menu.right { right: 0; }
.menu.left { left: 0; }
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  border: none;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-700);
  font-size: var(--fs-base);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.menu-item:hover { background: var(--surface-3); color: var(--ink-900); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep {
  height: 1px;
  margin: var(--sp-2) 0;
  background: var(--line);
}

/* ------------------------------------------------------------------
 * 11. 反馈组件
 * ------------------------------------------------------------------ */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spinner-lg {
  width: 30px;
  height: 30px;
  border-width: 3px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-9) 0;
  color: var(--ink-400);
  font-size: var(--fs-sm);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, #e9eef6 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-card { height: 220px; border-radius: var(--r-lg); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-9) var(--sp-6);
  text-align: center;
}
.empty-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  color: var(--ink-300);
}
.empty-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-700);
}
.empty-desc {
  font-size: var(--fs-sm);
  color: var(--ink-400);
  max-width: 340px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.65;
  border: 1px solid transparent;
}
.alert-info { background: var(--info-soft); color: #0a5c96; border-color: #cfe6f8; }
.alert-success { background: var(--success-soft); color: #0a6b45; border-color: #c8ecdb; }
.alert-warn { background: var(--warning-soft); color: #8a5a12; border-color: #f2e3c0; }
.alert-danger { background: var(--danger-soft); color: #96231a; border-color: #f7d0cb; }
.alert-icon { flex: none; margin-top: 1px; }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-500);
  flex-wrap: wrap;
}
.pager {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.pager button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--ink-600);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.pager button:hover:not(:disabled) { border-color: var(--brand-line); color: var(--brand); }
.pager button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* 进度条 */
.progress {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
  transition: width var(--dur-slow) var(--ease-out);
}

/* 统计卡 */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--ink-500);
  font-weight: 520;
}
.stat-value {
  font-size: var(--fs-2xl);
  font-weight: 680;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.stat-foot {
  font-size: var(--fs-xs);
  color: var(--ink-400);
}
.stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand);
}

/* 描述列表 */
.desc-list {
  display: grid;
  gap: var(--sp-3);
}
.desc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  font-size: var(--fs-base);
}
.desc-row .k {
  color: var(--ink-500);
  flex: none;
}
.desc-row .v {
  color: var(--ink-900);
  font-weight: 550;
  text-align: right;
  word-break: break-all;
}

/* 时间线 */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  position: relative;
  padding: 0 0 var(--sp-5) var(--sp-6);
  border-left: 2px solid var(--line);
}
.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--ink-200);
}
.timeline-item.is-done::before {
  border-color: var(--brand);
  background: var(--brand);
}
.timeline-title {
  font-size: var(--fs-base);
  font-weight: 580;
  color: var(--ink-800);
}
.timeline-meta {
  font-size: var(--fs-xs);
  color: var(--ink-400);
  margin-top: 2px;
}

/* 工具提示 */
.tip {
  position: relative;
}
.tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: var(--r-xs);
  background: var(--ink-900);
  color: #fff;
  font-size: var(--fs-xs);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
  z-index: 50;
}
.tip:hover::after { opacity: 1; }

/* 复制字段 */
.copy-field {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.copy-field code {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--ink-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-field .btn { flex: none; }

/* ------------------------------------------------------------------
 * 12. 分隔与工具
 * ------------------------------------------------------------------ */
.divider {
  height: 1px;
  background: var(--line);
  border: none;
  margin: var(--sp-6) 0;
}
.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }
.stack-6 > * + * { margin-top: var(--sp-6); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

/* 入场动画 */
.reveal {
  animation: revealUp var(--dur-slow) var(--ease-out) both;
}
.reveal-1 { animation-delay: 0.04s; }
.reveal-2 { animation-delay: 0.09s; }
.reveal-3 { animation-delay: 0.14s; }
.reveal-4 { animation-delay: 0.19s; }
@keyframes revealUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ------------------------------------------------------------------
 * 13. 响应式
 * ------------------------------------------------------------------ */
@media (max-width: 1024px) {
  :root {
    --fs-4xl: 36px;
    --fs-3xl: 28px;
    --fs-2xl: 23px;
    --page-max: 100%;
  }
  .page { padding: 0 var(--sp-5); }
}

@media (max-width: 720px) {
  :root {
    --fs-4xl: 30px;
    --fs-3xl: 24px;
    --fs-2xl: 20px;
    --sp-9: 40px;
    --sp-10: 48px;
  }
  .page { padding: 0 var(--sp-4); }
  .card-pad { padding: var(--sp-5); }
  .card-body { padding: var(--sp-5); }
  .section { padding: var(--sp-8) 0; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .toast-stack { left: var(--sp-4); right: var(--sp-4); top: var(--sp-4); }
  .toast { min-width: 0; max-width: none; }
}
