/* ==========================================================================
   代付链 · 设计系统
   全站共用（落地页 / 登录页 / 后台 / 支付页）。无外部资源，图标一律内联 SVG。
   命名：ds-* 为设计系统基础件，其余为业务组件。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* 品牌与语义色 */
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-weak: #eef2ff;
  --brand-ring: rgba(79, 70, 229, 0.22);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0ea5e9;

  /* 语义浅底（徽章 / 提示条） */
  --brand-soft: #eef2ff;
  --success-soft: #ecfdf5;
  --warning-soft: #fffbeb;
  --danger-soft: #fef2f2;
  --info-soft: #f0f9ff;
  --neutral-soft: #f3f4f6;

  /* 中性色阶（浅色模式） */
  --n-0: #ffffff;
  --n-25: #fcfcfd;
  --n-50: #f9fafb;
  --n-100: #f3f4f6;
  --n-150: #eceef2;
  --n-200: #e5e7eb;
  --n-300: #d1d5db;
  --n-400: #9ca3af;
  --n-500: #6b7280;
  --n-600: #4b5563;
  --n-700: #374151;
  --n-800: #1f2937;
  --n-900: #111827;
  --n-950: #0b1120;

  /* 语义化表面 */
  --bg: var(--n-50);
  --bg-elevated: var(--n-0);
  --surface: var(--n-0);
  --surface-2: var(--n-50);
  --surface-3: var(--n-100);
  --surface-inset: var(--n-100);
  --sidebar-bg: #ffffff;
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --divider: var(--n-150);
  --text: var(--n-900);
  --text-2: var(--n-600);
  --text-3: var(--n-400);
  --text-inverse: #ffffff;
  --overlay: rgba(17, 24, 39, 0.48);
  --hover: rgba(17, 24, 39, 0.045);
  --active: rgba(17, 24, 39, 0.075);

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  /* 间距（4 的倍数） */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 14px rgba(17, 24, 39, 0.08), 0 1px 3px rgba(17, 24, 39, 0.05);
  --shadow-lg: 0 18px 40px rgba(17, 24, 39, 0.14), 0 4px 10px rgba(17, 24, 39, 0.06);
  --shadow-xl: 0 32px 64px rgba(17, 24, 39, 0.22);

  /* 字体 */
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;

  /* 动效与层级 */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t: 200ms;
  --z-sidebar: 40;
  --z-drawer: 60;
  --z-topbar: 30;
  --z-toast: 90;
  --z-modal: 80;

  /* 布局尺寸 */
  --sidebar-w: 236px;
  --topbar-h: 58px;
  --content-max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --brand: #818cf8;
    --brand-strong: #a5b4fc;
    --brand-weak: rgba(129, 140, 248, 0.14);
    --brand-ring: rgba(129, 140, 248, 0.3);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;

    --brand-soft: rgba(129, 140, 248, 0.14);
    --success-soft: rgba(52, 211, 153, 0.13);
    --warning-soft: rgba(251, 191, 36, 0.13);
    --danger-soft: rgba(248, 113, 113, 0.13);
    --info-soft: rgba(56, 189, 248, 0.13);
    --neutral-soft: rgba(148, 163, 184, 0.12);

    --n-0: #0b1120;
    --n-25: #0e1526;
    --n-50: #111827;
    --n-100: #172033;
    --n-150: #1d273c;
    --n-200: #26314a;
    --n-300: #35415c;
    --n-400: #64748b;
    --n-500: #8b98ae;
    --n-600: #a8b3c6;
    --n-700: #c3ccda;
    --n-800: #dde3ec;
    --n-900: #eef2f8;
    --n-950: #f7f9fc;

    --bg: #080d18;
    --bg-elevated: var(--n-50);
    --surface: #101a2c;
    --surface-2: #142036;
    --surface-3: #1a2740;
    --surface-inset: #0d1524;
    --sidebar-bg: #0c1524;
    --border: #24304a;
    --border-strong: #33415e;
    --divider: #1b2438;
    --text: #eef2f8;
    --text-2: #a8b3c6;
    --text-3: #6f7c93;
    --text-inverse: #0b1120;
    --overlay: rgba(3, 7, 15, 0.66);
    --hover: rgba(255, 255, 255, 0.05);
    --active: rgba(255, 255, 255, 0.09);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 44px rgba(0, 0, 0, 0.58);
    --shadow-xl: 0 32px 70px rgba(0, 0, 0, 0.7);
  }
}

/* --------------------------------------------------------------------------
   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);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

a:hover {
  color: var(--brand-strong);
}

button {
  font: inherit;
  color: inherit;
  margin: 0;
}

img, svg, canvas {
  display: block;
  max-width: 100%;
}

code, pre, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: var(--s-5) 0;
}

::selection {
  background: var(--brand-ring);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--n-300) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--n-300);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--n-400);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. 工具类
   -------------------------------------------------------------------------- */
