:root {
  color-scheme: dark;
  --bg: #07060b;
  --bg-2: #0b0912;
  --panel: #100d18;
  --panel-2: #15111f;
  --line: rgba(236, 231, 255, 0.07);
  --line-2: rgba(236, 231, 255, 0.13);
  --text: #f5f2fc;
  --text-2: #bcb5cb;
  --muted: #8b849c;
  --dim: #645e75;
  --accent: #b9a6f5;
  --accent-2: #8f6ff0;
  --accent-soft: rgba(159, 132, 246, 0.13);
  --green: #56d6a4;
  --green-soft: rgba(86, 214, 164, 0.12);
  --red: #ef7b7b;
  --red-soft: rgba(239, 107, 107, 0.12);
  --amber: #f0b35b;
  --amber-soft: rgba(240, 179, 91, 0.12);
  --blue: #7fa8ff;
  --blue-soft: rgba(127, 168, 255, 0.12);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-num: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", var(--font);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 600px at 8% -10%, rgba(124, 92, 220, 0.16), transparent 62%),
    radial-gradient(800px 600px at 100% 108%, rgba(64, 100, 190, 0.08), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

code,
.mono {
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.09);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

::selection {
  background: rgba(185, 166, 245, 0.3);
}

:focus-visible {
  outline: 2px solid rgba(185, 166, 245, 0.6);
  outline-offset: 2px;
}

/* ---------- boot / login ---------- */
.boot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100vh;
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(185, 166, 245, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.small {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-page {
  position: relative;
  display: grid;
  place-items: center;
  height: 100vh;
  overflow: hidden;
}

.login-orbit {
  position: absolute;
  width: 680px;
  height: 680px;
  right: -160px;
  bottom: -220px;
  border-radius: 50%;
  border: 1px solid rgba(185, 166, 245, 0.1);
  box-shadow:
    0 0 0 80px rgba(185, 166, 245, 0.03),
    0 0 0 160px rgba(185, 166, 245, 0.018);
  transform: rotate(-16deg) scaleY(0.6);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 400px;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(23, 18, 35, 0.92), rgba(12, 9, 20, 0.94));
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(20px);
  animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 111, 240, 0.25), transparent 68%);
  filter: blur(6px);
}

.brand-mark img {
  position: relative;
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: brightness(1.3) drop-shadow(0 0 8px rgba(180, 150, 255, 0.6));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brand-text span {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.login-card h1 {
  margin-top: 26px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.login-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-2);
}

.field > span {
  letter-spacing: 0.02em;
}

input,
select,
textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(185, 166, 245, 0.5);
  background: rgba(159, 132, 246, 0.055);
  box-shadow: 0 0 0 4px rgba(159, 132, 246, 0.09);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.7;
}

.form-error {
  font-size: 11px;
  color: var(--red);
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.primary {
  color: #17102a;
  background: linear-gradient(135deg, #d8ccff, #b9a6f5 48%, #8f6ff0);
  box-shadow: 0 12px 26px -14px rgba(143, 111, 240, 0.8);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn.ghost {
  color: var(--text-2);
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn.small {
  height: 32px;
  padding: 0 12px;
  font-size: 11px;
}

.btn.tiny {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10px;
  border: 1px solid var(--line);
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.02);
}

.btn.tiny:hover {
  color: var(--text);
  border-color: var(--line-2);
}

.btn.tiny.danger {
  color: var(--red);
  border-color: rgba(239, 107, 107, 0.2);
}

.btn.tiny.success {
  color: var(--green);
  border-color: rgba(86, 214, 164, 0.2);
}

.btn.block {
  width: 100%;
  height: 44px;
  margin-top: 4px;
}

.login-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.login-hint code {
  color: var(--muted);
}

/* ---------- layout ---------- */
.admin {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 232px;
  flex: none;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(300px 200px at 0% 0%, rgba(124, 92, 220, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(17, 14, 26, 0.95), rgba(9, 7, 15, 0.98));
}

.sidebar .brand {
  padding: 0 8px 24px;
}

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

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #f1ebff;
  background: linear-gradient(90deg, rgba(159, 132, 246, 0.2), rgba(159, 132, 246, 0.05));
  box-shadow: inset 0 0 0 1px rgba(185, 166, 245, 0.13);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #d8ccff, #8f6ff0);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--dim);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-foot {
  margin-top: auto;
  padding: 12px 8px 0;
  border-top: 1px solid var(--line);
}

.server-state {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
}

.server-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(86, 214, 164, 0.8);
}

.side-version {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  flex: none;
  padding: 0 32px;
  background: linear-gradient(180deg, rgba(8, 7, 13, 0.8), rgba(8, 7, 13, 0.3));
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dim);
}

.crumb strong {
  color: var(--text-2);
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10.5px;
  color: var(--text-2);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 44px;
}

.view {
  max-width: 1360px;
  margin: 0 auto;
  animation: fade 0.3s var(--ease) both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.015em;
  background: linear-gradient(180deg, #fff 20%, #d3cae8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-head p {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.updated {
  font-size: 10px;
  color: var(--dim);
}

/* ---------- dashboard ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  position: relative;
  min-height: 118px;
  padding: 16px 18px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background:
    radial-gradient(180px 110px at 100% 0%, rgba(159, 132, 246, 0.08), transparent 72%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--text-2);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(185, 166, 245, 0.6);
}

.stat-dot.green {
  background: var(--green);
  box-shadow: 0 0 9px rgba(86, 214, 164, 0.6);
}

.stat-dot.blue {
  background: var(--blue);
  box-shadow: 0 0 9px rgba(127, 168, 255, 0.6);
}

.stat-dot.amber {
  background: var(--amber);
  box-shadow: 0 0 9px rgba(240, 179, 91, 0.6);
}

.stat-card strong {
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 9.5px;
  color: var(--dim);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  font-size: 10.5px;
  color: var(--muted);
}

.mini-card b {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--text-2);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(22, 18, 32, 0.78), rgba(14, 11, 21, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.panel-head p {
  margin-top: 4px;
  font-size: 10px;
  color: var(--dim);
}

.legend {
  display: flex;
  gap: 14px;
  font-size: 9.5px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend .line {
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.legend .line.green {
  background: var(--green);
}

.chart {
  display: block;
  width: 100%;
  height: 220px;
  margin-top: 14px;
  overflow: visible;
}

.chart .grid line {
  stroke: rgba(255, 255, 255, 0.055);
  stroke-width: 1;
}

.chart .line-path {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart .line-path.accent {
  stroke: var(--accent);
}

.chart .line-path.green {
  stroke: var(--green);
}

.chart .dots circle {
  fill: var(--accent);
}

.chart .axis text {
  fill: var(--dim);
  font-size: 8.5px;
  font-family: var(--font-num);
}

.chart-foot {
  display: flex;
  gap: 22px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--dim);
}

.chart-foot b {
  color: var(--text-2);
  font-family: var(--font-num);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 18px;
}

.plan-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 10.5px;
  color: var(--muted);
}

.plan-meta b {
  font-family: var(--font-num);
  color: var(--text-2);
}

.track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8f6ff0, #c3b0ff);
  transition: width 0.4s var(--ease);
}

.trial-box {
  margin-top: 18px;
  padding: 12px;
  border-radius: 11px;
  border: 1px solid rgba(185, 166, 245, 0.12);
  background: rgba(159, 132, 246, 0.055);
}

.trial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
}

.trial-box p {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}

.text-link {
  font-size: 10.5px;
  color: var(--accent);
  transition: color 0.15s var(--ease);
}

.text-link:hover {
  color: #e2d8ff;
}

.recent-panel {
  margin-top: 14px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.recent-row:last-child {
  border-bottom: 0;
}

.recent-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.recent-main strong {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
}

.recent-main span {
  overflow: hidden;
  font-size: 10px;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-row time {
  flex: none;
  font-size: 9.5px;
  color: var(--dim);
}

/* ---------- toolbar / table ---------- */
.toolbar {
  display: flex;
  gap: 9px;
  margin-bottom: 12px;
}

.search {
  max-width: 320px;
}

.select {
  width: 150px;
  height: 38px;
  font-size: 11.5px;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

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

.table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11.5px;
  color: var(--text-2);
  vertical-align: middle;
}

.table tbody tr {
  transition: background 0.15s var(--ease);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table .right {
  text-align: right;
}

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

.user-cell .avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  color: #201437;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, #e2d8ff, #b9a6f5 55%, #8f6ff0);
}

.user-cell div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-cell strong {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text);
}

.user-cell span {
  font-size: 9px;
  color: var(--dim);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(86, 214, 164, 0.14);
}

.badge.red {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(239, 107, 107, 0.14);
}

.badge.amber {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(240, 179, 91, 0.14);
}

.badge.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.plan-trial {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.plan-basic {
  color: var(--blue);
  background: var(--blue-soft);
}

.badge.plan-pro {
  color: var(--accent);
  background: var(--accent-soft);
}

.badge.plan-forever {
  color: var(--green);
  background: var(--green-soft);
}

.plan-select {
  width: 86px;
  height: 26px;
  padding: 0 24px 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background-color: rgba(255, 255, 255, 0.03);
  background-position: calc(100% - 13px) 11px, calc(100% - 8px) 11px;
  font-size: 10px;
  color: var(--text-2);
}

.plan-select:focus {
  box-shadow: none;
}

.plan-select option {
  background: #15111f;
}


/* ---------------- content management ---------------- */
.form-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.adv-details {
  margin-top: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.adv-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 10px;
}

.adv-details .form-two {
  margin-top: 10px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.relay-message {
  margin-top: 9px;
  font-size: 10px;
  line-height: 1.6;
}

.relay-message.ok { color: var(--green); }
.relay-message.error { color: #ef8b8b; }

.relay-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.relay-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.relay-list strong {
  width: 46px;
  font-size: 10px;
  color: var(--accent);
}

.relay-list span {
  font-size: 10px;
  color: var(--muted);
}

.toolbar-count {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--dim);
}

.prompt-preview {
  max-width: 380px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mono.muted {
  font-size: 8.5px;
  color: var(--dim);
}

.admin-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-style-card {
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.admin-style-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
}

.admin-style-card {
  position: relative;
  aspect-ratio: 16 / 10;
}

.admin-style-glyph {
  position: absolute;
  left: 10px;
  bottom: 34px;
  max-width: 88%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.05em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-style-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid var(--admin-art-accent);
  opacity: 0.28;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.025);
}

.admin-style-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 6, 12, 0.42);
  backdrop-filter: blur(6px);
}

.admin-style-meta {
  padding: 8px 9px 9px;
}

.admin-style-meta strong {
  display: block;
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-style-meta span {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  color: var(--dim);
}

.admin-style-meta em {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 8px;
  font-style: normal;
  color: var(--green);
}

.admin-style-meta em.disabled { color: var(--dim); }

.style-edit-cover {
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 9px;
}

.style-edit-cover img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.modal-close {
  color: var(--dim);
  font-size: 18px;
}

.modal-close:hover { color: var(--text); }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.code-copy {
  max-width: 170px;
  overflow: hidden;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s var(--ease);
}

.code-copy:hover {
  color: var(--accent);
}

.mono {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.ellipsis {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-text {
  color: var(--dim);
  font-size: 10px;
}

.empty-cell {
  padding: 36px 0;
  color: var(--dim);
  text-align: center;
  font-size: 11px;
}

.empty {
  padding: 24px 0;
  color: var(--dim);
  text-align: center;
  font-size: 11px;
}

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

/* ---------- settings ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.settings-panel h2,
.api-panel h2 {
  font-size: 15px;
  font-weight: 600;
}

.panel-desc {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--dim);
}

.switch-row,
.input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.switch-row > div,
.input-row > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.switch-row strong,
.input-row strong {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}

.switch-row span,
.input-row span {
  font-size: 9.5px;
  line-height: 1.6;
  color: var(--dim);
}

.input-row input {
  width: 110px;
  flex: none;
  height: 36px;
}

.input-row.column {
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
}

.input-row.column input,
.input-row.column textarea {
  width: 100%;
}

.switch-row input[type="checkbox"] {
  appearance: none;
  width: 42px;
  height: 23px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}

.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #d6cee8;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}

.switch-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #b9a6f5, #8f6ff0);
  border-color: transparent;
}

.switch-row input[type="checkbox"]:checked::after {
  transform: translateX(19px);
  background: #17102a;
}

.notice-box {
  margin-top: 16px;
  padding: 11px 12px;
  border-radius: 9px;
  border: 1px solid rgba(185, 166, 245, 0.12);
  background: rgba(159, 132, 246, 0.05);
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
}

.settings-panel .btn {
  margin-top: 16px;
}

.api-panel {
  margin-top: 14px;
}

.api-panel p {
  margin-top: 7px;
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--muted);
}

.api-panel code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 9.5px;
}

/* ---------- modal / toast ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 3, 8, 0.68);
  backdrop-filter: blur(8px);
}

.modal {
  width: 440px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #17121f, #0f0c17);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  animation: rise 0.25s var(--ease) both;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.modal-head h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal-head p {
  margin-top: 5px;
  font-size: 10px;
  color: var(--dim);
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
}

.modal-body .field input,
.modal-body .field select {
  height: 38px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
}

.generated {
  max-height: 180px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(86, 214, 164, 0.15);
  background: rgba(86, 214, 164, 0.05);
}

.generated-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: 10px;
  color: var(--green);
}

.generated code {
  display: block;
  padding: 3px 0;
  font-size: 10.5px;
  color: var(--text-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(20, 16, 31, 0.95);
  box-shadow: 0 14px 40px -16px rgba(0, 0, 0, 0.8);
  font-size: 11px;
  color: var(--text-2);
  animation: rise 0.2s var(--ease) both;
}

.log-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.log-type.login {
  color: var(--accent);
  background: var(--accent-soft);
}

.log-type.trial {
  color: var(--amber);
  background: var(--amber-soft);
}

.log-type.activate {
  color: var(--green);
  background: var(--green-soft);
}

.log-type.admin {
  color: var(--blue);
  background: var(--blue-soft);
}

.log-type.system {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.log-type.danger {
  color: var(--red);
  background: var(--red-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stat-grid,
  .mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .sidebar {
    width: 196px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .content {
    padding: 22px 20px 36px;
  }

  .topbar {
    padding: 0 20px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 820px;
  }

  .table-panel {
    overflow-x: auto;
  }
}
.text-link.danger { color: var(--red); margin-left: 10px; }
.text-link.danger:hover { color: color-mix(in srgb, var(--red) 75%, #000); }

.admin-workflow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.admin-workflow-card { overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; transition: transform .18s ease, border-color .18s ease; }
.admin-workflow-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); }
.admin-workflow-cover { position: relative; display: grid; place-items: center; aspect-ratio: 16/9; overflow: hidden; background: var(--panel-2); color: var(--dim); font-size: 11px; }
.admin-workflow-cover img { width: 100%; height: 100%; object-fit: cover; }
.admin-workflow-cover em { position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 5px; color: #fff; background: #22a06b; font-size: 10px; font-style: normal; }
.admin-workflow-cover b { position: absolute; top: 8px; right: 8px; padding: 3px 7px; border-radius: 5px; color: #fff; background: rgba(20,16,30,.55); font-size: 10px; font-weight: 500; backdrop-filter: blur(5px); }
.admin-workflow-cover b.disabled { background: rgba(160,60,60,.8); }
.admin-workflow-meta { padding: 12px 14px 14px; }
.admin-workflow-meta strong { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.admin-workflow-meta small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.admin-workflow-meta p { display: -webkit-box; overflow: hidden; margin-top: 7px; color: var(--dim); font-size: 10.5px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.admin-workflow-cover-preview { overflow: hidden; margin: 4px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.admin-workflow-cover-preview img { display: block; width: 100%; max-height: 220px; object-fit: cover; }


/* ===== 客户端更新配置 ===== */
.view .release-card { display: block; }
.release-form { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; }
.release-form .field { display: flex; flex-direction: column; gap: 6px; }
.release-form .field > span { color: var(--muted); font-size: 12px; }
.release-form .field > span em { color: var(--dim); font-style: normal; font-size: 11px; }
.release-form input, .release-form textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); background: var(--panel-2); font-size: 13px; line-height: 1.6; }
.release-form textarea { resize: vertical; font-family: inherit; }
.release-hint { margin: 0; color: var(--dim); font-size: 12px; }


/* ===== 提示词方案 ===== */
.scheme-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.scheme-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 12px; cursor: pointer; }
.scheme-tab.active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.scheme-tab small { color: var(--dim); font-size: 10px; }
.scheme-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; }
.scheme-list { display: flex; flex-direction: column; gap: 6px; max-height: 72vh; overflow: auto; }
.scheme-item { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 12px; cursor: pointer; }
.scheme-item.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.scheme-name { font-weight: 500; }
.scheme-meta { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 10px; }
.tag { font-style: normal; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); font-size: 10px; color: var(--muted); }
.tag.on { border-color: var(--green); color: var(--green); }
.code-area { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.7; }


