:root {
  --primary-100: #eef1ff;
  --primary-500: #4f6bff;
  --primary-600: #3f5cff;
  --primary-gradient: linear-gradient(135deg, #7057ff 0%, #4e78ff 100%);
  --page: #f4f7ff;
  --surface: #ffffff;
  --section: #f7f9ff;
  --text: #151923;
  --secondary: #5f6878;
  --tertiary: #98a1b2;
  --border: #e8edf6;
  --divider: #eef1f6;
  --success: #2fc58f;
  --warning: #ffad3b;
  --danger: #ff5e57;
  --gold: #ffd58a;
  --radius-card: 12px;
  --radius-control: 10px;
  --shadow-card: 0 18px 44px rgba(56, 75, 124, 0.08);
  --shadow-pop: 0 24px 70px rgba(21, 25, 35, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  color: var(--text);
  background: var(--page) url("./tupian/bg_admin_page.png") center / cover fixed;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: #0d1729;
  border-right: 1px solid rgba(148, 163, 184, .10);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .02);
}

.brand {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--primary-gradient);
  font-weight: 900;
}

.brand-name {
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
}

.brand-sub {
  margin-top: 4px;
  color: #8493ac;
  font-size: 12px;
}

.nav {
  margin-top: 26px;
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-head {
  position: relative;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: #cbd5e1;
  background: rgba(15, 23, 42, .52);
  text-align: left;
  font-size: 13px;
  font-weight: 800;
}

.nav-group-head::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease, border-color .18s ease;
}

.nav-group.collapsed .nav-group-head::after {
  transform: rotate(-45deg);
}

.nav-group.collapsed .nav-sub-list {
  display: none;
}

.nav-group-head:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, .72);
}

.nav-item {
  position: relative;
  height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-control);
  color: #94a3b8;
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-group-head img,
.nav-item img {
  width: 22px;
  height: 22px;
  opacity: .78;
  filter: brightness(0) saturate(100%) invert(68%) sepia(17%) saturate(444%) hue-rotate(181deg) brightness(91%) contrast(89%);
}

.nav-group.active .nav-group-head {
  color: #e0e7ff;
  background: rgba(99, 91, 255, .14);
}

.nav-group.active .nav-group-head img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(69%) sepia(66%) saturate(1460%) hue-rotate(200deg) brightness(101%) contrast(98%);
}

.nav-sub-list {
  display: grid;
  gap: 4px;
  padding-left: 16px;
}

.nav-sub-item {
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.nav-sub-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #64748b;
}

.nav-sub-item img {
  display: none;
}

.nav-item.active {
  color: #a5b4fc;
  background: #1d2350;
  box-shadow: inset 4px 0 0 #635bff;
}

.nav-sub-item.active::before {
  background: #8b9cff;
}

.nav-item.active img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(69%) sepia(66%) saturate(1460%) hue-rotate(200deg) brightness(101%) contrast(98%);
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, .72);
}

.main {
  min-width: 0;
  padding: 24px 28px 40px;
}

.topbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar-title {
  min-width: 0;
}

.mobile-menu-button,
.sidebar-backdrop {
  display: none;
}

h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 14px;
}

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

.search {
  width: 300px;
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.search img {
  width: 20px;
  height: 20px;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
}

.icon-btn img {
  width: 22px;
  height: 22px;
}

.admin-user {
  height: 42px;
  padding: 0 8px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}

.top-action-btn,
.logout-btn {
  height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-weight: 800;
}

.top-action-btn {
  color: #4f6bff;
  border-color: rgba(79, 107, 255, .24);
  background: #f8f9ff;
}

.top-action-btn:hover {
  color: #fff;
  border-color: transparent;
  background: var(--primary-gradient);
}

.logout-btn {
  color: #667085;
}

.logout-btn:hover {
  color: #ef4444;
  border-color: #ffd7d7;
  background: #fff7f7;
}

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary-gradient);
  font-size: 13px;
}

.content {
  margin-top: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
}

.toolbar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar-left,
.toolbar-right,
.btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.toolbar-select {
  min-width: 136px;
  height: 42px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: 0;
  color: var(--secondary);
  background-color: rgba(255, 255, 255, .9);
  font-weight: 800;
}

.toolbar-select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(79, 107, 255, .12);
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--secondary);
  background: #fff;
  font-weight: 800;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .72;
}

.btn img {
  width: 18px;
  height: 18px;
}

.btn.primary {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 12px 24px rgba(78, 107, 255, 0.22);
}

.btn.secondary {
  color: var(--primary-600);
  background: var(--primary-100);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn.ghost {
  border-color: var(--border);
}

.neo-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.neo-actions .btn {
  position: relative;
  min-width: 118px;
  height: 38px;
  min-height: 38px;
  padding: 0 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #786bff 0%, #496dff 100%);
  box-shadow:
    0 11px 18px rgba(78, 107, 255, .22),
    0 3px 0 rgba(255, 255, 255, .86),
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -6px 12px rgba(45, 66, 194, .14);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(36, 54, 156, .22);
}

.neo-actions .btn.secondary {
  color: #fff;
  background: linear-gradient(180deg, #5ec8ff 0%, #3f7cff 100%);
  box-shadow:
    0 11px 18px rgba(63, 124, 255, .20),
    0 3px 0 rgba(255, 255, 255, .86),
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -6px 12px rgba(30, 84, 184, .14);
  text-shadow: 0 1px 3px rgba(23, 75, 163, .22);
}

.neo-actions .btn.danger {
  color: #fff;
  background: linear-gradient(180deg, #ff817b 0%, #ff4050 100%);
  box-shadow:
    0 11px 18px rgba(255, 73, 86, .22),
    0 3px 0 rgba(255, 255, 255, .86),
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -6px 12px rgba(185, 35, 48, .14);
  text-shadow: 0 1px 3px rgba(172, 39, 49, .22);
}

.neo-actions .btn::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 4px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.neo-actions .btn::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 4px;
  height: 5px;
  border-radius: 999px;
  background: rgba(38, 48, 120, .08);
  pointer-events: none;
}

.neo-actions .btn img {
  display: none;
}

.neo-actions .btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.neo-actions .btn:active {
  transform: translateY(1px);
  box-shadow:
    0 7px 13px rgba(78, 107, 255, .18),
    0 2px 0 rgba(255, 255, 255, .86),
    inset 0 4px 12px rgba(40, 54, 150, .17);
}

.config-save-btn {
  min-width: 132px;
  height: 42px;
  margin-top: 18px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #efc744;
  border-radius: 10px;
  color: #151923;
  background: #ffd84d;
  box-shadow: 0 10px 22px rgba(255, 191, 31, 0.22);
  font-size: 14px;
  font-weight: 900;
}

.config-save-btn:hover {
  background: #ffcf24;
}

.grid {
  display: grid;
  gap: 16px;
}

.kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.kpi img {
  width: 44px;
  height: 44px;
}

.kpi-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 900;
}

.kpi-label {
  color: var(--secondary);
  font-size: 13px;
}

.kpi-trend {
  margin-top: 4px;
  color: var(--success);
  font-size: 12px;
}

.two-col {
  margin-top: 16px;
  grid-template-columns: 1.5fr 1fr;
}

.panel {
  padding: 18px;
}

.panel-head {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 17px;
  font-weight: 900;
}

.chart {
  height: 282px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.chart img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trend-bars {
  min-height: 282px;
  padding: 18px 10px 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.trend-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--tertiary);
  font-size: 12px;
  font-weight: 800;
}

.trend-bar {
  width: 100%;
  max-width: 34px;
  min-height: 8px;
  border-radius: 999px 999px 8px 8px;
  background: var(--primary-gradient);
  box-shadow: 0 10px 18px rgba(79, 107, 255, 0.18);
}

.trend-item b {
  color: var(--secondary);
  font-size: 12px;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 52px;
  align-items: center;
  gap: 12px;
  color: var(--secondary);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f6;
}

.dashboard-v2 {
  display: grid;
  gap: 12px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: -4px;
}

.dashboard-hero h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 900;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: #73809a;
  font-size: 13px;
  font-weight: 700;
}

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

