:root {
  --bg: #0a0e17;
  --bg-elevated: #111827;
  --bg-card: #151e2e;
  --bg-hover: #1c273b;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --rose: #f43f5e;
  --rose-soft: rgba(244, 63, 94, 0.14);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --violet: #a78bfa;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  --sidebar-w: 240px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ======================== 登录门禁 ======================== */
.auth-gate {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, #064e3b 0%, var(--bg) 52%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

/* ======================== 应用骨架 ======================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 22px 28px 90px;
  max-width: 1400px;
  width: calc(100% - var(--sidebar-w));
}

/* ======================== 顶部汇率条与页头 ======================== */
.fx-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 9px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  scrollbar-width: none;
}
.fx-ribbon::-webkit-scrollbar {
  display: none;
}

.fx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.fx-pill:hover {
  background: var(--bg-hover);
  border-color: var(--sky);
  transform: translateY(-1px);
}

.fx-pill .sym {
  font-weight: 700;
  color: var(--sky);
}
.fx-pill.crypto .sym {
  color: var(--amber);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.page-header p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ======================== 卡片与网格 ======================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 4px;
  letter-spacing: -0.4px;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.expense-text {
  color: var(--rose);
}
.income-text {
  color: var(--emerald);
}
.refund-text {
  color: var(--sky);
}
.transfer-text {
  color: var(--violet);
}

.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

/* ======================== 图表与进度条 ======================== */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 156px;
  padding-top: 12px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.bar-pair {
  width: 100%;
  max-width: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 120px;
}

.bar-exp {
  flex: 1;
  background: linear-gradient(180deg, #fb7185, #e11d48);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.bar-inc {
  flex: 1;
  background: linear-gradient(180deg, #34d399, #059669);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}

.bar-day {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.cat-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}
.cat-row.clickable {
  cursor: pointer;
}
.cat-row.clickable:hover {
  background: var(--bg-hover);
}
.cat-row:last-child {
  margin-bottom: 0;
}

.pending-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius);
}
.cat-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.cat-track {
  height: 7px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.cat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--sky));
  border-radius: 999px;
}

.currency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.currency-tile {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.currency-tile.clickable {
  cursor: pointer;
}
.currency-tile.clickable:hover {
  background: var(--bg-hover);
  border-color: var(--sky);
  transform: translateY(-1px);
}
.currency-tile-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-dim);
}
.currency-tile:hover .currency-tile-foot .go-hint {
  color: var(--sky);
}

/* ======================== 总控台式清晰总览 Hero 与折叠明细 ======================== */
.hero-card {
  background: linear-gradient(180deg, rgba(21, 30, 46, 0.98) 0%, rgba(15, 23, 38, 0.98) 100%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 20px 22px 16px;
  margin-bottom: 18px;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-net-label {
  font-size: 12px;
  color: var(--text-muted);
}
.hero-net-val {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin: 4px 0 4px;
}
.hero-meta-line {
  font-size: 12px;
  color: var(--text-dim);
}
.hero-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.hero-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.hero-cell.clickable {
  cursor: pointer;
}
.hero-cell.clickable:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.hero-cell .k {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.hero-cell .v {
  font-size: 22px;
  font-weight: 700;
  margin: 5px 0 3px;
}
.hero-cell .sub {
  font-size: 11px;
  color: var(--text-dim);
}
.hero-compose {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.compose-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  padding: 3px 0;
}
.compose-row .k {
  color: var(--text-muted);
}
.compose-row.total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 6px;
  font-weight: 700;
}
.compose-row.total .k {
  color: var(--text);
}

/* 清晰分段切换按钮 */
.seg-tabs {
  display: inline-flex;
  background: #0d1320;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover {
  color: var(--text);
}
.seg-btn.active {
  background: var(--emerald-soft);
  color: var(--emerald);
}

/* 总控台式原地折叠拆解（大头来源 / 分类 / 退款 / 互转） */
details.inline-detail {
  border-top: 1px solid var(--border);
  margin-top: 10px;
}
details.inline-detail > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 2px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sky);
}
details.inline-detail > summary::-webkit-details-marker {
  display: none;
}
details.inline-detail > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.16s ease;
}
details.inline-detail[open] > summary::after {
  transform: rotate(180deg);
}

