/* ===== 管理后台 ===== */

.admin {
  display: flex;
  min-height: 100vh;
  background: #f4f6fb;
}

/* ---------- 侧边栏 ---------- */
.side {
  width: 234px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px 16px;
  background: linear-gradient(180deg, #0c1628 0%, #101e37 58%, #132443 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.side::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  left: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(76, 133, 255, 0.24), transparent 65%);
  pointer-events: none;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  position: relative;
}

.side-brand .logo-mark {
  background: linear-gradient(150deg, #ffd28a, #e2a63f);
  color: #2a1c05;
  box-shadow: 0 6px 16px -6px rgba(226, 166, 63, 0.6);
}

.side-brand b {
  font-size: 13.5px;
  font-weight: 650;
  display: block;
  line-height: 1.3;
  letter-spacing: 0;
}

.side-brand small {
  font-size: 10.5px;
  color: #7f94b5;
  letter-spacing: 0.04em;
  display: block;
  line-height: 1.45;
  margin-top: 1px;
}

.side-label {
  font-size: 10.5px;
  color: #6b80a2;
  letter-spacing: 0.12em;
  padding: 14px 12px 7px;
  text-transform: uppercase;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: #a8b9d4;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}

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

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #e6eefc;
}

.nav-item.active {
  background: linear-gradient(100deg, rgba(76, 133, 255, 0.28), rgba(76, 133, 255, 0.1));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(120, 165, 255, 0.28);
}

.nav-item.active svg {
  opacity: 1;
  color: #9fc0ff;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e0443f;
  color: #fff;
  font-size: 10.5px;
  font-weight: 650;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.side-foot {
  margin-top: auto;
  position: relative;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 10px;
}

.side-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #cfe0ff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.side-user-meta {
  line-height: 1.3;
  min-width: 0;
}

.side-user-meta b {
  font-size: 12.5px;
  font-weight: 600;
  display: block;
}

.side-user-meta span {
  font-size: 10.5px;
  color: #7f94b5;
}

.side-link {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  color: #9db0cd;
  font-size: 12.5px;
  text-align: left;
  padding: 0 10px;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* ---------- 右侧 ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-top {
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}

.crumb b {
  color: var(--ink);
  font-weight: 600;
}

.admin-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-chip {
  font-size: 12px;
  color: var(--muted);
  background: #f4f6fb;
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.content {
  padding: 22px 26px 40px;
  flex: 1;
}

.view {
  animation: fadeUp 0.22s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.view-head h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.015em;
}

.view-head p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

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

/* ---------- 统计卡 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px 17px 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-value {
  margin: 7px 0 4px;
  font-size: 25px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-2);
  margin-left: 2px;
}

.kpi-foot {
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.delta {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.delta.up {
  color: var(--red);
}

.delta.down {
  color: var(--green);
}

.kpi-accent {
  background: linear-gradient(140deg, #0d1830, #17294b 60%, #1e3a66);
  border-color: #1b3157;
  color: #fff;
}

.kpi-accent .kpi-label {
  color: rgba(197, 214, 240, 0.72);
}

.kpi-accent .kpi-value {
  color: #fff;
}

.kpi-accent .kpi-foot {
  color: rgba(190, 209, 238, 0.62);
}

.kpi-accent::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -80px;
  background: radial-gradient(circle, rgba(255, 199, 108, 0.26), transparent 62%);
}

/* ---------- 布局 ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  align-items: start;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title span {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

.card-body {
  padding: 0 18px 18px;
}

.card-body.flush {
  padding: 0;
}

/* ---------- 图表 ---------- */
.chart {
  height: 190px;
}

.chart .inner {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100%;
}

.chart .c-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
}

.chart .c-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  opacity: 0;
  transition: opacity 0.16s ease;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart .c-col:hover .c-val {
  opacity: 1;
}

.chart .c-track {
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(180deg, #f8fafd, #f1f4fa);
  border-radius: 6px;
  overflow: hidden;
  min-height: 30px;
}

.chart .c-fill {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #c3d4ff, #e2eaff);
  transition: height 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chart .c-fill.last {
  background: linear-gradient(180deg, #3f78ff, #83a7ff);
}

.chart .c-x {
  font-size: 9.5px;
  color: var(--muted-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

/* ---------- 表格 ---------- */
.tbl-wrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  white-space: nowrap;
}

.tbl tbody tr:last-child td {
  border-bottom: none;
}

.tbl tbody tr:hover {
  background: #fbfcff;
}

.tbl th:last-child,
.tbl td:last-child {
  width: 1%;
}

.tbl .ta-r {
  text-align: right;
}

.tbl .ta-c {
  text-align: center;
}

.tbl .money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tbl .money.gold {
  color: var(--gold);
}

.tbl .money.muted {
  color: var(--muted);
  font-weight: 500;
}

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

.mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  flex: none;
}

.cell-user b {
  font-weight: 600;
  font-size: 13px;
  display: block;
  line-height: 1.3;
}

.cell-user small {
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

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

/* 区域服务商标识 */
.tag-provider {
  height: 18px;
  font-size: 10.5px;
  padding: 0 6px;
  margin-left: 6px;
  vertical-align: 1px;
}

.detail-item b.gold-text {
  color: var(--gold);
}

.detail-item b.muted-text {
  color: var(--muted-2);
  font-weight: 600;
}

.link-btn {
  font-size: 12.5px;
  color: var(--blue);
  padding: 3px 6px;
  border-radius: 6px;
}

.link-btn:hover {
  background: #eef3ff;
}

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

.link-btn.danger:hover {
  background: var(--red-soft);
}

/* 二次确认态：第一次点击后按钮变红加粗，再点一次才执行 */
.link-btn.is-armed,
.btn.is-armed {
  background: var(--red) !important;
  color: #fff !important;
  border-color: var(--red) !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(214, 61, 61, 0.35);
}

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

/* 结算口径切换 */
.seg {
  display: inline-flex;
  background: #f1f4f9;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn:hover {
  color: var(--blue);
}

.seg-btn.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(16, 32, 64, 0.12);
}

/* 运营支出录入表单 */
.exp-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-red {
  background: var(--red-soft);
  color: var(--red);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 300px;
}

.search-box .input {
  height: 36px;
  padding-left: 34px;
  font-size: 13px;
  background: #fafbfe;
}

.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.toolbar .select {
  height: 36px;
  width: auto;
  min-width: 110px;
  font-size: 13px;
}

.toolbar .btn {
  height: 36px;
}

.toolbar .spacer {
  flex: 1;
}

.date-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.date-input:focus {
  outline: none;
  border-color: #a9c0ff;
  box-shadow: 0 0 0 3.5px rgba(47, 107, 255, 0.12);
}

/* ---------- 表格内输入 ---------- */
.cell-input {
  width: 118px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfe;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  transition: all 0.16s ease;
}

.cell-input:focus {
  outline: none;
  background: #fff;
  border-color: #a9c0ff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.1);
}

.cell-input.sm {
  width: 82px;
}

/* ---------- 分页条 ---------- */
.pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 待办 / 列表 ---------- */
.todo-list {
  display: flex;
  flex-direction: column;
}

.todo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-2);
}

.todo:last-child {
  border-bottom: none;
}

.todo-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: none;
}

.todo-main {
  min-width: 0;
  flex: 1;
}

.todo-title {
  font-size: 13px;
  font-weight: 550;
}

.todo-sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.rank-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line-2);
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-no {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.rank-row.top1 .rank-no {
  color: var(--gold);
}

.rank-name {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-sub {
  font-size: 11px;
  color: var(--muted-2);
}

.rank-amount {
  font-size: 13px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 9px 18px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--line-2);
}

.log-row:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 11.5px;
}

.log-text {
  color: var(--ink-2);
  min-width: 0;
}

.log-text b {
  font-weight: 600;
}

/* ---------- 空态 ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.empty-ico {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 13px;
  background: #f2f5fb;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #b8c3d6;
}

/* ---------- 账号卡 ---------- */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.acc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px 17px;
  box-shadow: var(--shadow-sm);
}

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

.acc-dot {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
}

.acc-name {
  font-size: 13.5px;
  font-weight: 650;
}

.acc-sub {
  font-size: 11.5px;
  color: var(--muted-2);
}

.acc-metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--muted);
}