.ds-hidden { display: none !important; }
.ds-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.ds-row { display: flex; align-items: center; gap: var(--s-3); }
.ds-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ds-wrap { flex-wrap: wrap; }
.ds-col { display: flex; flex-direction: column; gap: var(--s-3); }
.ds-grow { flex: 1 1 auto; min-width: 0; }
.ds-right { text-align: right; }
.ds-center { text-align: center; }
.ds-nowrap { white-space: nowrap; }
.ds-mono { font-family: var(--font-mono); font-size: 0.94em; letter-spacing: -0.01em; }
.ds-muted { color: var(--text-2); }
.ds-dim { color: var(--text-3); }
.ds-strong { font-weight: 650; }
.ds-small { font-size: var(--fs-sm); }
.ds-xs { font-size: var(--fs-xs); }
.ds-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-break { overflow-wrap: anywhere; word-break: break-word; }
.ds-mt-2 { margin-top: var(--s-2); }
.ds-mt-3 { margin-top: var(--s-3); }
.ds-mt-4 { margin-top: var(--s-4); }
.ds-mt-6 { margin-top: var(--s-6); }
.ds-mb-3 { margin-bottom: var(--s-3); }
.ds-mb-4 { margin-bottom: var(--s-4); }
.ds-gap-2 { gap: var(--s-2); }
.ds-gap-4 { gap: var(--s-4); }
.ds-gap-6 { gap: var(--s-6); }

/* 无障碍：仅键盘可见的跳转 */
.ds-skip {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  transition: top var(--t) var(--ease);
}
.ds-skip:focus {
  top: 12px;
}

/* --------------------------------------------------------------------------
   4. 按钮
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--btn-h);
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.btn:hover { background: var(--n-200); }
.btn:active { transform: translateY(0.5px); }

.btn[disabled],
.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover { background: var(--brand-strong); }

@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0b1120; }
  .btn-primary:hover { background: var(--brand-strong); }
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--hover); border-color: var(--border-strong); }

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-quiet:hover { background: var(--hover); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { filter: brightness(0.94); }

.btn-danger-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--danger);
}
.btn-danger-ghost:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { filter: brightness(0.95); }

.btn-sm {
  --btn-h: 30px;
  padding: 0 11px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  gap: 4px;
}

.btn-lg {
  --btn-h: 46px;
  padding: 0 24px;
  font-size: var(--fs-md);
  border-radius: var(--r-md);
}

.btn-block { width: 100%; }

.btn-icon {
  width: var(--btn-h);
  padding: 0;
  flex: 0 0 auto;
}

.btn .btn-ico { width: 15px; height: 15px; flex: 0 0 auto; }

/* 加载态：保留宽度，内容半透明 + 转圈 */
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ds-spin 0.7s linear infinite;
}
.btn-ghost.is-loading::after,
.btn-quiet.is-loading::after {
  border-color: var(--brand-ring);
  border-top-color: var(--brand);
}

@keyframes ds-spin {
  to { transform: rotate(360deg); }
}

/* 按钮组 */
.btn-group {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* 分段控件（时间范围 / 天数切换） */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}
.segmented button {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   5. 表单
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.label .req {
  color: var(--danger);
  margin-left: 2px;
}

.hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.5;
}

.err-text {
  font-size: var(--fs-xs);
  color: var(--danger);
  min-height: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
  appearance: none;
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.input[disabled],
.select[disabled],
.textarea[disabled] {
  background: var(--surface-inset);
  color: var(--text-3);
  cursor: not-allowed;
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: var(--danger);
}
.input.is-invalid:focus,
.textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b3c6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  }
}

.input-group {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.input-group > .input {
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.input-group > .addon {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.input-group > .addon.left {
  border-left: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.input-group > .addon.left + .input {
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

/* 带图标前缀的搜索框 */
.search {
  position: relative;
  min-width: 0;
}
.search .input {
  padding-left: 34px;
}
.search .search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--r-full);
  background: var(--n-300);
  transition: background var(--t) var(--ease);
  flex: 0 0 auto;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--brand-ring); }

/* 复选/单选（简单版） */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
}
.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* 表单栅格 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.form-grid .span-2 { grid-column: 1 / -1; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
}

/* 快捷小时按钮 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. 卡片与区块
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
}

.card-pad { padding: var(--s-5); }
.card-pad-lg { padding: var(--s-6); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--divider);
}

.card-title {
  font-size: var(--fs-md);
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
  margin-top: 2px;
}

.card-body { padding: var(--s-5); }
.card-body.tight { padding: var(--s-3); }
.card-foot {
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* 分区标题 */
.section-title {
  font-size: var(--fs-lg);
  font-weight: 680;
  letter-spacing: -0.015em;
}
.section-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 2px;
}

