:root {
  color-scheme: light;

  --purple: #6a4df6;
  --purple-2: #5a3ce0;
  --purple-line: rgba(106, 77, 246, 0.34);
  --bg: #f3f2f9;
  --card: #ffffff;
  --text: #1d1a2e;
  --sub: #5d5877;
  --text-2: #5c5c74;
  --line: rgba(26, 22, 48, 0.10);
  --danger: #d23a30;
  --ok: #1a9b68;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --purple: #9b83f9;
  --purple-2: #ac97fd;
  --purple-line: rgba(150, 120, 255, 0.34);
  --bg: #000000;
  --card: #0a0a0b;
  --text: #ededed;
  --sub: #8b8b8b;
  --text-2: #b9b9b9;
  --line: rgba(255, 255, 255, 0.08);
  --danger: #ff7b72;
  --ok: #3ddc97;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; height: 100%; }

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

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }

.hidden { display: none !important; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.3s;
}

.boot.gone { opacity: 0; pointer-events: none; }
.boot-card { text-align: center; }

.boot-logo {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, #8f7cf9, #6f6cf6);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.7; }
}

.boot-text { margin: 0; font-size: 13px; color: var(--sub); }

.adm { display: flex; height: 100vh; overflow: hidden; }

/* ---------------- 侧栏 ---------------- */

.side {
  width: 214px;
  flex: 0 0 214px;
  background: #fbfaff;
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
}

.brand { display: flex; align-items: center; gap: 9px; padding: 2px 4px 18px; }

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name { font-size: 13px; font-weight: 500; letter-spacing: 0.2px; }