.dashboard-range {
  height: 34px;
  min-width: 68px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #e6ebf4;
  border-radius: 12px;
  color: #58647a;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 12px 34px rgba(27, 45, 82, .04);
  font-weight: 900;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-metric-card,
.dashboard-card {
  border: 1px solid #e8edf6;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 28px rgba(31, 45, 78, .055);
}

.dashboard-metric-card {
  min-height: 126px;
  padding: 14px 16px 10px;
  overflow: hidden;
}

.dashboard-metric-main {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
}

.dashboard-metric-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
}

.dashboard-metric-label {
  color: #66728a;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-metric-value {
  margin-top: 4px;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 900;
}

.dashboard-metric-meta {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #73809a;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-metric-meta b {
  color: currentColor;
}

.dashboard-metric-card.blue,
.dashboard-sparkline.blue {
  color: #4f6bff;
}

.dashboard-metric-card.green,
.dashboard-sparkline.green {
  color: #22c66f;
}

.dashboard-metric-card.purple,
.dashboard-sparkline.purple {
  color: #8b47ff;
}

.dashboard-metric-card.orange,
.dashboard-sparkline.orange {
  color: #ff8a12;
}

.dashboard-metric-card.blue .dashboard-metric-icon {
  background: #eef1ff;
}

.dashboard-metric-card.green .dashboard-metric-icon {
  background: #e9fbf1;
}

.dashboard-metric-card.purple .dashboard-metric-icon {
  background: #f1eaff;
}

.dashboard-metric-card.orange .dashboard-metric-icon {
  background: #fff2e3;
}

.dashboard-sparkline {
  width: 100%;
  height: 28px;
  margin-top: 7px;
  display: block;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .98fr);
  gap: 12px;
  align-items: stretch;
}

.dashboard-trend-panel {
  display: flex;
  flex-direction: column;
}

.dashboard-side-stack {
  display: grid;
  gap: 12px;
}

.dashboard-card {
  padding: 16px 18px;
}

.dashboard-panel-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-panel-head h3,
.dashboard-quick h3 {
  margin: 0;
  color: #111827;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
}

.dashboard-select,
.dashboard-link {
  border: 0;
  background: transparent;
  font-weight: 900;
}

.dashboard-select {
  height: 34px;
  padding: 0 14px;
  border: 1px solid #e4eaf4;
  border-radius: 12px;
  color: #4d5870;
  background: #fff;
}

.dashboard-link {
  color: #5570ff;
}

.dashboard-trend-chart {
  width: 100%;
  height: auto;
  min-height: 226px;
  flex: 1;
  display: block;
}

.dashboard-grid-line {
  stroke: #e9edf5;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.dashboard-axis-text {
  fill: #71809a;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-point-text {
  fill: #344054;
  font-size: 14px;
  font-weight: 900;
}

.dashboard-top-list {
  display: grid;
  gap: 10px;
}

.dashboard-top-row {
  display: grid;
  grid-template-columns: 28px minmax(86px, .55fr) minmax(120px, 1fr) 46px;
  align-items: center;
  gap: 10px;
  color: #4b5567;
  font-size: 13px;
}

.dashboard-top-row b {
  min-width: 0;
  overflow: hidden;
  color: #30384a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #6d778b;
  background: #eef2f7;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-rank.hot {
  color: #fff;
  background: linear-gradient(180deg, #635bff, #4e55e8);
}

.dashboard-top-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f6;
}

.dashboard-top-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #634cff, #346cff);
}

.dashboard-top-row em {
  color: #66728a;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.dashboard-reminder-card {
  min-height: 108px;
}

.dashboard-reminder {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
}

.dashboard-reminder + .dashboard-reminder {
  margin-top: 8px;
}

.dashboard-reminder span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.dashboard-reminder.success span {
  color: #18ba68;
  background: #ddfae9;
}

.dashboard-reminder.danger span {
  color: #ff4b55;
  background: #ffe9ec;
}

.dashboard-reminder b {
  color: #344054;
}

.dashboard-reminder p {
  margin: 4px 0 0;
  color: #71809a;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, .98fr);
  gap: 12px;
}

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

.dashboard-activity-table th,
.dashboard-activity-table td {
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
  color: #30384a;
  font-size: 13px;
  text-align: left;
}

.dashboard-activity-table th {
  color: #71809a;
  font-weight: 900;
}

