/* XSHOOW 控制台 — 参考 developers.openai.com 的文档式版式，沿用站点黑白色调 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-hover: #f1f1f2;
  --fg: #0d0d0d;
  --fg-soft: #4b5563;
  --muted: #8f8f8f;
  --border: #e8e8e8;
  --border-strong: #d9d9d9;
  --accent: #2563eb;
  --ok: #0f766e;
  --warn: #b45309;
  --danger: #b91c1c;
  --code-bg: #0d0d0d;
  --code-fg: #f4f4f5;
  --radius: 12px;
  --radius-sm: 8px;
  --top-h: 60px;
  --side-w: 248px;
}

[data-theme="dark"] {
  --bg: #0d0d0d;
  --bg-soft: #161617;
  --bg-hover: #1f1f21;
  --fg: #ededed;
  --fg-soft: #a1a1aa;
  --muted: #71717a;
  --border: #26262a;
  --border-strong: #35353a;
  --accent: #7ea6ff;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --code-bg: #17171a;
  --code-fg: #ededed;
}

* { box-sizing: border-box; }

body.cx {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 顶栏 ---------- */

.cx-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cx-top-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--top-h);
  padding: 0 22px;
}

.cx-brand { display: inline-flex; align-items: center; gap: 9px; }
.cx-logo { width: 26px; height: 26px; }
.cx-brand span { font-size: 16px; font-weight: 650; letter-spacing: .2px; }

.cx-top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--fg-soft);
}

.cx-top-nav a:hover { color: var(--fg); }

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

.cx-user {
  font-size: 13px;
  color: var(--fg-soft);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cx-icon-btn {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s, background-color .16s;
}

.cx-icon-btn:hover { border-color: var(--fg); }

/* ---------- 布局 ---------- */

.cx-body {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--top-h));
}

.cx-side {
  position: sticky;
  top: var(--top-h);
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  height: calc(100vh - var(--top-h));
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--border);
}

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

.cx-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-soft);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .14s, color .14s;
}

.cx-nav-item:hover { background: var(--bg-hover); color: var(--fg); }
.cx-nav-item.is-active { background: var(--bg-hover); color: var(--fg); font-weight: 550; }

.cx-i { width: 18px; height: 18px; flex: none; }

.cx-side-bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.cx-side-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cx-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 60;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .13), 0 2px 6px rgba(15, 23, 42, .07);
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity .18s, transform .18s, visibility .18s;
}

.cx-toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.cx-theme .cx-i-sun { display: none; }
[data-theme="dark"] .cx-theme .cx-i-sun { display: block; }
[data-theme="dark"] .cx-theme .cx-i-moon { display: none; }

/* ---------- 内容区 ---------- */

.cx-main { flex: 1 1 auto; min-width: 0; padding: 34px 40px 72px; }

.cx-page { max-width: 1080px; margin: 0 auto; }

.cx-h1 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -.4px;
}

.cx-sub { margin: 0 0 24px; color: var(--fg-soft); font-size: 14.5px; }
.cx-card + .cx-sub { margin-top: 30px; }

.cx-h2 {
  margin: 30px 0 12px;
  font-size: 16px;
  font-weight: 620;
}
.cx-h1 + .cx-h2 { margin-top: 16px; }

/* 卡片 */

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

.cx-card + .cx-card { margin-top: 14px; }

/* 卡片后的包装层（充值页的支付区 / 汇总区）沿用同一间距：
   中间多一层 div 会让 .cx-card + .cx-card 失效、两张卡贴在一起 */
.cx-card + .cx-block { margin-top: 14px; }

.cx-card-soft { background: var(--bg-soft); }

.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.cx-stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.cx-stat-label { font-size: 13px; color: var(--fg-soft); }
.cx-stat-value { margin-top: 4px; font-size: 22px; font-weight: 620; letter-spacing: -.3px; }
.cx-stat-hint { margin-top: 2px; font-size: 12.5px; color: var(--muted); }

/* 表格 */

.cx-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

.cx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }

.cx-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 550;
  font-size: 12.5px;
  color: var(--fg-soft);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.cx-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-table tbody tr:hover td { background: var(--bg-soft); }

.cx-empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* 表单 */