/* 提示条 */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.55;
  border: 1px solid transparent;
}
.alert .alert-ico { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }
.alert-info { background: var(--info-soft); border-color: rgba(14, 165, 233, 0.3); color: var(--text); }
.alert-warn { background: var(--warning-soft); border-color: rgba(245, 158, 11, 0.35); color: var(--text); }
.alert-error { background: var(--danger-soft); border-color: rgba(239, 68, 68, 0.32); color: var(--text); }
.alert-success { background: var(--success-soft); border-color: rgba(16, 185, 129, 0.32); color: var(--text); }
.alert-info .alert-ico { color: var(--info); }
.alert-warn .alert-ico { color: var(--warning); }
.alert-error .alert-ico { color: var(--danger); }
.alert-success .alert-ico { color: var(--success); }

/* --------------------------------------------------------------------------
   7. 表格
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 14px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  color: var(--text);
}

.table tbody tr:last-child td { border-bottom: 0; }

.table tbody tr {
  transition: background var(--t-fast) var(--ease);
}

.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--hover); }

.table .col-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .col-actions { text-align: right; white-space: nowrap; }
.table .col-actions .btn + .btn { margin-left: 4px; }

.table td.w-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.table-compact tbody td { padding: 9px 12px; }
.table-compact thead th { padding: 8px 12px; }

.table-empty td { padding: 0 !important; border: 0 !important; }

/* 订单号等次要标识 */
.id-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   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: 600;
  line-height: 1;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--text-2);
}
.badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.badge-pending   { background: var(--warning-soft); color: #b45309; }
.badge-paid      { background: var(--success-soft); color: #047857; }
.badge-expired   { background: var(--neutral-soft); color: var(--text-2); }
.badge-cancelled { background: var(--neutral-soft); color: var(--text-3); }
.badge-refunded  { background: var(--info-soft);    color: #0369a1; }
.badge-brand     { background: var(--brand-soft);   color: var(--brand); }
.badge-danger    { background: var(--danger-soft);  color: #b91c1c; }
.badge-ok        { background: var(--success-soft); color: #047857; }
.badge-failed    { background: var(--danger-soft);  color: #b91c1c; }
.badge-neutral   { background: var(--neutral-soft); color: var(--text-2); }
.badge-admin     { background: var(--brand-soft);   color: var(--brand); }
.badge-outline   { background: transparent; border: 1px solid var(--border); color: var(--text-2); }

@media (prefers-color-scheme: dark) {
  .badge-pending   { color: #fbbf24; }
  .badge-paid      { color: #34d399; }
  .badge-refunded  { color: #38bdf8; }
  .badge-danger,
  .badge-failed    { color: #f87171; }
  .badge-ok        { color: #34d399; }
  .badge-brand     { color: var(--brand); }
}

/* 状态圆点（表格内紧凑用） */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--n-400);
}
.status-dot.pending { background: var(--warning); }
.status-dot.paid { background: var(--success); }
.status-dot.expired { background: var(--n-400); }
.status-dot.cancelled { background: var(--n-400); }
.status-dot.refunded { background: var(--info); }

/* --------------------------------------------------------------------------
   9. 空态 / 加载态 / 骨架屏
   -------------------------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-9) var(--s-5);
  text-align: center;
  color: var(--text-2);
}
.empty .empty-ico {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-3);
}
.empty .empty-ico svg { width: 24px; height: 24px; }
.empty .empty-title {
  font-size: var(--fs-md);
  font-weight: 650;
  color: var(--text);
}
.empty .empty-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  max-width: 380px;
  line-height: 1.6;
}

/* 错误态 */
.state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-8) var(--s-5);
  text-align: center;
}
.state-error .err-ico {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
}
.state-error .err-ico svg { width: 22px; height: 22px; }
.state-error .err-title { font-weight: 650; font-size: var(--fs-md); }
.state-error .err-msg { font-size: var(--fs-sm); color: var(--text-2); max-width: 420px; }

/* 行内小加载 */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--brand-ring);
  border-top-color: var(--brand);
  animation: ds-spin 0.7s linear infinite;
  flex: 0 0 auto;
}
.spinner.sm { width: 13px; height: 13px; border-width: 1.6px; }
.spinner.lg { width: 26px; height: 26px; border-width: 3px; }

.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: var(--s-8) var(--s-5);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--hover), transparent);
  animation: ds-shimmer 1.4s infinite;
}
@keyframes ds-shimmer {
  100% { transform: translateX(100%); }
}
.sk-line { height: 12px; border-radius: var(--r-xs); }
.sk-line + .sk-line { margin-top: 8px; }
.sk-title { height: 18px; width: 40%; }
.sk-card {
  height: 96px;
  border-radius: var(--r);
}
.sk-chart {
  height: 220px;
  border-radius: var(--r-md);
}
.sk-table-row {
  height: 42px;
  border-radius: var(--r-xs);
}
.sk-table-row + .sk-table-row { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .skeleton::after,
  .spinner,
  .btn.is-loading::after {
    animation-duration: 3s;
  }
}

/* --------------------------------------------------------------------------
   10. Toast
   -------------------------------------------------------------------------- */
.toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-toast);
  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 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in var(--t) var(--ease);
  overflow-wrap: anywhere;
}