.nav-label {
  margin: 10px 0 6px;
  padding-left: 10px;
  font-size: 11px;
  color: #a8a8bd;
  letter-spacing: 0.6px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #4c4c63;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.8; }

.nav-item:hover { background: #f2effc; color: #2c2c40; }

.nav-item.active {
  background: linear-gradient(100deg, #7b57f3, #6a3df2);
  color: #fff;
  box-shadow: 0 6px 14px rgba(108, 71, 245, 0.28);
}

.nav-item.active svg { opacity: 1; }

.side-foot {
  margin-top: auto;
  padding-left: 10px;
  font-size: 11px;
  color: #b6b6c8;
}

/* ---------------- 主区 ---------------- */

.adm .main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.adm .topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tb-title { margin: 0; font-size: 15px; font-weight: 500; }
.tb-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--sub); }

.tb-right { display: flex; align-items: center; gap: 10px; }

.who {
  font-size: 12px;
  color: #5c5c74;
  background: #f5f3fd;
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #5c5c74;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost:hover { border-color: var(--purple-line); color: var(--purple); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { border-color: #f3c9c6; color: var(--danger); }

.scroll { flex: 1; overflow: auto; padding: 18px 24px 28px; }

/* ---------------- 统计卡 ---------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 16px 14px;
}

.stat-label { margin: 0; font-size: 12px; color: var(--sub); }

.stat-value {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

/* 项目营收看板 */
.revenue-panel { padding: 16px 18px; margin-bottom: 16px; }
.rev-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rev-title { font-size: 15px; font-weight: 600; color: var(--text); }
.rev-hint { font-size: 11px; color: var(--sub); }
.rev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rev-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card); }
.rev-label { margin: 0; font-size: 12px; color: var(--sub); }
.rev-value { margin: 8px 0 0; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.rev-sub { margin: 6px 0 0; font-size: 11px; color: var(--sub); }

/* 审计日志状态标签 */
.st { display: inline-block; padding: 1px 8px; border-radius: 5px; font-size: 11px; white-space: nowrap; }
.st-ok { color: #2fae75; background: rgba(47, 174, 117, 0.12); }
.st-fail { color: #e8564b; background: rgba(232, 86, 75, 0.12); }
.st-run { color: #8b8b8b; background: rgba(139, 139, 139, 0.12); }

/* ---------------- 面板 / 表格 ---------------- */

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  max-width: 300px;
}

.search svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: #b0b0c4;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 33px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 12.5px;
  background: #fcfcfe;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search input:focus {
  border-color: var(--purple-line);
  box-shadow: 0 0 0 3px rgba(108, 71, 245, 0.08);
  background: #fff;
}

.sel {
  height: 34px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%239a9ab0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center/14px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 12.5px;
  color: #4c4c63;
  outline: none;
  cursor: pointer;
}

.sel:focus { border-color: var(--purple-line); }

.count { margin-left: auto; font-size: 12px; color: var(--sub); }

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.table thead th {
  text-align: left;
  font-weight: 400;
  font-size: 11.5px;
  color: #9595ab;
  padding: 11px 14px;
  background: #fbfaff;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f4f2fa;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fcfbff; }
.table .num, .table .right { text-align: right; }
.table th.num, .table th.right { text-align: right; }

.cell-user { display: flex; align-items: center; gap: 9px; min-width: 0; }

.avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7f9cf7, #8f72f5);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.u-name { font-size: 12.5px; color: #2c2c40; }
.u-acc { font-size: 11.5px; color: #9a9ab0; margin-top: 2px; }
.u-self { color: var(--purple); }

.role-sel {
  height: 30px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%239a9ab0' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 6px center/12px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.role-sel:focus { border-color: var(--purple-line); }
.role-sel:disabled { background-color: #fafafc; color: #a8a8bd; cursor: not-allowed; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}

.badge.ok { background: #e9f8f1; color: var(--ok); }
.badge.off { background: #fdeeed; color: var(--danger); }
.badge.role { background: #f2effd; color: var(--purple); }

.credits { font-variant-numeric: tabular-nums; font-size: 13px; }

.ops { display: flex; gap: 6px; justify-content: flex-end; }

.btn-op {
  height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #5c5c74;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.btn-op:hover { border-color: var(--purple-line); color: var(--purple); }
.btn-op.warn:hover { border-color: #f3c9c6; color: var(--danger); }

.empty { padding: 44px 0; text-align: center; color: #a8a8bd; font-size: 12.5px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: #7c7c93;
}

.btn-page {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #5c5c74;
  font-size: 12px;
  cursor: pointer;
}

.btn-page:hover:not(:disabled) { border-color: var(--purple-line); color: var(--purple); }
.btn-page:disabled { color: #c2c2d2; cursor: not-allowed; }

/* ---------------- 弹窗 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 24, 56, 0.32);
}

.modal.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px 22px;
  box-shadow: 0 20px 50px rgba(30, 22, 70, 0.22);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 500; }

.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: #a0a0b6;
  cursor: pointer;
  padding: 0 2px;
}

.modal-sub { margin: 6px 0 16px; font-size: 12px; color: #9a9ab0; }

.modal .field { margin-bottom: 14px; }
.modal .field label { display: block; font-size: 12px; color: #6a6a82; margin-bottom: 7px; }

.modal .text-input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  font-size: 12.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal .text-input:focus {
  border-color: var(--purple-line);
  box-shadow: 0 0 0 3px rgba(108, 71, 245, 0.08);
}

.amount-row { display: flex; gap: 7px; margin-bottom: 8px; flex-wrap: wrap; }

.chip {
  height: 27px;
  padding: 0 11px;
  border: 1px solid var(--purple-line);
  border-radius: 999px;
  background: #f8f5ff;
  color: var(--purple);
  font-size: 11.5px;
  cursor: pointer;
}

.chip:hover { background: #f0e9ff; }
.chip.minus { color: var(--danger); border-color: #f3c9c6; background: #fdf6f5; }

.perm-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.perm-name { font-size: 12.5px; color: #3c3c52; }
.perm-hint { font-size: 11px; color: #a2a2b8; margin-top: 2px; }

.switch {
  position: relative;
  width: 38px;
  height: 21px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: #e2e0ec;
  border: none;
  cursor: pointer;
  transition: background 0.18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}

.switch.on { background: var(--purple); }
.switch.on::after { transform: translateX(17px); }

.form-error { min-height: 15px; margin: 0 0 8px; font-size: 12px; color: var(--danger); }

.adm-btn {
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(100deg, #7c4ef6, #6a3df2);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(108, 71, 245, 0.24);
}

.adm-btn:hover { filter: brightness(1.05); }
.adm-btn:disabled { background: #cfc9e8; box-shadow: none; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 14px);
  background: #1c1c1e;
  color: #fff;
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: 76vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .side { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroll { padding: 14px; }
  .adm .topbar { padding: 0 14px; }
  .tb-sub { display: none; }
}

/* ================================================================
   深空暗色皮肤（与工作台、登录页同一套调性）
   只覆盖颜色与阴影，尺寸 / 布局 / 结构一律不动
   ================================================================ */

html[data-theme="dark"] body {
  background-color: var(--bg);
  /* 纯黑：不再铺紫色雾光（2026-11-17 用户要求「达到全黑」） */
  background-image: none;
}

/* ---- 侧栏 ---- */

html[data-theme="dark"] .side {
  background: #000000;
  border-right-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .brand-logo { box-shadow: 0 6px 18px -8px rgba(124, 92, 246, 0.9); }
html[data-theme="dark"] .nav-label { color: #6d6d6d; }
html[data-theme="dark"] .nav-item { color: var(--text-2); }
html[data-theme="dark"] .nav-item svg { opacity: 0.72; }
html[data-theme="dark"] .nav-item:hover { background: rgba(255, 255, 255, 0.055); color: #ffffff; }

html[data-theme="dark"] .nav-item.active {
  background: linear-gradient(100deg, #7c5cf6, #9a7bfd);
  box-shadow: 0 6px 18px -6px rgba(124, 92, 246, 0.75);
}

html[data-theme="dark"] .side-foot { color: #6d6d6d; }

/* ---- 顶栏 ---- */

html[data-theme="dark"] .adm .topbar {
  background: #0a0a0b;
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .who { color: var(--text-2); background: rgba(255, 255, 255, 0.06); }

html[data-theme="dark"] .btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
}

html[data-theme="dark"] .btn-ghost:hover { border-color: var(--purple-line); color: var(--purple-2); }
html[data-theme="dark"] .btn-ghost.danger:hover { border-color: rgba(255, 109, 99, 0.42); }

/* ---- 统计卡 / 面板 ---- */

html[data-theme="dark"] .stat { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .panel { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .toolbar { border-bottom-color: var(--line); }

/* ---- 工具条 ---- */

html[data-theme="dark"] .search svg { color: #6f6989; }

html[data-theme="dark"] .search input {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .search input::placeholder { color: var(--hint); }

html[data-theme="dark"] .search input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(150, 120, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 246, 0.16);
}

html[data-theme="dark"] .sel {
  background-color: rgba(255, 255, 255, 0.045);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238b8b8b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .sel:focus { border-color: var(--purple-line); }
html[data-theme="dark"] .sel option { background: #0a0a0b; color: var(--text); }

/* ---- 表格 ---- */

html[data-theme="dark"] .table thead th {
  color: #8b8b8b;
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--line);
}

html[data-theme="dark"] .table td { border-bottom-color: rgba(255, 255, 255, 0.05); }
html[data-theme="dark"] .table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

html[data-theme="dark"] .u-name { color: var(--text); }
html[data-theme="dark"] .u-acc { color: var(--sub); }
html[data-theme="dark"] .u-self { color: var(--purple-2); }

html[data-theme="dark"] .role-sel {
  background-color: rgba(255, 255, 255, 0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%238b8b8b' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .role-sel:focus { border-color: var(--purple-line); }

html[data-theme="dark"] .role-sel:disabled {
  background-color: rgba(255, 255, 255, 0.02);
  color: #6b6585;
}

html[data-theme="dark"] .role-sel option { background: #0a0a0b; color: var(--text); }

html[data-theme="dark"] .badge.ok { background: rgba(61, 220, 151, 0.14); color: var(--ok); }
html[data-theme="dark"] .badge.off { background: rgba(255, 123, 114, 0.14); color: var(--danger); }
html[data-theme="dark"] .badge.role { background: rgba(124, 92, 246, 0.18); color: var(--purple-2); }

html[data-theme="dark"] .btn-op {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
}

html[data-theme="dark"] .btn-op:hover { border-color: var(--purple-line); color: var(--purple-2); }
html[data-theme="dark"] .btn-op.warn:hover { border-color: rgba(255, 109, 99, 0.42); }

html[data-theme="dark"] .empty { color: #6f6989; }
html[data-theme="dark"] .pager { color: var(--sub); border-top-color: var(--line); }

html[data-theme="dark"] .btn-page {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
}

html[data-theme="dark"] .btn-page:hover:not(:disabled) { border-color: var(--purple-line); color: var(--purple-2); }
html[data-theme="dark"] .btn-page:disabled { color: #5b566f; }

/* ---- 弹窗 ---- */

html[data-theme="dark"] .modal { background: rgba(5, 3, 12, 0.66); }

html[data-theme="dark"] .modal-card {
  background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .modal-close { color: var(--sub); }
html[data-theme="dark"] .modal-close:hover { color: #ffffff; }
html[data-theme="dark"] .modal-sub { color: var(--sub); }
html[data-theme="dark"] .modal .field label { color: var(--text-2); }

html[data-theme="dark"] .modal .text-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .modal .text-input::placeholder { color: var(--hint); }

html[data-theme="dark"] .modal .text-input:focus {
  border-color: rgba(150, 120, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 246, 0.16);
}

html[data-theme="dark"] .modal .text-input:-webkit-autofill, html[data-theme="dark"] .modal .text-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #101012 inset;
}

html[data-theme="dark"] .chip {
  background: rgba(124, 92, 246, 0.14);
  border-color: rgba(150, 120, 255, 0.32);
  color: var(--purple-2);
}

html[data-theme="dark"] .chip:hover { background: rgba(124, 92, 246, 0.24); }

html[data-theme="dark"] .chip.minus {
  color: var(--danger);
  border-color: rgba(255, 109, 99, 0.4);
  background: rgba(255, 109, 99, 0.1);
}

html[data-theme="dark"] .perm-row { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.025); }
html[data-theme="dark"] .perm-name { color: var(--text); }
html[data-theme="dark"] .perm-hint { color: var(--sub); }

html[data-theme="dark"] .switch { background: rgba(255, 255, 255, 0.16); }
html[data-theme="dark"] .switch::after { background: #ffffff; }
html[data-theme="dark"] .switch.on { background: var(--purple); }

html[data-theme="dark"] .adm-btn:disabled { background: rgba(255, 255, 255, 0.12); color: #8b8b8b; }

html[data-theme="dark"] .toast {
  background: #161618;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .boot { background: #000000; }

/* ---- 滚动条 ---- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 999px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }
html[data-theme="dark"] ::-webkit-scrollbar-corner { background: transparent; }


/* ---- 添加账号 / 修改账号 ---- */

html[data-theme="dark"] .btn-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 13px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #8f7cf9, #6f6cf6);
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(124, 92, 246, 0.85);
  transition: filter 0.15s, transform 0.06s;
}

html[data-theme="dark"] .btn-add svg { width: 14px; height: 14px; }
html[data-theme="dark"] .btn-add:hover { filter: brightness(1.08); }
html[data-theme="dark"] .btn-add:active { transform: translateY(1px); }

html[data-theme="dark"] .modal .field label.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

html[data-theme="dark"] .chip.slim {
  height: 22px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
}

html[data-theme="dark"] .sel.block {
  display: block;
  width: 100%;
  height: 38px;
}

html[data-theme="dark"] .modal-hint {
  margin: -4px 0 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--hint);
}

html[data-theme="dark"] .modal-hint.hidden { display: none; }

/* ---- 注册赠送积分设置条 ---- */

html[data-theme="dark"] .setting-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(155, 131, 249, 0.05);
}

html[data-theme="dark"] .setting-title {
  font-size: 12.5px;
  color: var(--text);
}

html[data-theme="dark"] .setting-unit {
  font-size: 12px;
  color: var(--sub);
}

html[data-theme="dark"] .setting-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--hint);
}

html[data-theme="dark"] .setting-input {
  width: 92px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12.5px;
  text-align: center;
}

html[data-theme="dark"] .setting-input:focus {
  outline: none;
  border-color: var(--purple-line);
}

html[data-theme="dark"] .setting-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---- 删除账号（危险操作） ---- */

html[data-theme="dark"] .btn-op.danger {
  color: var(--danger);
}

html[data-theme="dark"] .btn-op.danger:hover {
  border-color: rgba(255, 99, 99, 0.5);
  color: #ff8f86;
}

/* ==================== 充值审核 ==================== */

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e5544b;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  flex: none;
}

html[data-theme="dark"] .setting-input.wide {
  width: 280px;
  text-align: left;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-pending { color: #e0b055; background: rgba(224, 176, 85, 0.12); border-color: rgba(224, 176, 85, 0.32); }
.tag-approved { color: #7fd3ac; background: rgba(72, 160, 120, 0.14); border-color: rgba(72, 160, 120, 0.3); }
.tag-rejected { color: #ff7b72; background: rgba(255, 123, 114, 0.1); border-color: rgba(255, 123, 114, 0.28); }

.rc-muted {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.5;
  color: #7b7593;
  font-weight: 400;
}

html[data-theme="dark"] .btn-op.ok {
  color: #7fd3ac;
  border-color: rgba(72, 160, 120, 0.34);
}
html[data-theme="dark"] .btn-op.ok:hover {
  color: #a6e8c6;
  border-color: rgba(72, 160, 120, 0.6);
}

/* 充值设置：宽输入框撑满剩余空间，「元起」紧贴输入框，别被 margin-left:auto 顶到最右 */
html[data-theme="dark"] .setting-bar .setting-input.wide {
  flex: 1 1 auto;
  width: auto;
  max-width: 620px;
  text-align: left;
}

.setting-unit {
  font-size: 11.5px;
  color: var(--hint);
  flex: none;
}
html[data-theme="dark"] .setting-unit { color: var(--hint); }

/* 模型积分模块 */
.mp-head { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mp-head-title { font-size: 15px; font-weight: 600; color: var(--text); }
.mp-head-sub { font-size: 12px; color: var(--sub); line-height: 1.5; }
#mpRefreshBtn { margin-left: auto; flex: none; }

/* 模型积分表：列宽按内容分配，列与列之间使用完全相同的 16px 间距。
   关键点：使用 border-spacing 产生真实列间距，单元格不再叠加左右 padding；
   表头和数据统一左对齐，避免数字右对齐在列首造成额外的大空白。 */
.mp-table {
  --mp-column-gap: 16px;
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--mp-column-gap) 0;
}
.mp-table .c-api    { width: 16%; }
.mp-table .c-upname { width: 13%; }
.mp-table .c-local  { width: 16%; }
.mp-table .c-num    { width: 12%; }
.mp-table .c-input  { width: 11%; }
.mp-table .c-profit { width: 10%; }
.mp-table .c-op     { width: 10%; }
.mp-table thead th,
.mp-table #mpRows td { padding-left: 0; padding-right: 0; }
.mp-table .num,
.mp-table .right,
.mp-table th.num,
.mp-table th.right { text-align: left; }

.mp-input { width: 100%; height: 34px; min-width: 0; padding: 0 10px; text-align: center; }
.mp-over { color: #8b74f8; font-size: 11px; margin-left: 6px; }
.mp-tag { color: #8b74f8; font-size: 11px; border: 1px solid rgba(139, 116, 248, 0.4); border-radius: 4px; padding: 1px 5px; margin-left: 6px; white-space: nowrap; flex: none; }
.mp-new { color: #fff; background: #8b74f8; font-size: 11px; border-radius: 4px; padding: 1px 6px; margin-left: 6px; white-space: nowrap; flex: none; }

/* 上游调用标识列：等宽小字 + 单行省略，悬停 title 看全 */
.mp-upstream {
  font-family: "SF Mono", "Menlo", "Consolas", "Courier New", monospace;
  font-size: 11px;
  color: #9791b0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 上游模型名称列：单行省略 */
.mp-upname {
  font-size: 12px;
  color: #b9b9b9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 本站模型名称列：序号 + 名称 + 标签，名称单行省略 */
.mp-local { min-width: 0; }
.mp-local-inner { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mp-local-inner .mp-idx { color: #6d6d6d; font-variant-numeric: tabular-nums; flex: none; }
.mp-local-inner .mp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.th-sub { display: block; font-size: 11px; font-weight: 400; color: #9791b0; margin-top: 2px; }
.mp-profit { white-space: nowrap; }
.mp-profit .mp-profit-pos { color: #4ade80; font-weight: 600; }
.mp-profit .mp-profit-neg { color: #ff7b7b; font-weight: 600; }
.mp-profit .mp-profit-zero { color: #9791b0; }

/* 模型积分表：行距收紧、数值列等宽右对齐、输入框填满单元格 */
#mpRows td { padding: 10px 12px; }
#mpRows .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
#mpRows .mp-save { min-width: 48px; }

/* 内嵌进 index.html 时，管理后台视图的外层留白（铺满主区宽度） */
.adm-view { padding: 24px 28px 44px; }
@media (max-width: 760px) {
  .adm-view { padding: 16px 14px 32px; }
}

/* 查看作品（超级管理员跨账号看生产内容） */
.works-card { max-width: 640px; }
.works-body { max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.works-sec { display: flex; flex-direction: column; gap: 8px; }
.works-sec-title { font-size: 13px; font-weight: 600; color: #ededed; }
.works-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 8px; }
.works-item-main { flex: 1; min-width: 0; }
.works-item-name { font-size: 13px; color: #ededed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.works-item-meta { font-size: 11.5px; color: #8b8b8b; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.works-item-right { text-align: right; flex: none; }
.works-item-cost { font-size: 12px; color: #8b74f8; font-variant-numeric: tabular-nums; }
.works-item-time { font-size: 11px; color: #6d6d6d; margin-top: 2px; }

/* ================= 项目营收 · 账号利润排行（2026-11-25） ================= */
.rev-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rev-range { display: flex; gap: 6px; }
.rev-range-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rev-range-btn:hover { color: var(--text); border-color: var(--purple-line); }
.rev-range-btn.is-on {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.rev-table-wrap { overflow-x: auto; }
.rev-acct-table { width: 100%; border-collapse: collapse; }
.rev-acct-table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: #6d6d6d;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rev-acct-table thead th.num { text-align: right; }
.rev-acct-table tbody td {
  font-size: 12.5px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rev-acct-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rev-acct-row { cursor: pointer; }
.rev-acct-row:hover td { background: rgba(255, 255, 255, 0.02); }
.rev-acct-rank { color: #6d6d6d; font-weight: 500; }
.rev-acct-row:nth-child(1) .rev-acct-rank { color: var(--purple); }
.rev-acct-user { display: flex; align-items: center; gap: 8px; }
.rev-acct-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--purple); color: #fff;
  font-size: 11px; display: flex; align-items: center; justify-content: center; flex: none;
}
.rev-acct-name { color: var(--text); }
.rev-acct-profit { font-weight: 500; }
.rev-acct-profit.pos { color: var(--ok); }
.rev-acct-profit.neg { color: var(--danger); }
.rev-acct-caret { color: #6d6d6d; text-align: center; }

/* 展开的账号任务明细行 */
.rev-detail-row td {
  background: #101012;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.rev-detail-box { padding: 12px 16px; }
.rev-detail-head { font-size: 11px; color: #6d6d6d; margin-bottom: 8px; }
.rev-detail-list { display: flex; flex-direction: column; gap: 6px; }
.rev-detail-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; background: #0a0a0b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px; padding: 8px 10px;
}
.rev-detail-icon {
  width: 42px; height: 28px; border-radius: 5px; background: #161618;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.rev-detail-name { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-detail-model { width: 140px; text-align: center; color: #8b8b8b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-detail-spec { width: 54px; text-align: center; color: #6d6d6d; }
.rev-detail-sold { width: 56px; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.rev-detail-up { width: 56px; text-align: right; color: #8b8b8b; font-variant-numeric: tabular-nums; }
.rev-detail-diff { width: 52px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.rev-detail-diff.pos { color: var(--ok); }
.rev-detail-diff.neg { color: var(--danger); }
.rev-detail-status { width: 46px; text-align: center; font-size: 11px; border-radius: 5px; padding: 2px 0; }
.rev-detail-status.ok { color: var(--ok); background: rgba(61, 220, 151, 0.14); }
.rev-detail-status.fail { color: var(--danger); background: rgba(255, 123, 114, 0.14); }
.rev-detail-status.run { color: #c9a227; background: rgba(201, 162, 39, 0.14); }
.rev-detail-view { width: 64px; text-align: center; color: var(--purple); font-size: 11px; cursor: pointer; white-space: nowrap; }
.rev-detail-view:hover { text-decoration: underline; }
.rev-detail-more { font-size: 11px; color: #6d6d6d; margin-top: 8px; }

/* 明细列标题行 */
.rev-detail-cols {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 6px; margin-bottom: 6px;
  font-size: 11px; color: #6d6d6d; border-bottom: 1px solid #26262a;
}
.rev-detail-cols .c-icon { width: 42px; flex: none; }
.rev-detail-cols .c-name { flex: 1; min-width: 0; }
.rev-detail-cols .c-model { width: 140px; text-align: center; }
.rev-detail-cols .c-spec { width: 54px; text-align: center; }
.rev-detail-cols .c-sold { width: 56px; text-align: right; }
.rev-detail-cols .c-up { width: 56px; text-align: right; }
.rev-detail-cols .c-diff { width: 52px; text-align: right; }
.rev-detail-cols .c-status { width: 46px; text-align: center; }
.rev-detail-cols .c-op { width: 64px; text-align: center; }

/* 积分管理 · 分组标题行（Seedance 2.5 / 2.0 / 图片模型 三层级分隔） */
.mp-group-row td {
  padding: 10px 0 6px;
  background: #101012;
  border-top: 1px solid var(--line);
}
.mp-group-row:first-child td { border-top: none; }
.mp-group-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--purple);
  letter-spacing: 0.3px;
}
