/* B-3 补丁：表清单中英双行 + 列头双行（已迁移到 tokens 配色） */
.db-table-name        { display: flex; justify-content: space-between; align-items: center; }
.db-table-cn          { font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--text); }
.db-table-en          { font-family: var(--font-mono); color: var(--muted); margin-top: 1px; }
.db-table-meta        { color: var(--muted); margin-top: 2px; }
.db-table-en-inline   { color: var(--muted); margin: 0 8px; }
.col-en               { font-weight: 400; color: var(--muted); margin-top: 2px; }

/* 运营页（operations）：待确认订单清单 */
.ops-order-list       { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ops-order-row        { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                        padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
                        transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.ops-order-row:hover  { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.ops-order-main       { min-width: 0; }
.ops-order-line       { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-order-meta       { margin-top: 4px; word-break: break-all; }
.ops-order-row .btn   { flex: 0 0 auto; white-space: nowrap; }
/* 需人工确认 USDT 单：needs_attention 行标红置顶（左侧危险色描边）。 */
.ops-order-row--alert { border-color: var(--danger-deep); border-left-width: 3px;
                        background: var(--danger-bg); }
.ops-order-row--alert:hover { border-color: var(--danger-deep); }
/* 正常监听中(watching)单：静态置灰「监听中」标签，非按钮，不可点（防误放款）。 */
.ops-watch-tag        { flex: 0 0 auto; white-space: nowrap; cursor: default; opacity: 0.7;
                        font-style: italic; user-select: none; }

/* 客户管理页（customers）：搜索行 + 可点击行 + 分页 + 数字列 */
.cust-search-row      { display: flex; gap: 8px; align-items: center; }
.cust-search-row .input { flex: 1 1 auto; min-width: 0; }
.cust-search-row .btn { flex: 0 0 auto; white-space: nowrap; }
.cust-row             { cursor: pointer; }
.cust-row:hover       { background: var(--accent-soft); }
.cust-row:focus       { outline: 2px solid var(--accent); outline-offset: -2px; }
.cust-email           { font-weight: var(--fw-semi); color: var(--text); }
.data-table td.num    { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cust-pager           { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.cust-pager-info      { color: var(--text-2); }
.cust-detail .kv-grid { margin-top: 8px; }

/* ===== Wave1 风控 + KYC 门槛（客户详情） ===== */
/* 风控 / KYC 操作区：与备注卡上方分隔线，标题小字。 */
.cust-status-actions,
.cust-kyc-actions     { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
/* needs_kyc 醒目横幅（红底，置于资料最上方）。 */
.cust-kyc-banner      { display: flex; align-items: flex-start; gap: 10px;
                        margin: 4px 0 12px; padding: 12px 14px;
                        border: 1px solid var(--danger-deep); border-left-width: 3px;
                        border-radius: var(--radius); background: var(--danger-bg); color: var(--text); }
.cust-kyc-banner-ico  { flex: 0 0 auto; display: inline-flex; color: var(--danger-deep); margin-top: 1px; }
.cust-kyc-banner strong { color: var(--danger-deep); }
/* kyc_forced 只读提示行（不可撤销）。 */
.cust-kyc-forced      { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* RBAC：管理员与权限页 */
.rbac-add-row         { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.rbac-actions         { display: flex; gap: 8px; flex-wrap: wrap; }
.rbac-email           { font-weight: var(--fw-semi); color: var(--text); }
.rbac-protected       { margin-left: 8px; font-weight: var(--fw-medium); }
.select--inline       { min-width: 120px; padding: 4px 8px; font-size: var(--fs-sm); }

/* ===== 数据库浏览页·人话版（B 友好化） ===== */
/* 左侧「高级 / 系统表」折叠开关 */
.db-group-toggle      { display: flex; align-items: center; gap: 6px; width: 100%;
                        margin: 10px 0 4px; padding: 7px 10px; border: 0; cursor: pointer;
                        background: var(--surface-2); border-radius: var(--radius-sm);
                        color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium);
                        text-align: left; transition: background var(--transition-fast); }
.db-group-toggle:hover{ background: var(--bg-2); color: var(--text); }
.db-group-toggle .btn-ico { display: inline-flex; color: var(--muted); }

/* 工具栏：表说明独占一行（中文人话） */
.db-hint-line         { color: var(--muted); margin-top: 4px; max-width: 60ch; }

/* 单元格：状态徽章中性色 / 金额 / 空值 */
.badge--neutral       { background: var(--surface-2); color: var(--text-2); }
.money-cell           { font-variant-numeric: tabular-nums; }
.data-table td .muted { color: var(--muted); }

/* 可复制的截断 ID / 哈希 */
.copyable             { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
                        border-radius: var(--radius-sm); padding: 1px 4px; transition: background var(--transition-fast); }
.copyable:hover       { background: var(--accent-soft); }
.copyable .copy-ico   { display: inline-flex; color: var(--muted); opacity: .6; }
.copyable:hover .copy-ico { opacity: 1; color: var(--accent); }

/* 编辑抽屉：字段提示 + 必填星 + 原始字段名小字 */
.field-hint           { color: var(--muted); margin-top: 4px; }
.field-en             { font-family: var(--font-mono); color: var(--muted); font-weight: 400; }
.req-star             { color: var(--danger-deep); font-weight: var(--fw-medium); }

/* ===== 客户详情·头像 + 昵称编辑区 ===== */
.cust-avatar-block    { display: flex; align-items: flex-start; gap: 16px;
                        margin: 4px 0 14px; padding-bottom: 14px;
                        border-bottom: 1px solid var(--border); }
/* 圆形头像缩略图容器（固定方形，内容 cover 不变形）。 */
.cust-avatar-thumb    { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 50%;
                        overflow: hidden; background: var(--surface-2);
                        box-shadow: inset 0 0 0 1px var(--border-strong); }
.cust-avatar-img      { width: 100%; height: 100%; object-fit: cover; display: block; }
.cust-avatar-fallback { display: flex; align-items: center; justify-content: center;
                        width: 100%; height: 100%; color: #fff;
                        font-size: 30px; font-weight: var(--fw-bold); line-height: 1;
                        user-select: none; }
/* 右侧：头像操作 + 提示 + 昵称编辑 */
.cust-avatar-side     { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cust-avatar-actions  { display: flex; gap: 8px; flex-wrap: wrap; }
.cust-avatar-hint     { color: var(--muted); margin: 0; }
.cust-name-row        { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.cust-name-row .btn   { flex: 0 0 auto; white-space: nowrap; }
/* 昵称输入：≥16px 防移动端聚焦放大，限制宽度避免占满整行。 */
.cust-name-input      { flex: 1 1 220px; min-width: 160px; max-width: 360px; font-size: 16px; }

@media (max-width: 560px) {
  .cust-avatar-block  { gap: 12px; }
  .cust-avatar-thumb  { width: 60px; height: 60px; }
  .cust-avatar-fallback { font-size: 24px; }
  .cust-name-input    { max-width: none; }
}

/* ════════════════════════════════════════════════════════
   系统检测 / 诊断页（diagnostics）
   —— 顶部总览条 + 分组卡片网格 + 纯 CSS 状态灯
   状态色：ok=绿 / warn(降级)=黄 / down=红 / muted(未配置)=灰 / unknown=灰蓝
   ════════════════════════════════════════════════════════ */

/* ── 顶部总览条：左统计 chip / 右上次时间 + 重新检测 ── */
.diag-overview {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.diag-overview-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.diag-overview-total { font-size: var(--fs-sm); color: var(--muted); margin-left: 2px; }
.diag-overview-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.diag-checked-at {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap;
}
.diag-checked-at .icon, .diag-checked-at svg { color: var(--muted); }

/* ── 分组区块 ── */
.diag-section { padding-top: var(--sp-md); padding-bottom: var(--sp-md); }
.diag-section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.diag-section-head .card-title-icon { flex: 0 0 auto; }
.diag-section-head > div { flex: 1 1 auto; min-width: 0; }
.diag-section-count {
  flex: 0 0 auto; font-size: var(--fs-xs); font-weight: var(--fw-semi);
  color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 3px 10px;
}

/* ── 卡片网格 ── */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--sp-md);
}

/* ── 单张服务卡 ── */
.diag-card {
  border: 1px solid var(--border-strong); border-left-width: 3px;
  border-radius: var(--radius); padding: 13px 14px;
  background: var(--surface-2);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}
.diag-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
/* 左侧描边按状态着色（异常项一眼可辨）。 */
.diag-card--ok      { border-left-color: var(--safe); }
.diag-card--warn    { border-left-color: var(--warn);   background: var(--warn-bg); }
.diag-card--down    { border-left-color: var(--danger); background: var(--danger-bg); }
.diag-card--muted   { border-left-color: var(--border-strong); }
.diag-card--unknown { border-left-color: var(--info); }

.diag-card-top { display: flex; align-items: center; gap: 8px; }
.diag-card-name {
  flex: 1 1 auto; min-width: 0; font-size: var(--fs-md); font-weight: var(--fw-semi);
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 纯 CSS 状态灯（小圆点 + 柔光环；ok 带呼吸动画） */
.diag-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 0 0 3px rgba(152, 162, 179, .18);
}
.diag-dot--ok      { background: var(--safe);   box-shadow: 0 0 0 3px var(--safe-bg);   animation: diag-pulse 2.4s var(--ease-out) infinite; }
.diag-dot--warn    { background: var(--warn);   box-shadow: 0 0 0 3px var(--warn-bg); }
.diag-dot--down    { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.diag-dot--muted   { background: var(--muted);  box-shadow: 0 0 0 3px var(--bg-2); }
.diag-dot--unknown { background: var(--info);   box-shadow: 0 0 0 3px var(--info-bg); }

/* 状态 pill */
.diag-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: var(--fw-semi);
  background: var(--bg-2); color: var(--text-2);
}
.diag-pill--ok      { background: var(--safe-bg);   color: var(--safe-deep); }
.diag-pill--warn    { background: var(--warn-bg);   color: var(--warn-deep); }
.diag-pill--down    { background: var(--danger-bg); color: var(--danger-deep); }
.diag-pill--muted   { background: var(--bg-2);      color: var(--muted); }
.diag-pill--unknown { background: var(--info-bg);   color: var(--info); }

/* 卡内 meta：延迟 + key */
.diag-card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 9px; min-height: 16px;
}
.diag-latency {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.diag-latency .icon, .diag-latency svg { color: var(--muted); }
.diag-key { font-size: 10.5px; color: var(--muted); }

/* detail 小字（自动换行，不撑破卡片） */
.diag-detail {
  margin: 8px 0 0; font-size: var(--fs-xs); color: var(--text-2);
  line-height: var(--lh-snug); word-break: break-word;
}

/* 重新检测按钮转圈（图标旋转） */
.diag-spin svg { animation: diag-spin .8s linear infinite; }
@keyframes diag-spin { to { transform: rotate(360deg); } }
@keyframes diag-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--safe-bg); }
  50%      { box-shadow: 0 0 0 5px var(--safe-bg); }
}

@media (max-width: 560px) {
  .diag-grid { grid-template-columns: 1fr; }
  .diag-overview { align-items: flex-start; }
  .diag-overview-right { width: 100%; justify-content: space-between; }
}