.toast.is-leaving {
  animation: toast-out 160ms var(--ease) forwards;
}

.toast .toast-ico {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
}
.toast .toast-msg { flex: 1 1 auto; min-width: 0; }
.toast .toast-close {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  margin: -2px -4px 0 0;
}
.toast .toast-close:hover { background: var(--hover); color: var(--text); }

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-warning { border-left: 3px solid var(--warning); }

.toast-success .toast-ico { color: var(--success); }
.toast-error   .toast-ico { color: var(--danger); }
.toast-info    .toast-ico { color: var(--info); }
.toast-warning .toast-ico { color: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(12px); }
}

/* --------------------------------------------------------------------------
   11. 模态框
   -------------------------------------------------------------------------- */
.modal-host {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
}
.modal-mask {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(2px);
  animation: fade-in 160ms var(--ease);
}
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  animation: modal-in 200ms var(--ease);
  overflow: hidden;
}
.modal.modal-sm { width: min(420px, 100%); }
.modal.modal-lg { width: min(760px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-5) var(--s-3);
}
.modal-head h3 {
  font-size: var(--fs-lg);
  font-weight: 680;
  letter-spacing: -0.015em;
}
.modal-head .modal-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 4px;
}
.modal-close {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-body {
  padding: 0 var(--s-5) var(--s-4);
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-top: 1px solid var(--divider);
  background: var(--surface-2);
  flex-wrap: wrap;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* 表格单元格内的操作菜单 */
.row-actions {
  position: relative;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.menu-pop {
  position: fixed;
  z-index: 70;
  min-width: 168px;
  padding: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.menu-pop button,
.menu-pop .menu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.menu-pop button:hover,
.menu-pop .menu-link:hover {
  background: var(--hover);
  color: var(--text);
}
.menu-pop button svg,
.menu-pop .menu-link svg { width: 14px; height: 14px; color: var(--text-2); flex: 0 0 auto; }
.menu-pop button.danger { color: var(--danger); }
.menu-pop button.danger svg { color: var(--danger); }
.menu-pop button.danger:hover { background: var(--danger-soft); }
.menu-pop .menu-sep {
  height: 1px;
  margin: 4px 2px;
  background: var(--divider);
}

/* 明细折叠 */
details.inline-details > summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 6px 0;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
details.inline-details > summary::-webkit-details-marker { display: none; }
details.inline-details > summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid var(--text-3);
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform var(--t-fast) var(--ease);
}
details.inline-details[open] > summary::before { transform: rotate(90deg); }

/* --------------------------------------------------------------------------
   12. 分页器
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--divider);
}
.pager .pager-info {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.pager .pager-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pager button.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.pager button.page-btn:hover:not([disabled]) { border-color: var(--brand); color: var(--brand); }
.pager button.page-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 650;
}
@media (prefers-color-scheme: dark) {
  .pager button.page-btn.is-active { color: #0b1120; }
}
.pager button.page-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.pager .ellipsis {
  padding: 0 4px;
  color: var(--text-3);
  user-select: none;
}

/* --------------------------------------------------------------------------
   13. 后台外壳
   -------------------------------------------------------------------------- */
body.app-body {
  background: var(--bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 var(--s-5);
  border-bottom: 1px solid var(--divider);
  flex: 0 0 auto;
}
.sidebar-brand .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
  flex: 0 0 auto;
}
.sidebar-brand .logo-mark svg { width: 16px; height: 16px; }
.sidebar-brand .brand-name {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar-brand .brand-tag {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--s-4) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-label {
  padding: var(--s-4) 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: 0.85; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.is-active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.sidebar-foot {
  flex: 0 0 auto;
  padding: var(--s-3);
  border-top: 1px solid var(--divider);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  min-width: 0;
}
.sidebar-user .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: 0 0 auto;
}
.sidebar-user .who { min-width: 0; flex: 1 1 auto; }
.sidebar-user .who .name {
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .who .mail {
  font-size: var(--fs-xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 主区 */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-6);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar .crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  min-width: 0;
}
.topbar .crumbs .sep { color: var(--text-3); }
.topbar .crumbs .current { color: var(--text); font-weight: 600; }

.topbar .topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.merchant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 4px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  max-width: 260px;
}
.merchant-chip .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.merchant-chip .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-btn {
  display: none;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.menu-btn svg { width: 18px; height: 18px; }

.app-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-6);
  padding-bottom: var(--s-10);
}

/* 抽屉遮罩 */
.drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: calc(var(--z-sidebar) - 1);
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t) var(--ease);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-drawer);
  }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-mask { display: block; }
  .app-main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 var(--s-4); }
  .app-content { padding: var(--s-4); padding-bottom: var(--s-9); }
  .merchant-chip { max-width: 150px; }
  .sidebar-brand { border-bottom: 0; }
}

