:root {
  color-scheme: dark;
  --bg: #080c17;
  --surface: #101625;
  --surface-2: #151c2d;
  --surface-3: #1b2336;
  --line: rgba(154, 166, 197, 0.14);
  --line-strong: rgba(154, 166, 197, 0.24);
  --text: #f5f7ff;
  --muted: #8f9bb3;
  --violet: #7b61ff;
  --violet-light: #9d8cff;
  --cyan: #2dd4bf;
  --blue: #4da3ff;
  --amber: #ffb84d;
  --red: #ff647c;
  --green: #48d597;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.68; }
.hidden { display: none !important; }
.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
}
.ambient-one { width: 430px; height: 430px; background: rgba(105, 70, 255, 0.16); top: -160px; right: 10%; }
.ambient-two { width: 360px; height: 360px; background: rgba(20, 120, 180, 0.08); bottom: -140px; left: 12%; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  font-weight: 800;
  color: white;
  background: linear-gradient(145deg, #956eff, #5d3fe8);
  box-shadow: 0 10px 30px rgba(100, 71, 236, 0.35);
}
.brand-mark-large { width: 64px; height: 64px; border-radius: 19px; font-size: 34px; }
.brand-mark { overflow: hidden; }
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.65);
}
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.eyebrow {
  margin: 0 0 9px;
  color: var(--violet-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.17em;
}
.muted { color: var(--muted); }

.login-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 90px;
}
.login-brand { padding: 64px 30px; }
.login-brand h1 {
  margin: 28px 0 22px;
  max-width: 620px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.13;
  letter-spacing: -0.05em;
}
.login-intro { max-width: 520px; color: var(--muted); font-size: 17px; line-height: 1.9; }
.feature-row { display: flex; gap: 12px; margin-top: 38px; flex-wrap: wrap; }
.feature-row span {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c1c9da;
  background: rgba(255, 255, 255, 0.025);
}
.login-panel { display: flex; justify-content: flex-end; }
.login-card {
  width: min(100%, 430px);
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(23, 30, 49, 0.96), rgba(13, 18, 32, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-card h2 { margin: 4px 0 8px; font-size: 31px; }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 34px; }
form label { display: block; margin-top: 22px; color: #c7cede; font-size: 13px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  margin-top: 9px;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #0b101d;
  transition: 160ms ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.13); }