.breakdown-item {
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.breakdown-item:last-child {
  margin-bottom: 0;
}
.breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.breakdown-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breakdown-amt {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}
.breakdown-track {
  height: 6px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.breakdown-fill-inc {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 999px;
}
.breakdown-fill-exp {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  border-radius: 999px;
}
.breakdown-fill-ref {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 999px;
}
.mini-rows {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 6px;
}
.mini-rows tr {
  cursor: pointer;
  transition: background 0.12s;
}
.mini-rows tr:hover {
  background: rgba(255, 255, 255, 0.05);
}
.mini-rows td {
  padding: 7px 6px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}
.mini-rows tr:last-child td {
  border-bottom: none;
}
.mini-rows .col-date {
  width: 90px;
  color: var(--text-dim);
  white-space: nowrap;
}
.mini-rows .col-amt {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}

/* 可点击账户卡片 */
.account-card {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.account-card:hover {
  background: var(--bg-hover);
  border-color: var(--emerald);
  transform: translateY(-2px);
}
.account-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-dim);
}
.account-card:hover .account-card-foot .go-hint {
  color: var(--emerald);
  font-weight: 600;
}

/* ======================== 侧滑明细钻取抽屉 ======================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.68);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: flex-end;
  z-index: 140;
}
.drawer-backdrop.open {
  display: flex;
}
.drawer {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.45);
}
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 {
  margin: 0;
  font-size: 18px;
}
.drawer-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.drawer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.drawer-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.drawer-stat .k {
  font-size: 11px;
  color: var(--text-muted);
}
.drawer-stat .v {
  font-size: 15px;
  font-weight: 700;
  margin-top: 2px;
}
.drawer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
}
.drawer-footer {
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
}

/* ======================== 最新版采集中心组件 ======================== */
.auto-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.auto-channel-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.shortcut-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, transform 0.12s;
}
.shortcut-card:hover {
  background: rgba(16, 185, 129, 0.14);
  transform: translateY(-1px);
}
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.matrix-table th,
.matrix-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.matrix-table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.badge.purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--violet);
}
.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-summary-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
}

/* ======================== 流水列表 ======================== */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tx-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.tx-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.tx-meta {
  min-width: 0;
  flex: 1;
}

.tx-merchant {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.tx-right {
  text-align: right;
  flex-shrink: 0;
}

.tx-cny {
  font-size: 16px;
  font-weight: 700;
}

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

/* ======================== 标签与按钮 ======================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-muted);
}
.badge.green {
  background: var(--emerald-soft);
  color: var(--emerald);
}
.badge.red {
  background: var(--rose-soft);
  color: var(--rose);
}
.badge.blue {
  background: var(--sky-soft);
  color: var(--sky);
}
.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
}
.btn:hover {
  background: #25334d;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
}
.btn-danger {
  background: var(--rose-soft);
  border-color: rgba(244, 63, 94, 0.35);
  color: var(--rose);
}
.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

/* ======================== 表单控件 ======================== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  background: #0d1320;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--emerald);
}

.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 128px;
}
.filter-bar input[type="text"] {
  flex: 1;
  min-width: 180px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field.full {
  grid-column: 1 / -1;
}
.field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ======================== 子标签页 ======================== */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-btn {
  padding: 9px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--emerald);
  border-bottom-color: var(--emerald);
}

.code-box {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.guide-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.guide-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-steps {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 13px;
}
.guide-steps li {
  margin-bottom: 5px;
}

/* ======================== 弹窗与提示 ======================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 150;
}
.modal-backdrop.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
}

.preview-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 10px;
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1e293b;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 300;
  font-size: 13px;
  max-width: 380px;
  display: none;
}
.toast.show {
  display: block;
}
.toast.success {
  border-color: var(--emerald);
}
.toast.error {
  border-color: var(--rose);
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-muted);
}

/* ======================== 移动端底部导航 ======================== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 90;
  justify-content: space-around;
}

.mobile-nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  cursor: pointer;
  padding: 4px 8px;
}
.mobile-nav button.active {
  color: var(--emerald);
}
.mobile-nav .m-icon {
  font-size: 18px;
}

.fab {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  color: #fff;
  border: none;
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.4);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 960px) {
  .kpi-grid,
  .hero-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-compose {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .main-area {
    margin-left: 0;
    width: 100%;
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
  }
  .mobile-nav {
    display: flex;
  }
  .fab {
    bottom: calc(74px + env(safe-area-inset-bottom));
    right: 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .kpi-value {
    font-size: 21px;
  }
  .hero-net-val {
    font-size: 28px;
  }
  .hero-cell .v {
    font-size: 18px;
  }
  .drawer {
    max-width: 100%;
  }
}