@media (max-width: 620px) {
  .ds-hide-sm { display: none; }
  .merchant-chip { display: none; }
  .page-head h1 { font-size: var(--fs-xl); }
}

/* --------------------------------------------------------------------------
   14. 页面头部（后台各页）
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.page-head h1 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.page-head .page-desc {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   15. KPI 卡
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
}

.kpi {
  padding: var(--s-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease), transform var(--t) var(--ease);
}
.kpi:hover { box-shadow: var(--shadow-sm); }
.kpi .kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kpi .kpi-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 550;
}
.kpi .kpi-ico {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: 0 0 auto;
}
.kpi .kpi-ico svg { width: 16px; height: 16px; }
.kpi .kpi-ico.ok { background: var(--success-soft); color: var(--success); }
.kpi .kpi-ico.warn { background: var(--warning-soft); color: var(--warning); }
.kpi .kpi-ico.info { background: var(--info-soft); color: var(--info); }
.kpi .kpi-value {
  margin-top: var(--s-3);
  font-size: var(--fs-2xl);
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi .kpi-value .unit {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-2);
  margin-left: 3px;
  letter-spacing: 0;
}
.kpi .kpi-foot {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kpi .kpi-trend { font-weight: 600; }
.kpi .kpi-trend.up { color: var(--success); }
.kpi .kpi-trend.down { color: var(--danger); }

/* 迷你进度条 */
.mini-bar {
  margin-top: 10px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.mini-bar > span {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
  transition: width var(--t) var(--ease);
}

/* --------------------------------------------------------------------------
   16. 图表（纯 SVG / 手绘）
   -------------------------------------------------------------------------- */
.chart-card .chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-5) var(--s-5) var(--s-3);
}

.chart-shell {
  position: relative;
  width: 100%;
  padding: 0 var(--s-5) var(--s-4);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  touch-action: pan-y;
}

.chart-svg text {
  font-family: var(--font);
  font-size: 10px;
  fill: var(--text-3);
}

.chart-svg .grid-line {
  stroke: var(--divider);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart-svg .axis-label { fill: var(--text-3); }
.chart-svg .bar {
  fill: var(--brand);
  transition: fill var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.chart-svg .bar.dim { opacity: 0.55; }
.chart-svg .bar.hot { fill: var(--brand-strong); }
.chart-svg .area {
  fill: url(#dpAreaFill);
}
.chart-svg .line {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-svg .hover-band {
  fill: var(--hover);
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.chart-svg .hover-band.on { opacity: 1; }

.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 116px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--n-900);
  color: #fff;
  font-size: var(--fs-xs);
  line-height: 1.55;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%);
  transition: opacity var(--t-fast) var(--ease);
  white-space: nowrap;
}
.chart-tip.on { opacity: 1; }
.chart-tip .tip-date { color: rgba(255, 255, 255, 0.62); font-size: 11px; }
.chart-tip .tip-val { font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.chart-tip .tip-sub { color: rgba(255, 255, 255, 0.72); }

@media (prefers-color-scheme: dark) {
  .chart-tip { background: #1f2937; border: 1px solid var(--border-strong); }
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  pointer-events: none;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 0 var(--s-5) var(--s-4);
  font-size: var(--fs-xs);
  color: var(--text-2);
  flex-wrap: wrap;
}
.chart-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .swatch {
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--brand);
}

/* 横向条形图（渠道分布） */
.hbars {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5) var(--s-5);
}
.hbar {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
}
.hbar .hb-name {
  font-size: var(--fs-sm);
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hbar .hb-name .dot {
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--brand);
  flex: 0 0 auto;
}
.hbar .hb-track {
  height: 10px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.hbar .hb-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand);
  transition: width var(--t) var(--ease);
  min-width: 2px;
}
.hbar .hb-val {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.hbar .hb-sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 400;
  margin-left: 4px;
}

/* 渠道色板 */
.hbar[data-channel="sandbox"] .dot,
.hbar[data-channel="sandbox"] .hb-fill { background: var(--brand); }
.hbar[data-channel="alipay"] .dot,
.hbar[data-channel="alipay"] .hb-fill { background: #1677ff; }
.hbar[data-channel="wechat"] .dot,
.hbar[data-channel="wechat"] .hb-fill { background: #07c160; }
.hbar[data-channel="any"] .dot,
.hbar[data-channel="any"] .hb-fill { background: var(--n-400); }

/* --------------------------------------------------------------------------
   17. 订单列表工具栏
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--divider);
}
.toolbar .toolbar-search { flex: 1 1 260px; min-width: 180px; max-width: 380px; }
.toolbar .select { width: auto; min-width: 116px; }
.toolbar .toolbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* 自定义时间范围 */
.range-custom {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding: 0 var(--s-5) var(--s-4);
}
.range-custom .input { width: auto; min-width: 148px; }

/* 汇总条 */
.summary-bar {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  padding: 10px var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.summary-bar .sb-item { display: inline-flex; align-items: baseline; gap: 6px; }
.summary-bar .sb-val {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-md);
}

/* --------------------------------------------------------------------------
   18. 订单详情
   -------------------------------------------------------------------------- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
}
@media (max-width: 1000px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.detail-head .dt-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.detail-head .dt-amount {
  margin-left: auto;
  text-align: right;
}
.detail-head .dt-amount .amt {
  font-size: var(--fs-2xl);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.detail-head .dt-amount .lbl {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.kv {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px var(--s-4);
  font-size: var(--fs-sm);
}
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { font-size: var(--fs-xs); margin-top: 8px; }
}

/* 支付链接展示块 */
.link-box {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 12px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-width: 0;
}
.link-box .link-text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 二维码容器 */
.qr-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.qr-box canvas,
.qr-box svg { width: 148px; height: 148px; display: block; }
.qr-box .qr-cap {
  font-size: var(--fs-xs);
  color: #4b5563;
}

/* 时间线 */
.timeline {
  position: relative;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--divider);
  border-radius: 2px;
}
.tl-item {
  position: relative;
  padding: 0 0 var(--s-4) var(--s-3);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--n-400);
}
.tl-item.ok::before { border-color: var(--success); }
.tl-item.warn::before { border-color: var(--warning); }
.tl-item.err::before { border-color: var(--danger); }
.tl-item.info::before { border-color: var(--info); }
.tl-item .tl-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-item .tl-time {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tl-item .tl-payload {
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--surface-inset);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 132px;
  overflow: auto;
}

/* --------------------------------------------------------------------------
   19. 代付页编辑器
   -------------------------------------------------------------------------- */
.dpay-workspace {
  width: 100%;
  max-width: 920px;
  margin-inline: auto;
}

.dpay-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: var(--s-5);
  align-items: start;
}