.cx-field { display: flex; gap: 10px; }

.cx-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}

.cx-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.cx-input::placeholder { color: var(--muted); }

.cx-btn {
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .16s;
}

.cx-btn:hover { opacity: .86; }
.cx-btn:disabled { opacity: .5; cursor: not-allowed; }
a.cx-btn { display: inline-flex; align-items: center; justify-content: center; }

.cx-btn-outline { background: var(--bg); color: var(--fg); border-color: var(--border-strong); }
.cx-btn-outline:hover { opacity: 1; border-color: var(--fg); }

/* 提示条 */

.cx-note {
  display: none;
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--fg);
  font-size: 13.5px;
}

.cx-note.is-show { display: block; }
.cx-note.is-error { border-color: #f0c0c0; color: var(--danger); background: var(--bg-soft); }
.cx-note.is-ok { border-color: var(--border-strong); color: var(--fg); background: var(--bg-soft); }

/* 定义列表 */

.cx-dl { display: grid; grid-template-columns: 150px 1fr; gap: 10px 18px; font-size: 14px; }
.cx-dl dt { color: var(--fg-soft); }
.cx-dl dd { margin: 0; word-break: break-all; }

.cx-muted { color: var(--muted); font-size: 13px; }
.cx-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.cx-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 充值页顶部分类：额度充值 / 订阅购买（撑满整行，两段等分） */
.cx-tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.cx-tab {
  flex: 1;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-soft);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}

.cx-tab:hover { background: var(--bg); color: var(--fg); }

.cx-tab.is-on {
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.cx-pane[hidden] { display: none; }

.cx-loading { padding: 22px 0; color: var(--muted); font-size: 13.5px; }

/* ---------- 用量信息 ---------- */

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

.cx-money-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 15px 20px 17px;
}

.cx-money-label { font-size: 13px; color: var(--fg-soft); }
.cx-money-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.cx-money-value { font-size: 30px; font-weight: 650; letter-spacing: -.8px; }
.cx-money-unit { font-size: 13px; color: var(--muted); margin-right: auto; }
.cx-money-row .cx-btn { height: 36px; padding: 0 17px; font-size: 13.5px; }

.cx-rule { border: 0; border-top: 1px solid var(--border); margin: 26px 0 22px; }

.cx-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cx-filter { display: flex; align-items: center; gap: 8px; }
.cx-filter-label { font-size: 13px; color: var(--fg-soft); }

.cx-select {
  height: 38px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background-color: var(--bg);
  color: var(--fg);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

.cx-select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* 时间维度：下拉面板（预设区间）+ 双月日历（自定义区间） */
.cx-range { position: relative; }

.cx-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background-image: none;
}

.cx-caret { width: 13px; height: 13px; flex: none; opacity: .55; }

.cx-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 0;
  padding: 10px 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .13);
}

.cx-pop[hidden] { display: none; }

.cx-pop-body { display: flex; align-items: stretch; }

.cx-presets { display: flex; flex-direction: column; min-width: 118px; }

.cx-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}

.cx-preset:hover { background: var(--bg-hover); }

.cx-preset.is-on { color: var(--accent); font-weight: 600; }

.cx-preset.is-on::after { content: "✓"; font-size: 12px; }

.cx-cal-wrap {
  display: flex;
  gap: 16px;
  padding-left: 12px;
  margin-left: 6px;
  border-left: 1px solid var(--border);
}

.cx-cal-wrap[hidden] { display: none; }

.cx-cal { width: 208px; }

.cx-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 8px; }

.cx-cal-title { font-size: 13.5px; font-weight: 600; }

.cx-cal-nav {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.cx-cal-nav:hover { background: var(--bg-hover); color: var(--fg); }

.cx-cal-week, .cx-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }

.cx-cal-week span { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0 6px; }

/* 区间整块底色：一行内合并成一条矩形，避免逐格背景之间出现缝隙 */
.cx-cal-band {
  background: var(--bg-hover);
  border-radius: 0;
  pointer-events: none;
}

/* 端点所在行：外侧用与实心圆同半径的圆角封口，色带延伸到圆点处收口，不再露出直角空隙 */
.cx-cal-band.is-start { border-radius: 999px 0 0 999px; }
.cx-cal-band.is-end { border-radius: 0 999px 999px 0; }
.cx-cal-band.is-start.is-end { border-radius: 999px; }