.acc-metrics b {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- 详情行 ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.detail-item {
  background: #f8fafd;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
}

.detail-item span {
  font-size: 11.5px;
  color: var(--muted);
}

.detail-item b {
  display: block;
  font-size: 14px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.modal.wide {
  max-width: 640px;
}

.modal-note {
  font-size: 12px;
  color: var(--muted);
  background: #f8fafd;
  border-radius: 9px;
  padding: 9px 12px;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---------- 登录 ---------- */
.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(900px 500px at 15% 0%, #dfe9ff, transparent 60%),
    radial-gradient(700px 400px at 100% 10%, #f7ecd8, transparent 55%), #f4f6fb;
}

.al-card {
  width: 100%;
  max-width: 408px;
  background: #fff;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(14, 26, 48, 0.55), 0 0 0 1px rgba(14, 26, 48, 0.05);
}

.al-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 28px;
  color: #fff;
  background: linear-gradient(150deg, #0c1730 0%, #14264a 55%, #1d3a6b 100%);
  overflow: hidden;
}

.al-head::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: -90px;
  top: -120px;
  background: radial-gradient(circle, rgba(255, 199, 108, 0.32), transparent 62%);
}

.al-head .logo-mark {
  background: linear-gradient(150deg, #ffd28a, #e2a63f);
  color: #2a1c05;
  box-shadow: 0 6px 16px -6px rgba(226, 166, 63, 0.6);
}

.al-head-text {
  position: relative;
  z-index: 1;
  line-height: 1.3;
}

.al-head-text b {
  display: block;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.al-head-text small {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: #93a9c9;
}

.al-body {
  padding: 26px 28px 24px;
}

.al-card h2 {
  margin: 0 0 5px;
  font-size: 20px;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.al-card .sub {
  margin: 0 0 22px;
  font-size: 12.5px;
  color: var(--muted);
}

.al-card .btn-primary {
  height: 42px;
  margin-top: 4px;
}

.al-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.al-hint code {
  font-family: var(--font);
  font-weight: 600;
  color: var(--ink-2);
}

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

@media (max-width: 900px) {
  .side {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 30px 0 60px -40px rgba(8, 16, 30, 0.8);
  }
  .side.open {
    transform: none;
  }
  .admin-top {
    padding: 0 16px;
    gap: 10px;
  }
  .content {
    padding: 16px 14px 40px;
  }
  .menu-toggle {
    display: grid !important;
  }
  .crumb b {
    font-size: 13px;
  }
  .view-head h1 {
    font-size: 18px;
  }
  .kpi-value {
    font-size: 21px;
  }
  .date-chip {
    display: none;
  }
}

.menu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
}

.side-mask {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 32, 0.4);
  z-index: 70;
  display: none;
}

.side-mask.show {
  display: block;
}

/* ---------- 区域管理 ---------- */
.region-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .region-grid {
    grid-template-columns: 1fr;
  }
}

.rtree {
  padding: 8px 6px 12px;
  max-height: 640px;
  overflow: auto;
}

.rt-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.rt-node:hover {
  background: #f3f6fd;
}

.rt-node.selected {
  background: #eaf0ff;
}

.rt-toggle {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  border-radius: 5px;
  transition: transform 0.14s ease;
}

.rt-toggle.open {
  transform: rotate(90deg);
}

.rt-toggle.hidden {
  visibility: hidden;
}

.rt-name {
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rt-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.rt-count {
  flex: none;
  font-size: 11px;
  color: var(--muted);
  background: #f1f4fa;
  padding: 1px 7px;
  border-radius: 99px;
}

.rt-count.has {
  background: #e8f8f1;
  color: #0f9f6e;
}

.rt-acts {
  display: none;
  flex: none;
  gap: 2px;
}

.rt-node:hover .rt-acts {
  display: flex;
}

.rt-act {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.rt-act:hover {
  background: #e4eaf5;
  color: var(--text);
}

.rt-act.del:hover {
  background: #fdeceb;
  color: #e0443f;
}

.rt-children {
  margin-left: 17px;
  border-left: 1px dashed var(--line);
  padding-left: 4px;
}

.rt-children.hidden {
  display: none;
}

.cascade-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
}

/* 名下 OPC 台数：台数 + 来源 */
.opc-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-2, var(--muted));
}

/* ---------- 分配会员列表 ---------- */
.assign-list {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

.assign-row:last-child {
  border-bottom: none;
}

.assign-row:hover {
  background: #f7f9fd;
}

.assign-row.checked {
  background: #f0f6ff;
}

.assign-row.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.assign-row b {
  font-size: 13px;
}

.assign-row small {
  color: var(--muted);
  font-size: 12px;
}

.assign-meta {
  margin-left: auto;
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 显示比例 ---------- */
.display-modes {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.radio-chip:has(input:checked) {
  border-color: #2f6bff;
  background: #eef4ff;
  color: #2f6bff;
  font-weight: 600;
}

.radio-chip input {
  accent-color: #2f6bff;
}

.uniform-box {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.uniform-box.show {
  display: flex;
}

.uniform-box input[type='range'] {
  width: 160px;
  accent-color: #2f6bff;
}

.region-path {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manual-tag {
  margin-left: 4px;
  font-size: 10px;
  color: #b8791a;
  background: #fdf3e2;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.code-block {
  background: #0d1b33;
  color: #cfe0ff;
  font-size: 12px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
  font-family: Consolas, 'JetBrains Mono', monospace;
  white-space: pre;
}

/* ---------- 平台对接 ---------- */
.plat-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.plat-card.ok {
  border-color: #b7e3cd;
  background: linear-gradient(180deg, #fbfffd, #fff);
}

.plat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.plat-head b {
  font-size: 13.5px;
}

.plat-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.pf-item label {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.pf-item .input {
  height: 34px;
  font-size: 12.5px;
}

.plat-msg {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}

.acc-bind {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0 4px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 8px;
}

.acc-bind b {
  color: var(--text);
  font-size: 12px;
}

/* ---------- 机房基地管理 ---------- */
.base-add {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.base-add .input {
  max-width: 320px;
}

.base-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.base-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-size: 12.5px;
  color: var(--text);
}

.base-chip .bc-count {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.base-chip .link-btn {
  font-size: 11.5px;
}

/* ---------- 管道收益设置 ---------- */
.pl-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pl-label {
  font-size: 12.5px;
  color: var(--muted);
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}