.dashboard-activity-table td b {
  color: #273246;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-activity-table td p {
  margin: 4px 0 0;
  color: #7b879c;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-type-pill,
.dashboard-status-pill {
  height: 24px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-type-pill {
  color: #5269ff;
  background: #eef1ff;
}

.dashboard-status-pill {
  color: #17a65d;
  background: #e7faef;
}

.dashboard-status-pill.danger {
  color: #ef4444;
  background: #feecec;
}

.dashboard-recent-orders {
  min-height: 158px;
}

.dashboard-order-list {
  display: grid;
  gap: 10px;
}

.dashboard-order-row {
  min-height: 48px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  background: #f6f8ff;
}

.dashboard-order-row b {
  display: block;
  overflow: hidden;
  color: #273246;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-order-row p {
  margin: 4px 0 0;
  color: #7b879c;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-order-side {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.dashboard-order-side strong {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.dashboard-order-side span {
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #5269ff;
  background: #eef1ff;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-quick {
  min-height: 158px;
}

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

.dashboard-quick-grid button {
  min-height: 76px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  border-radius: 12px;
  color: #30384a;
  background: #f5f7ff;
  font-weight: 900;
}

.dashboard-quick-grid span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 19px;
  font-weight: 900;
}

.dashboard-quick-grid .purple {
  background: linear-gradient(135deg, #7559ff, #4d62f6);
}

.dashboard-quick-grid .green {
  background: linear-gradient(135deg, #28d383, #18b968);
}

.dashboard-quick-grid .blue {
  background: linear-gradient(135deg, #4f83ff, #3467ee);
}

.dashboard-quick-grid .orange {
  background: linear-gradient(135deg, #ff9d1a, #ff7600);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-gradient);
}

.table-card {
  overflow: hidden;
}

.cost-table-card {
  overflow-x: auto;
  overflow-y: visible;
}

.cost-table-card .table {
  margin-bottom: 0;
}

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

.table th,
.table td {
  height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

.table th {
  height: 50px;
  color: var(--secondary);
  background: var(--section);
  font-weight: 900;
}

.table-input {
  width: 88px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.table-input.short {
  width: 72px;
}

.table-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.12);
}

.table-input.metric-input {
  width: 62px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-align: center;
  font-size: 13px;
  line-height: 34px;
  box-sizing: border-box;
}

.table tr:last-child td {
  border-bottom: 0;
}

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

.cell-main img {
  width: 34px;
  height: 34px;
}

.user-cell-main {
  position: relative;
}

.user-row-check {
  flex: 0 0 auto;
}

.user-avatar-wrap {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.user-avatar-fallback,
.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.user-avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--primary-600);
  background: #edf1ff;
  font-size: 14px;
  font-weight: 900;
}

.user-avatar-img {
  position: absolute;
  left: 0;
  top: 0;
  object-fit: cover;
  background: #fff;
}

.category-dot {
  width: 34px;
  height: 34px;
  display: inline-block;
  border-radius: 10px;
  background: var(--primary-gradient);
}

.empty-note {
  padding: 24px;
  color: var(--tertiary);
  text-align: center;
  font-weight: 800;
}

.muted {
  color: var(--tertiary);
}

.badge {
  min-width: 54px;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.success {
  color: var(--success);
  background: #e9f8f3;
}

.badge.warning {
  color: #b97300;
  background: #fff6e7;
}

.badge.danger {
  color: var(--danger);
  background: #fff0f0;
}

.badge.primary {
  color: var(--primary-600);
  background: var(--primary-100);
}

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  color: var(--primary-600);
  background: transparent;
  font-weight: 900;
  white-space: nowrap;
}

.action-link.danger {
  color: var(--danger);
}

.action-link.danger-strong {
  color: #c93434;
}

.tools-list-card {
  margin-top: 18px;
}

.no-cost-tools-panel {
  margin-top: 18px;
}

.no-cost-tool-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.no-cost-tool-name img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.tools-list-head,
.tool-card-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) minmax(120px, .7fr) minmax(190px, 1fr) 74px 66px 66px 72px;
  align-items: center;
  column-gap: 12px;
}

.tools-list-head {
  height: 36px;
  padding: 0 14px;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 900;
}

.tool-select-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.batch-select-hint {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--secondary);
  background: #f3f6ff;
  font-size: 12px;
  font-weight: 800;
}

.check-control {
  width: 22px;
  height: 22px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.check-control input {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.check-control i {
  width: 20px;
  height: 20px;
  border: 1px solid #d8e0ef;
  border-radius: 7px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 10px rgba(54, 72, 112, .06);
}

.check-control input:checked + i {
  border-color: var(--primary-500);
  background: var(--primary-gradient);
}

.check-control input:checked + i::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.check-control input:disabled + i {
  opacity: .48;
}

.tools-list-head span:nth-child(n+4) {
  text-align: center;
}

.tools-card-list {
  display: grid;
  gap: 6px;
}

.tool-card-row {
  min-height: 72px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 26px rgba(53, 78, 128, .045);
  cursor: grab;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.tool-card-row:active {
  cursor: grabbing;
}

.tool-card-row.dragging {
  opacity: .58;
  transform: scale(.99);
  box-shadow: 0 8px 18px rgba(53, 78, 128, .12);
}

.tool-info-cell {
  display: grid;
  grid-template-columns: 22px 40px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.tool-row-check {
  align-self: center;
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  padding: 3px;
  border-radius: 10px;
  object-fit: contain;
  background: #f4f7ff;
}

.tool-info-body {
  min-width: 0;
}

.tool-info-body b,
.tool-stack-cell b {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.tool-info-body span,
.tool-stack-cell span {
  display: block;
  margin-top: 2px;
  color: var(--secondary);
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}

.tool-stack-cell {
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.4;
}

.tool-status-cell {
  display: flex;
  justify-content: center;
}

.tool-usage-cell,
.tool-sort-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-operation-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.outline-action {
  height: 30px;
  min-width: 52px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--primary-600);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(46, 60, 100, .04);
}

.outline-action.danger {
  color: var(--danger);
  background: #fff5f4;
  border-color: #ffe0df;
}

.membership-page {
  display: grid;
  gap: 22px;
}

.membership-kpis {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 18px;
}

.membership-kpi {
  min-height: 96px;
  padding: 22px 24px;
}

.membership-kpi img {
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 12px;
  object-fit: contain;
  background: #f2f5ff;
}

.membership-section {
  padding: 18px;
}

.membership-section-head {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.membership-section-head .muted {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.membership-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.membership-plan-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  box-shadow: 0 12px 28px rgba(53, 78, 128, .055);
  cursor: grab;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.membership-plan-card:active {
  cursor: grabbing;
}

.membership-plan-card.dragging {
  opacity: .58;
  transform: scale(.98);
  box-shadow: 0 8px 18px rgba(53, 78, 128, .12);
}

.membership-plan-top {
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.membership-plan-name {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
}

.membership-plan-desc {
  margin-top: 4px;
  color: var(--tertiary);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.membership-price-row {
  margin-top: 10px;
  min-height: 26px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.membership-price {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.membership-origin {
  color: var(--tertiary);
  font-size: 12px;
  text-decoration: line-through;
}

.membership-recommend {
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #7a5700;
  background: #fff4cf;
  font-size: 12px;
  font-weight: 900;
}

.membership-meta-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.membership-meta-grid div {
  min-height: 44px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #edf1f8;
}

.membership-meta-grid span {
  display: block;
  color: var(--tertiary);
  font-size: 11px;
  line-height: 1.3;
}

.membership-meta-grid b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}

.membership-actions {
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--divider);
}

.membership-actions .outline-action {
  min-width: 72px;
  height: 30px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.membership-card-table {
  margin-top: 0;
  padding-top: 0;
}

.membership-card-table .membership-section-head {
  padding: 22px 24px 0;
}

.membership-danger-actions {
  gap: 12px;
}

.membership-danger-actions .btn.danger {
  position: relative;
  min-width: 124px;
  height: 34px;
  min-height: 34px;
  padding: 0 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ff817b 0%, #ff4050 100%);
  box-shadow:
    0 10px 17px rgba(255, 73, 86, .22),
    0 3px 0 rgba(255, 255, 255, .86),
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -6px 12px rgba(185, 35, 48, .14);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 1px 3px rgba(172, 39, 49, .22);
}

.membership-danger-actions .btn.danger:nth-child(2) {
  min-width: 116px;
}

.membership-danger-actions .btn.danger::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 4px;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.membership-danger-actions .btn.danger::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 4px;
  height: 5px;
  border-radius: 999px;
  background: rgba(105, 20, 30, .08);
  filter: blur(.2px);
  pointer-events: none;
}

.membership-danger-actions .btn.danger img {
  display: none;
}

.membership-danger-actions .btn.danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.membership-danger-actions .btn.danger:active {
  transform: translateY(1px);
  box-shadow:
    0 6px 12px rgba(255, 73, 86, .18),
    0 2px 0 rgba(255, 255, 255, .86),
    inset 0 4px 12px rgba(136, 25, 36, .18);
}

.membership-table th,
.membership-table td {
  height: 58px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 12px;
}

.membership-table th:nth-child(1),
.membership-table td:nth-child(1) {
  width: 180px;
}

.membership-table th:nth-child(4),
.membership-table td:nth-child(4) {
  width: 150px;
}

.membership-table th:nth-child(8),
.membership-table td:nth-child(8) {
  width: 64px;
  text-align: center;
}

.membership-table .action-link {
  padding: 0 8px;
  border-radius: 8px;
  background: #fff5f4;
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 188px;
  padding-right: 22px !important;
}

.order-select-cell {
  width: 54px;
  min-width: 54px;
  text-align: center !important;
}

.order-select-cell .check-control {
  margin: 0 auto;
}

.compact-action-cell {
  gap: 8px;
  min-width: 176px;
}

.compact-action-cell .action-link {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f5f7ff;
  font-size: 13px;
}

.compact-action-cell .action-link.danger {
  background: #fff5f4;
}

.compact-action-cell .action-link.danger-strong {
  background: #fff0f0;
}

[data-category-drag-row] {
  cursor: grab;
  transition: opacity .16s ease, background .16s ease;
}

[data-category-drag-row]:active {
  cursor: grabbing;
}

[data-category-drag-row].dragging {
  opacity: .52;
  background: #f1f5ff;
}

.category-system-row {
  background: #f8fbf9;
}

.user-table th:first-child,
.user-table td:first-child {
  min-width: 220px;
}

.user-action-cell {
  min-width: 166px;
}

.tool-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.tool-row-actions .action-link {
  min-height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f5f7ff;
  font-size: 11px;
}

.tool-row-actions .action-link.danger {
  background: #fff5f4;
}

.tool-row-actions .action-link.danger-strong {
  background: #fff0f0;
}

.session-table .active-row {
  background: #f7f8ff;
}

.session-table .user-cell {
  max-width: 180px;
}

.session-table .user-cell b {
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cost-estimate-table th:nth-child(2),
.cost-estimate-table td:nth-child(2) {
  min-width: 260px;
  white-space: normal;
}

.cost-estimate-table {
  min-width: 1160px;
  table-layout: fixed;
}

.cost-col-model {
  width: 280px;
}

.cost-col-select {
  width: 54px;
}

.cost-select-cell {
  width: 54px;
  text-align: center !important;
}

.cost-select-cell .check-control {
  margin: 0 auto;
}

.cost-col-provider {
  width: 130px;
}

.cost-col-price {
  width: 165px;
}

.cost-col-energy {
  width: 250px;
}

.cost-col-status {
  width: 130px;
}

.cost-estimate-table th:nth-child(3),
.cost-estimate-table td:nth-child(3) {
  width: 120px;
}

.cost-estimate-table th:nth-child(4),
.cost-estimate-table td:nth-child(4),
.cost-estimate-table th:nth-child(5),
.cost-estimate-table td:nth-child(5) {
  width: 160px;
}

.cost-empty-cell {
  color: var(--muted);
  font-size: 13px;
}

.cost-estimate-table th:nth-child(6),
.cost-estimate-table td:nth-child(6) {
  min-width: 220px;
}

.cost-estimate-table th:nth-child(7),
.cost-estimate-table td:nth-child(7) {
  width: 110px;
  text-align: center;
}

.cost-status-head,
.cost-status-cell {
  text-align: center !important;
}

.cost-status-cell {
  vertical-align: middle;
}

.cost-status-cell .switch {
  margin: 0 auto;
}

.aliyun-price-monitor-note {
  margin: -4px 0 12px;
  color: #7a8498;
  font-size: 12px;
  font-weight: 700;
}

.aliyun-price-change {
  margin-top: 5px;
  padding: 0;
  border: 0;
  color: #d97706;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.aliyun-price-change:hover {
  color: #b45309;
  text-decoration: underline;
}

.aliyun-price-error {
  margin-top: 5px;
  color: #dc4355;
  font-size: 12px;
  font-weight: 800;
}

.aliyun-price-modal {
  width: min(980px, calc(100vw - 36px));
}

.aliyun-price-modal .modal-body {
  max-height: min(68vh, 720px);
  overflow: auto;
}

.aliyun-price-summary {
  margin-bottom: 14px;
  color: #657086;
  font-size: 13px;
  line-height: 1.6;
}

.aliyun-price-table-wrap {
  overflow: auto;
  border: 1px solid #e8edf5;
  border-radius: 8px;
}

.aliyun-price-table {
  min-width: 800px;
}

.aliyun-price-table th,
.aliyun-price-table td {
  padding: 12px 14px;
}

.aliyun-price-table th:first-child,
.aliyun-price-table td:first-child {
  width: 48px;
  text-align: center;
}

.aliyun-price-table a {
  color: #4f6bff;
  font-weight: 800;
}

.aliyun-price-direction {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.aliyun-price-direction.up {
  color: #dc4355;
  background: #fff0f2;
}

.aliyun-price-direction.down {
  color: #169b62;
  background: #eafaf2;
}

.aliyun-price-energy-option {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #334155;
  cursor: pointer;
}

.aliyun-price-energy-option input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.aliyun-price-energy-option span,
.aliyun-price-energy-option small {
  display: block;
}

.aliyun-price-energy-option small {
  margin-top: 4px;
  color: #7a8498;
  font-size: 12px;
  line-height: 1.5;
}

.aliyun-price-empty {
  padding: 10px 2px;
  color: #334155;
}

.aliyun-price-empty > b {
  font-size: 16px;
}

.aliyun-price-empty > p {
  margin: 8px 0 0;
  color: #7a8498;
  line-height: 1.6;
}

.aliyun-price-failures {
  margin-top: 16px;
  border-top: 1px solid #e8edf5;
}

.aliyun-price-failures > div {
  padding: 12px 0;
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  border-bottom: 1px solid #eef2f7;
}

.aliyun-price-failures span {
  color: #dc4355;
  font-size: 12px;
  line-height: 1.5;
}

.cost-edit-input,
.cost-note-input {
  width: 132px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  box-sizing: border-box;
}

.energy-cost-control .cost-edit-input {
  width: 154px;
}

.cost-note-input {
  width: 100%;
  font-weight: 700;
}

.cost-note-input.compact {
  height: 34px;
  margin-top: 10px;
  font-size: 13px;
}

.cost-edit-input:focus,
.cost-note-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.12);
}

.energy-cost-control {
  display: grid;
  gap: 7px;
}

.energy-slider-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 70px;
  gap: 8px;
  align-items: center;
}

.energy-slider-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.energy-profit-slider {
  width: 100%;
  accent-color: var(--primary-500);
}

.batch-energy-modal {
  width: 440px;
}

.batch-energy-form {
  display: grid;
  gap: 12px;
}

.batch-energy-summary {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--secondary);
  background: #f3f6ff;
  font-size: 13px;
}

.batch-energy-form label {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.batch-energy-input-row {
  display: grid;
  grid-template-columns: 1fr 38px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.batch-energy-input-row:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(79, 107, 255, 0.12);
}

.batch-energy-input-row input {
  height: 42px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  font: inherit;
  font-weight: 800;
}

.batch-energy-input-row span {
  color: var(--muted);
  font-weight: 800;
}

.batch-energy-form p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.energy-session-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 86px;
  color: var(--text);
}

.energy-session-main {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.energy-session-value {
  color: #ef4444;
  font-size: 15px;
  font-weight: 400;
}

.energy-session-main span {
  color: #ef4444;
  font-size: 12px;
  font-weight: 400;
}

.primary-action {
  color: #fff;
  background: linear-gradient(180deg, #786bff 0%, #496dff 100%);
  border-radius: 999px;
  padding: 8px 18px;
  box-shadow: 0 8px 16px rgba(78, 107, 255, .18);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.cost-setting-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
}

.cost-setting-card a {
  color: var(--primary-600);
  font-weight: 900;
}

.cost-form {
  margin-top: 14px;
}

.sync-meta {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--section);
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.45;
}

.call-cost-note {
  margin-bottom: 16px;
}

.cost-help-text {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.65;
}

.cost-help-text p {
  margin: 0;
}

.cost-help-text a {
  color: var(--primary-600);
  font-weight: 900;
}

.cost-warning-text {
  color: var(--danger);
}

.retention-control {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 800;
}

.retention-control input {
  width: 86px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--primary);
  font-weight: 900;
}

.official-record-card {
  margin-top: 16px;
}

.official-raw-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  background: var(--section);
}

.official-raw-box b {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--primary);
}

.official-raw-box pre {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.6;
}

.official-table td {
  vertical-align: top;
}

.quickrouter-detail-table th,
.quickrouter-detail-table td {
  white-space: nowrap;
}

.quickrouter-detail-table td:nth-child(3) {
  min-width: 180px;
  white-space: normal;
}

.model-pill {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef0f4;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.danger-text {
  color: var(--danger);
}

.warning-text {
  color: #b97300;
}

.success-text {
  color: var(--success);
}

.form {
  display: grid;
  gap: 14px;
}

.general-config-panel {
  grid-column: 1 / -1;
}

.model-config-panel {
  grid-column: 1 / -1;
}

.general-config-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.general-config-form .config-feature-card {
  min-height: 128px;
}

.general-config-form .wide-config-card {
  grid-column: 1 / -1;
  min-height: 0;
}

.form label {
  display: grid;
  gap: 7px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 800;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.config-feature-card {
  padding: 18px 20px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(215, 224, 244, .92);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow:
    0 12px 26px rgba(70, 91, 140, .08),
    inset 0 1px 0 rgba(255, 255, 255, .82);
}

.config-feature-card .switch-row {
  min-height: 36px;
}

.config-feature-card label {
  margin: 0;
}

.share-config-card {
  gap: 16px;
}

.config-card-heading {
  margin: -2px 0 4px;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e6ebf2;
}

.config-card-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-card-heading span {
  min-width: 64px;
  padding: 5px 10px;
  border-radius: 6px;
  color: #fff;
  background: #16a765;
  font-size: 12px;
  text-align: center;
}

.config-card-heading h3,
.config-card-heading p {
  margin: 0;
}

.config-card-heading h3 {
  color: var(--primary);
  font-size: 17px;
}

.config-card-heading p {
  max-width: 520px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: right;
}

.config-subsection-title {
  margin-top: 4px;
  padding: 10px 12px;
  border-left: 4px solid #2563eb;
  border-radius: 0 8px 8px 0;
  color: #1e3a8a;
  background: #eff5ff;
  font-size: 14px;
  font-weight: 900;
}

.share-image-row {
  grid-template-columns: 160px 1fr;
  align-items: center;
}

.share-image-preview {
  width: 160px;
  height: 128px;
  overflow: hidden;
}

.share-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-qr-preview {
  height: 160px;
}

.home-ui-config-card {
  gap: 10px;
}

.home-ui-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-ui-config-grid .wide-field {
  grid-column: 1 / -1;
}

.profile-ui-config-card {
  gap: 14px;
}

.profile-ui-section-title {
  padding-top: 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.profile-ui-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-ui-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(215, 224, 244, .9);
  border-radius: 12px;
  background: rgba(247, 249, 255, .78);
}

.profile-ui-item-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.profile-ui-icon-row {
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
}

.profile-ui-icon-preview {
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.profile-ui-icon-preview img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.tabbar-config-card {
  gap: 14px;
}

.tabbar-config-card .form-section-title {
  margin-top: 0;
}

.tabbar-config-card .field-help {
  margin-top: 4px;
}

.tabbar-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tabbar-config-item {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(215, 224, 244, .9);
  border-radius: 12px;
  background: rgba(247, 249, 255, .78);
}

.tabbar-config-item label {
  gap: 6px;
  font-size: 12px;
}

.tabbar-config-item input {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
}

.tabbar-icon-row {
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
}

.tabbar-icon-preview {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
}

.tabbar-icon-preview img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.tabbar-config-card .logo-fields {
  gap: 8px;
}

.tabbar-config-card .upload-control {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
}

.poster-config-preview {
  display: grid;
  gap: 10px;
}

.mini-edit-btn {
  min-height: 34px;
  border: 1px solid rgba(66, 101, 255, .32);
  border-radius: 10px;
  color: var(--primary-600);
  background: #f4f7ff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  outline: 0;
  background: #fff;
  color: var(--text);
}

.secret-field {
  position: relative;
  display: block;
}

.secret-field input {
  padding-right: 48px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 1px;
}

.secret-field input.is-visible {
  font-family: inherit;
  letter-spacing: 0;
}

.secret-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: #f5f7ff;
  transform: translateY(-50%);
}

.secret-toggle img {
  width: 17px;
  height: 17px;
  opacity: .74;
}

.form textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

.form .disabled-field {
  opacity: .45;
}

.form .hidden-field {
  display: none !important;
}

.form .disabled-field input,
.form .disabled-field select,
.form .disabled-field textarea {
  cursor: not-allowed;
  background: #f4f6fb;
}

.textarea-large {
  min-height: 118px !important;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-settings-panel {
  padding: 22px 24px 24px;
}

.agent-panel-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
}

.agent-panel-head .btn {
  min-width: 126px;
  flex: 0 0 auto;
}

.agent-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.agent-setting-field {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 44px auto;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbff;
}

.agent-setting-field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.agent-setting-field input,
.agent-setting-field select,
.agent-setting-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce3f0;
  border-radius: 9px;
  outline: 0;
  color: var(--text);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.agent-setting-field input,
.agent-setting-field select {
  height: 44px;
  padding: 0 13px;
}

.agent-setting-field textarea {
  height: 96px;
  min-height: 96px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.6;
}

.agent-setting-field input:focus,
.agent-setting-field select:focus,
.agent-setting-field textarea:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(79, 107, 255, .11);
}

.agent-setting-field small {
  min-height: 18px;
  color: var(--tertiary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.agent-setting-note {
  grid-template-rows: auto auto auto;
}

.agent-setting-switch {
  grid-template-rows: auto 44px auto;
}

.agent-setting-switch .switch {
  align-self: center;
}

.membership-visibility-panel {
  margin-bottom: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.membership-visibility-panel .muted {
  margin-top: 6px;
}

.membership-visibility-control {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.membership-visibility-control strong {
  color: var(--secondary);
  font-size: 13px;
}

.agent-table-card {
  margin-top: 16px;
}

.agent-table-head {
  min-height: 76px;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--divider);
}

.agent-table-head .small-text,
.agent-panel-head .small-text {
  margin-top: 5px;
  line-height: 1.45;
}

.agent-table-card .table th,
.agent-table-card .table td {
  padding-left: 20px;
  padding-right: 20px;
}

.model-config-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.model-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.model-provider-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(247, 249, 255, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
}

.model-provider-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.form-section-title {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.tool-edit-form {
  gap: 16px;
}

.logo-upload-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: start;
}

.logo-preview {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--section);
}

.logo-preview img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.preview-media-field {
  display: grid;
  gap: 12px;
}

.preview-media-uploader {
  display: grid;
  gap: 10px;
}

.preview-media-field .upload-control {
  width: 100%;
  box-sizing: border-box;
}

.preview-media-box {
  width: min(420px, 100%);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--section);
}

.preview-media-box img,
.preview-media-box video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.preview-media-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.category-icon-row {
  margin-bottom: 2px;
}

.logo-fields {
  display: grid;
  gap: 12px;
}

.upload-control {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--primary-500);
  border-radius: var(--radius-control);
  color: var(--primary-600) !important;
  background: var(--primary-100);
  cursor: pointer;
}

.upload-control input {
  display: none;
}

.skill-tools-panel {
  margin-top: 16px;
}

.skill-tools-panel th:last-child,
.skill-tools-panel td:last-child {
  width: 204px;
  min-width: 204px;
}

.skill-action-cell {
  padding-right: 18px !important;
}

.skill-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.skill-action-group .action-link {
  min-width: 52px;
  min-height: 30px;
  padding: 0 12px;
  justify-content: center;
  border-radius: 8px;
  background: #f5f7ff;
  font-size: 13px;
}

.skill-action-group .action-link.danger {
  background: #fff5f4;
}

.skill-action-group .action-link.danger-strong {
  background: #fff0f0;
}

.template-tools-panel {
  margin-top: 16px;
}

.small-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
}

.membership-recommend-switch {
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcff;
}

.switch {
  width: 46px;
  height: 26px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
  background: #d9dfec;
}

.switch::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin-left: 0;
  border-radius: 50%;
  background: #fff;
  transition: margin 0.18s ease;
}

.switch.on {
  background: var(--primary-500);
}

.switch.on::after {
  margin-left: auto;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.tab {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--secondary);
  background: #fff;
  font-weight: 900;
}

.tab.active {
  color: var(--primary-600);
  background: var(--primary-100);
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.session-preview {
  display: grid;
  gap: 10px;
}

.session-modal-preview {
  max-height: 62vh;
  overflow-y: auto;
}

.message-item {
  padding: 12px;
  border-radius: 10px;
  background: var(--section);
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.5;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(21, 25, 35, 0.28);
}

.hidden {
  display: none !important;
}

.modal,
.drawer,
.tool-modal {
  position: fixed;
  z-index: 60;
  background: #fff;
  box-shadow: var(--shadow-pop);
}

.modal {
  left: 50%;
  top: 50%;
  width: 520px;
  transform: translate(-50%, -50%);
  border-radius: 18px;
}

.tool-modal {
  left: 50%;
  top: 50%;
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  transform: translate(-50%, -50%);
  border-radius: 20px;
  overflow: hidden;
}

.drawer {
  top: 0;
  right: 0;
  width: 430px;
  height: 100vh;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head,
.tool-modal .modal-head,
.drawer-head {
  min-height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
}

.modal-title {
  font-size: 18px;
  font-weight: 900;
}

.modal-body,
.drawer-body {
  padding: 20px;
}

.tool-modal .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 22px 24px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 24px;
}

.modal-foot,
.drawer-foot {
  padding: 16px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--divider);
}

.tool-modal .modal-foot {
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 -12px 28px rgba(82, 95, 132, 0.08);
}

.drawer-foot {
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 -12px 28px rgba(82, 95, 132, 0.08);
}

.close-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--section);
}

.close-btn img {
  width: 18px;
  height: 18px;
}

.empty-note {
  padding: 38px;
  color: var(--secondary);
  text-align: center;
}

.feedback-content {
  max-width: 520px;
  white-space: pre-wrap;
}

.feedback-reply {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #18764a;
  background: #eafbf1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-wrap;
}

.poster-qr-editor {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.poster-qr-stage {
  width: min(520px, 100%);
  margin: 0 auto;
  position: relative;
  overflow: visible;
  border-radius: 18px;
  background: #f6f8fb;
  box-shadow:
    0 18px 36px rgba(38, 62, 98, .12),
    inset 0 0 0 1px rgba(216, 226, 241, .9);
}

.poster-qr-bg {
  width: 100%;
  display: block;
  user-select: none;
  pointer-events: none;
}

.poster-qr-box {
  aspect-ratio: 1 / 1;
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px dashed #17c56b;
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(23, 197, 107, .14) 25%, transparent 25%, transparent 50%, rgba(23, 197, 107, .14) 50%, rgba(23, 197, 107, .14) 75%, transparent 75%, transparent);
  background-size: 18px 18px;
  box-shadow:
    0 10px 22px rgba(13, 172, 90, .18),
    inset 0 0 0 999px rgba(255, 255, 255, .18);
  cursor: grab;
  touch-action: none;
}

.poster-qr-box::after {
  content: "二维码";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #087f42;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 0 #fff;
}

.poster-qr-box:active {
  cursor: grabbing;
}

.poster-qr-fields {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow:
    0 14px 32px rgba(38, 62, 98, .10),
    inset 0 0 0 1px rgba(226, 234, 244, .9);
}

.poster-qr-fields label {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.poster-qr-fields input[type="range"] {
  margin-top: 8px;
  padding: 0;
}

.poster-qr-values {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--secondary);
  font-size: 12px;
  font-weight: 800;
}

.poster-qr-modal {
  width: min(1120px, calc(100vw - 36px));
}

.poster-qr-modal .modal-body {
  overflow: auto;
  padding: 28px 28px 32px;
}

@media (max-width: 980px) {
  .poster-qr-editor {
    grid-template-columns: 1fr;
  }

  .poster-qr-fields {
    position: static;
  }
}

.toast {
  position: fixed;
  right: 28px;
  top: 24px;
  z-index: 80;
  min-width: 220px;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: var(--radius-control);
  color: #fff;
  background: var(--success);
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  font-weight: 800;
}

.toast.danger {
  background: var(--danger);
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .two-col,
  .split-layout,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .general-config-form {
    grid-template-columns: 1fr;
  }

  .general-config-form .wide-config-card {
    grid-column: auto;
  }

  .model-config-top,
  .model-provider-grid,
  .tabbar-config-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .config-card-heading {
    display: grid;
  }

  .config-card-heading p {
    text-align: left;
  }

  body {
    min-width: 0;
    overflow-x: hidden;
    background-attachment: scroll;
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }

  .admin-shell {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: min(84vw, 310px);
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(8, 15, 30, .24);
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 90;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(10, 18, 32, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .brand {
    height: 62px;
  }

  .nav {
    margin-top: 20px;
    padding-bottom: 20px;
  }

  .nav-item,
  .nav-group-head {
    min-height: 46px;
  }

  .main {
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) 12px max(28px, env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .mobile-menu-button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 22px rgba(50, 70, 120, .08);
  }

  .mobile-menu-button span {
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: #43516a;
  }

  .topbar-title {
    padding-top: 1px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.25;
  }

  .topbar p {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .top-actions {
    gap: 6px;
  }

  .top-action-btn,
  .logout-btn {
    height: 36px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 12px;
  }

  .content {
    margin-top: 16px;
  }

  .toolbar,
  .toolbar-filters,
  .membership-section-head,
  .membership-visibility-panel,
  .panel-head,
  .dashboard-panel-head,
  .agent-table-head,
  .agent-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    gap: 10px;
  }

  .toolbar-left,
  .toolbar-right,
  .toolbar-filters,
  .neo-actions,
  .membership-danger-actions {
    width: 100%;
  }

  .toolbar-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-select,
  .search {
    width: 100%;
    min-width: 0;
    border-radius: 10px;
  }

  .toolbar-left .btn,
  .toolbar-right .btn,
  .neo-actions .btn {
    min-height: 42px;
    flex: 1 1 128px;
  }

  .kpi-grid,
  .dashboard-metrics,
  .membership-kpis,
  .kpi-grid[style] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  .kpi,
  .membership-kpi {
    min-height: 92px;
    padding: 14px;
    gap: 10px;
  }

  .kpi img,
  .membership-kpi img {
    width: 36px;
    height: 36px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .dashboard-main-grid,
  .dashboard-bottom-grid,
  .two-col,
  .split-layout,
  .config-grid,
  .model-config-top,
  .model-provider-grid,
  .general-config-form,
  .home-ui-config-grid,
  .profile-ui-list,
  .tabbar-config-grid,
  .agent-settings-form,
  .poster-qr-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-hero-actions {
    flex-wrap: wrap;
  }

  .dashboard-card,
  .panel,
  .membership-section,
  .agent-settings-panel,
  .config-feature-card,
  .model-provider-card {
    padding: 14px;
  }

  .dashboard-trend-chart {
    min-height: 180px;
  }

  .dashboard-top-row {
    grid-template-columns: 26px minmax(72px, .7fr) minmax(80px, 1fr) 40px;
    gap: 7px;
    font-size: 12px;
  }

  .table-card,
  .tools-list-card {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .table-card > .panel-head,
  .table-card > .membership-section-head {
    min-width: 0;
  }

  .table-card .table {
    min-width: 760px;
  }

  .cost-table-card .table,
  .cost-estimate-table {
    min-width: 1160px;
  }

  .tools-list-card {
    padding-bottom: 4px;
  }

  .tools-list-head,
  .tool-card-row {
    min-width: 930px;
  }

  .membership-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .membership-visibility-control {
    width: 100%;
    justify-content: space-between;
  }

  .membership-card-table .membership-section-head {
    padding: 16px 16px 0;
  }

  .membership-danger-actions .btn.danger {
    flex: 1 1 130px;
  }

  .agent-setting-field {
    padding: 14px;
  }

  .agent-panel-head .btn {
    width: 100%;
  }

  .tabs {
    width: 100%;
    padding-bottom: 4px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
  }

  .share-image-row,
  .logo-upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .share-image-preview {
    width: 100%;
    max-width: 240px;
  }

  .form-grid.two {
    grid-template-columns: minmax(0, 1fr);
  }

  .overlay {
    z-index: 110;
  }

  .modal,
  .tool-modal {
    z-index: 120;
    left: 10px;
    right: 10px;
    top: max(10px, env(safe-area-inset-top));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    transform: none;
  }

  .modal-body,
  .tool-modal .modal-body {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
  }

  .modal-head,
  .tool-modal .modal-head,
  .drawer-head {
    min-height: 56px;
    padding: 0 16px;
  }

  .modal-title {
    padding-right: 8px;
    font-size: 17px;
    line-height: 1.35;
  }

  .modal-foot,
  .drawer-foot {
    padding: 12px 16px max(14px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-foot .btn,
  .drawer-foot .btn {
    width: 100%;
    min-height: 44px;
  }

  .drawer {
    z-index: 120;
    width: calc(100vw - 8px);
    height: 100dvh;
  }

  .drawer-body {
    padding: 16px;
  }

  .poster-qr-modal .modal-body {
    padding: 16px;
  }

  .toast {
    z-index: 140;
    left: 12px;
    right: 12px;
    top: max(12px, env(safe-area-inset-top));
    min-width: 0;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .topbar {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .top-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-action-btn,
  .logout-btn {
    width: 100%;
  }

  .kpi,
  .membership-kpi {
    padding: 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .kpi-value {
    font-size: 19px;
  }
}
.tenant-phase-note{margin-bottom:16px;padding:15px 18px;display:flex;align-items:center;gap:16px;border:1px solid #bfe0cb;border-radius:10px;color:#24603d;background:#effaf3}.tenant-phase-note b{flex:0 0 auto;font-size:15px}.tenant-phase-note span{color:#557064;font-size:12px;line-height:1.55}.tenant-stat-grid{margin-bottom:20px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.tenant-stat-grid>div{min-height:98px;padding:17px 20px;border:1px solid #e1e8e4;border-radius:10px;background:#fff;box-shadow:0 8px 22px rgba(45,70,58,.04)}.tenant-stat-grid span,.tenant-stat-grid strong{display:block}.tenant-stat-grid span{color:var(--muted);font-size:12px;font-weight:700}.tenant-stat-grid strong{margin-top:10px;font-size:28px;line-height:1}.tenant-toolbar{margin-bottom:12px;align-items:flex-end}.tenant-toolbar h2{margin:0;font-size:22px}.tenant-toolbar p{margin:6px 0 0;color:var(--muted);font-size:12px}.tenant-table{overflow-x:auto;border:1px solid #e4e9f0;border-radius:12px;background:#fff}.tenant-table table{min-width:1160px;table-layout:fixed;border-collapse:separate;border-spacing:0}.tenant-table thead th{height:48px;padding:0 16px;border-bottom:1px solid #e7ebf1;color:#647083;background:#f8fafc;font-size:12px;font-weight:800;text-align:left;white-space:nowrap}.tenant-table tbody td{padding:18px 16px;border-bottom:1px solid #edf0f4;vertical-align:middle}.tenant-table tbody tr:last-child td{border-bottom:0}.tenant-table tbody tr:hover td{background:#fbfcff}.tenant-col-main{width:23%}.tenant-col-miniapp{width:17%}.tenant-col-domain{width:13%}.tenant-col-status{width:8%}.tenant-col-expire{width:12%}.tenant-col-actions{width:14%}.tenant-identity,.tenant-stack{display:grid;gap:6px;min-width:0}.tenant-name-line{display:flex;align-items:center;gap:8px;min-width:0}.tenant-name-line b{overflow:hidden;color:var(--text);font-size:15px;text-overflow:ellipsis;white-space:nowrap}.tenant-name-line em{flex:0 0 auto;padding:3px 7px;border-radius:5px;color:#20744a;background:#e8f7ef;font-size:10px;font-style:normal;font-weight:800}.tenant-identity>span,.tenant-stack span{color:var(--muted);font-size:11px;line-height:1.4}.tenant-stack>b{overflow:hidden;color:#202837;font-size:12px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.tenant-appid{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tenant-metrics{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px}.tenant-metrics i{padding:4px 7px;border-radius:5px;color:#657086;background:#f2f5f9;font-size:10px;font-style:normal;font-weight:700;white-space:nowrap}.tenant-job{width:max-content;max-width:100%;padding:3px 7px;border-radius:5px;background:#f2f5f8}.tenant-job-pending,.tenant-job-running{color:#8a641b!important;background:#fff6df}.tenant-job-success{color:#20744a!important;background:#e9f8ef}.tenant-job-failed{color:#aa3d45!important;background:#fff0f1}.tenant-status-cell{display:flex;align-items:center}.tenant-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.tenant-actions .action-link{min-height:30px;padding:5px 7px;border:1px solid #dce3ee;border-radius:6px;color:#4265ff;background:#fff;font-size:11px;font-weight:800;text-align:center;white-space:nowrap}.tenant-actions .action-link:hover{border-color:#b8c6ff;background:#f4f6ff}.tenant-actions .action-link.danger{color:#c24751;border-color:#f0cfd2;background:#fffafb}.tenant-drawer{width:min(620px,94vw)}.tenant-form-section{margin-top:5px;padding:11px 12px;border-radius:8px;background:#f1f8f4}.tenant-form-section b,.tenant-form-section span{display:block}.tenant-form-section span{margin-top:4px;color:var(--muted);font-size:11px;line-height:1.5}.tenant-default-warning{padding:11px;border:1px solid #f0d7a7;border-radius:8px;color:#8a5b13;background:#fff8e8;font-size:12px;line-height:1.5}
@media(max-width:1100px){.tenant-table table{min-width:1080px}.tenant-col-main{width:22%}.tenant-col-actions{width:16%}}
@media(max-width:760px){.tenant-phase-note{display:block}.tenant-phase-note span{margin-top:6px;display:block}.tenant-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tenant-stat-grid>div{min-height:86px;padding:14px}.tenant-toolbar{align-items:flex-start}.tenant-table{overflow-x:auto}.tenant-table table{min-width:1040px}.tenant-table thead th,.tenant-table tbody td{padding-left:13px;padding-right:13px}}

.tenant-col-main{width:24%}.tenant-col-miniapp{width:18%}.tenant-col-domain{width:20%}.tenant-col-status{width:8%}.tenant-col-expire{width:13%}.tenant-col-actions{width:17%}
@media(max-width:1100px){.tenant-table table{min-width:1020px}.tenant-col-main{width:23%}.tenant-col-actions{width:18%}}

.tenant-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.tenant-actions .action-link{display:flex;align-items:center;justify-content:center;min-height:34px;padding:7px 10px;border:1px solid #dfe5ef;border-radius:7px;color:#4d5f7a;background:#f8fafc;font-size:11px;font-weight:800;line-height:1;box-shadow:none;transition:border-color .16s ease,background .16s ease,color .16s ease}.tenant-actions .action-link:hover{border-color:#c3cfff;color:#3557eb;background:#f2f5ff}.tenant-actions .tenant-action-primary{grid-column:1/-1;color:#fff;border-color:#526cff;background:#526cff}.tenant-actions .tenant-action-primary:hover{color:#fff;border-color:#405be8;background:#405be8}.tenant-actions .action-link.danger{color:#bd4650;border-color:#efd6d9;background:#fff8f8}.tenant-actions .action-link.danger:hover{color:#a9343e;border-color:#e7bfc4;background:#fff1f2}
.tenant-switch-button{min-height:36px;padding:0 12px;border:1px solid #cfe0d5;border-radius:8px;color:#17683f;background:#f4fbf7;font-weight:800}.tenant-switch-list{display:grid;gap:8px}.tenant-switch-list button{width:100%;padding:11px 12px;display:flex;align-items:center;justify-content:space-between;border:1px solid #e0e8e3;border-radius:9px;background:#fff;text-align:left}.tenant-switch-list button.active{border-color:#21b966;background:#effbf4}.tenant-switch-list b,.tenant-switch-list small{display:block}.tenant-switch-list small{margin-top:4px;color:var(--muted)}.tenant-switch-list em{color:#168e50;font-style:normal;font-weight:800}