.cx-cal-d {
  position: relative;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg);
  cursor: pointer;
}

.cx-cal-d:hover { background: var(--bg-hover); }

.cx-cal-d.is-out { color: var(--muted); }

/* 底色由整块 .cx-cal-band 负责，单元格本身不再铺底 */
.cx-cal-d.is-in { border-radius: 0; }

.cx-cal-d.is-start, .cx-cal-d.is-end { background: var(--fg); color: var(--bg); font-weight: 600; }

.cx-cal-d.is-start:hover, .cx-cal-d.is-end:hover { background: var(--fg); }

.cx-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 8px 10px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
}

.cx-pop-hint { white-space: nowrap; }

.cx-btn.cx-btn-sm { height: 30px; padding: 0 14px; font-size: 12.5px; }

.cx-filters-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cx-filters-right .cx-btn { height: 38px; padding: 0 22px; font-size: 13.5px; }

.cx-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }

.cx-metric {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 15px 18px 17px;
}

.cx-metric-label { font-size: 13px; color: var(--fg-soft); }
.cx-metric-row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.cx-metric-value { font-size: 25px; font-weight: 650; letter-spacing: -.5px; }
.cx-metric-unit { font-size: 12.5px; color: var(--muted); }

/* API 管理：订阅额度进度条、套餐卡与下单结果 */

/* 订阅额度卡片整宽展示，套餐卡保持多列 */
.cx-subs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cx-plans {
  display: grid;
  /* auto-fit：套餐卡不足一行时铺满卡片宽度，不留下空的列位 */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.cx-sub-card, .cx-plan {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
}

.cx-plan { display: flex; flex-direction: column; }
.cx-plan.is-owned { border-color: var(--fg); }
.cx-plan.is-locked { opacity: .62; }

.cx-sub-head, .cx-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cx-sub-name, .cx-plan-name { font-size: 14.5px; font-weight: 600; }
.cx-plan-price { font-size: 18px; font-weight: 650; letter-spacing: -.4px; }

.cx-sub-tag {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg-soft);
}

.cx-sub-meta, .cx-plan-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.cx-plan-desc { margin: 8px 0 0; font-size: 13px; color: var(--fg-soft); }

.cx-plan-feats {
  margin: 8px 0 0;
  padding-left: 17px;
  font-size: 13px;
  color: var(--fg-soft);
}

.cx-plan-feats li { margin: 2px 0; }

.cx-plan-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 8px; }

/* 额度摘要行：每日 / 每周 / 每月 */
.cx-sub-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.cx-sub-limits b { font-weight: 600; color: var(--fg); }

.cx-quota { margin-top: 12px; }

.cx-quota-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-soft);
}

.cx-quota-head b { font-weight: 600; color: var(--fg); }

.cx-quota-bar {
  height: 6px;
  margin: 5px 0 4px;
  border-radius: 999px;
  background: var(--bg-hover);
  overflow: hidden;
}

.cx-quota-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--fg);
}

.cx-quota-bar i.is-warn { background: var(--warn); }
.cx-quota-bar i.is-full { width: 100%; background: var(--border-strong); }

.cx-quota-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.cx-quota-foot span:only-child { margin-left: auto; }

.cx-buy-result { margin-top: 10px; }
.cx-buy-result:empty { display: none; }

/* 柱状图 */

.cx-chart-card { margin-top: 14px; padding: 18px 20px 20px; }
.cx-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cx-chart-title { font-size: 14px; color: var(--fg-soft); }
.cx-chart-total { margin-left: 8px; font-size: 14px; font-weight: 620; }
.cx-chart { display: flex; gap: 10px; height: 286px; margin-top: 22px; }

.cx-chart-card [data-chart] { min-height: 322px; display: flex; flex-direction: column; justify-content: center; }

.cx-chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
  width: 42px;
  text-align: right;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cx-chart-y span:first-child { transform: translateY(-1px); }
.cx-chart-y span:last-child { transform: translateY(1px); }