.dpay-editor-column {
  display: grid;
  min-width: 0;
  gap: var(--s-4);
}

.dpay-editor-fields {
  display: grid;
  gap: var(--s-4);
  min-inline-size: 0;
  margin: 0;
  border: 0;
}

.dpay-editor-fields .textarea {
  min-height: 100px;
  resize: vertical;
}

.dpay-editor-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.dpay-preview-card {
  min-width: 0;
  overflow: hidden;
}

.dpay-preview-head {
  align-items: center;
  flex-wrap: wrap;
  row-gap: var(--s-1);
}

.dpay-preview-frame {
  display: block;
  width: 100%;
  border: 0;
  background: #f3f8fe;
}

.dpay-share-url {
  margin-block: var(--s-2) var(--s-3);
  font-family: var(--font-mono);
}

.dpay-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

@media (max-width: 780px) {
  .dpay-workspace { max-width: 480px; }
  .dpay-composer { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------------------------
   20. 设置页
   -------------------------------------------------------------------------- */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  max-width: 880px;
}

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .sr-main { flex: 1 1 300px; min-width: 0; }
.setting-row .sr-label { font-size: var(--fs-base); font-weight: 600; }
.setting-row .sr-desc { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; line-height: 1.6; }
.setting-row .sr-action { flex: 0 0 auto; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* 渠道状态列表 */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.channel-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  flex-wrap: wrap;
}
.channel-row .cr-ico {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex: 0 0 auto;
}
.channel-row .cr-name { font-weight: 600; }
.channel-row .cr-id { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }
.channel-row .cr-state { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

/* 代码块 */
.codeblock {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  overflow: hidden;
}
.codeblock .cb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: 7px 10px 7px 12px;
  border-bottom: 1px solid var(--divider);
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-weight: 600;
}
.codeblock pre {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre;
  tab-size: 2;
}
.codeblock code { color: inherit; }

/* 密钥展示 */
.secret-box {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 12px;
  background: var(--warning-soft);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--r-md);
  min-width: 0;
}
.secret-box .sk-text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   21. 运营页
   -------------------------------------------------------------------------- */
