:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #e6e6eb;
  --text: #1a1a1f;
  --muted: #6b6b76;
  --accent: #4f46e5;
  --accent-weak: #eef0ff;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 40, 0.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
}
.brand-text h1 { font-size: 16px; margin: 0; font-weight: 650; }
.brand-text p { font-size: 12px; margin: 0; color: var(--muted); }

.token-area { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); }
.dot.off { background: #c9c9d2; }

/* 面板 */
.panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
}
.panel.hidden { display: none; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.panel-actions { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.link { color: var(--accent); text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* 布局 */
.container {
  max-width: 1180px;
  margin: 24px auto 40px;
  padding: 0 20px;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.col-left { display: flex; flex-direction: column; gap: 16px; }

/* 桌面双栏：左配置 + 右工作区常驻 */
@media (min-width: 960px) {
  .grid {
    grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
    gap: 20px;
  }
  .col-right { position: sticky; top: 88px; }
}

/* 工作区卡片 */
.workspace { display: flex; flex-direction: column; min-height: 320px; }
.live-timer {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  background: var(--accent-weak);
  padding: 2px 8px;
  border-radius: 10px;
}
.live-timer.hidden { display: none; }
.live-timer::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* 空状态占位 */
.empty-hint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 10px;
  padding: 36px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-top: 14px;
  font-size: 13px;
}
.empty-hint.hidden { display: none; }
.empty-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 3px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.card-head h2 { font-size: 15px; margin: 0; font-weight: 600; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form .field { margin: 0; }
.form label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 6px; }
.form label .req { color: var(--err); }
input[type="text"], input[type="password"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
textarea { min-height: 92px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.select { width: 100%; padding: 9px 11px; }

/* 按钮 */
.actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { background: #f4f4f7; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.ghost { background: transparent; }

/* 状态 */
.status {
  padding: 14px 16px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid var(--border);
  font-size: 14px;
}
.status.empty { color: var(--muted); }
.status.queued { color: var(--warn); border-color: #fde9c8; background: #fffaf0; }
.status.running { color: var(--accent); border-color: var(--accent-weak); background: #f6f7ff; }
.status.success { color: var(--ok); border-color: #c4eccd; background: #f1fcf4; }
.status.failed { color: var(--err); border-color: #f3c9c9; background: #fdf3f3; }
.status .label { font-weight: 600; }
.status .meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.results { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.result-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fafafa;
}
.result-item video, .result-item img {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto;
  background: #000;
}
.result-item .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.result-item .bar a { color: var(--accent); text-decoration: none; }
.result-item .bar a:hover { text-decoration: underline; }
.warn-box {
  font-size: 12px;
  color: var(--warn);
  background: #fffaf0;
  border: 1px solid #fde9c8;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 12px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px;
}
.footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
}

.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }
.small { font-size: 12px; }

/* 通用隐藏工具类 */
.hidden { display: none !important; }

/* 顶栏右侧账号区 */
.auth-area { display: flex; align-items: center; gap: 10px; }
.balance { font-size: 13px; color: var(--accent); font-weight: 600; background: var(--accent-weak); padding: 4px 10px; border-radius: 12px; }
.user-email { font-size: 13px; color: var(--muted); }

/* 登录/注册浮层 */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 40, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: authFadeIn 0.18s ease;
}
.auth-overlay.hidden { display: none !important; }
.auth-modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(20, 20, 60, 0.22);
  padding: 34px 28px 22px;
  width: 100%;
  max-width: 400px;
  animation: authPop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.18);
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-close:hover { background: #f4f4f7; color: var(--text); }

.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .logo {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 19px;
  margin: 0 auto 14px;
}
.auth-brand h2 { font-size: 20px; margin: 0 0 4px; font-weight: 650; }
.auth-brand p { font-size: 13px; color: var(--muted); margin: 0; }

.auth-tabs {
  display: flex;
  background: #f4f4f7;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.08);
}

.auth-form { display: flex; flex-direction: column; }
.auth-field { position: relative; display: block; margin-bottom: 14px; }
.auth-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.15s;
}
.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px 0 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input::placeholder { color: #a0a0aa; }
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.auth-field:focus-within .auth-icon { color: var(--accent); }

/* 验证码行：输入框 + 发送按钮 */
.auth-code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.auth-code-row.hidden { display: none; }
.auth-code-row input {
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 2px;
  text-align: center;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-code-row input::placeholder { letter-spacing: 0; color: #a0a0aa; font-family: inherit; }
.auth-code-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.send-code-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 16px;
  height: 44px;
  font-size: 13px;
  border-radius: 10px;
  min-width: 96px;
}
.send-code-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-submit {
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 10px;
  margin-top: 4px;
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-msg {
  text-align: center;
  min-height: 18px;
  margin: 12px 0 0;
  transition: color 0.15s;
}
.auth-msg.error { color: var(--err); }
.auth-msg.ok { color: var(--ok); }
.auth-hint {
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@keyframes authFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes authPop {
  from { opacity: 0; transform: scale(0.94) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-overlay, .auth-modal { animation: none; }
}

/* （原未登录门页 .gate 样式已随 authGate 组件移除，保留 .empty-hint 复用） */

/* 价格预览 */
.cost-preview { font-size: 12px; color: var(--accent); }

/* schema 驱动表单：媒体预览与多素材序列 */
.media-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.media-preview {
  display: block;
  margin-top: 8px;
  max-width: 180px;
  max-height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #000;
}
audio.media-preview { width: 100%; max-width: none; padding: 4px; background: #fafafa; }

.series { display: flex; flex-direction: column; gap: 8px; }
.series-slots { display: flex; flex-direction: column; gap: 14px; }
.add-btn { align-self: flex-start; font-size: 13px; padding: 6px 12px; }
.add-btn:disabled { opacity: 0.4; }
.small-remove { font-size: 12px; padding: 3px 8px; margin-left: 8px; vertical-align: middle; }

/* 复选框字段：标签与开关同行 */
.field:has(input[type="checkbox"]) label { display: inline; margin-right: 8px; }
.field:has(input[type="checkbox"]) input { width: auto; }

/* 上传：URL 输入 + 上传按钮并排 */
.media-row { display: flex; gap: 8px; align-items: stretch; }
.media-row input { flex: 1; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.upload-btn:hover { background: #f4f4f7; border-color: #d4d4dc; }
.upload-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.upload-btn.disabled { opacity: 0.55; cursor: not-allowed; border-style: dashed; background: #fafafa; }

/* ==================== 顶部导航 ==================== */
.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.topnav.hidden { display: none; }
.topnav a {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.topnav a:hover { color: var(--text); }
.topnav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ==================== 落地首页 ==================== */
.home { max-width: 920px; }

.hero { text-align: center; padding: 56px 12px 40px; }
.hero-title {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 16px;
  color: var(--muted);
}
.hero-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-cta { padding: 12px 30px; font-size: 16px; }

.section { margin-top: 40px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}

/* 功能亮点网格 */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.feature-card .fi { display: block; font-size: 26px; margin-bottom: 10px; }
.feature-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 650; }
.feature-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* 计费说明 */
.billing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.billing ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.billing li { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.billing li::before { content: "◆"; color: var(--accent); font-size: 8px; }
.billing .rate { font-weight: 700; color: var(--accent); }

/* 上手三步 */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.step-card h4 { margin: 2px 0 4px; font-size: 14px; font-weight: 650; }
.step-card p { margin: 0; font-size: 13px; color: var(--muted); }

/* 底部 CTA */
.cta {
  margin-top: 48px;
  padding: 36px 20px;
  text-align: center;
  background: linear-gradient(120deg, var(--accent-weak), #f3f0ff);
  border: 1px solid #d8dcff;
  border-radius: 16px;
}
.cta p { margin: 0 0 18px; font-size: 18px; font-weight: 650; }

/* ==================== 页面通用标题 ==================== */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.page-title { margin: 0; font-size: 22px; font-weight: 700; }

/* 余额摘要卡 */
.balance-card {
  margin-bottom: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent), #4338ca);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.25);
}
.balance-label { display: block; margin-bottom: 4px; font-size: 13px; opacity: 0.85; }
.balance-num {
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.balance-unit { margin-left: 8px; font-size: 14px; font-weight: 600; opacity: 0.85; }
.balance-hint { display: block; margin-top: 10px; font-size: 12px; opacity: 0.75; }

/* 任务 / 流水列表 */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.task-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-name { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.task-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.task-right .cost { margin: 0; }
.ledger-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ledger-reason { font-size: 14px; font-weight: 600; }
.ledger-delta {
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.ledger-delta.pos { color: var(--ok); }
.ledger-delta.neg { color: var(--err); }

/* 状态徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.queued  { color: var(--warn);   background: #fffaf0; border: 1px solid #fde0ae; }
.badge.running { color: var(--accent); background: var(--accent-weak); border: 1px solid #d4d8ff; }
.badge.success { color: var(--ok);     background: #f1fcf4; border: 1px solid #c4eccd; }
.badge.failed  { color: var(--err);    background: #fdf3f3; border: 1px solid #f3c9c9; }

/* 响应式兜底 */
@media (max-width: 720px) {
  .hero { padding: 40px 8px 28px; }
  .hero-title { font-size: 28px; }
  .topnav { padding: 0 14px; }
  .topnav a { padding: 11px 12px; }
}

/* ==================== 管理后台 ==================== */
#adminContent { display: flex; flex-direction: column; gap: 18px; }
.admin-card { margin: 0; }

/* 仪表盘统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); }
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* 数据表格 */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table th {
  background: #fafafb;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.data-table tbody tr:nth-child(even) { background: #fafafb; }
.data-table tbody tr:hover { background: var(--accent-weak); }
.data-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .pos { color: var(--ok); }
.data-table .neg { color: var(--err); }
.data-table td.ops { white-space: nowrap; }
.data-table td.ops .btn + .btn { margin-left: 6px; }

/* 表格内小按钮 */
.btn.mini { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* 令牌池管理：添加表单行 */
.keys-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.key-input { flex: 1; min-width: 0; }
.key-add-btn { flex-shrink: 0; }
.keys-note { margin-top: 0; margin-bottom: 12px; }

/* 停用徽章（灰底） */
.badge.off {
  color: var(--muted);
  background: #f4f4f7;
  border: 1px solid #e0e0e6;
}

/* 价格管理 */
.pricing-note { margin-top: 0; margin-bottom: 12px; }
.price-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
#marginPctInput { width: 220px; max-width: 100%; }
input.pricing-sell {
  width: 96px;
  padding: 6px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  text-align: right;
}
.charge-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-weak);
  border: 1px solid #d4d8ff;
  white-space: nowrap;
}
.margin-pos { color: var(--ok); }
.margin-neg { color: var(--err); }

@media (max-width: 720px) {
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}