.cx-chart-plot { position: relative; flex: 1 1 auto; min-width: 0; }
.cx-chart-lines { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; }
.cx-chart-lines i { border-top: 1px solid var(--border); }
.cx-chart-lines i:first-child { border-top-color: var(--border-strong); }

.cx-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 0 1px;
  overflow-x: auto;
  overflow-y: hidden;
}

.cx-bar-col { flex: 1 1 0; min-width: 5px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cx-bar {
  width: 100%;
  max-width: 12px;
  min-height: 3px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: filter .14s;
}
.cx-bar-col:hover .cx-bar { filter: brightness(.88); }

/* hover：柱心虚线 + 数值卡片 */
.cx-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 0;
  border-left: 1px dashed var(--border-strong);
  pointer-events: none;
}
.cx-guide[hidden] { display: none; }

.cx-tip {
  position: absolute;
  z-index: 3;
  min-width: 168px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .13), 0 2px 6px rgba(15, 23, 42, .07);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg);
  pointer-events: none;
}
.cx-tip[hidden] { display: none; }
.cx-tip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.cx-tip-head span { color: var(--fg-soft); }
.cx-tip-head b { font-weight: 620; font-variant-numeric: tabular-nums; }
.cx-tip-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cx-tip-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--fg-soft); }
.cx-tip-row b { color: var(--fg); font-weight: 550; font-variant-numeric: tabular-nums; }
.cx-tip-name { display: inline-flex; align-items: center; }
.cx-tip-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 7px; }

.cx-chart-x { display: flex; gap: 5px; margin: 8px 0 0 52px; font-size: 11px; color: var(--muted); }
.cx-chart-x span { flex: 1 1 0; min-width: 6px; text-align: center; white-space: nowrap; overflow: hidden; }

.cx-chart-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.cx-chart-none {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  color: var(--muted);
}

.cx-detail-card { margin-top: 14px; }
.cx-detail-body { margin-top: 14px; }

/* ---------- 充值 ---------- */

.cx-account-name { margin-top: 4px; font-size: 16px; font-weight: 600; }

.cx-form-label { display: block; margin-bottom: 9px; font-size: 13px; color: var(--fg-soft); }
.cx-form-label-gap { margin-top: 16px; }

.cx-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.cx-chip {
  height: 46px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .16s, color .16s;
}

.cx-chip:hover { border-color: var(--fg); }
.cx-chip.is-on { border-color: var(--accent); color: var(--accent); }

.cx-amount-input { position: relative; }
.cx-amount-symbol {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
}

.cx-amount-input .cx-input { width: 100%; height: 46px; padding-left: 32px; font-size: 16px; }
.cx-amount-error { margin: 8px 0 0; }
.cx-amount-hint { margin: 10px 0 0; }
.cx-amount-error:empty { display: none; }

.cx-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

.cx-method {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  height: 54px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s;
}

.cx-method:hover:not(:disabled) { border-color: var(--fg); }
.cx-method.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cx-method:disabled { opacity: .45; cursor: not-allowed; }
.cx-method-fee { font-size: 11.5px; font-weight: 400; color: var(--muted); }

