/* 云匠商城 · 平台/商家后台设计系统（Material 3 / Google Workspace 风格） */
:root {
  color-scheme: light;
  --bg: #f8fafd;
  --surface: #ffffff;
  --surface-2: #f1f5fa;
  --surface-3: #e8eef6;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e2e7ee;
  --line-strong: #c9d1dc;
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --primary-soft: #d3e3fd;
  --on-primary-soft: #041e49;
  --accent: #146c2e;
  --danger: #b3261e;
  --danger-soft: #fce8e6;
  --warning: #8f5000;
  --warning-soft: #feefc3;
  --success: #146c2e;
  --success-soft: #e3f2e7;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .10), 0 1px 3px 1px rgba(60, 64, 67, .06);
  --shadow-2: 0 2px 6px 2px rgba(60, 64, 67, .08), 0 1px 2px rgba(60, 64, 67, .12);
  --shadow-3: 0 8px 24px rgba(20, 30, 45, .12);
  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --sidebar: 264px;
  --topbar: 68px;
  --font: "Google Sans", "Roboto", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131314;
  --surface: #1e1f20;
  --surface-2: #242628;
  --surface-3: #2d2f31;
  --text: #e6e8ea;
  --muted: #a6acb3;
  --line: #35383b;
  --line-strong: #4a4e52;
  --primary: #a8c7fa;
  --primary-hover: #d3e3fd;
  --primary-soft: #0842a0;
  --on-primary-soft: #d3e3fd;
  --accent: #8bd5a4;
  --danger: #f2b8b5;
  --danger-soft: #3d1a17;
  --warning: #fdd663;
  --warning-soft: #3a2d0a;
  --success: #8bd5a4;
  --success-soft: #13291a;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .45);
  --shadow-3: 0 12px 32px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.ic { flex: none; vertical-align: middle; }
::selection { background: var(--primary-soft); color: var(--on-primary-soft); }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 60;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 16px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
  background: linear-gradient(135deg, #0b57d0, #3f7ce0);
  box-shadow: 0 6px 14px rgba(11, 87, 208, .28);
}
[data-theme="dark"] .brand-mark { color: #062e6f; background: linear-gradient(135deg, #a8c7fa, #d3e3fd); box-shadow: none; }
.brand-text b { display: block; font-size: 15px; letter-spacing: .01em; }
.brand-text span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav-group { margin-top: 14px; }
.nav-group > span {
  display: block; padding: 0 12px 6px; font-size: 11px; color: var(--muted);
  letter-spacing: .06em; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 12px; border-radius: 999px;
  color: var(--muted); font-size: 13.5px; margin-bottom: 2px;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 600; }
[data-theme="dark"] .nav-item.active { color: #d3e3fd; }
.nav-item .tag { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-weight: 500; }
.nav-item.active .tag { background: rgba(255, 255, 255, .35); color: inherit; }
[data-theme="dark"] .nav-item.active .tag { background: rgba(0, 0, 0, .3); }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: var(--r-md); }
.sidebar-user:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--primary-soft); color: var(--on-primary-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.sidebar-user b { display: block; font-size: 12.5px; font-weight: 600; }
.sidebar-user span { display: block; font-size: 11px; color: var(--muted); }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) { .topbar { background: var(--bg); } }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar h1 { font-size: 17px; font-weight: 600; letter-spacing: .01em; }
.topbar .crumb { font-size: 11px; color: var(--muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); transition: background .16s, color .16s;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button.soft { background: var(--surface); border: 1px solid var(--line); }
.user-chip {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 4px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12px;
}
.user-chip .avatar { width: 28px; height: 28px; font-size: 11px; }

.page { padding: 8px 32px 48px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 12px 0 20px; }
.page-head h2 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.page-head p { color: var(--muted); font-size: 12.5px; margin-top: 6px; max-width: 720px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 20px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
  transition: background .16s, box-shadow .16s, transform .1s, opacity .16s;
}
[data-theme="dark"] .btn { color: #062e6f; }
.btn:hover { background: var(--primary-hover); box-shadow: var(--shadow-1); }
[data-theme="dark"] .btn:hover { color: #041e49; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn--tonal { background: var(--primary-soft); color: var(--on-primary-soft); }
.btn--tonal:hover { background: var(--primary-soft); filter: brightness(.97); color: var(--on-primary-soft); }
.btn--outlined { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--outlined:hover { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn--text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn--text:hover { background: var(--primary-soft); color: var(--on-primary-soft); box-shadow: none; }
.btn--danger { background: var(--danger); color: #fff; }
[data-theme="dark"] .btn--danger { color: #601410; }
.btn--danger:hover { filter: brightness(.94); }
.btn--sm { height: 32px; padding: 0 13px; font-size: 12px; gap: 5px; }
.btn--xs { height: 26px; padding: 0 10px; font-size: 11px; }
.btn--icon { width: 38px; padding: 0; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 22px 22px; }
.card-body.tight { padding: 12px 22px 18px; }
.card-body.flush { padding: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }

/* ---------- 指标卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-1);
}
.stat-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.stat-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--primary);
}
.stat-value { font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin-top: 12px; font-feature-settings: "tnum"; }
.stat-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.trend-up { color: var(--success); font-weight: 600; }
.trend-down { color: var(--danger); font-weight: 600; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 12px 16px; background: var(--surface-2); white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table th:first-child { border-top-left-radius: var(--r-md); }
.table th:last-child { border-top-right-radius: var(--r-md); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .cell-main { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.thumb--lg { width: 58px; height: 58px; border-radius: 12px; }
.cell-title { font-weight: 600; font-size: 13px; line-height: 1.4; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.table-actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-empty { padding: 54px 20px; text-align: center; color: var(--muted); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted);
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.no-dot::before { display: none; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--primary { background: var(--primary-soft); color: var(--on-primary-soft); }
[data-theme="dark"] .badge--primary { color: #d3e3fd; }
.badge--outline { background: transparent; border: 1px solid var(--line-strong); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.chip.on { background: var(--primary-soft); color: var(--on-primary-soft); border-color: transparent; font-weight: 600; }
[data-theme="dark"] .chip.on { color: #d3e3fd; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  outline: none; font-size: 13px; transition: border-color .16s, box-shadow .16s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235f6368' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a6acb3' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); }
.hint { font-size: 11px; color: var(--muted); line-height: 1.6; }
.error-text { font-size: 11px; color: var(--danger); }
.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; height: auto; }
.input-prefix { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); font-size: 12px; color: var(--muted); }
.input-prefix + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch i::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); left: 3px; top: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s;
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .grow b { display: block; font-size: 13px; font-weight: 600; }
.switch-row .grow span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.color-input { display: flex; align-items: center; gap: 9px; }
.color-input input[type="color"] { width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
.color-input .input { flex: 1; font-family: var(--mono); text-transform: lowercase; }

/* ---------- 分段 / 标签页 ---------- */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 999px; gap: 2px; }
.segmented a, .segmented button {
  height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 5px;
}
.segmented .on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs a, .tabs button { padding: 12px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-art {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); margin: 0 auto 14px;
}
.empty b { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty span { font-size: 12px; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 16px 22px; flex-wrap: wrap; }
.pagination .info { margin-right: auto; font-size: 11px; color: var(--muted); }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; color: var(--muted);
  border: 1px solid transparent;
}
.page-btn:hover { background: var(--surface-2); }
.page-btn.on { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 600; }
[data-theme="dark"] .page-btn.on { color: #d3e3fd; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- 弹窗 ---------- */
dialog.modal {
  border: 0; padding: 0; background: transparent; max-width: 560px; width: calc(100vw - 32px);
  color: var(--text);
}
dialog.modal::backdrop { background: rgba(12, 16, 22, .48); backdrop-filter: blur(2px); }
.modal-card {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3);
  border: 1px solid var(--line); overflow: hidden;
  animation: modal-in .2s cubic-bezier(.2, .7, .3, 1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { padding: 22px 24px 6px; }
.modal-head h3 { font-size: 18px; font-weight: 600; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.modal-body { padding: 16px 24px 8px; max-height: 68dvh; overflow-y: auto; }
.modal-foot { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- 提示条 ---------- */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md); font-size: 12px; line-height: 1.65;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.alert .ic { margin-top: 1px; flex: none; }
.alert b { color: var(--text); }
.alert--info { background: var(--primary-soft); border-color: transparent; color: var(--on-primary-soft); }
[data-theme="dark"] .alert--info { color: #d3e3fd; }
.alert--warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.alert--danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert--success { background: var(--success-soft); border-color: transparent; color: var(--success); }

.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px;
  padding: 13px 16px; border-radius: var(--r-md); background: #202124; color: #f1f3f4;
  font-size: 12.5px; box-shadow: var(--shadow-3); animation: toast-in .24s ease;
}
.toast--success { background: #146c2e; }
.toast--error { background: #b3261e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 代码编辑器 ---------- */
.code-editor {
  width: 100%; min-height: 460px; padding: 16px 18px;
  background: #0f1117; color: #d6e2f0; border: 1px solid #2a2f3a; border-radius: var(--r-md);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; tab-size: 4;
  resize: vertical; outline: none; white-space: pre; overflow: auto;
}
.code-editor:focus { border-color: #4c7dd8; box-shadow: 0 0 0 3px rgba(76, 125, 216, .18); }
.file-list { display: flex; flex-direction: column; gap: 2px; }
.file-list a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: var(--muted); font-family: var(--mono);
}
.file-list a:hover { background: var(--surface-2); color: var(--text); }
.file-list a.on { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 600; }
[data-theme="dark"] .file-list a.on { color: #d3e3fd; }

/* ---------- 主题卡 ---------- */
.theme-card { overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.theme-preview { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.theme-preview img { width: 100%; height: 100%; object-fit: cover; }
.theme-preview .mock { position: absolute; inset: 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.theme-swatch { display: flex; gap: 4px; }
.theme-swatch i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.06); }
.theme-body { padding: 15px 18px 18px; }
.theme-body h4 { font-size: 14px; font-weight: 600; }
.theme-body p { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; min-height: 3.2em; }

/* ---------- 登录 ---------- */
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 12% 0%, rgba(11, 87, 208, .12), transparent 60%),
    radial-gradient(700px 420px at 92% 100%, rgba(20, 108, 46, .10), transparent 62%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: var(--shadow-3); overflow: hidden;
}
.auth-side {
  padding: 40px 38px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #0b57d0, #083f9c 62%, #062e6f);
  display: flex; flex-direction: column;
}
.auth-side::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  right: -110px; bottom: -130px; background: rgba(255, 255, 255, .10);
}
.auth-side::before {
  content: ""; position: absolute; width: 160px; height: 160px; border-radius: 36px;
  left: -60px; top: -50px; background: rgba(255, 255, 255, .08); transform: rotate(24deg);
}
.auth-side .mark { width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; font-weight: 700; font-size: 19px; }
.auth-side h2 { font-size: 30px; line-height: 1.25; margin-top: 28px; letter-spacing: -.02em; font-weight: 600; }
.auth-side p { font-size: 12.5px; opacity: .82; margin-top: 12px; line-height: 1.8; max-width: 300px; }
.auth-points { margin-top: 34px; display: flex; flex-direction: column; gap: 13px; font-size: 12px; position: relative; z-index: 1; }
.auth-points div { display: flex; align-items: center; gap: 9px; opacity: .92; }
.auth-form { padding: 44px 42px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.auth-form h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth-form .sub { font-size: 12px; color: var(--muted); margin-top: -8px; line-height: 1.7; }
.auth-form .field { gap: 8px; }
.auth-form .input { height: 46px; }
.auth-tip { font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }
.auth-switch { font-size: 12px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--primary); font-weight: 600; }

/* ---------- 其它 ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 12.5px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); margin-top: 5px; flex: none; z-index: 1; }
.timeline-item.on .timeline-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-body b { display: block; font-size: 12.5px; font-weight: 600; }
.timeline-body span { font-size: 11px; color: var(--muted); }

.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

.upload {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 22px;
  display: flex; align-items: center; gap: 14px; background: var(--surface-2); cursor: pointer;
}
.upload:hover { border-color: var(--primary); background: var(--surface); }
.upload img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.upload b { display: block; font-size: 12.5px; }
.upload span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }

.stat-line { display: flex; align-items: baseline; gap: 8px; }
.stat-line b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.stat-line span { font-size: 11px; color: var(--muted); }

.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.queue-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.queue-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.queue-pill.off i { background: var(--warning); }

.sidebar-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-104%); transition: transform .24s cubic-bezier(.2,.7,.3,1); box-shadow: var(--shadow-3); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 14, 20, .42); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 18px; }
  .page { padding: 6px 18px 40px; }
  .page-head h2 { font-size: 22px; }
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  .auth-side { display: none; }
  .auth-form { padding: 34px 28px; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 22px; }
  .page-head h2 { font-size: 20px; }
  .topbar h1 { font-size: 15px; }
  .topbar .crumb { display: none; }
  .user-chip span { display: none; }
  .card-head { flex-wrap: wrap; }
  .table th, .table td { padding: 11px 12px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 图片地址 + 上传 ---------- */
.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-field-thumb {
  position: relative; width: 78px; height: 78px; flex: none;
  border-radius: 12px; border: 1px dashed var(--line-strong); background: var(--surface-2);
  overflow: hidden; display: grid; place-items: center; color: var(--muted);
}
.img-field-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-field-thumb.is-empty img { display: none; }
.img-field-thumb::after {
  content: "图片"; font-size: 10px; color: var(--muted); letter-spacing: .08em;
}
.img-field-thumb:not(.is-empty)::after { display: none; }
.img-field-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.img-field-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.img-field-actions .btn { flex: none; }
.img-field-status { font-size: 11px; color: var(--muted); }
.img-field-status.is-error { color: var(--danger); }
.img-field-status.is-ok { color: var(--success); }

/* 商品图缩略图墙 */
.gallery-thumb {
  position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb .gallery-remove {
  position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; line-height: 18px; text-align: center;
}
.gallery-thumb .gallery-cover {
  position: absolute; left: 0; bottom: 0; padding: 2px 6px; font-size: 10px;
  background: var(--primary); color: #fff; border-radius: 0 6px 0 0;
}
.gallery-thumb.is-cover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

/* 折叠的高级输入 */
.advanced-box {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: 0 14px; background: var(--surface-2);
}
.advanced-box > summary {
  list-style: none; cursor: pointer; padding: 11px 0;
  font-size: 12px; color: var(--muted); user-select: none;
}
.advanced-box > summary::-webkit-details-marker { display: none; }
.advanced-box > summary::before { content: "＋"; margin-right: 6px; font-size: 11px; }
.advanced-box[open] > summary::before { content: "－"; }
.advanced-box[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.advanced-box .field { padding: 10px 0 14px; }