input::placeholder { color: #5f6a81; }
textarea { resize: vertical; min-height: 70px; }
.password-field { position: relative; }
.password-field input { padding-right: 60px; }
.text-button {
  position: absolute;
  right: 10px;
  top: 19px;
  border: 0;
  color: var(--violet-light);
  background: none;
  font-size: 12px;
}
.form-error { min-height: 21px; margin: 11px 0 0; color: #ff8295; font-size: 12px; }
.primary-button, .secondary-button, .quiet-button {
  border-radius: 10px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: 160ms ease;
}
.primary-button {
  background: linear-gradient(135deg, #8067ff, #6546eb);
  box-shadow: 0 9px 24px rgba(104, 72, 235, 0.25);
}
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.login-button { width: 100%; min-height: 46px; margin-top: 5px; }
.secondary-button { background: rgba(123, 97, 255, 0.1); color: #bdb1ff; border-color: rgba(123, 97, 255, 0.24); }
.secondary-button:hover { background: rgba(123, 97, 255, 0.17); }
.quiet-button { border-color: var(--line); background: rgba(255, 255, 255, 0.03); color: #aab4c9; }
.quiet-button:hover { color: white; border-color: var(--line-strong); }
.danger-button {
  margin-right: auto;
  padding: 10px 15px;
  border: 1px solid rgba(255, 100, 124, 0.25);
  border-radius: 10px;
  color: #ff93a4;
  background: rgba(255, 100, 124, 0.08);
  font-weight: 700;
}
.danger-button:hover { background: rgba(255, 100, 124, 0.15); }
.security-note { margin: 24px 0 0; text-align: center; color: #68748c; font-size: 11px; }
.security-note span { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 242px;
  padding: 25px 18px;
  display: flex;
  flex-direction: column;
  background: #0b101d;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 27px; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; margin-top: 4px; color: #68748c; font-size: 11px; }
nav { margin-top: 6px; }
.nav-caption { margin: 23px 12px 10px; color: #4f5b73; font-size: 10px; letter-spacing: 0.13em; }
.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  color: #8f9bb3;
  background: transparent;
  text-align: left;
}
.nav-item:hover { color: #dce1ef; background: rgba(255, 255, 255, 0.03); }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(123, 97, 255, 0.22), rgba(123, 97, 255, 0.07)); }
.nav-item.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 23px; border-radius: 0 3px 3px 0; background: var(--violet); }
.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}
.nav-item.active .nav-icon { border-color: rgba(157, 140, 255, 0.4); color: var(--violet-light); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--line); color: #5f6a81; font-size: 10px; }
.server-state { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; color: #8792a9; }
.server-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(72, 213, 151, 0.08); }

.main-area { min-height: 100vh; margin-left: 242px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 84px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 23, 0.88);
  backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h2 { margin: 0; font-size: 20px; }
.topbar .eyebrow { margin-bottom: 4px; }
.admin-profile { display: flex; align-items: center; gap: 11px; }
.profile-copy { text-align: right; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy small { margin-top: 3px; color: #6d7890; font-size: 11px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(123, 97, 255, 0.35); border-radius: 12px; background: rgba(123, 97, 255, 0.13); color: #c8bfff; font-weight: 800; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); }
.mobile-menu { display: none; }
.content { max-width: 1540px; margin: 0 auto; padding: 30px 34px 50px; }
.page { display: none; animation: page-in 180ms ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } }

.welcome-card {
  min-height: 150px;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(123, 97, 255, 0.2);
  border-radius: 17px;
  background:
    radial-gradient(circle at 86% 25%, rgba(139, 113, 255, 0.22), transparent 25%),
    linear-gradient(125deg, rgba(31, 29, 61, 0.95), rgba(16, 23, 39, 0.96));
}
.welcome-card::after { content: "风"; position: absolute; right: 13%; color: rgba(255, 255, 255, 0.025); font-family: serif; font-size: 180px; font-weight: 900; transform: rotate(-8deg); }
.welcome-card > * { z-index: 1; }
.welcome-card h3 { margin: 2px 0 9px; font-size: 25px; }
.welcome-card p:last-child { margin: 0; color: #a5afc3; }
.metric-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.metric-card {
  min-height: 158px;
  padding: 23px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(20, 27, 44, 0.97), rgba(14, 20, 34, 0.98));
}
.metric-card:hover { border-color: var(--line-strong); }
.metric-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; }
.metric-card.violet .metric-icon { color: #b7aaff; background: rgba(123, 97, 255, 0.14); }
.metric-card.green .metric-icon { color: #70e4ad; background: rgba(72, 213, 151, 0.12); }
.metric-card.cyan .metric-icon { color: #6ee7d7; background: rgba(45, 212, 191, 0.12); }
.metric-card.blue .metric-icon { color: #8ec3ff; background: rgba(77, 163, 255, 0.12); }
.metric-card.amber .metric-icon { color: #ffd083; background: rgba(255, 184, 77, 0.12); }
.metric-card span { display: block; margin-bottom: 8px; color: #8f9bb3; font-size: 12px; }
.metric-card strong { display: block; font-size: 31px; letter-spacing: -0.04em; }
.metric-card small { grid-column: 1 / -1; padding-top: 17px; border-top: 1px solid var(--line); color: #667189; font-size: 10px; }
.overview-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.7fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 15px; background: rgba(16, 22, 37, 0.93); overflow: hidden; }
.panel-head { min-height: 76px; padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h3, .section-heading h3 { margin: 0; font-size: 17px; }
.panel-head .eyebrow { margin-bottom: 5px; }
.link-button { border: 0; color: var(--violet-light); background: none; font-size: 12px; }
.service-panel { padding-bottom: 10px; }
.service-visual { height: 125px; display: grid; place-items: center; }
.pulse-ring { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(72, 213, 151, 0.3); background: rgba(72, 213, 151, 0.055); box-shadow: 0 0 0 12px rgba(72, 213, 151, 0.025); }
.pulse-ring div { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 50%; color: #0b1b15; background: var(--green); font-size: 20px; font-weight: 900; }
.service-list { margin: 0; padding: 0 22px; }
.service-list div { padding: 11px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }
.service-list dt { color: #77839b; }
.service-list dd { margin: 0; color: #cbd2e1; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-badge.active, .status-badge.completed, .status-badge.unused { color: #70e4ad; background: rgba(72, 213, 151, 0.1); }
.status-badge.disabled, .status-badge.failed { color: #ff8da0; background: rgba(255, 100, 124, 0.1); }
.status-badge.queued { color: #ffd080; background: rgba(255, 184, 77, 0.1); }
.status-badge.redeemed { color: #b8a6ff; background: rgba(139, 112, 255, 0.11); }
.status-badge.processing { color: #88bfff; background: rgba(77, 163, 255, 0.11); }
.status-badge.cancelled, .status-badge.neutral { color: #9aa5ba; background: rgba(154, 166, 197, 0.09); }

.section-heading { margin: 2px 0 20px; display: flex; align-items: end; justify-content: space-between; }
.section-heading h3 { font-size: 24px; }
.section-heading p { margin: 8px 0 0; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.model-summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.model-summary-grid article {
  min-height: 92px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(20, 27, 44, 0.97), rgba(14, 20, 34, 0.98));
}
.model-summary-grid span { color: #8995ac; font-size: 12px; }
.model-summary-grid strong { color: #d9d3ff; font-size: 25px; }
.model-monitor-panel { margin-bottom: 18px; overflow: hidden; }
.model-monitor-head { align-items: flex-start; gap: 18px; }
.model-monitor-head p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.model-monitor-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.model-monitor-summary div { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-right: 1px solid var(--line); }
.model-monitor-summary div:last-child { border-right: 0; }
.model-monitor-summary span { color: #8995ac; font-size: 12px; }
.model-monitor-summary strong { color: #e7ddff; font-size: 20px; }
.model-monitor-message { margin: 14px 18px 0; padding: 10px 12px; color: #8fa1ba; border: 1px solid rgba(77, 163, 255, .16); background: rgba(77, 163, 255, .045); font-size: 12px; }
.model-monitor-message.error { color: #ff9bac; border-color: rgba(255, 100, 124, .3); background: rgba(255, 100, 124, .06); }
.model-monitor-list { max-height: 470px; padding: 14px 18px 18px; display: grid; gap: 9px; overflow: auto; }
.model-monitor-empty { padding: 24px; color: #7e899f; border: 1px dashed var(--line); text-align: center; }
.model-monitor-item { min-width: 0; padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid var(--line); background: rgba(9, 14, 24, .55); }
.model-monitor-item.state-pending { border-color: rgba(255, 184, 77, .34); background: rgba(255, 184, 77, .035); }
.model-monitor-item.state-offline { border-color: rgba(255, 100, 124, .25); }
.model-monitor-item-main { min-width: 0; }
.model-monitor-item-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.model-monitor-item-title strong { color: #e5e9f4; font-size: 14px; }
.model-monitor-item-title code { max-width: 260px; color: #8f9cb2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-kind-chip { padding: 3px 7px; color: #8fc3ff; border: 1px solid rgba(77, 163, 255, .22); border-radius: 999px; font-size: 10px; font-weight: 800; }
.model-monitor-item p { margin: 6px 0 5px; color: #9aa5b8; font-size: 12px; }
.model-monitor-item small { color: #68748a; }
.model-monitor-item-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.compact-button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.pricing-calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, .72fr);
  gap: 18px;
  align-items: start;
}
.calculator-rate-badge {
  padding: 7px 10px;
  border: 1px solid rgba(229,193,100,.28);
  border-radius: 4px;
  color: #f0cf73;
  background: rgba(210,161,43,.08);
  font-size: 11px;
  font-weight: 800;
}
.calculator-body { padding: 24px; }
.calculator-formula {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(216,178,84,.17);
  background: rgba(210,161,43,.035);
  text-align: center;
}
.calculator-formula span { color: #f1e7ce; font-size: 14px; font-weight: 800; }
.calculator-formula b { color: #b9933d; font-size: 12px; }
.calculator-fields {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 14px;
  align-items: end;
}
.calculator-fields label { margin: 0; }
.calculator-fields label > span { display: block; margin-bottom: 9px; color: #aaa18e; font-size: 12px; }
.calculator-fields input { margin: 0; height: 54px; font-size: 20px; font-weight: 800; }
.calculator-fields input[readonly] { color: #f2d476; border-color: rgba(231,194,98,.34); background: rgba(210,161,43,.06); }
.calculator-operator { height: 54px; display: grid; place-items: center; color: #d2ad50; font-size: 15px; font-weight: 900; white-space: nowrap; }
.calculator-result-card {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(216,178,84,.16);
  background: #080a0b;
}
.calculator-result-card > div { padding: 20px; }
.calculator-result-card > div + div { border-left: 1px solid rgba(216,178,84,.16); }
.calculator-result-card small { display: block; color: #766e5e; font-size: 11px; }
.calculator-result-card strong { display: block; margin-top: 8px; color: #f3d77e; font-size: 24px; }
.calculator-result-card p { margin: 8px 0 0; color: #7c7568; font-size: 11px; }
.calculator-settlement strong { color: #ece8df; }
.calculator-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.pricing-reference-list { display: grid; gap: 1px; padding: 16px; }
.pricing-reference-list button {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(216,178,84,.12);
  color: #928a7b;
  background: rgba(255,255,255,.012);
}
.pricing-reference-list button:hover { border-color: rgba(229,193,100,.3); background: rgba(210,161,43,.06); }
.pricing-reference-list strong { color: #e9c969; }
.calculator-note { margin: 0; padding: 0 20px 20px; color: #756e61; font-size: 11px; line-height: 1.7; }
.toolbar { min-height: 70px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.credit-toolbar { flex-wrap: wrap; }
.search-box { width: min(330px, 100%); position: relative; }
.search-box span { position: absolute; top: 19px; left: 13px; color: #6a7690; }
.search-box input { margin: 0; padding-left: 36px; background: #0c111e; }
.count-label { color: #71809a; font-size: 12px; white-space: nowrap; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 13px 17px; color: #647088; background: rgba(8, 12, 23, 0.35); text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap; }
td { padding: 15px 17px; border-top: 1px solid rgba(154, 166, 197, 0.09); color: #bec6d7; font-size: 12px; vertical-align: middle; }
tbody tr:hover { background: rgba(255, 255, 255, 0.015); }
.table-primary { display: block; color: #eef1f8; font-size: 12px; font-weight: 700; }
.table-secondary { display: block; max-width: 220px; margin-top: 5px; color: #667189; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-live-status { margin-left: auto; color: #7d899f; font-size: 11px; }
.task-source-cell .table-primary { color: #cbd6e8; }
.task-provider-ready { color: #70e4ad; }
#page-tasks table { min-width: 1160px; }
.admin-task-progress { display: block; width: 150px; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: rgba(125, 144, 170, 0.16); }
.admin-task-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fb6ff, #6be1bd); transition: width 0.35s ease; }
.table-secondary.recharge-card-key {
  max-width: none;
  color: #aab4c9;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  user-select: text;
}
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 145px; }
.mini-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #c7bdff; background: rgba(123, 97, 255, 0.12); font-weight: 800; }
.role-label { color: #a9b2c5; }
.card-key-copy {
  min-width: 170px;
  padding: 7px 10px;
  border: 1px solid rgba(216, 177, 80, 0.26);
  border-radius: 5px;
  color: #f0cf72;
  background: rgba(194, 141, 28, 0.07);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.035em;
  white-space: nowrap;
}
.card-key-copy:not(:disabled):hover { border-color: rgba(239, 202, 105, 0.55); background: rgba(194, 141, 28, 0.14); }
.card-key-copy:disabled { cursor: default; opacity: 0.62; }
.modal-user .card-key-copy { width: 100%; margin-top: 12px; }
.number { color: #eceffa; font-variant-numeric: tabular-nums; }
.credit-positive { color: #63dda2; font-weight: 800; font-variant-numeric: tabular-nums; }
.credit-negative { color: #ff8295; font-weight: 800; font-variant-numeric: tabular-nums; }
.manage-button { padding: 7px 11px; border: 1px solid rgba(123, 97, 255, 0.24); border-radius: 8px; color: #bcb0ff; background: rgba(123, 97, 255, 0.08); font-size: 11px; }
.manage-button:hover { background: rgba(123, 97, 255, 0.15); }
.progress { width: 82px; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255, 255, 255, 0.06); }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d50ed, #9b87ff); }
.progress-label { display: block; margin-top: 5px; color: #67728a; font-size: 9px; }
.filter-group { display: flex; gap: 5px; flex-wrap: wrap; }
.filter-button { padding: 7px 11px; border: 1px solid transparent; border-radius: 8px; color: #7f8aa1; background: transparent; font-size: 11px; }
.filter-button:hover { color: #c5ccda; }
.filter-button.active { color: #c1b7ff; border-color: rgba(123, 97, 255, 0.18); background: rgba(123, 97, 255, 0.1); }
.empty-state { padding: 48px 20px; color: #69758d; text-align: center; }
.pagination {
  min-height: 66px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--line);
}
.pagination-button {
  min-width: 72px;
  padding: 8px 12px;
  border: 1px solid rgba(216, 178, 84, .24);
  border-radius: 5px;
  color: #e2c36d;
  background: rgba(194, 141, 28, .07);
}
.pagination-button:hover:not(:disabled) { background: rgba(194, 141, 28, .14); }
.pagination-button:disabled { cursor: default; opacity: .35; }
.pagination-status { color: #8b8374; font-size: 12px; font-variant-numeric: tabular-nums; }
.release-delete-button { margin: 0; padding: 7px 11px; font-size: 11px; }
.compact-table table { min-width: 590px; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(2, 5, 12, 0.72); backdrop-filter: blur(6px); }
.modal-card { width: min(100%, 450px); padding: 25px; border: 1px solid var(--line-strong); border-radius: 18px; background: #121827; box-shadow: var(--shadow); }
.model-modal-card { width: min(100%, 760px); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: start; }
.modal-head h3 { margin: 0; font-size: 21px; }
.modal-user { margin: 22px 0 4px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.modal-actions { margin-top: 25px; display: flex; justify-content: flex-end; gap: 9px; }
.form-tip { margin: 10px 0 0; color: #69758d; font-size: 11px; }
.card-key-result {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(72, 213, 151, 0.25);
  border-radius: 12px;
  background: rgba(72, 213, 151, 0.06);
  text-align: center;
}
.card-key-result span { display: block; color: #91a39b; font-size: 11px; line-height: 1.7; }
.card-key-result strong {
  white-space: pre-wrap;
  display: block;
  margin: 16px 0;
  color: #e9fff4;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 21px;
  letter-spacing: 0.08em;
}
.model-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.model-form-grid .span-2 { grid-column: 1 / -1; }
.model-feature-switch {
  margin: 2px 0 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(216,178,84,.24);
  border-radius: 10px;
  background: rgba(216,178,84,.045);
}
.model-feature-switch > div { display: grid; gap: 5px; }
.model-feature-switch b { color: var(--text); font-size: 13px; }
.model-feature-switch small { color: var(--muted); font-size: 11px; line-height: 1.55; }
.toggle-switch {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 0 0 auto;
}
.toggle-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.toggle-switch span {
  position: relative;
  width: 44px;
  height: 24px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: #252832;
  transition: 160ms ease;
}
.toggle-switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8d95a7;
  transition: 160ms ease;
}
.toggle-switch input:checked + span {
  border-color: rgba(224,180,65,.76);
  background: rgba(224,180,65,.34);
}
.toggle-switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--gold);
}
.toggle-switch em {
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.toggle-switch input:checked ~ em { color: var(--gold); }
.model-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}
.model-order-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.model-order-controls .model-order-button {
  width: 28px;
  min-width: 28px;
  padding: 6px 0;
  text-align: center;
}
.model-order-controls .model-order-button:disabled {
  cursor: default;
  opacity: .28;
}
.model-row-actions .toggle-switch span { width: 40px; height: 22px; }
.model-row-actions .toggle-switch span::after { width: 14px; height: 14px; }
.model-row-actions .toggle-switch input:checked + span::after { transform: translateX(18px); }
.model-row-actions .toggle-switch input:disabled + span { cursor: wait; opacity: .55; }
.model-row-actions .toggle-switch em { min-width: 36px; }
.feature-control-panel { max-width: 1040px; }
.feature-control-list { padding: 8px 20px 2px; }
.feature-control-list .model-feature-switch { margin: 12px 0; min-height: 78px; }
.feature-control-actions { padding: 6px 20px 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.feature-control-actions p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.model-output-options {
  margin: 8px 0 18px;
  padding: 16px;
  border: 1px solid rgba(224, 180, 65, .28);
  background: linear-gradient(145deg, rgba(224, 180, 65, .07), rgba(255, 255, 255, .015));
}
.model-output-heading,
.model-output-group {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.model-output-heading { align-items: flex-start; margin-bottom: 14px; }
.model-output-heading > div { display: grid; gap: 4px; }
.model-output-heading b,
.model-output-group > b { color: var(--text); font-size: 13px; }
.model-output-heading span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.model-output-heading > span {
  padding: 5px 9px;
  color: var(--gold);
  border: 1px solid rgba(224, 180, 65, .34);
  white-space: nowrap;
}
.model-output-group { align-items: center; margin: 12px 0; }
.model-output-group > b { width: 112px; flex: 0 0 auto; }
.model-option-editor {
  min-width: 0;
  flex: 1;
  display: grid;
  justify-items: end;
  gap: 9px;
}
.model-option-checks { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.model-option-checks label {
  margin: 0;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0,0,0,.18);
  cursor: pointer;
}
.model-option-checks label:has(input:checked) {
  color: var(--gold);
  border-color: rgba(224, 180, 65, .6);
  background: rgba(224, 180, 65, .1);
}
.model-option-checks input { width: auto; margin: 0; accent-color: var(--gold); }
.model-option-checks label.custom-option { padding-right: 6px; }
.model-option-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  color: #c8b98e;
  background: transparent;
}
.model-option-remove:hover { color: #ff9caa; background: rgba(255, 100, 124, .1); }
.model-custom-option {
  width: min(100%, 390px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.model-custom-option input { margin: 0; min-width: 0; }
.model-custom-option button { min-height: 42px; white-space: nowrap; }
.model-option-editor > small { color: var(--muted); font-size: 11px; text-align: right; }
.model-secret-state {
  margin-top: 18px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #7d89a1;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
}
.checkbox-label { margin: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.checkbox-label input { width: auto; margin: 0; accent-color: var(--violet); }
.toast { position: fixed; z-index: 80; right: 25px; bottom: 25px; max-width: 360px; padding: 13px 17px; border: 1px solid rgba(72, 213, 151, 0.24); border-radius: 11px; color: #bcebd3; background: #11241d; box-shadow: var(--shadow); }
.toast.error { color: #ffc1cb; border-color: rgba(255, 100, 124, 0.25); background: #29151a; }
.error-dialog-card { width: min(100%, 590px); border-color: var(--red); }
.error-dialog-card h3 { margin: 8px 0 12px; color: #ffdce2; font-size: 24px; }
.error-sigil { color: #1b0710; background: linear-gradient(180deg, #ff97aa, #ff647c); }
.error-dialog-guidance { margin: 16px 0 0; color: #b8bfd0; font-size: 13px; line-height: 1.7; }
.sidebar-mask { display: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .service-panel { max-width: none; }
}
@media (max-width: 800px) {
  .login-shell { width: min(100% - 30px, 470px); grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { justify-content: center; }
  .mobile-brand { display: flex; }
  .sidebar { transform: translateX(-100%); transition: 200ms ease; }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: block; }
  .sidebar-mask { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.5); }
  .app-shell.menu-open .sidebar-mask { display: block; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px 42px; }
  .model-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .model-monitor-summary { grid-template-columns: repeat(2, 1fr); }
  .model-monitor-summary div:nth-child(2) { border-right: 0; }
  .model-monitor-summary div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .model-monitor-item { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 570px) {
  .login-card { padding: 30px 24px; }
  .metric-grid { grid-template-columns: 1fr; }
  .welcome-card { align-items: flex-start; flex-direction: column; gap: 24px; padding: 26px; }
  .welcome-card h3 { font-size: 21px; }
  .profile-copy { display: none; }
  .admin-profile .quiet-button { padding: 9px 11px; }
  .section-heading { align-items: flex-start; gap: 18px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .heading-actions { align-items: stretch; flex-direction: column; }
  .model-form-grid { grid-template-columns: 1fr; }
  .model-form-grid .span-2 { grid-column: auto; }
  .model-secret-state { align-items: flex-start; flex-direction: column; }
}

/* Fengyi Obsidian Gold — unified commercial admin console */
:root {
  --bg: #050606;
  --surface: #0b0d0e;
  --surface-2: #111315;
  --surface-3: #17191b;
  --line: rgba(216, 178, 84, .14);
  --line-strong: rgba(230, 195, 107, .28);
  --text: #f3eee1;
  --muted: #9b9485;
  --violet: #c89b3d;
  --violet-light: #edd079;
  --cyan: #c5a34f;
  --blue: #d0ad55;
  --amber: #e2ba58;
  --shadow: 0 28px 90px rgba(0,0,0,.58);
}
body {
  background:
    radial-gradient(circle at 80% -12%,rgba(197,148,43,.11),transparent 30%),
    #050606;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(rgba(218,181,89,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(218,181,89,.025) 1px,transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom,black,transparent 86%);
}
.ambient-one { background: rgba(198,149,43,.13); }
.ambient-two { background: rgba(120,84,21,.08); }
.brand-mark {
  border: 1px solid rgba(255,226,142,.5);
  border-radius: 6px;
  color: #171207;
  background: linear-gradient(145deg,#f2d987,#bd8b31 58%,#76511a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),0 12px 30px rgba(181,126,26,.23);
}
.eyebrow { color: #e7c566; }
.feature-row span {
  border-radius: 4px;
  border-color: rgba(216,178,84,.17);
  color: #b9ad94;
  background: rgba(205,157,48,.035);
}
.login-card {
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  border-color: rgba(229,194,106,.31);
  background:
    linear-gradient(135deg,rgba(219,177,71,.08),transparent 24%),
    linear-gradient(160deg,rgba(19,21,21,.99),rgba(7,8,9,.98));
  box-shadow: var(--shadow);
}
.login-card::before, .login-card::after,
.modal-card::before, .modal-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.login-card::before, .modal-card::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid #d5a948;
  border-left: 1px solid #d5a948;
}
.login-card::after, .modal-card::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid #d5a948;
  border-bottom: 1px solid #d5a948;
}
input, select, textarea {
  border-radius: 5px;
  border-color: rgba(220,181,83,.2);
  color: #eee9df;
  background: #07090a;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(237,205,118,.58);
  box-shadow: 0 0 0 3px rgba(202,153,38,.08);
}
.text-button { color: #e0bd5e; }
.primary-button, .secondary-button, .quiet-button, .danger-button {
  border-radius: 5px;
}
.primary-button {
  border: 1px solid rgba(255,231,158,.48);
  color: #171207;
  background: linear-gradient(135deg,#efd27a,#c49135 60%,#96651d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5),0 10px 28px rgba(181,126,26,.2);
}
.secondary-button {
  color: #e5c669;
  border-color: rgba(222,181,77,.28);
  background: rgba(193,140,29,.08);
}
.secondary-button:hover { background: rgba(200,151,39,.14); }
.quiet-button { border-color: rgba(215,176,80,.16); background: rgba(213,171,70,.025); color: #a69f91; }
.sidebar {
  background: linear-gradient(180deg,#0c0e0f,#060708);
  border-color: rgba(214,175,79,.16);
  box-shadow: 20px 0 80px rgba(0,0,0,.22);
}
.brand small, .nav-caption, .sidebar-foot { color: #696151; }
.nav-item { border-radius: 5px; }
.nav-item:hover { color: #efe7d6; background: rgba(216,178,84,.045); }
.nav-item.active {
  color: #fff4d8;
  background: linear-gradient(90deg,rgba(202,153,40,.2),rgba(202,153,40,.025));
  box-shadow: inset 0 0 0 1px rgba(226,188,91,.07);
}
.nav-item.active::before { width: 2px; background: #dcb34c; box-shadow: 0 0 15px rgba(220,179,76,.7); }
.nav-icon { border-radius: 4px; border-color: rgba(216,178,84,.15); }
.nav-item.active .nav-icon { border-color: rgba(237,205,117,.4); color: #e9c96b; }
.topbar {
  border-color: rgba(216,178,84,.14);
  background: rgba(5,6,6,.88);
  backdrop-filter: blur(18px);
}
.avatar { border: 1px solid rgba(218,179,81,.25); color: #e8ca70; background: linear-gradient(145deg,#29261d,#111314); }
.welcome-card, .metric-card, .panel, .table-card, .model-summary-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border-color: rgba(216,178,84,.15);
  background: linear-gradient(145deg,rgba(17,19,20,.99),rgba(8,10,11,.99));
  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}
.welcome-card::before, .metric-card::before, .panel::before, .table-card::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg,#d4a947,transparent);
}
.metric-card.violet, .metric-card.cyan, .metric-card.blue, .metric-card.amber { border-color: rgba(217,178,80,.18); }
.metric-icon {
  border-radius: 4px;
  color: #e5c464;
  border: 1px solid rgba(218,178,80,.18);
  background: rgba(194,142,31,.07);
}
.filter-button, .manage-button, .status-badge, .role-label { border-radius: 4px; }
.filter-button.active {
  color: #f2d780;
  border-color: rgba(230,191,91,.34);
  background: rgba(197,147,34,.1);
}
.manage-button { color: #dfbe60; border-color: rgba(218,177,78,.22); background: rgba(194,141,28,.07); }
thead { color: #766e5e; }
tbody tr:hover { background: rgba(213,171,68,.025); }
.status-badge.active, .credit-positive { color: #acd19d; }
.status-badge.processing, .role-label { color: #e8c968; border-color: rgba(218,178,80,.22); background: rgba(197,146,32,.07); }

/* Every admin dialog is centered and visually consistent */
.modal {
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,0,0,.83);
  backdrop-filter: blur(12px) saturate(.72);
}
.modal-card {
  position: relative;
  width: min(100%,450px);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  border-radius: 8px;
  border-color: rgba(231,197,111,.34);
  background:
    linear-gradient(135deg,rgba(218,176,71,.08),transparent 22%),
    linear-gradient(155deg,#141616,#08090a);
  box-shadow: 0 34px 120px rgba(0,0,0,.72),0 0 0 1px rgba(0,0,0,.85);
}
.model-modal-card { width: min(100%,760px); }
.modal-head .icon-button { border-radius: 4px; border-color: rgba(216,177,80,.2); background: rgba(216,177,80,.025); }
.modal-user, .card-key-result, .model-secret-state { border-radius: 5px; border-color: rgba(216,177,80,.15); background: #080a0b; }
.confirm-action-card { width: min(100%,470px); padding: 32px; text-align: center; }
.confirm-action-card .eyebrow { margin-top: 15px; }
.confirm-action-card h3 { margin: 10px 0 8px; font-size: 22px; }
.confirm-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.confirm-action-card .modal-actions { justify-content: center; }
.confirm-action-card .danger-button { margin-right: 0; }
.confirm-sigil {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(229,193,100,.36);
  color: #f0d178;
  background: radial-gradient(circle,rgba(213,169,58,.16),transparent 70%);
  font-family: Georgia,serif;
  font-size: 24px;
}
.toast { z-index: 1200; border-radius: 5px; }

/* Resolution and token based commercial pricing. */
.model-modal-card { width: min(100%,920px); }
.model-pricing-options {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(224,180,65,.28);
  background: linear-gradient(145deg,rgba(224,180,65,.055),rgba(255,255,255,.012));
}
.model-pricing-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.video-billing-mode-selector {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.video-billing-mode-option {
  min-height: 74px;
  margin: 0;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  cursor: pointer;
}
.video-billing-mode-option.active {
  border-color: var(--gold);
  background: rgba(220,172,54,.1);
  box-shadow: inset 0 0 0 1px rgba(229,193,100,.12);
}
.video-billing-mode-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.video-billing-mode-option span,
.video-billing-mode-option b,
.video-billing-mode-option small { display: block; }
.video-billing-mode-option b { color: var(--gold); font-size: 14px; }
.video-billing-mode-option small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.video-duration-range { margin-bottom: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.model-duration-options-field { display: grid; gap: 8px; margin-bottom: 14px; }
.model-duration-options-field small { color: var(--text-soft); line-height: 1.55; }
.model-pricing-grid label,
.model-pricing-resolution-grid label,
.model-pricing-table-row label { margin: 0; }
.model-pricing-resolution-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.model-pricing-resolution-grid label {
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(90px,1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.16);
}
.model-pricing-resolution-grid label > span { color: var(--gold); font-weight: 800; }
.model-pricing-resolution-grid label > small,
.model-pricing-table-row label > small { color: var(--muted); white-space: nowrap; }
.model-pricing-resolution-grid.provider-map label {
  grid-template-columns: auto minmax(90px,.7fr) auto minmax(190px,1.5fr);
}
.model-pricing-resolution-grid.provider-map { grid-template-columns: 1fr; }
.model-pricing-resolution-grid .provider-resolution-model {
  width: 100%;
  min-width: 0;
}
.model-pricing-resolution-grid input,
.model-pricing-table-row input { margin: 0; min-width: 0; }
.model-pricing-table { display: grid; border: 1px solid var(--line); }
.model-pricing-table-head,
.model-pricing-table-row {
  display: grid;
  grid-template-columns: 110px repeat(3,minmax(0,1fr));
  gap: 12px;
  align-items: center;
}
.model-pricing-table-head { padding: 9px 12px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; }
.model-pricing-table-row { padding: 10px 12px; border-top: 1px solid var(--line); }
.model-pricing-table-row > b { color: var(--gold); }
.model-pricing-table-row label { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.model-pricing-flat { padding: 14px; border: 1px solid var(--line); color: var(--muted); background: rgba(0,0,0,.16); }
#model-edit-form label:has(#model-speed),
#model-edit-form label:has(#model-quality) { display: none; }

@media (max-width: 760px) {
  .video-billing-mode-selector { grid-template-columns: 1fr; }
  .model-pricing-grid,.model-pricing-resolution-grid { grid-template-columns: 1fr; }
  .model-pricing-resolution-grid.provider-map label { grid-template-columns: auto minmax(0,1fr) auto; }
  .model-pricing-resolution-grid.provider-map .provider-resolution-model { grid-column: 1 / -1; }
  .model-pricing-table-head,.model-pricing-table-row { grid-template-columns: 68px repeat(3,minmax(0,1fr)); }
  .pricing-calculator-layout,.calculator-fields,.calculator-result-card { grid-template-columns: 1fr; }
  .calculator-formula { grid-template-columns: 1fr; }
  .calculator-result-card > div + div { border-left: 0; border-top: 1px solid rgba(216,178,84,.16); }
  .calculator-operator { height: auto; }
}

/* Recharge settings and audit records */
.recharge-settings-panel,
.recharge-plan-panel {
  margin-bottom: 18px;
}
.recharge-settings-head p:not(.eyebrow) {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.recharge-channel-list {
  padding: 18px 22px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.recharge-channel-list .feature-control-card {
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(142, 99, 255, .26);
  background: rgba(8, 7, 20, .32);
}
.recharge-channel-list .feature-control-card > span:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.recharge-channel-list .feature-control-card strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}
.recharge-channel-list .feature-control-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.recharge-channel-toggle {
  min-width: 92px;
  justify-content: flex-end;
}
.recharge-channel-toggle em {
  min-width: 28px;
  text-align: left;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .recharge-channel-list {
    padding-inline: 14px;
  }
  .recharge-channel-list .feature-control-card {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
  }
}
.recharge-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 22px 20px;
}
.recharge-plan-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.recharge-plan-form label:not(.recharge-plan-enabled) {
  display: grid;
  gap: 8px;
}
.recharge-plan-form label span,
.compact-field span {
  color: var(--muted);
  font-size: 12px;
}
.recharge-plan-enabled {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.recharge-plan-form-actions {
  display: flex;
  align-items: end;
  gap: 9px;
}
.recharge-order-toolbar {
  justify-content: space-between;
}
.compact-field {
  display: flex;
  align-items: center;
  gap: 10px;
}
.compact-field select {
  min-width: 180px;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.danger-ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 82, 120, .65);
  background: rgba(255, 54, 99, .08);
  color: #ff9cb5;
}
.danger-ghost-button:hover {
  background: rgba(255, 54, 99, .16);
  color: #ffd3de;
}

@media (max-width: 900px) {
  .recharge-plan-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .recharge-plan-form {
    grid-template-columns: 1fr;
  }
  .recharge-plan-form-actions,
  .recharge-settings-actions {
    justify-content: stretch;
  }
  .recharge-plan-form-actions button,
  .recharge-settings-actions button {
    flex: 1;
  }
  .recharge-order-toolbar,
  .compact-field {
    align-items: stretch;
    flex-direction: column;
  }
  .compact-field select {
    width: 100%;
  }
}

/* Scalable two-level model catalog */
.model-category-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}
.model-category-card {
  overflow: hidden;
  border: 1px solid rgba(216,178,84,.15);
  border-radius: 7px;
  background: linear-gradient(145deg,rgba(16,18,19,.98),rgba(7,9,10,.98));
}
.model-category-card.expanded {
  border-color: rgba(226,187,88,.28);
  box-shadow: inset 3px 0 0 rgba(216,174,69,.62);
}
.model-category-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
}
.model-category-toggle {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
}
.model-category-toggle:hover { color: #f4d982; }
.model-category-chevron {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(220,180,78,.2);
  border-radius: 4px;
  color: #d7b253;
  font-size: 22px;
  line-height: 1;
  transition: transform 160ms ease,background 160ms ease;
}
.model-category-card.expanded .model-category-chevron {
  transform: rotate(90deg);
  background: rgba(201,149,31,.1);
}
.model-category-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.model-category-title strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-category-title small {
  color: var(--muted);
  font-size: 11px;
}
.model-category-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.model-category-table {
  border-top: 1px solid rgba(216,178,84,.12);
  background: rgba(0,0,0,.14);
}
.model-category-table table { min-width: 920px; }
.model-category-empty-row td {
  padding: 28px 24px;
  color: var(--muted);
  text-align: center;
}
.category-modal-card { width: min(100%,500px); }

@media (max-width: 700px) {
  .model-category-header {
    align-items: stretch;
    flex-direction: column;
  }
  .model-category-actions {
    padding: 0 8px 8px 49px;
  }
  .model-category-actions .manage-button { flex: 1; }
}

/* Signed desktop release management */
.update-layout {
  display: grid;
  gap: 18px;
}

.platform-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}

.platform-content-form,
.customer-service-editor { padding: 22px; }
.platform-content-form label { display: grid; gap: 9px; color: var(--muted); font-size: 13px; }
.platform-content-form textarea { min-height: 130px; resize: vertical; }
.platform-content-form input[type="file"] { width: 100%; }
.platform-content-form small { color: var(--muted); line-height: 1.5; }
.announcement-admin-list { display: grid; gap: 10px; padding: 0 22px 22px; }
.announcement-admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.announcement-admin-item p { margin: 0 0 8px; color: var(--text); white-space: pre-wrap; line-height: 1.65; }
.announcement-admin-item small { color: var(--muted); }
.announcement-admin-image {
  display: block;
  width: min(100%, 420px);
  max-height: 420px;
  margin: 10px 0;
  object-fit: contain;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,.2);
}
.customer-service-editor { display: grid; gap: 16px; }
.customer-service-preview {
  min-height: 270px;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}
.customer-service-preview img { display: block; width: min(100%, 300px); max-height: 360px; object-fit: contain; }
.customer-service-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mail-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 18px;
}
.mail-settings-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}
.mail-settings-form label {
  display: grid;
  gap: 8px;
}
.mail-settings-form label small {
  color: var(--muted);
  line-height: 1.6;
}
.mail-settings-form input[readonly] {
  color: var(--muted);
  background: rgba(255,255,255,.025);
}
@media (max-width: 980px) {
  .mail-settings-layout { grid-template-columns: 1fr; }
}

.business-inquiries-panel { overflow: hidden; }
.business-inquiry-list { display: grid; gap: 12px; padding: 0 22px 22px; }
.business-inquiry-item {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 3px solid #55c7ff;
  border-radius: 10px;
  background: linear-gradient(120deg,rgba(76,178,255,.07),rgba(255,255,255,.018) 42%);
}
.business-inquiry-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.business-inquiry-item header strong { display: block; color: var(--text); font-size: 15px; }
.business-inquiry-item header small { display: block; margin-top: 5px; color: var(--muted); }
.business-inquiry-time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.business-inquiry-meta { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.business-inquiry-meta span,
.business-inquiry-description {
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  background: rgba(0,0,0,.13);
}
.business-inquiry-meta small,
.business-inquiry-description small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.business-inquiry-meta b { color: var(--text); font-size: 12px; font-weight: 650; word-break: break-word; }
.business-inquiry-description { margin-top: 10px; color: var(--text); white-space: pre-wrap; line-height: 1.65; }
.business-inquiry-description.empty { color: var(--muted); }

@media (max-width: 1050px) {
  .platform-content-layout { grid-template-columns: 1fr; }
  .business-inquiry-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .business-inquiry-meta { grid-template-columns: 1fr; }
  .business-inquiry-item header { display: grid; }
}
.update-publish-panel {
  padding: 20px;
}
.release-form {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  margin-top: 18px;
}
.release-form label:not(.checkbox-label) {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.release-form input,
.release-form textarea {
  width: 100%;
}
.release-form textarea {
  resize: vertical;
  min-height: 118px;
}
.release-form .span-2 {
  grid-column: 1 / -1;
}
.release-mandatory {
  padding: 14px;
  border: 1px solid rgba(216,178,84,.18);
  background: rgba(202,153,40,.05);
}
.release-version-cell {
  display: grid;
  gap: 4px;
}
.release-version-cell strong {
  color: #f4d982;
  font-size: 15px;
}
.release-hash {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  font-family: Consolas,monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .release-form {
    grid-template-columns: 1fr;
  }
  .release-form .span-2 {
    grid-column: auto;
  }
}