.cx-sum-host { margin-top: 16px; }
.cx-sum { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.cx-sum-row { display: flex; justify-content: space-between; gap: 14px; }
.cx-sum-row > span:first-child { color: var(--fg-soft); }
.cx-sum-total { border-top: 1px solid var(--border); padding-top: 10px; font-weight: 550; }
.cx-sum-amount { font-size: 19px; font-weight: 650; color: var(--accent); }
.cx-sum-note { margin: 2px 0 0; }

.cx-btn-block { width: 100%; height: 46px; margin-top: 14px; font-size: 15px; }

.cx-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; }
.cx-qr img { width: 200px; height: 200px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cx-qr p { margin: 0; }

/* ---------- 窄屏 ---------- */

/* 中等宽度：压缩侧栏与内边距，避免内容区被挤到过窄 */
@media (max-width: 1080px) {
  :root { --side-w: 212px; }
  .cx-main { padding: 28px 26px 64px; }
}

@media (max-width: 860px) {
  .cx-body { flex-direction: column; align-items: stretch; }
  .cx-side {
    position: static;
    width: 100%;
    flex: none;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
  }
  .cx-nav { flex-direction: row; flex-wrap: wrap; }
  .cx-nav-item { height: 34px; }
  .cx-side-foot { margin-top: 10px; padding-top: 10px; }
  .cx-main { width: 100%; padding: 22px 18px 60px; }
  .cx-duo, .cx-trio { grid-template-columns: 1fr; }
  .cx-subs, .cx-plans { grid-template-columns: 1fr; }
  .cx-money-value { font-size: 26px; }
  .cx-chart-y { width: 34px; }
  .cx-chart-x { margin-left: 44px; }
  .cx-top-nav { display: none; }
  .cx-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-pop { left: auto; right: 0; }
  .cx-pop-body { flex-direction: column; }
  .cx-cal-wrap {
    padding-left: 0;
    margin-left: 0;
    padding-top: 10px;
    margin-top: 8px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .cx-methods { grid-template-columns: 1fr; }
  .cx-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .cx-dl dt { margin-top: 8px; }
}

/* 手机宽度：进一步压缩留白与图表密度，避免横向滚动 */
@media (max-width: 560px) {
  .cx-top-inner { gap: 12px; padding: 0 14px; }
  .cx-user { max-width: 130px; }
  .cx-main { padding: 18px 14px 56px; }
  .cx-h1 { font-size: 23px; }
  .cx-card { padding: 16px 15px; }
  .cx-money-value { font-size: 24px; }
  .cx-money-row { flex-wrap: wrap; }
  .cx-chart { height: 190px; margin-top: 16px; gap: 6px; }
  .cx-chart-card [data-chart] { min-height: 232px; }
  .cx-chart-card { padding: 16px 14px 18px; }
  .cx-chart-y { width: 30px; }
  .cx-chart-x { margin-left: 36px; gap: 2px; }
  .cx-bars { gap: 2px; }
  .cx-bar-col { min-width: 4px; }
  .cx-bar { max-width: 8px; border-radius: 3px 3px 0 0; }
  .cx-tip { min-width: 150px; font-size: 12px; }
  .cx-chart-x span { min-width: 4px; }
  .cx-table { font-size: 12.5px; }
  .cx-table th, .cx-table td { padding: 9px 10px; }
  .cx-filters-right { margin-left: 0; width: 100%; }
  .cx-filters-right .cx-btn { width: 100%; }
  .cx-cal-wrap { flex-wrap: wrap; gap: 12px; }
  .cx-cal { width: 100%; min-width: 196px; }
  .cx-pop { padding: 8px 8px 6px; }
  .cx-pop-hint { white-space: normal; }
  .cx-qr img { width: 100%; max-width: 200px; height: auto; }
  .cx-tab { padding: 0 12px; font-size: 14px; }
}

/* ---------- 支付弹窗 ---------- */

.cx-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cx-modal[hidden] { display: none; }

.cx-modal-mask { position: absolute; inset: 0; background: rgba(13, 13, 13, .48); }
[data-theme="dark"] .cx-modal-mask { background: rgba(0, 0, 0, .62); }

.cx-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(13, 13, 13, .18);
  padding: 22px 20px 20px;
}

.cx-modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.cx-modal-x:hover { background: var(--bg-hover); color: var(--fg); }

.cx-modal-title { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.cx-modal-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.cx-modal-sub[hidden] { display: none; }

.cx-modal-rows { margin: 0 0 14px; border-top: 1px solid var(--border); }
.cx-modal-rows[hidden] { display: none; }
.cx-modal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cx-modal-row > span:first-child { color: var(--fg-soft); }
.cx-modal-row > span:last-child { font-weight: 500; word-break: break-all; text-align: right; }

.cx-modal-qr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cx-modal-qr canvas,
.cx-modal-qr img {
  width: 200px;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
}
.cx-modal-qr p { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }

.cx-payload {
  margin: 0;
  width: 100%;
  word-break: break-all;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  color: var(--fg-soft);
}

.cx-modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.cx-modal-foot .cx-btn { flex: 1; }

@media (max-width: 560px) {
  .cx-modal-card { max-width: none; padding: 20px 16px 16px; }
  .cx-modal-qr canvas,
  .cx-modal-qr img { width: 100%; max-width: 220px; height: auto; }
}