.admin-merchant-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.admin-merchant-cell .m-name { font-weight: 600; overflow-wrap: anywhere; }
.admin-merchant-cell .m-mail { font-size: var(--fs-xs); color: var(--text-3); overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   22. 落地页
   -------------------------------------------------------------------------- */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 50% -240px, var(--brand-weak), transparent 70%),
    var(--bg);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-6);
}
.landing-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.landing-nav .nav-brand .logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.35);
}
.landing-nav .nav-brand .logo-mark svg { width: 17px; height: 17px; }
.landing-nav .nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.hero {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--s-9) var(--s-6) var(--s-8);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--s-8);
  align-items: center;
}
@media (max-width: 940px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); padding-top: var(--s-7); }
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.01em;
}
.hero h1 {
  margin-top: var(--s-4);
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.16;
  font-weight: 760;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand), #8b5cf6 60%, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lede {
  margin-top: var(--s-4);
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--text-2);
  max-width: 560px;
}
.hero .hero-cta {
  margin-top: var(--s-6);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.hero .hero-note {
  margin-top: var(--s-4);
  font-size: var(--fs-xs);
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.hero .hero-note span { display: inline-flex; align-items: center; gap: 5px; }
.hero .hero-note svg { width: 13px; height: 13px; color: var(--success); }

/* 右侧示意卡（纯 CSS 假界面） */
.hero-visual {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--s-5);
  transform: perspective(1200px) rotateY(-4deg) rotateX(1.5deg);
  transition: transform 400ms var(--ease);
}
.hero-visual:hover { transform: none; }
.hero-visual .hv-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--divider);
}
.hero-visual .hv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--n-300); }
.hero-visual .hv-dot.b { background: var(--brand); }
.hero-visual .hv-title { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); }
.hv-amount {
  margin: var(--s-5) 0 var(--s-2);
  font-size: 34px;
  font-weight: 760;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hv-sub { font-size: var(--fs-sm); color: var(--text-2); }
.hv-rows { margin-top: var(--s-4); display: flex; flex-direction: column; gap: 8px; }
.hv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
}
.hv-row .hv-ok {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--success); font-weight: 600; font-size: var(--fs-xs);
}
.hv-row .hv-ok svg { width: 13px; height: 13px; }
.hv-bar {
  margin-top: var(--s-4);
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 62px;
}
.hv-bar span {
  flex: 1 1 auto;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
  opacity: 0.75;
}
.hv-bar span:nth-child(3n) { opacity: 0.45; }

/* 特性卡 */
.features {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--s-6) var(--s-9);
}
.features-head { text-align: center; margin-bottom: var(--s-6); }
.features-head h2 {
  font-size: var(--fs-2xl);
  font-weight: 720;
  letter-spacing: -0.025em;
}
.features-head p { margin-top: 8px; color: var(--text-2); font-size: var(--fs-md); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
}

.feature {
  padding: var(--s-5);
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.feature .f-ico {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: var(--s-4);
}
.feature .f-ico svg { width: 19px; height: 19px; }
.feature h3 { font-size: var(--fs-md); font-weight: 680; letter-spacing: -0.01em; }
.feature p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-2); line-height: 1.7; }

.landing-foot {
  margin-top: auto;
  border-top: 1px solid var(--divider);
  padding: var(--s-5) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-3);
  max-width: 1120px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   23. 认证页
   -------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 460px at 50% -220px, var(--brand-weak), transparent 68%),
    var(--bg);
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-6);
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}
.auth-top .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.auth-top .nav-brand .logo-mark {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: grid; place-items: center;
  color: #fff;
}
.auth-top .nav-brand .logo-mark svg { width: 16px; height: 16px; }

.auth-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-4) var(--s-5) var(--s-8);
}

.auth-card {
  width: 100%;
  max-width: 404px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: var(--s-6);
}

.auth-card h1 {
  font-size: var(--fs-2xl);
  font-weight: 720;
  letter-spacing: -0.025em;
}
.auth-card .auth-sub {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* tab 切换 */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  margin: var(--s-5) 0 var(--s-4);
}
.auth-tabs button {
  height: 32px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.auth-card .form-foot {
  margin-top: var(--s-5);
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

.auth-card .switch-hint {
  margin-top: var(--s-4);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.auth-card .switch-hint button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.auth-card .switch-hint button:hover { text-decoration: underline; }

.auth-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.auth-error.show { display: flex; }
.auth-error svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--danger); }

/* 密码可见切换 */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--hover); }
.pw-toggle svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   25. 商品页编辑器
   -------------------------------------------------------------------------- */

/* 编辑器整体布局：左表单 + 右实时预览 */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--s-4);
  align-items: start;
}
@media (max-width: 1080px) {
  .product-layout { grid-template-columns: minmax(0, 1fr); }
}

.product-stack { display: flex; flex-direction: column; gap: var(--s-4); }

/* 图片上传区 */
.uploader {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--s-5);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.dropzone .dz-ico { width: 26px; height: 26px; color: var(--text-3); }
.dropzone:hover .dz-ico { color: var(--brand); }
.dropzone .dz-hint { font-size: var(--fs-xs); color: var(--text-3); }
.dropzone.is-busy { pointer-events: none; opacity: 0.7; }

/* 单张封面 */
.cover-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-preview .img-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