/* ---------- credit stats redesign ---------- */
.credit-stats-view .page-head { margin-bottom: 16px; }
.credit-head h1 { margin: 4px 0 6px; font-size: 28px; letter-spacing: -0.02em; }
.credit-head p { max-width: 720px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.credit-eyebrow { color: var(--accent); font-size: 9px; letter-spacing: .18em; font-weight: 700; }
.credit-filter { padding: 14px 18px; }
.credit-filter .toolbar { align-items: end; }
.credit-range-hint { margin-left: auto; align-self: center; color: var(--dim); font-size: 10px; white-space: nowrap; }
.credit-kpi-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 14px; margin: 16px 0 12px; }
.credit-kpi { position: relative; min-height: 164px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); overflow: hidden; background: linear-gradient(155deg, rgba(255,255,255,.045), rgba(255,255,255,.012)); display: flex; flex-direction: column; }
.credit-kpi::after { content: ''; position: absolute; width: 180px; height: 180px; right: -70px; top: -80px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, rgba(159,132,246,.16)), transparent 68%); pointer-events: none; }
.credit-kpi.is-consume { --kpi-glow: rgba(255,112,112,.15); }
.credit-kpi.is-recharge { --kpi-glow: rgba(86,214,164,.15); }
.credit-kpi.is-income { --kpi-glow: rgba(127,168,255,.15); }
.credit-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-2); font-size: 11px; }
.credit-kpi-top em { color: var(--dim); font-style: normal; font-size: 8px; letter-spacing: .14em; }
.credit-kpi > strong { margin-top: 18px; font-family: var(--font-num); font-size: 34px; font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.credit-kpi > p { margin-top: 7px; color: var(--muted); font-size: 10px; }
.credit-kpi-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; color: var(--dim); font-size: 9.5px; border-top: 1px solid var(--line); }
.credit-mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.credit-mini { display: flex; flex-direction: column; gap: 4px; padding: 12px 15px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.016); }
.credit-mini span { color: var(--muted); font-size: 10px; }
.credit-mini b { font-family: var(--font-num); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.credit-mini small { color: var(--dim); font-size: 9px; }
.credit-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border: 1px solid rgba(159,132,246,.20); border-radius: 10px; background: rgba(159,132,246,.055); color: var(--muted); font-size: 10px; line-height: 1.7; }
.credit-note b { flex: none; color: var(--accent); font-size: 10px; }
.credit-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.credit-split .panel, .credit-stats-view > .panel { margin-bottom: 14px; }
.credit-total-pill { padding: 4px 9px; border-radius: 999px; background: rgba(255,112,112,.12); color: #ff9d9d; font-family: var(--font-num); font-size: 11px; }
.credit-total-pill.green { background: rgba(86,214,164,.12); color: var(--green); }
.credit-bar-row { margin-top: 14px; }
.credit-bar-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10.5px; }
.credit-bar-label b { color: var(--text); font-family: var(--font-num); font-size: 11px; font-weight: 500; }
.credit-bar { height: 7px; margin-top: 7px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.credit-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #ff7373, #b94b6a); transition: width .35s var(--ease); }
.credit-bar i.green { background: linear-gradient(90deg, var(--green), #3e8f72); }
.credit-empty { margin-top: 16px; color: var(--dim); font-size: 10px; }
.credit-type-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; background: var(--dim); }
.credit-type-dot.red { background: #ff7373; box-shadow: 0 0 7px rgba(255,115,115,.45); }
.credit-type-dot.green { background: var(--green); box-shadow: 0 0 7px rgba(86,214,164,.45); }
@media (max-width: 1100px) {
  .credit-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credit-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .credit-kpi-grid, .credit-mini-grid { grid-template-columns: 1fr; }
  .credit-range-hint { width: 100%; margin-left: 0; }
  .credit-filter .toolbar { flex-wrap: wrap; }
}


/* ---------- credit stats tabs ---------- */
.credit-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.credit-tabs button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: .2s var(--ease); }
.credit-tabs button:hover { background: rgba(255,255,255,.035); color: var(--text); }
.credit-tabs button.active { border-color: rgba(159,132,246,.36); background: rgba(159,132,246,.11); color: var(--text); }
.credit-tab-num { color: var(--dim); font-family: var(--font-num); font-size: 9px; }
.credit-tabs button.active .credit-tab-num { color: var(--accent); }
.credit-tabs b { font-size: 11px; font-weight: 600; white-space: nowrap; }
.credit-tabs small { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-family: var(--font-num); font-size: 9px; }
.credit-tab-panel { animation: credit-fade .22s var(--ease); }
@keyframes credit-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.credit-kpi.clickable { cursor: pointer; }
.credit-kpi.clickable:hover { border-color: rgba(159,132,246,.32); transform: translateY(-2px); }
.credit-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 14px; padding: 2px 2px 0; }
.credit-section-head h2 { margin: 4px 0 4px; font-size: 20px; }
.credit-section-head p { color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.credit-summary-chip { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.02); color: var(--muted); font-size: 10px; }
.credit-summary-chip b { margin-left: 6px; color: var(--text); font-family: var(--font-num); font-size: 15px; }
.credit-summary-chip.green b { color: var(--green); }
.credit-inline-bar { width: 100%; min-width: 100px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.credit-inline-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #ff7373, #b94b6a); }
.credit-inline-bar.green i { background: linear-gradient(90deg, var(--green), #3e8f72); }
.credit-search-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.credit-search-field { flex: 1 1 300px; max-width: none !important; }
.credit-search-hint { margin-top: 8px; color: var(--dim); font-size: 9.5px; }
.credit-ledger-search { margin-bottom: 14px; }
@media (max-width: 1100px) {
  .credit-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .credit-tabs small { display: none; }
}
@media (max-width: 720px) {
  .credit-tabs { grid-template-columns: 1fr 1fr; }
  .credit-section-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .credit-search-row { align-items: stretch; }
}


/* ---------- fine-tuned ledger table ---------- */
.credit-ledger-table { table-layout: fixed; }
.credit-ledger-table th:nth-child(1), .credit-ledger-table td:nth-child(1) { width: 142px; }
.credit-ledger-table th:nth-child(2), .credit-ledger-table td:nth-child(2) { width: 110px; }
.credit-ledger-table th:nth-child(3), .credit-ledger-table td:nth-child(3) { width: 150px; }
.credit-ledger-table th:nth-child(4), .credit-ledger-table td:nth-child(4) { width: 90px; }
.credit-ledger-table th:nth-child(5), .credit-ledger-table td:nth-child(5) { width: 90px; }
.credit-ledger-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-ledger-time { color: var(--muted); font-size: 9.5px; }
.credit-ledger-account { color: var(--text-2); }
.credit-ledger-kind small { display: block; margin-top: 1px; margin-left: 13px; color: var(--dim); font-size: 8.5px; }
.credit-ledger-detail { color: var(--muted); white-space: normal !important; line-height: 1.45; }
.credit-user-table { table-layout: fixed; }
.credit-user-table td, .credit-user-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-user-table th:nth-child(1), .credit-user-table td:nth-child(1) { width: 130px; }
.credit-user-table th:nth-child(2), .credit-user-table td:nth-child(2) { width: 58px; }
.credit-user-table th:nth-child(3), .credit-user-table td:nth-child(3) { width: 72px; }
.credit-user-table th:last-child, .credit-user-table td:last-child { width: 116px; }


/* ---------- credit user reconciliation ---------- */
.credit-user-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.credit-user-overview > div { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.credit-user-overview span { color: var(--muted); font-size: 10px; }
.credit-user-overview b { color: var(--text); font-family: var(--font-num); font-size: 21px; font-weight: 600; line-height: 1.1; }
.credit-user-overview b.green { color: var(--green); }
.credit-user-overview small { color: var(--dim); font-size: 9px; }
.credit-user-toolbar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.credit-user-search { flex: 1 1 280px; max-width: 420px !important; }
.credit-user-hint { margin-left: auto; padding-bottom: 8px; color: var(--dim); font-size: 9.5px; }
.credit-user-table { table-layout: fixed; }
.credit-user-table td, .credit-user-table th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-user-table th:nth-child(1), .credit-user-table td:nth-child(1) { width: 190px; }
.credit-user-table th:nth-child(2), .credit-user-table td:nth-child(2) { width: 150px; }
.credit-user-table th:nth-child(3), .credit-user-table td:nth-child(3) { width: 230px; }
.credit-user-table th:nth-child(4), .credit-user-table td:nth-child(4) { width: 90px; }
.credit-user-table th:nth-child(5), .credit-user-table td:nth-child(5) { width: 86px; }
.credit-user-table th:nth-child(6), .credit-user-table td:nth-child(6) { width: 58px; }
.credit-user-table th:nth-child(7), .credit-user-table td:nth-child(7) { width: 125px; }
.credit-user-table th:nth-child(8), .credit-user-table td:nth-child(8) { width: 58px; }
.credit-user-cell b { display: block; color: var(--text); font-size: 11px; font-weight: 600; }
.credit-user-cell small { display: block; margin-top: 3px; color: var(--dim); font-size: 9px; }
.credit-user-metric { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.credit-user-metric b { font-family: var(--font-num); font-size: 12px; font-weight: 600; }
.credit-user-metric b.green { color: var(--green); }
.credit-user-metric small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); font-size: 8.5px; }
.credit-user-bar { display: block; height: 5px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.credit-user-bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, #ff7373, #b94b6a); }
.credit-user-time { color: var(--muted); font-size: 9px; }

/* ---------- daily trend chart ---------- */
.credit-day-legend { display: flex; gap: 12px; color: var(--muted); font-size: 9.5px; }
.credit-day-legend span { display: inline-flex; align-items: center; gap: 5px; }
.credit-day-legend i { width: 7px; height: 7px; border-radius: 2px; background: #ff7373; }
.credit-day-legend .income i { background: var(--green); }
.credit-day-chart { max-height: 370px; overflow: auto; padding-right: 4px; }
.credit-day-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 128px 78px; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid rgba(255,255,255,.035); }
.credit-day-date { color: var(--muted); font-family: var(--font-num); font-size: 9.5px; }
.credit-day-bars { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.credit-day-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,.05); overflow: hidden; }
.credit-day-bar i { display: block; height: 100%; min-width: 1px; border-radius: inherit; transition: width .3s var(--ease); }
.credit-day-bar i.consume { background: linear-gradient(90deg, #ff7373, #b94b6a); }
.credit-day-bar i.income { background: linear-gradient(90deg, var(--green), #3e8f72); }
.credit-day-nums { display: flex; justify-content: space-between; gap: 7px; font-family: var(--font-num); font-size: 10.5px; }
.credit-day-nums em { color: #ff9d9d; font-style: normal; }
.credit-day-nums b { color: var(--green); font-weight: 500; }
.credit-day-net { text-align: right; font-family: var(--font-num); font-size: 10.5px; }
.credit-day-net.is-income { color: var(--green); }
.credit-day-net.is-consume { color: #ff9d9d; }
.credit-day-details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.credit-day-details summary { color: var(--dim); font-size: 9.5px; cursor: pointer; }
.credit-day-details[open] summary { margin-bottom: 8px; }
@media (max-width: 900px) {
  .credit-user-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credit-user-table { table-layout: auto; }
  .credit-user-table th, .credit-user-table td { width: auto !important; }
  .credit-day-row { grid-template-columns: 44px minmax(0, 1fr) 110px 64px; }
}


/* ---------- single day mode / insights ---------- */
.credit-filter-toolbar { flex-wrap: wrap; }
.credit-mode-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.credit-mode-switch button { padding: 7px 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.credit-mode-switch button.active { background: var(--accent-soft, rgba(159,132,246,.16)); color: var(--text); }
.credit-insight-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.credit-insight { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.016); }
.credit-insight span { color: var(--muted); font-size: 9.5px; }
.credit-insight b { font-family: var(--font-num); font-size: 18px; font-weight: 600; line-height: 1.1; }
.credit-insight b.red { color: #ff9d9d; }
.credit-insight b.green { color: var(--green); }
.credit-insight small { color: var(--dim); font-size: 8.5px; }
.data-table tfoot th { padding-top: 9px; border-top: 1px solid var(--line-2); color: var(--text-2); font-size: 9.5px; }
@media (max-width: 1100px) { .credit-insight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .credit-insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---------- rich admin users ---------- */
.users-rich-table { table-layout: fixed; }
.users-rich-table th:nth-child(1), .users-rich-table td:nth-child(1) { width: 190px; }
.users-rich-table th:nth-child(2), .users-rich-table td:nth-child(2) { width: 165px; }
.users-rich-table th:nth-child(3), .users-rich-table td:nth-child(3) { width: 195px; }
.users-rich-table th:nth-child(4), .users-rich-table td:nth-child(4) { width: 130px; }
.users-rich-table th:nth-child(5), .users-rich-table td:nth-child(5) { width: 120px; }
.users-rich-table th:nth-child(6), .users-rich-table td:nth-child(6) { width: 78px; }
.users-rich-table td { overflow: hidden; }
.users-rich-table .user-cell span { display: flex; align-items: center; gap: 6px; }
.users-rich-table .user-cell small { display: block; margin-top: 3px; color: var(--dim); font-size: 8.5px; }
.tenant-tag { display: inline-block; padding: 1px 5px; border-radius: 4px; font-style: normal; font-size: 8px; line-height: 1.5; }
.tenant-tag.qdm { color: var(--green); background: rgba(86,214,164,.10); }
.tenant-tag.sjm { color: var(--amber); background: rgba(240,179,91,.10); }
.user-sub { display: block; margin-top: 3px; color: var(--dim); font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-copy { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: transparent; color: var(--muted); font-family: var(--font-num); font-size: 9px; text-align: left; cursor: pointer; padding: 0; }
.device-copy:hover { color: var(--accent); }
.user-credit-cell { display: flex; flex-direction: column; gap: 3px; }
.user-credit-cell b { color: var(--text); font-family: var(--font-num); font-size: 13px; }
.user-credit-cell span { color: var(--dim); font-size: 8.5px; white-space: nowrap; }
.user-credit-cell em { color: var(--green); font-style: normal; }
.user-edit-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.user-edit-meta > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); }
.user-edit-meta span { display: block; color: var(--dim); font-size: 9px; }
.user-edit-meta b { display: block; margin-top: 4px; font-family: var(--font-num); font-size: 16px; }
.user-edit-meta b.green { color: var(--green); }
.user-readonly { display: grid; gap: 7px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.user-readonly > div { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.user-readonly span { width: 62px; flex: none; color: var(--dim); font-size: 9px; }
.user-readonly em { color: var(--dim); font-style: normal; font-size: 9px; }
.user-readonly small { color: var(--dim); font-size: 8.5px; }
.user-readonly b { color: var(--text-2); font-size: 9.5px; font-weight: 500; }
.user-credit-edit { margin: 12px 0; padding: 12px; border: 1px solid rgba(159,132,246,.20); border-radius: 9px; background: rgba(159,132,246,.04); }
.user-credit-edit > div:first-child { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.user-credit-edit strong { font-size: 11px; }
.user-credit-edit span { color: var(--dim); font-size: 9px; }
.tenant-tag.trial { color: var(--amber); background: rgba(240,179,91,.10); }


/* ---------- trial stats ---------- */
.credit-trial-panel { margin-bottom: 14px; border-color: rgba(240,179,91,.24); background: linear-gradient(120deg, rgba(240,179,91,.055), rgba(255,255,255,.012)); }
.credit-trial-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.credit-trial-grid > div { padding: 12px 14px; border: 1px solid rgba(240,179,91,.16); border-radius: 10px; background: rgba(255,255,255,.016); }
.credit-trial-grid span { display: block; color: var(--muted); font-size: 9.5px; }
.credit-trial-grid b { display: block; margin-top: 4px; font-family: var(--font-num); font-size: 18px; font-weight: 600; }
.credit-trial-grid b.red { color: #ff9d9d; }
.credit-trial-grid b.green { color: var(--green); }
.credit-trial-grid small { color: var(--dim); font-size: 8.5px; }
.user-trial { color: var(--amber) !important; font-size: 8px !important; }
@media (max-width: 900px) { .credit-trial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* ---------- profit tab ---------- */
.credit-profit-grid { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 12px; margin-bottom: 14px; }
.credit-profit-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); }
.credit-profit-card.qdm { border-color: rgba(86,214,164,.22); }
.credit-profit-card.sjm { border-color: rgba(240,179,91,.22); }
.credit-profit-card.settle { border-color: rgba(159,132,246,.24); background: rgba(159,132,246,.06); }
.credit-profit-card span { color: var(--muted); font-size: 10px; }
.credit-profit-card b { font-family: var(--font-num); font-size: 26px; font-weight: 600; }
.credit-profit-card small { color: var(--dim); font-size: 9px; line-height: 1.6; }
.credit-type-dot.amber { background: var(--amber); box-shadow: 0 0 7px rgba(240,179,91,.45); }
@media (max-width: 900px) { .credit-profit-grid { grid-template-columns: 1fr; } }
