/* 虚拟卡网 — 明亮专业风格样式表
   设计原则：
   1. 白底 + 深色文字，清楚明亮，长辈客户也能一眼看懂
   2. 只用一套色板与间距，任何新页面直接复用，不各写一套
   3. 表单元素必须有清楚的聚焦态与错误态（钱的操作不能靠猜）
   4. 手机优先：375px 宽也能正常使用
*/

:root {
  --bg: #f5f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.20);

  --text: #0f172a;
  --text-muted: #55637a;
  --text-dim: #8592a8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.10);
  --success: #059669;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.07);
  --warning: #d97706;

  --radius: 14px;
  --radius-sm: 10px;
  --gap: 18px;
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 50% -220px, rgba(37, 99, 235, 0.10), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
  color: #f8fafc;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a, .nav-links button {
  color: var(--text-muted);
  font-size: 14px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  text-decoration: none;
}

/* ---------- 布局 ---------- */
.main { flex: 1; }
.container { max-width: 1080px; margin: 0 auto; padding: 40px 20px 64px; }
.container--narrow { max-width: 460px; }

.page-head { margin-bottom: 24px; }
h1 { font-size: 26px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--text-muted); font-size: 14px; }
.dim { color: var(--text-dim); font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: var(--gap); }
.card--flat { box-shadow: none; background: var(--surface-2); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--text-dim); }
input:hover { border-color: #94a3b8; }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .06s ease, opacity .15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 禁用分两种：永久不可用（例如冻结中的卡不能充值）给「禁止」光标；
   只有真的在提交时才用转圈光标，否则客户会以为页面卡住了（2026-11-19 用户反馈） */
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn[disabled].is-busy { cursor: progress; }
.btn--ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--inline { width: auto; }
/* 按钮文字一律不换行：2026-11-23 用户手机截图「快速充值」被挤成「快速充 值」两行 */
.btn { white-space: nowrap; }
/* 危险动作（删除）：只有悬停/聚焦时才变红，平时与普通按钮一致 */
.btn--danger { color: #be1e2d; border-color: rgba(190, 30, 45, .45); }
.btn--danger:hover { background: rgba(190, 30, 45, .06); border-color: #be1e2d; }
/* 当前唯一可做的动作（激活已冻结的卡）:描边用主色 */
.btn--accent { color: var(--accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-soft); }
/* 不可用：虚线灰框 + 禁用光标，与可点按钮区分开 */
.btn--off { color: var(--text-dim); border-style: dashed; cursor: not-allowed; }
.btn--off:hover { background: #fff; }

/* ---------- 提示 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert--error { background: var(--danger-soft); border-color: rgba(220,38,38,.25); color: #991b1b; }
.alert--ok { background: rgba(5,150,105,.08); border-color: rgba(5,150,105,.25); color: #065f46; }
.alert--info { background: var(--accent-soft); border-color: rgba(37,99,235,.22); color: #1e40af; }

/* ---------- 首页 hero ---------- */
.hero { padding: 16px 0 6px; }
.hero h1 { font-size: 34px; }
.hero p { color: var(--text-muted); max-width: 620px; font-size: 16px; }

.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.feature h3 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---------- 数据面板（预留） ---------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12px; color: var(--text-muted); letter-spacing: .02em; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-value--empty { color: var(--text-dim); font-size: 15px; font-weight: 500; }
.stat-note { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* ---------- 状态徽标 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: #fff;
  /* 徽章不换行：否则窄列里「USDT 充值」会被拆成两行或压到相邻列 */
  white-space: nowrap;
}
.badge--ok { color: #065f46; border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.08); }
.badge--warn { color: #92400e; border-color: rgba(217,119,6,.3); background: rgba(217,119,6,.08); }
.is-critical { color: #be1e2d; font-weight: 600; }
.badge--bad { color: #be1e2d; border-color: rgba(190,30,45,.3); background: rgba(190,30,45,.08); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  background: rgba(255,255,255,.6);
}
.footer .dot { opacity: .4; margin: 0 8px; }

/* ---------- 小工具 ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.sep { height: 1px; background: var(--border); margin: 22px 0; }
.center { text-align: center; }

@media (max-width: 560px) {
  .container { padding: 26px 16px 48px; }
  .hero h1 { font-size: 27px; }
  .card { padding: 20px 16px; }
  .nav-inner { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 标签页（登录方式切换） ---------- */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.tab {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab-panel[hidden] { display: none; }

/* ---------- 宽版容器（多区块的账户页用，桌面端不再像手机） ---------- */
.container--wide { max-width: 880px; }
.container--full { max-width: none; }

/* 多个安全区块并排：宽屏两列，窄屏自动一列 */
.section-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-items: start;
}
/* auto-fit 的 340px 是**最小列宽**：窗口比它窄时整行会溢出、右边被切掉
   （2026-11-24 实测 340px 窗口中招，首页四张卡片一起被切）。
   窄于这个宽度时强制一列，按容器宽度走。 */
@media (max-width: 380px) {
  .section-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 区块小标题带一条分隔线，视觉上把"账户状态/安全设置"分开 */
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 表格在窄屏可以横向滚动，而不是把页面撑破 */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 420px; }
/* 充值订单表：表头不换行（列多，压缩会把「$ 50.00」拆成两行） */
.usdt-table th { white-space: nowrap; }

/* 管理员操作记录表：表头不许按字拆行（列一窄就变成一列一个字，2026-11-23 用户截图） */
.audit-table th { white-space: nowrap; }

/* 表格里的行更紧凑一点 */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 8px 6px; }
.data-table td { padding: 10px 6px; border-top: 1px solid var(--border); }
.data-table td.num { font-variant-numeric: tabular-nums; }

/* 表单在宽版里不要把按钮拉满整行 */
.card .btn--inline { width: auto; min-width: 140px; }

/* ---------- 密码显示/隐藏 ---------- */
.password-wrap { position: relative; }
.password-wrap input[type="password"],
.password-wrap input[type="text"] { padding-right: 62px; }
.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- 个人信息页专用排版 ---------- */
.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.avatar {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .5px;
}
.identity-text h1 { margin: 0; font-size: 22px; }
.identity-text .muted { margin: 2px 0 0; font-size: 13px; }
/* 徽章紧跟「个人信息 / 邮箱」之后，不再推到最右边（用户 2026-11-21 反馈离得太远） */
.identity-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; }

/* 概览卡片：更紧凑，数字更突出 */
.stat--compact { padding: 16px 18px; }
.stat--compact .stat-value { font-size: 22px; }
.stat--compact .stat-value.small { font-size: 15px; font-weight: 600; }

/* 统计卡片「左右分栏」变体（2026-11-24 用户要求：右侧卡头列表与左边标题顶端齐平）。
   用 grid 让右栏从卡片内容顶端开始，而不是跟着大数字往下走。 */
.stat--split { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: start; }
.stat--split__list {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.45; color: var(--text-dim);
  text-align: right; white-space: nowrap;
}
/* 只有真的放不下才退回上下排列。
   2026-11-24 用户截图：560px 的门槛太保守，一般手机/窄窗口其实并排放得下，
   结果被提前改成上下排，看着像没生效。实测「数字 + 6 行卡头」约 200px 就够。 */
@media (max-width: 300px) {
  .stat--split { grid-template-columns: minmax(0, 1fr); }
  .stat--split__list { text-align: left; margin-top: 8px; }
}

/* 两列布局：桌面固定两列，手机/平板竖屏一列（比 auto-fit 更可控）。
   2026-11-24 iPad 截图：断点原来是 720px，iPad 竖屏（810/834px）仍分两列，
   每列约 380px，5 列的数据表放不下被切成碎片 → 提高到 1000px（平板竖屏一律单列）。 */
.two-col { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

/* 卡片标题统一：标题 + 右侧状态 */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 700; }

/* 表单在卡片里更紧凑 */
.card form .field:last-of-type { margin-bottom: 14px; }

/* ---------- 可折叠区块（默认收起，点击展开） ---------- */
.fold > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  min-width: 140px;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: background .15s ease;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "▾";
  font-size: 12px;
  opacity: .55;
  transition: transform .15s ease;
}
.fold[open] > summary::after { transform: rotate(180deg); }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold[open] > summary { margin-bottom: 16px; }
.fold .fold-body { padding-top: 4px; }

/* ---------- 数据表格（交易/流水类列表用） ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 后台正文里的表头一律不按字拆行（手机上一挤就变成一列一个字，2026-11-23 用户截图） */
.admin-main th { white-space: nowrap; }
/* 后台宽表格（2026-11-23 管理员管理页手机截图：表头被挤成一列一个字、按钮被切掉）：
   表头与格子默认不拆行，整表放不下时在卡片内左右滑动；确实要换行的格子加 .allow-wrap。 */
.admin-table th { white-space: nowrap; }
.admin-table td { white-space: nowrap; }
.admin-table td.allow-wrap { white-space: normal; word-break: break-word; }
/* 手机上给宽表一句「左右滑动」提示（只在窄屏显示，桌面不出现） */
.table-hint { display: none; }
@media (max-width: 560px) {
  .table-hint { display: block; font-size: 12px; color: var(--text-dim); margin: 0 0 6px; }
}
.data-table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left; color: var(--text-muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  padding: 10px 12px;
}
.data-table td { padding: 12px; white-space: nowrap; vertical-align: middle; }
.data-table tbody tr { border-top: 1px solid var(--border); }
.data-table tbody tr:hover { background: rgba(15, 23, 42, .02); }
.data-table .num {
  text-align: right; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.data-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.data-table .muted-cell { color: var(--text-dim); }
.data-table .merchant {
  display: inline-block; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: bottom;
}
.txn-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.txn-badge--auth { background: #fef3c7; color: #92400e; }
.txn-badge--posted { background: #dcfce7; color: #166534; }
.txn-badge--declined { background: #fee2e2; color: #991b1b; }
.txn-badge--credit { background: #dbeafe; color: #1e40af; }
.txn-badge--other { background: #f1f5f9; color: #334155; }

/* ---------- 我的卡片列表（横排卡片，参考图版式） ---------- */
.card-rows {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
/* 宽屏三段并列：卡名+卡号 | 四个数字 | 六个按钮（用户 2026-11-20 要求并列显示）。
   为什么不再把全部内容塞一行：卡号会被压到 100px 以内、后四位变省略号；
   所以「卡名+卡号」自己占一列、「四个数字」占一列，各自可以换行，互不挤压。 */
.card-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  grid-template-areas: "id metrics actions";
  align-items: center;
  gap: 12px 12px;
  padding: 16px 14px;
  border-top: 1px solid var(--border);
}
.card-row:first-child { border-top: none; }

.card-id { grid-area: id; min-width: 0; }
/* 卡名与状态同一行：状态紧跟在名字后面，不再飘在中间 */
.card-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-name {
  font-size: 19px; font-weight: 700; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-note { margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.card-meta {
  margin-top: 6px; font-size: 13.5px; color: var(--text-dim);
  /* 绝不截断：卡号后四位是客户认卡的唯一线索，宁可换行也不能变成省略号 */
  overflow-wrap: anywhere;
}

/* 四个数字用固定宽度 + 等分列：每行都是同一个宽度，跨行才对得齐（用户 2026-11-20 指出时间列没对齐） */
.card-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 372px;
}
.card-state { grid-area: state; text-align: left; }

.metric { text-align: left; }
.metric--right { text-align: right; }
.metric-label { font-size: 12px; color: var(--text-dim); }
.metric-value {
  margin-top: 4px; font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.metric-value .unit { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.metric-sub { margin-top: 4px; font-size: 12px; color: var(--text-dim); }

.pill {
  display: inline-block; padding: 5px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  /* 徽章文字绝不在词中间断行（2026-11-23 用户截图：「已删除」被挤成「已删 / 除」） */
  white-space: nowrap; text-align: center; line-height: 1.25;
}
.pill--ok { background: rgba(5, 150, 105, .1); color: #047857; }
.pill--warn { background: rgba(217, 119, 6, .12); color: #b45309; }
.pill--dim { background: var(--surface-2); color: var(--text-muted); }
.pill--bad { background: rgba(190, 30, 45, .12); color: #be1e2d; }
/* 「上游封卡（欺诈/被盗）」是最长的状态：主动断成两行 + 字号收一档，
   宽度正好落进 68px 的状态格，不会顶到右边的按钮（2026-11-23） */
.card-state .pill--bad { font-size: 12px; padding: 4px 8px; }
/* 卡头（BIN）标记：等宽字 + 品牌蓝，让客户一眼看出这张卡属于哪个卡段 */
.pill--bin {
  background: var(--accent-soft); color: var(--accent-hover);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .6px;
}

/* 卡片操作一律用文字按钮：一排六个，窄屏自动换行，不压缩其他列 */
.card-buttons .btn { flex: 0 0 auto; white-space: nowrap; font-size: 12px; padding: 5px 8px; }
.card-actions {
  grid-area: actions;
  display: flex; align-items: center; gap: 10px;
  justify-content: flex-start; flex-wrap: nowrap;
}
/* 状态单独占固定宽度的一格：每行的胶囊都落在同一 X 位置（用户 2026-11-20 要求）。
   68px 是实测值：三个字的徽章（已删除 / 开卡中 / 删除中）要 65px，64px 会差 1px 把词挤断。 */
.card-state { flex: 0 0 68px; }
.card-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.icon-form { display: inline-flex; }

/* 中等宽度：按钮放不下就和资料分两行，按钮从左边起 */
@media (max-width: 1180px) {
  .card-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "id metrics"
      "state actions";
    gap: 12px 18px;
  }
  .card-actions { justify-content: flex-start; flex-wrap: wrap; }
  .card-buttons { flex-wrap: wrap; }
  /* 批量模式同样先拆成两行，不要让勾选列把资料挤窄 */
  .card-rows.batch-mode .card-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas:
      "check id metrics"
      "check state actions";
  }
}

/* 窄屏：全部竖排 */
@media (max-width: 820px) {
  .card-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "id"
      "metrics"
      "state"
      "actions";
    row-gap: 12px;
  }
  .card-metrics { gap: 20px; width: auto; }
}

@media (max-width: 560px) {
  .card-row { gap: 10px 16px; padding: 14px; }
  .card-name { font-size: 17px; }
  .card-meta { font-size: 12.5px; }
  .card-actions { gap: 6px; }
  .card-metrics { gap: 16px; }
}

/* ---------- 卡片操作弹窗（充值 / 减少余额） ---------- */
.op-dialog {
  border: 0;
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.op-dialog::backdrop { background: rgba(15, 23, 42, .45); }
.op-form { padding: 26px 26px 24px; }

.op-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.op-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.op-close {
  border: 0; background: none; cursor: pointer; padding: 2px 6px;
  font-size: 26px; line-height: 1; color: var(--text-dim); font-family: inherit;
}
.op-close:hover { color: var(--text); }

.op-sub { margin: 8px 0 18px; color: var(--text-muted); font-size: 14px; }
.op-sub.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.op-summary {
  background: #fdf8f3;
  border: 1px solid #f3e9df;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.op-summary > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 6px 0; font-size: 14.5px; color: var(--text-muted);
}
.op-summary strong {
  font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.op-summary--fees > div { color: var(--text-muted); }
.op-summary .op-total {
  border-top: 1px solid #ece0d3; margin-top: 6px; padding-top: 12px;
  color: var(--text); font-weight: 600;
}
.op-summary .op-total strong { font-size: 16px; }

.op-field { margin: 6px 0 18px; }
.op-field label {
  display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 10px;
}
.op-field input {
  width: 100%; box-sizing: border-box;
  padding: 18px 20px; font-size: 24px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1.5px solid #ddd6fe; border-radius: 18px;
  background: var(--surface); color: var(--text); font-family: inherit;
}
.op-field input::placeholder { color: #c4b5fd; font-weight: 400; }
.op-field input:focus {
  outline: none; border-color: #7c3aed; box-shadow: 0 0 0 4px rgba(124, 58, 237, .12);
}
.op-field input:disabled { background: var(--surface-2); color: var(--text-dim); }

.op-hint { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.op-warn {
  margin: 10px 0 0; padding: 10px 14px; border-radius: 12px;
  background: #fdf6e3; border: 1px solid #f6e3b4; color: #8a5a00;
  font-size: 13px; line-height: 1.6;
}

.op-submit {
  width: 100%; margin-top: 6px; padding: 16px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: #5b21b6; color: #fff;
  font-size: 16px; font-weight: 700; font-family: inherit;
  transition: background .15s, opacity .15s;
}
.op-submit:hover { background: #4c1d95; }
.op-submit:disabled { background: #c4b5fd; cursor: not-allowed; }

@media (max-width: 560px) {
  .op-form { padding: 20px 18px; }
  .op-field input { font-size: 20px; padding: 14px 16px; }
}

/* ---------- 查看卡号：二次验证 / 卡资料弹窗 ---------- */
.op-resend { padding: 0 26px 22px; margin: 0; }
.op-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 14px; font-family: inherit; text-decoration: underline;
}

.secret-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.secret-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.secret-item {
  position: relative;
  background: #fdf8f3; border: 1px solid #f3e9df; border-radius: 16px;
  padding: 14px 18px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.secret-label { font-size: 12px; color: var(--text-dim); }
.secret-value {
  font-size: 20px; font-weight: 700; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.secret-value.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.icon-copy {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid #ddd6fe; background: var(--surface); color: #7c3aed;
  cursor: pointer; padding: 0;
}
.icon-copy svg { width: 18px; height: 18px; }
.icon-copy:hover { background: #f5f3ff; }
.icon-copy--done { border-color: #10b981; color: #047857; background: #ecfdf5; }

@media (max-width: 560px) {
  .secret-row { grid-template-columns: 1fr; }
  .secret-value { font-size: 17px; }
  .secret-item--wide .secret-value { padding-right: 42px; }
}

/* ---------- 我的卡片：页签 / 搜索 / 批量操作 ---------- */
.cards-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  display: inline-block; padding: 9px 20px; border-radius: 999px;
  white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px; text-decoration: none;
}
.tab:hover { border-color: var(--border-strong); color: var(--text); }
.tab.is-active {
  background: #4c1d95; border-color: #4c1d95; color: #fff; font-weight: 600;
}
.cards-search { margin-left: auto; }
.cards-search input {
  width: 220px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 14px; font-family: inherit; color: var(--text);
}
.cards-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.batch-toggle { border-radius: 999px; }

/* 多选框：只有进入批量模式才占位置 */
.row-check { display: none; align-items: center; justify-content: center; }
.row-check input {
  width: 20px; height: 20px; accent-color: #7c3aed; cursor: pointer;
}
.card-rows.batch-mode .card-row {
  grid-template-columns: 28px minmax(150px, 1fr) auto 96px auto;
  grid-template-areas: "check id metrics state actions";
}
.card-rows.batch-mode .row-check { display: flex; grid-area: check; align-self: start; }

/* 底部悬浮操作条 */
.batch-bar {
  position: fixed; right: 28px; bottom: 28px; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  background: #1f1b3a; color: #fff;
  padding: 14px 22px; border-radius: 999px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .35);
  font-size: 14px;
}
.batch-bar[hidden] { display: none; }
.batch-count strong { font-variant-numeric: tabular-nums; }
.batch-action {
  border: 0; background: none; cursor: pointer; padding: 0;
  color: #e9e5ff; font-size: 14px; font-family: inherit;
}
.batch-action:hover { color: #fff; text-decoration: underline; }
.batch-action--danger {
  background: #b91c1c; color: #fff; padding: 8px 16px; border-radius: 999px;
  font-weight: 600;
}
.batch-action--danger:hover { background: #991b1b; text-decoration: none; }

@media (max-width: 1200px) {
  .cards-search { margin-left: 0; width: 100%; }
  .cards-search input { width: 100%; box-sizing: border-box; }
  .batch-bar { left: 16px; right: 16px; bottom: 16px; justify-content: space-between; gap: 10px; }
}

@media (max-width: 820px) {
  .card-rows.batch-mode .card-row {
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-areas:
      "check id"
      "check metrics"
      "check state"
      "check actions";
  }
}

/* 批量操作条：冻结是默认动作（实心主色），销卡是危险动作 */
.batch-action--primary {
  background: #5b21b6; color: #fff;
  padding: 8px 16px; border-radius: 999px; font-weight: 600;
}
.batch-action--primary:hover { background: #4c1d95; text-decoration: none; color: #fff; }

/* 状态标签：放在卡名右侧，长文案换行而不是把整行挤歪 */
.card-state { max-width: 180px; }
.state-reason { line-height: 1.45; overflow-wrap: anywhere; }

/* 文本类输入（备注 / 地址）用小号字，不用金额那种大字 */
.op-field--text input { font-size: 15px; padding: 12px 16px; font-weight: 500; }

/* 卡片操作按钮组（详情页：两个按钮一行） */
.op-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* 消费记录 / 操作记录切换（本站主色） */
.op-tabs { display: flex; gap: 8px; margin: 18px 0 12px; }
.op-tab {
  padding: 9px 20px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 14px; font-family: inherit;
}
.op-tab:hover { color: var(--text); }
.op-tab.is-active {
  background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600;
}

/* 弹窗主按钮改用本站主色（原来是紫色） */
.op-submit { background: #2563eb; }
.op-submit:hover { background: #1d4ed8; }
.op-submit:disabled { background: #bfdbfe; }
.icon-copy { border-color: #bfdbfe; color: #2563eb; }
.icon-copy:hover { background: #eff6ff; }
.op-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.op-field input { border-color: #dbeafe; }
.op-field input::placeholder { color: #93c5fd; }
.batch-action--primary { background: #2563eb; }
.batch-action--primary:hover { background: #1d4ed8; }

/* 备注按钮：长文本截断，不把网格撑高 */
.note-btn {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block;
}
/* CVC 旁的小「查看」链接 */
.link-look { margin-left: 8px; padding: 4px 12px !important; font-size: 13px; }
/* 列表里各指标列垂直对齐一致（每行内部按列对齐） */
.card-metrics { align-items: stretch; }
.metric { display: flex; flex-direction: column; justify-content: center; }

/* 详情页卡片操作：三个按钮并排 */
.op-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.op-buttons .btn, .op-buttons-inline .btn { width: auto; }
.op-buttons-inline { margin: 0 0 12px; }

/* 列表右侧数值比卡片名小一档、也更轻，避免和卡片名抢视觉 */
.metric-value { font-size: 15px; font-weight: 500; }
.metric-label { font-size: 12px; }
.card-name { font-size: 18px; }

/* 详情页：左边信息网格 + 右边操作按钮 */
.detail-top { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px; }
.detail-actions { display: flex; flex-direction: column; gap: 10px; align-self: center; }
.detail-actions .btn { width: 100%; }
.detail-actions form { margin: 0; }
@media (max-width: 900px) {
  .detail-top { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: row; flex-wrap: wrap; }
  .detail-actions .btn { width: auto; }
}

/* 卡片名称（备注）不用粗体，避免和右侧数值抢视觉 */
.card-name { font-weight: 500; }

/* 页面标题行：标题 + 右侧操作按钮 */
.page-head-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head-row h1 { margin: 0; }

/* 数据面板右上角的小按钮（快速充值） */
.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* 工单页：可直接点选的未入账订单 */
.claim-order-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.claim-order {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: inherit; text-decoration: none; font-size: 14px;
}
.claim-order:hover { border-color: var(--accent); }

/* ---------- 系统与安全：安全加固 / 安全事件 / 网站体检 / 服务器健康度 ---------- */
/* 检查项左侧的状态点：绿=正常 橙=值得注意 红=有问题 灰=读不到 */
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 7px;
  background: var(--text-dim);
}
.status-dot--good { background: #059669; }
.status-dot--warn { background: #d97706; }
.status-dot--bad  { background: #dc2626; }
.status-dot--unknown { background: #9ca3af; }

.check-list { display: flex; flex-direction: column; }
.check-item {
  display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border);
}
.check-item:first-child { border-top: none; }
.check-main { flex: 1; min-width: 0; }
.check-name { font-weight: 600; font-size: 14px; }
.check-value { font-size: 14px; }
.check-detail { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.55; }

.risk {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); margin-bottom: 10px; font-size: 14px;
}
.risk--high { border-color: rgba(220,38,38,.3); background: rgba(220,38,38,.05); }
.risk--medium { border-color: rgba(217,119,6,.3); background: rgba(217,119,6,.05); }
.risk--ok { border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.05); }
.risk-title { font-weight: 600; }
.risk-detail { color: var(--text-muted); font-size: 13px; margin-top: 2px; line-height: 1.55; }

.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter > span.meter--warn { background: #d97706; }
.meter > span.meter--bad { background: #dc2626; }

/* 两列布局里的卡片必须允许收缩，否则长表格会把整页撑宽（手机上一屏只能左右拖动）。
   .data-table 的 980px 最小宽度是给整页宽表格用的，窄栏里必须让位并允许换行。 */
.two-col > * { min-width: 0; }
.two-col .data-table { width: 100%; min-width: 0; table-layout: fixed; }
.two-col .data-table th,
.two-col .data-table td { white-space: normal; word-break: break-word; }
/* 接口耗时表（「最慢的页面」）：等分列宽会把「毫秒」挤成「毫 / 秒」两行。
   改成按内容分配列宽；数字与单位不拆行；放不下时在栏内横向滑（2026-11-23）。
   2026-11-24 iPad 截图补充：这张表已改成整行独占（模板里移出两栏），
   并把最小宽度从 980px 降到 520px——980 是为宽列表设计的，
   会让 iPad 一进页面就得左右滑。路径整行不拆，表格按内容自然撑开。 */
.table-wrap table.perf-table { table-layout: auto; min-width: 520px; }
.perf-table th, .perf-table td.num, .perf-table td:first-child { white-space: nowrap; }
/* 网站体检页里列很少的表（2～3 列）：980px 的最小宽度是为宽列表定的，
   在这里只会让 iPad 一进页面就得左右滑 → 按内容自适应。 */
.data-table.wt-narrow { min-width: 0; }
/* 「异常 IP（按建议处理）」表：整页是 system-page 样式（单元格默认任意断字），
   会把 IP 拆成两行、表头「次数」拆成「次 / 数」。这里恢复不拆行，
   只有标了 .allow-wrap 的两列（它做了什么 / 建议）允许换行。 */
/* 宽屏要有足够宽度，窄屏由下面的媒体查询改成一列（不能用行内 style，媒体查询压不住行内样式） */
.system-page .data-table.wt-anomaly { min-width: 980px; }
.system-page .data-table.wt-anomaly th,
.system-page .data-table.wt-anomaly td { white-space: nowrap; overflow-wrap: normal; }
.system-page .data-table.wt-anomaly td.allow-wrap { white-space: normal; overflow-wrap: anywhere; }
/* 平板/手机（≤1000px）：这张表改成「一条一块」竖排，每格前面带小标题。
   5 列在 780px 里怎么分都不够读，横向滑动又容易漏掉「建议」那一列。 */
@media (max-width: 1000px) {
  .system-page .data-table.wt-anomaly { min-width: 0; }
  .system-page .data-table.wt-anomaly thead { display: none; }
  .system-page .data-table.wt-anomaly,
  .system-page .data-table.wt-anomaly tbody,
  .system-page .data-table.wt-anomaly tr,
  .system-page .data-table.wt-anomaly td {
    display: block; width: auto; min-width: 0; white-space: normal;
  }
  .system-page .data-table.wt-anomaly tr { padding: 12px 0; }
  .system-page .data-table.wt-anomaly td { padding: 2px 0; }
  .system-page .data-table.wt-anomaly td::before {
    content: attr(data-label);
    display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 2px;
  }
  .system-page .data-table.wt-anomaly td:first-child::before { display: none; }
  .system-page .data-table.wt-anomaly td:first-child { font-size: 15px; font-weight: 600; }
  /* 竖排时数字靠左，不然「30」会贴到屏幕最右边 */
  .system-page .data-table.wt-anomaly td.num { text-align: left; font-size: 14px; }
}

/* 系统与安全四页：表格不再锁死 980px 最小宽度，窄屏允许换行。
   .data-table 的 980px 是给整页宽列表用的，这些页面列少、内容长，
   强行撑到 980 会在小窗口下把整页顶宽（横向滚动、内容被切）。 */
.system-page .data-table { min-width: 0; }
.system-page .data-table th,
.system-page .data-table td { white-space: normal; overflow-wrap: anywhere; }

/* 进程名 / 用户名是长串英文，换行会拆得很难看：固定列宽 + 省略号 */
.system-page .proc-table { table-layout: fixed; }
.system-page .proc-table th { white-space: nowrap; }
.system-page .proc-table th:nth-child(1) { width: 38%; }
.system-page .proc-table th:nth-child(2) { width: 20%; }
.system-page .proc-table th:nth-child(3) { width: 18%; }
.system-page .proc-table th:nth-child(4) { width: 24%; }
.system-page .proc-table td {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal;
}

/* ---------- 网站体检：一句话结论 + 三张卡片 + 可折叠技术明细 ---------- */
.wt-verdict {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: 12px; border: 1px solid var(--border);
  font-size: 14.5px; line-height: 1.6; margin-bottom: 16px;
}
.wt-verdict strong { font-size: 15px; white-space: nowrap; }
.wt-tone-good { border-color: rgba(5,150,105,.3); background: rgba(5,150,105,.06); }
.wt-tone-good strong { color: #065f46; }
.wt-tone-warn { border-color: rgba(217,119,6,.32); background: rgba(217,119,6,.06); }
.wt-tone-warn strong { color: #92400e; }
.wt-tone-bad { border-color: rgba(220,38,38,.32); background: rgba(220,38,38,.06); }
.wt-tone-bad strong { color: #991b1b; }
.wt-tone-quiet { border-color: var(--border); background: var(--surface-2); }

.wt-scan-list { list-style: none; margin: 0; padding: 0; }
.wt-scan-list li {
  padding: 7px 0; border-bottom: 1px dashed var(--border, #e5e7eb);
  font-size: 13px; line-height: 1.6; word-break: break-all;
}
.wt-scan-list li:last-child { border-bottom: none; }
.wt-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.wt-card {
  position: relative; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); padding: 18px 18px 16px; border-top-width: 3px;
}
.wt-card.wt-tone-good { border-top-color: #059669; }
.wt-card.wt-tone-warn { border-top-color: #d97706; }
.wt-card.wt-tone-bad { border-top-color: #dc2626; }
.wt-card.wt-tone-quiet { border-top-color: #cbd5e1; }
.wt-card h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.wt-card-value strong { font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.wt-card-value span { font-size: 13px; color: var(--text-muted); margin-left: 4px; }
.wt-card-lines { margin: 12px 0 0; padding-left: 18px; font-size: 13.5px; line-height: 1.7; }
.wt-card-action { margin-top: 14px; }

.wt-details { margin-top: 16px; }
.wt-details > summary {
  cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none;
}
.wt-details > summary::-webkit-details-marker { display: none; }
.wt-details > summary::before { content: "▸ "; color: var(--text-dim); }
.wt-details[open] > summary::before { content: "▾ "; }
.wt-details-body { margin-top: 16px; }
.wt-details-body .two-col { margin-top: 18px; }
.wt-subhead { font-size: 14px; font-weight: 600; margin: 0 0 6px; }

.wt-series { display: flex; align-items: flex-end; gap: 3px; height: 90px; margin: 10px 0 4px; }
.wt-bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.wt-bar > span { display: block; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; }
.wt-bar > em { font-style: normal; font-size: 9px; color: var(--text-dim); text-align: center; }

/* 日志路径是一长串没有空格的字符，必须允许任意位置断开，
   否则整段文字会把页面撑出一条横向滚动条 */
.wt-footer { margin-top: 14px; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }
.wt-details .data-table th,
.wt-details .data-table td { overflow-wrap: anywhere; }

/* 后台列表页共用的搜索条与筛选按钮（原先只在个别页面里内联定义，这里统一一份） */
.search-panel {
  border: 1px solid var(--border, #e2e8f0); border-radius: 12px;
  background: #fbfcfe; padding: 14px 16px; margin: 16px 0;
}
.search-panel label {
  display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
}
.search-line { display: flex; gap: 10px; flex-wrap: wrap; }
.search-line input { flex: 1 1 240px; min-width: 0; }
.search-line select { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn--pill { border-radius: 999px; }

/* ---------- 后台筛选区（照卡分析系统的「卡列表」结构，2026-11-11） ---------- */
.filter-panel { padding: 18px 20px 16px; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}
.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.filter-grid label > span:first-child { font-weight: 500; }
.filter-grid .filter-wide { grid-column: 1 / -1; }
.filter-grid select,
.filter-grid input {
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
/* 控制件不必铺满整列（用户 2026-11-21 指出太宽）：下拉/输入统一限宽，左侧对齐 */
.filter-grid select,
.filter-grid input { max-width: 300px; }
/* 搜索框可以宽一点，但也不必横贯整页 */
.filter-grid .filter-wide input { max-width: 420px; }
.filter-grid select:focus,
.filter-grid input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-op { display: flex; gap: 8px; }
.filter-op select { flex: 0 0 118px; }
.filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-muted);
  background: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip--on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip--off { opacity: .45; }
.result-count { margin-left: auto; font-size: 13px; color: var(--text-muted); }
.result-count strong { color: var(--text); font-size: 15px; }

/* 表格型卡片：贴边、无内边距，让表头横线贯通 */
.card--table { padding: 0; overflow: hidden; }
.data-table--cards { min-width: 900px; }
.data-table--cards th {
  background: var(--surface-2);
  font-size: 12px;
  letter-spacing: .02em;
  padding: 10px 12px;
  border-top: 0;
}
.data-table--cards td { padding: 10px; }
.data-table--cards tbody tr:hover td { background: #f8fafc; }
.badge--dim {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface-2);
}
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
.row-actions input[type="text"] { min-width: 130px; padding: 8px 10px; font-size: 13px; }
.row-actions select { padding: 8px 10px; font-size: 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.btn--small { padding: 8px 12px; font-size: 13px; font-weight: 500; }

.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 4px 0; }
.pager-info { font-size: 13px; color: var(--text-muted); }

@media (max-width: 980px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .filter-grid { grid-template-columns: 1fr; }
  .result-count { margin-left: 0; }
}

/* 表格里的折叠操作：默认只占一个 chip 宽，点开才展开表单（避免把整行撑高） */
.row-action { display: inline-block; }
.row-action > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.row-action > summary::-webkit-details-marker { display: none; }
.row-action[open] > summary { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.row-action[open] > summary { margin-bottom: 8px; }
.row-action .row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 190px;
}

/* 批量操作栏（勾选后整批冻结） */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 4px 12px;
}
.bulk-bar input[type="text"] { max-width: 280px; padding: 9px 11px; font-size: 14px; }
.bulk-bar select {
  padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
}
.bulk-bar .btn--inline { width: auto; }
.bulk-bar button.chip { font-family: inherit; cursor: pointer; }
.col-check { width: 34px; text-align: center; }
.col-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.data-table--cards { min-width: 1040px; }

/* 操作列固定在右边：表格再宽，冻结/解除按钮也始终在视野里 */
.data-table--cards th:last-child,
.data-table--cards td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  box-shadow: -10px 0 14px -10px rgba(15, 23, 42, .25);
}
.data-table--cards thead th:last-child { background: var(--surface-2); }
.data-table--cards tbody tr:hover td:last-child { background: #f8fafc; }

/* ---------- 卡详情页（后台，照卡分析系统的卡详情结构） ---------- */
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: var(--gap);
}
.detail-pan { font-size: 20px; letter-spacing: 2px; color: var(--text); }
.detail-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.detail-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.detail-grid .card { margin-bottom: 0; }
.detail-grid .card h2 { margin: 0 0 12px; font-size: 15px; }
.kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  margin: 0;
  font-size: 13.5px;
}
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: right; color: var(--text); }
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-head { flex-direction: column; }
  .detail-tags { align-items: flex-start; }
}

/* 确认表单里的下拉框：跟文本输入框同一套外观（站内没有全局 select 样式） */
.confirm-form select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.confirm-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 交易记录表：不需要「操作列固定」，最后一列是拒付原因，按正常表格滚动即可 */
.data-table--txns { min-width: 1080px; }
.data-table--txns th:last-child,
.data-table--txns td:last-child {
  position: static;
  box-shadow: none;
  background: transparent;
}
.data-table--txns thead th:last-child { background: var(--surface-2); }

/* 「我的账户」：账户状态与最近登录左右并排（窄屏自动上下） */
.dashboard-split {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 1.7fr);
  gap: var(--gap);
  margin-top: 22px;
}
.dashboard-split .card { margin-top: 0; }
/* 网格子项默认 min-width: auto，会被表格的 min-width 撑大 → 整页出现横向滚动条
   （2026-11-23 用户手机截图：最近登录把卡片撑出屏幕 184px）。必须让子项可收缩到 0。 */
.dashboard-split > * { min-width: 0; }
/* 最近登录只有 4 列（手机上 3 列），不需要全站表格那条 980px 最小宽度——
   否则电脑上右侧那一栏稍窄一点，表格内部就出现横向滚动条（2026-11-23 用户指出是电脑端）。
   注意：`.table-wrap table { min-width: 420px }` 选择器更"重"，必须写全这一串才压得住。 */
.table-wrap table.data-table--logins { min-width: 0; }
/* 这张表的单元格允许换行（时间除外）：桌面端右侧栏稍窄时也不会出现横向滚动条 */
.data-table--logins td { white-space: normal; }
.data-table--logins td:first-child { white-space: nowrap; }
/* 但"允许换行"不能让中文词被拦腰断开（2026-11-23 用户截图：
   「马来西亚」变成「马来西 / 亚」、「桌面」变成「桌 / 面」）：
   IP 整体不拆、「 · 国家」整体挪到下一行，设备列只在空格/「·」处换行。 */
.data-table--logins .ip-copy { white-space: nowrap; }
.data-table--logins td:nth-child(3) .dim { white-space: nowrap; }
.data-table--logins td:nth-child(4) { word-break: keep-all; }
@media (max-width: 980px) {
  .dashboard-split { grid-template-columns: 1fr; }
}

/* 可拖动列宽的表格（客户卡片消费记录） */
.data-table--fixed { table-layout: fixed; width: 100%; min-width: 0; }
.data-table--fixed td {
  overflow: hidden; text-overflow: ellipsis;
  /* 长商家名 / 长拒付原因默认省略，鼠标悬停看全文；拉宽列即可看全 */
}
.data-table--fixed th { position: relative; }
.col-grip {
  position: absolute; top: 0; right: -4px; bottom: 0; width: 9px;
  cursor: col-resize; z-index: 2;
}
.col-grip::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 4px; width: 1px;
  background: transparent;
}
.col-grip:hover::after { background: var(--accent); }
body.col-resizing { cursor: col-resize; user-select: none; }

/* 客户「消费记录」的状态筛选：一排大一点的胶囊标签，点一下切换 */
.status-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.status-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.status-tab:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.status-tab.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* 「全部 / 资金类」这类切换按钮的选中态（卡详情操作记录，2026-11-21） */
.btn--on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------------------------------------------------------------- 宽表格的「上方滚动条」
   问题（用户 2026-11-22）：交易记录等宽表格的横向滚动条在表格最下面，
   50 行的表格要拉到底才够得着，每看几行就要滚上去再滚下来。
   做法：在表格上方画一条自己的滚动条（JS 见 base.html），拖动/点击都能横移表格。
   **不依赖浏览器原生滚动条**：macOS 的滚动条默认「滚动时才出现」，
   原生的话用户根本看不见这条，等于没做。表格不宽时自动隐藏。 */
.table-scroll-top {
  display: none;
  position: relative;
  height: 12px;
  margin: 0 0 8px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 6px;
  cursor: pointer;
  touch-action: none;      /* 拖动时不要连带滚动整页 */
  user-select: none;
}
.table-scroll-top.is-on { display: block; }
.table-scroll-top__thumb {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(15, 23, 42, 0.32);
  border-radius: 6px;
  cursor: grab;
}
.table-scroll-top__thumb:active { cursor: grabbing; }

/* 筛选区里的复选框（卡片列表「只看负余额」）：按普通表单控件对齐，不被输入框样式撑成大方块 */
.filter-grid .filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
  color: var(--text);
}
.filter-grid .filter-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  max-width: none;
  margin: 0;
  accent-color: var(--accent);
}


/* ---------------------------------------------------------------- 客户端手机端（2026-11-23 用户截图）
   问题：① 「快速充值」按钮文字被挤成两行；② 统计卡两列时「欠费」独占半列、右边空一片；
        ③ 最近登录的 IP 太长把表格挤窄、列文字贴边。 */
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat { padding: 16px; }
  /* 余额卡里按钮与数字并排时，给按钮留出不被压缩的空间 */
  .stat-head { flex-wrap: wrap; }
  .stat-head .btn { flex: 0 0 auto; }
  /* 手机上的表格：字号收一档，长 IP 允许在任意位置换行，不再把列挤到贴边 */
  .data-table th, .data-table td { font-size: 12px; padding: 8px 6px; }
  .data-table td { overflow-wrap: anywhere; }
  /* 最近登录：手机上四列都要能看（2026-11-23 用户：看不到设备信息了）。
     做法是恢复「设备 / 浏览器」列，并让这张表可以左右滑动去看——
     注意前面的 `.table-wrap table.data-table--logins { min-width: 0 }` 选择器更重，
     这里必须写全同样的选择器才压得住。 */
  .table-wrap table.data-table--logins { min-width: 560px; }
  /* 表格默认 min-width:980px、单元格 nowrap —— 手机端必须针对这一张放开，
     否则 IP 再短也放不下（2026-11-23 实测仍溢出 96px）。 */
  .data-table--logins td { white-space: normal; }
  .data-table--logins td:first-child { white-space: nowrap; }
}


/* 最近登录里的短 IP：看起来像文字，点一下复制完整值（2026-11-23 用户要求） */
.ip-copy {
  border: 0; background: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
  border-bottom: 1px dashed var(--border-strong);
}
.ip-copy:hover { color: var(--accent); border-bottom-color: currentColor; }
/* 复制成功的轻提示（1.6 秒后自动消失） */
.ip-copy-tip {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 90; padding: 9px 16px; border-radius: 999px;
  background: rgba(15, 23, 42, .88); color: #fff; font-size: 13px;
  pointer-events: none;
}