/* 图集缩略图 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: var(--s-2);
}
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
  cursor: grab;
}
.gallery-item.is-dragging { opacity: 0.4; cursor: grabbing; }
.gallery-item.is-drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.gallery-item .gi-index {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: rgba(17, 24, 39, 0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.gallery-item .gi-tools {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  background: linear-gradient(transparent, rgba(17, 24, 39, 0.7));
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.gallery-item:hover .gi-tools,
.gallery-item:focus-within .gi-tools { opacity: 1; }
.gallery-item .gi-tools button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  cursor: pointer;
}
.gallery-item .gi-tools button:hover { background: #fff; }
.gallery-item .gi-tools button.danger { color: #dc2626; }
.gallery-item .gi-tools button[disabled] { opacity: 0.4; cursor: not-allowed; }
.gallery-item .gi-tools button svg { width: 12px; height: 12px; }

/* 上传占位 */
.upload-tile {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 10px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.upload-tile:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.upload-tile svg { width: 20px; height: 20px; }

/* 上传进度条 */
.upload-progress {
  height: 4px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 6px;
}
.upload-progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 120ms linear;
}

/* 主题色选择 */
.color-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.color-swatch.is-active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-ring);
}
.color-input {
  width: 44px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}

/* 可增删条目列表 */
.repeat-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.repeat-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  padding: var(--s-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.repeat-item .ri-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: var(--s-2);
}
.repeat-item .ri-fields.two { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.repeat-item .ri-fields.spec { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.repeat-item .ri-tools {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}
.repeat-item .ri-tools button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
}
.repeat-item .ri-tools button:hover { background: var(--hover); color: var(--text); }
.repeat-item .ri-tools button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.repeat-item .ri-tools button[disabled] { opacity: 0.3; cursor: not-allowed; }
.repeat-item .ri-tools button svg { width: 13px; height: 13px; }
.repeat-item .ri-handle {
  flex: 0 0 auto;
  width: 18px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  cursor: grab;
  padding-top: 8px;
}
.repeat-item .ri-handle svg { width: 13px; height: 13px; }
.repeat-item.is-dragging { opacity: 0.4; }
.repeat-item.is-drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; }

.repeat-empty {
  padding: var(--s-4);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}

/* 图标选择器 */
.icon-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.icon-picker button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.icon-picker button:hover { border-color: var(--brand); color: var(--brand); }
.icon-picker button.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.icon-picker button svg { width: 15px; height: 15px; }

/* 商品页预览卡（右栏） */
.product-preview {
  position: sticky;
  top: calc(var(--topbar-h) + var(--s-4));
}
@media (max-width: 1080px) {
  .product-preview { position: static; }
}

.preview-phone {
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.preview-hero {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  overflow: hidden;
}
.preview-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-hero .ph-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
}
.preview-hero .ph-placeholder svg { width: 34px; height: 34px; }
.preview-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.preview-body { padding: var(--s-4); }
.preview-subtitle {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-bottom: 4px;
}
.preview-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.preview-amount {
  margin-top: var(--s-3);
  font-size: var(--fs-2xl);
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.preview-specs {
  margin-top: var(--s-3);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.preview-specs .ps-item {
  padding: 7px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  min-width: 0;
}
.preview-specs .ps-k { font-size: 10px; color: var(--text-3); }
.preview-specs .ps-v { font-size: var(--fs-xs); font-weight: 600; overflow-wrap: anywhere; }
.preview-highlights {
  margin-top: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-highlights .ph-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.preview-highlights .ph-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.preview-highlights .ph-ico svg { width: 12px; height: 12px; }
.preview-highlights .ph-t { font-size: var(--fs-xs); font-weight: 650; }
.preview-highlights .ph-d { font-size: 11px; color: var(--text-2); line-height: 1.5; }
.preview-gallery-strip {
  margin-top: var(--s-3);
  display: flex;
  gap: 4px;
  overflow: hidden;
}
.preview-gallery-strip img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
  flex: 0 0 auto;
}
.preview-gallery-strip .more {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text-2);
  font-weight: 600;
  flex: 0 0 auto;
}

/* 商品页区块（订单详情里） */
.product-summary {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  flex-wrap: wrap;
}
.product-summary .ps-cover {
  flex: 0 0 auto;
  width: 132px;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.product-summary .ps-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-summary .ps-cover svg { width: 26px; height: 26px; }
.product-summary .ps-info { flex: 1 1 200px; min-width: 0; }

/* 订单列表的商品页小标识 */
.product-dot {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.product-dot svg { width: 10px; height: 10px; }

/* 编辑器底部固定操作条 */
.editor-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
}
.editor-bar .eb-left { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.editor-bar .eb-right { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; margin-left: auto; }

/* 编辑器锚点导航 */
.editor-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: var(--s-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
}
.editor-tabs button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
}
.editor-tabs button:hover { background: var(--hover); color: var(--text); }

/* --------------------------------------------------------------------------
   24. 打印 / 减少动画
   -------------------------------------------------------------------------- */
@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;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toast-host,
  .toolbar,
  .pager,
  .btn {
    display: none !important;
  }
  .app-main { margin-left: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}
