:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --line: #e7eaf2;
  --text: #1f2430;
  --muted: #7a8196;
  --accent: #4f46e5;
  --accent-weak: #eef0ff;
  --danger: #e5484d;
  --radius: 12px;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #171a2b 0%, #10131f 100%);
  color: #c6cbe0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
}
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center;
  letter-spacing:.5px;
}
.brand-text { display:flex; flex-direction:column; line-height:1.25; }
.brand-text strong { color:#fff; font-size:15px; }
.brand-text span { font-size:11px; color:#8b90a8; }

.nav { padding: 8px 10px; flex:1; overflow:auto; }
.nav-label {
  font-size: 11px; color: #6a7089; text-transform: uppercase;
  letter-spacing: 1px; padding: 12px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 4px; border-radius: 9px;
  cursor: pointer; color: #c6cbe0; transition: .15s;
  border: none; background: transparent; width: 100%;
  font-size: 14px; text-align:left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color:#fff; }
.nav-item.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink:0; }
.sidebar-foot { padding: 12px 18px; font-size: 11px; color: #5c6077; }

.main { flex:1; min-width: 0; display:flex; flex-direction:column; }

.topbar {
  padding: 20px 26px 0;
  display:flex; align-items:flex-end; justify-content:space-between; gap:16px;
}
.topbar h1 { margin:0; font-size:20px; }
.topbar p { margin:4px 0 0; color: var(--muted); font-size:13px; }

.body { padding: 16px 26px 40px; }

/* ============ 统计卡片 ============ */
.stats-bar {
  display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:12px; margin-bottom:16px;
}
.stat-card {
  background: var(--card); border:1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
  display:flex; flex-direction:column; gap:6px;
}
.stat-card .stat-label { font-size:12px; color:var(--muted); display:flex;align-items:center;gap:6px;}
.stat-card .stat-dot { width:8px;height:8px;border-radius:50%;display:inline-block;}
.stat-card .stat-value { font-size:22px; font-weight:700; line-height:1; font-variant-numeric: tabular-nums;}
.stat-card.accent { background: linear-gradient(135deg,#4f46e5,#7c3aed); color:#fff; border:none; }
.stat-card.accent .stat-label { color: rgba(255,255,255,.85); }

/* ============ 主卡片 ============ */
.card {
  background: var(--card); border:1px solid var(--line);
  border-radius: var(--radius); overflow:hidden;
}
.card-head {
  padding: 14px 18px; display:flex; align-items:center; justify-content:space-between;
  gap:12px; border-bottom:1px solid var(--line); flex-wrap:wrap;
}
.card-head h2 { margin:0; font-size:15px; }
.card-head .desc { color:var(--muted); font-size:12px; margin-top:2px; }
.btn-row { display:flex; gap:8px; }

.btn {
  border:1px solid var(--line); background:#fff; color:var(--text);
  padding: 8px 14px; border-radius: 8px; font-size:13px; cursor:pointer;
  display:inline-flex; align-items:center; gap:6px; transition:.15s;
}
.btn:hover { border-color:#cfd4e4; background:#f8f9fd; }
.btn svg{width:15px;height:15px;}
.btn.primary {
  background: var(--accent); border-color: var(--accent); color:#fff;
  box-shadow:0 4px 10px rgba(79,70,229,.25);
}
.btn.primary:hover { background:#4338ca; }
.btn.danger:hover { border-color:var(--danger); color:var(--danger); background:#fef2f2; }

.toolbar {
  padding: 12px 18px; display:flex; gap:10px; flex-wrap:wrap;
  border-bottom:1px solid var(--line); background:#fbfcfe;
}
.tool-hint { display:inline-flex; align-items:center; font-size:12px; margin-left:auto; }
.search-box { position:relative; flex:1; min-width:200px; max-width:380px; }
.search-box svg { position:absolute; left:10px; top:50%; transform:translateY(-50%); width:15px;height:15px;color:var(--muted);}
.search-box input {
  width:100%; padding:8px 12px 8px 32px; border:1px solid var(--line);
  border-radius:8px; font-size:13px; outline:none; background:#fff;
}
.search-box input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak); }
.tool-select {
  padding: 8px 10px; border:1px solid var(--line); border-radius:8px;
  font-size:13px; background:#fff; outline:none; cursor:pointer;
}

.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; min-width:720px; }
thead th {
  text-align:left; font-size:12px; color:var(--muted); font-weight:600;
  padding:10px 14px; border-bottom:1px solid var(--line); white-space:nowrap;
  background:#fafbfe; position:sticky; top:0;
}
tbody td {
  padding:10px 14px; border-bottom:1px solid #f0f2f8; vertical-align:middle;
  font-size:13px; word-break:break-all;
}
tbody tr:hover { background:#f7f8fd; }
tbody tr:last-child td { border-bottom:none; }
.td-actions { white-space:nowrap; text-align:right; width:1%; }
.num-cell { font-variant-numeric: tabular-nums; }
.cell-nowrap { white-space: nowrap; }
tr.row-detail { cursor: pointer; }

/* 表头列宽拖拽（Excel 风格） */
.col-resizer {
  position: absolute; top: 0; right: -5px; bottom: 0; width: 10px;
  cursor: col-resize; z-index: 5;
}
.col-resizer::after {
  content: ''; position: absolute; top: 12px; bottom: 12px; left: 50%;
  transform: translateX(-50%); width: 2px; border-radius: 2px;
  background: transparent; transition: background .15s;
}
thead th:hover .col-resizer::after { background: #cdd2e6; }
.col-resizer:hover::after { background: var(--accent); }
body.col-resizing, body.col-resizing * {
  cursor: col-resize !important; user-select: none !important;
}

/* 记录详情页 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 26px; padding: 4px 18px 8px; }
.detail-field { padding: 13px 2px; border-bottom: 1px dashed #eef0f7; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-field .dl { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.detail-field .dl:empty { display: none; }
.detail-field .dv { font-size: 14px; color: var(--text); line-height: 1.5; word-break: break-all; }
.detail-field .dv.mono { font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.detail-field .dv .link-btn { padding: 1px 6px; margin-left: 2px; vertical-align: middle; }
.detail-field .dv.amount-lg { font-size: 22px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .4px; }
.detail-field.wide { grid-column: 1 / -1; }
.detail-field .dv.desc-txt { line-height: 1.7; }
.btn:disabled { opacity:.55; cursor:not-allowed; }
.probe-cell { white-space:nowrap; }
.probe-cell .muted { font-size:12px; }

.muted { color:var(--muted); }
.empty-row td { text-align:center; padding:46px 0; color:var(--muted); }

.tag {
  display:inline-flex; align-items:center; gap:4px; padding:3px 9px;
  border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap;
}
.tag::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }
.tag-blue   { background:#e8efff; color:#2563eb; }
.tag-green  { background:#e6f7ee; color:#059669; }
.tag-orange { background:#fff1e2; color:#d97706; }
.tag-red    { background:#feecec; color:#dc2626; }
.tag-gray   { background:#f0f2f6; color:#6b7280; }

.secret-box { display:inline-flex; align-items:center; gap:6px; }
.icon-btn {
  border:none; background:transparent; cursor:pointer; padding:4px; border-radius:6px;
  color:var(--muted); display:inline-flex; align-items:center;
}
.icon-btn:hover { background:#eceef8; color:var(--accent); }
.icon-btn svg { width:15px; height:15px; }
.cell-copy { padding:2px; margin-left:5px; }
.cell-copy svg { width:13px; height:13px; }
.cell-copy:hover { color:var(--accent); }
.link-btn {
  border:none; background:none; color:var(--accent); cursor:pointer;
  font-size:13px; padding:3px 6px; border-radius:6px;
}
.link-btn:hover { background:var(--accent-weak); }
.link-btn.danger { color:var(--danger); }
.link-btn.danger:hover { background:#feecec; }

.table-foot { padding:10px 18px; color:var(--muted); font-size:12px; display:flex; justify-content:space-between; align-items:center;}

/* 只读视图标签 */
.readonly-tag {
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:999px;
  background:var(--accent-weak); color:var(--accent); font-size:12.5px; font-weight:600;
}
.readonly-tag svg { width:14px; height:14px; }

/* 登录窗口 */
.login-mask {
  position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; padding:20px;
  background: radial-gradient(1200px 600px at 20% 10%, #3b3f66 0%, #171a2b 45%, #0f1220 100%);
}
.login-mask[hidden] { display:none !important; }
.login-card {
  width:100%; max-width:360px; background:#fff; border-radius:16px; padding:30px 30px 22px;
  box-shadow:0 30px 80px rgba(0,0,0,.4); display:flex; flex-direction:column;
}
.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:22px; }
.login-brand .brand-logo { width:44px; height:44px; font-size:17px; }
.login-brand strong { display:block; font-size:17px; }
.login-brand span { font-size:12px; color:var(--muted); }
.login-field { margin-bottom:14px; }
.login-field label { display:block; font-size:12.5px; color:var(--muted); margin-bottom:6px; font-weight:600; }
.login-field input {
  width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:9px;
  font-size:14px; outline:none; background:#fff;
}
.login-field input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak); }
.login-btn { justify-content:center; width:100%; padding:11px; font-size:14.5px; margin-top:4px; letter-spacing:4px; }
.login-hint { text-align:center; font-size:12px; color:var(--muted); line-height:1.7; margin:18px 0 0; }
/* 登录第二步：两步验证 */
.login-2fa-head {
  display:flex; align-items:center; gap:12px; margin-bottom:16px;
  padding:12px 14px; border-radius:10px; background:var(--accent-weak);
}
.login-2fa-badge {
  width:34px; height:34px; border-radius:9px; flex-shrink:0;
  background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff;
  display:flex; align-items:center; justify-content:center;
}
.login-2fa-badge svg { width:17px; height:17px; }
.login-2fa-head strong { display:block; font-size:13.5px; }
.login-2fa-head > div > span { font-size:11.5px; color:var(--muted); }
.login-field-tip { font-size:11.5px; color:var(--muted); margin-top:6px; line-height:1.5; }
.login-back {
  display:block; margin:14px auto 0; border:none; background:none; cursor:pointer;
  color:var(--muted); font-size:12.5px; padding:4px 8px; border-radius:6px;
}
.login-back:hover { color:var(--accent); background:var(--accent-weak); }

/* 两步验证配置弹窗 */
.totp-intro { color:var(--muted); font-size:12.5px; line-height:1.8; margin:0 0 14px; }
.totp-intro strong { color:var(--text); }
.step-line { display:flex; gap:8px; font-size:12.5px; color:var(--muted); line-height:1.7; margin:2px 0; }
.step-line b { color:var(--accent); min-width:16px; }
.qr-row { display:flex; align-items:flex-start; gap:18px; margin:6px 0 14px; }
.qr-box {
  width:180px; height:180px; flex-shrink:0; border:1px solid var(--line);
  border-radius:10px; padding:8px; background:#fff; display:flex; align-items:center; justify-content:center;
}
.qr-box img { width:164px; height:164px; image-rendering:pixelated; }
.qr-fallback { font-size:12px; color:var(--muted); line-height:1.7; }
.key-label { display:block; font-size:12.5px; color:var(--muted); margin:0 0 6px; font-weight:600; }
.totp-secret {
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#f6f7fb; border:1px dashed #c3c9d8; border-radius:8px;
  padding:8px 10px; font-size:12.5px; line-height:1.7; word-break:break-all;
}
.totp-secret-input {
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#f6f7fb; color:#33415c; letter-spacing:.5px;
}
.inline-copy {
  border:1px solid var(--line); background:#fff; color:var(--accent);
  border-radius:6px; padding:3px 9px; font-size:12px; cursor:pointer;
}
.inline-copy:hover { background:var(--accent-weak); border-color:#b9b6f7; }
.totp-state-ok {
  display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600;
  color:#059669; background:#e6f7ee; border-radius:9px; padding:10px 12px; margin-bottom:10px;
}
.totp-state-ok svg { width:16px; height:16px; flex-shrink:0; }
.totp-state-ok .muted-ok { font-weight:400; font-size:12.5px; color:#3f7d63; }

/* 侧栏当前用户 */
.side-user {
  display:flex; align-items:center; gap:9px; padding:10px 0;
  border-top:1px solid rgba(255,255,255,.07); margin-bottom:6px;
}
.su-avatar {
  width:30px; height:30px; border-radius:8px; flex-shrink:0;
  background:linear-gradient(135deg,#6366f1,#8b5cf6); color:#fff;
  font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.su-meta { flex:1; min-width:0; line-height:1.3; }
.su-meta strong { display:block; color:#fff; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.su-meta span { font-size:11px; color:#8b90a8; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.su-logout {
  border:none; background:rgba(255,255,255,.08); color:#a9aec9; cursor:pointer;
  width:28px; height:28px; border-radius:7px; display:flex; align-items:center; justify-content:center;
}
.su-logout:hover { background:rgba(229,72,77,.18); color:#ff8b8f; }
.su-logout svg { width:15px; height:15px; }
.side-version { font-size:11px; color:#565b73; padding:2px 0 4px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position:fixed; inset:0; background:rgba(15,18,32,.45); z-index:50;
  display:flex; align-items:center; justify-content:center; padding:20px;
  backdrop-filter: blur(2px);
}
.modal-mask[hidden] { display: none !important; }
.modal {
  background:#fff; border-radius:14px; width:100%; max-width:560px;
  max-height:88vh; display:flex; flex-direction:column; overflow:hidden;
  box-shadow:0 24px 60px rgba(15,18,32,.3);
}
.modal-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--line);
}
.modal-head h3 { margin:0; font-size:16px; }
.modal-close { border:none; background:none; font-size:22px; cursor:pointer; color:var(--muted); line-height:1; padding:2px 6px; border-radius:6px;}
.modal-close:hover { background:#f0f2f6; color:var(--text); }
.modal-body { padding:18px 20px; overflow:auto; }
.modal-foot {
  padding:14px 20px; border-top:1px solid var(--line);
  display:flex; justify-content:flex-end; gap:10px; background:#fbfcfe;
}

.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-field.full { grid-column:1 / -1; }
.form-field label {
  display:block; font-size:12.5px; color:var(--muted); margin-bottom:6px; font-weight:600;
}
.form-field label .req { color:var(--danger); margin-left:2px; }
.radio-group { display:flex; align-items:center; gap:20px; height:40px; }
.radio-item {
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  font-size:13.5px; color:var(--text); user-select:none;
}
.radio-item input { width:15px; height:15px; margin:0; cursor:pointer; accent-color:var(--accent); }
.radio-item span { line-height:1; }
.form-control, .form-field select, .form-field textarea {
  width:100%; padding:9px 12px; border:1px solid var(--line); border-radius:8px;
  font-size:13.5px; outline:none; background:#fff; font-family:inherit;
}
/* 下拉框与文本框高度保持一致 */
.form-field input.form-control, .form-field select.form-control {
  height:40px;
}
.form-control:focus, .form-field select:focus, .form-field textarea:focus {
  border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak);
}
.form-field textarea { resize:vertical; min-height:72px; }
.form-field select:disabled, .form-field input:disabled, .form-field input[readonly] {
  background:#f3f4f8; color:var(--muted); cursor:not-allowed;
}
.form-tip { font-size:11.5px; color:var(--muted); margin-top:5px; line-height:1.5; }
.pwd-wrap { display:flex; gap:8px; }
.pwd-wrap .form-control { flex:1; }
.gen-btn {
  border:1px dashed #b9b6f7; background:var(--accent-weak); color:var(--accent);
  border-radius:8px; padding:0 12px; cursor:pointer; font-size:12px; white-space:nowrap;
}
.gen-btn:hover { background:#e2e4ff; }

/* ============ 提示 ============ */
.toast-root { position:fixed; top:18px; right:18px; z-index:100; display:flex; flex-direction:column; gap:8px; }
.toast {
  background:#1f2430; color:#fff; padding:11px 16px; border-radius:10px;
  font-size:13px; box-shadow:0 8px 24px rgba(0,0,0,.25);
  display:flex; align-items:center; gap:8px; animation: slideIn .2s ease;
}
.toast.ok::before { content:""; width:8px;height:8px;border-radius:50%;background:#34d399; }
.toast.err::before { content:""; width:8px;height:8px;border-radius:50%;background:#f87171; }
.toast.info::before { content:""; width:8px;height:8px;border-radius:50%;background:#60a5fa; }
@keyframes slideIn { from { transform:translateX(20px); opacity:0;} to {transform:none; opacity:1;} }

::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-thumb { background:#d3d8e6; border-radius:8px; }
::-webkit-scrollbar-track { background:transparent; }

/* ============ 登录页 IP 白名单拦截提示 ============ */
.login-denied {
  display:flex; flex-direction:column; gap:3px;
  background:#feecec; border:1px solid #f6c6c6;
  border-radius:9px; padding:10px 12px; margin:0 0 14px;
}
.login-denied[hidden] { display:none; }
.login-denied b { color:#b91c1c; font-size:12.5px; }
.login-denied span { color:#b91c1c; opacity:.9; font-size:12px; line-height:1.6; }

/* ============ IP 白名单管理页 ============ */
.wl-head {
  display:grid; grid-template-columns:1.7fr 1fr; gap:12px;
  margin-bottom:16px; align-items:stretch;
}
.wl-toggle-card, .wl-ip-card {
  background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px 16px;
}
.wl-toggle-card { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.wl-toggle-card h3 { margin:0 0 6px; font-size:14.5px; display:flex; align-items:center; gap:8px; }
.wl-toggle-card p { margin:0; color:var(--muted); font-size:12px; line-height:1.7; max-width:470px; }
.wl-ip-card code {
  display:block; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:15px; margin:6px 0 2px; color:#33415c;
}
.wl-ip-card .key-label { font-size:12px; }
.wl-warn {
  background:#fff4e5; border:1px solid #f3d9a7; color:#92400e;
  border-radius:10px; padding:10px 14px; margin:0 0 14px;
  font-size:12.5px; line-height:1.7;
}
.switch { position:relative; width:44px; height:24px; flex-shrink:0; cursor:pointer; margin-top:2px; }
.switch input { opacity:0; width:0; height:0; }
.switch-slider {
  position:absolute; inset:0; background:#cbd2e0;
  border-radius:999px; transition:.18s;
}
.switch-slider::before {
  content:""; position:absolute; width:18px; height:18px; border-radius:50%;
  background:#fff; top:3px; left:3px; transition:.18s;
  box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .switch-slider { background:var(--accent); }
.switch input:checked + .switch-slider::before { transform:translateX(20px); }
.switch input:disabled + .switch-slider { opacity:.5; cursor:not-allowed; }
.ip-code {
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#f6f7fb; border-radius:6px; padding:2px 8px; font-size:12.5px; color:#33415c;
}
@media (max-width: 900px) {
  .wl-head { grid-template-columns:1fr; }
}

/* ============ Excel 导入弹窗 ============ */
.imp-upload { text-align:center; padding:4px 0 2px; }
.imp-file-btn {
  display:inline-flex; align-items:center; gap:8px; max-width:100%;
  padding:11px 20px; border:1.5px dashed #c4cbdb; border-radius:10px;
  background:#fafbfe; color:#33415c; cursor:pointer; font-size:13.5px; transition:.15s;
}
.imp-file-btn svg { width:17px; height:17px; flex:none; }
.imp-file-btn:hover { border-color:var(--accent); color:var(--accent); background:#f4f8ff; }
.imp-note {
  margin:12px 0 10px; padding:10px 12px; border-radius:8px;
  background:#f6f7fb; border:1px solid var(--line);
  color:#525f7a; font-size:12px; line-height:1.9;
}
.imp-cols { width:100%; border-collapse:collapse; margin-top:2px; font-size:12.5px; }
.imp-cols th { background:#f6f7fb; text-align:left; color:#33415c; font-weight:600; }
.imp-cols th, .imp-cols td { border-bottom:1px solid var(--line); padding:7px 10px; vertical-align:top; }
.imp-cols tbody tr:last-child th,
.imp-cols tbody tr:last-child td { border-bottom:none; }
.imp-cols code {
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background:#eef1f7; padding:1px 6px; border-radius:5px; color:#1f2b44;
}
.imp-result .imp-summary { font-size:14px; margin:0 0 10px; }
.imp-result .imp-red { color:#dc2626; }
.imp-errors {
  max-height:210px; overflow:auto; border:1px solid #f3d3d3; background:#fef7f7;
  border-radius:8px; padding:4px 12px; margin:8px 0;
}
.imp-errors ul { margin:8px 0; padding-left:20px; }
.imp-errors li { font-size:12.5px; color:#b91c1c; line-height:1.9; }

/* AI 账号列表：重复银行卡号标注（卡号后次数小徽章） */
.dup-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:18px; padding:0 6px; margin-left:6px;
  border-radius:999px; background:#e8efff; color:#2563eb;
  font-size:11.5px; font-weight:800; font-variant-numeric:tabular-nums;
  vertical-align:-2px; flex-shrink:0; cursor:help;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.18);
}

/* 已在 AI 账号管理中使用：资源标识列后的小图标 */
.used-ico {
  display:inline-flex; width:14px; height:14px; margin-left:5px;
  color:#2563eb; vertical-align:-2px; flex-shrink:0; cursor:help;
}
.used-ico svg { width:100%; height:100%; }

/* 密码/密钥查看弹层 */
.sec-label { margin:0 0 10px; font-size:12px; color:var(--muted); }
.sec-value {
  margin:0; padding:10px 12px; background:#f6f7fb; border:1px solid #e5e7eb; border-radius:8px;
  font-size:13px; line-height:1.6; word-break:break-all; white-space:pre-wrap; user-select:text;
  max-height:260px; overflow:auto;
}

/* 邮箱详情：双列布局 */
.detail-grid.grid-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 银行卡详情：三列布局（9 字段排满 3 行，末行状态 + 是否可注销并排） */
.detail-grid.grid-cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-grid.grid-cols3.bank-layout { gap: 0 26px; padding: 6px 18px 4px; }
.bank-layout .detail-field { padding: 14px 2px 13px; }

/* 邮箱详情：主信息整行卡片 + 凭据整行 + 其余字段双列成对（消除首行右侧空白） */
.detail-grid.grid-cols2.email-layout { gap: 0 30px; padding: 6px 20px 4px; }
.email-layout .detail-field { padding: 14px 2px 13px; }
.email-layout .email-hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f8f6ff 60%, #f3f1ff 100%);
  border: 1px solid #e3e7ff; border-radius: 12px; margin: 4px 0 8px;
  padding: 16px 18px 15px !important;
}
.email-layout .email-hero .dl { color: var(--accent); font-size: 11px; letter-spacing: .6px; }
.email-layout .dv.email-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 16px; font-weight: 700; color: #232946; line-height: 1.6;
}
.email-layout .dv.email-main .email-txt { overflow-wrap: anywhere; word-break: break-word; }
.email-layout .dv.email-main .link-btn { flex: none; font-weight: 600; }
.email-layout .email-main .hero-status { display: inline-flex; flex: none; }
.email-layout .email-main .hero-status .tag {
  font-size: 13.5px; font-weight: 800; letter-spacing: .4px;
  padding: 5px 16px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65), 0 2px 6px rgba(30,41,59,.14);
  filter: drop-shadow(0 0 7px color-mix(in srgb, currentColor 38%, transparent));
}
.email-layout .email-main .hero-status .tag::before { width: 6px; height: 6px; }
.detail-field .dv.no-wrap-txt {
  white-space: nowrap; word-break: normal; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.detail-field .dv.no-wrap-txt::-webkit-scrollbar { height: 5px; }
.detail-field .dv.no-wrap-txt::-webkit-scrollbar-thumb { background:#d5d9e8; border-radius:3px; }
@media (max-width: 1080px) {
  .detail-grid.grid-cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .detail-grid.grid-cols2,
  .detail-grid.grid-cols3 { grid-template-columns: 1fr; }
}

/* ============ 状态维护页 ============ */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; padding: 2px 4px 12px; }
.st-card { border: 1px solid #e6e9f2; border-radius: 10px; padding: 14px 16px; background: #fcfcfe; }
.st-head { display: flex; flex-direction: column; gap: 3px; padding-bottom: 4px; }
.st-head strong { font-size: 14px; color: var(--text); }
.st-hint { font-size: 11px; color: var(--muted); line-height: 1.5; }
.st-items { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.st-row { display: flex; align-items: center; gap: 8px; }
.st-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.st-input { flex: 1; min-width: 0; height: 32px; padding: 0 10px; font-size: 13px; border: 1px solid #dfe3ec; border-radius: 7px; outline: none; background: #fff; color: var(--text); }
.st-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.st-color { height: 30px; width: 72px; padding: 0 4px; font-size: 12px; border: 1px solid #dfe3ec; border-radius: 7px; outline: none; background: #fff; color: var(--text); flex: none; }
.st-usage { flex: none; width: 52px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-del { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: #c3c7d4; border-radius: 6px; cursor: pointer; }
.st-del:hover:not(:disabled) { background: #fee2e2; color: #dc2626; }
.st-del:disabled { cursor: not-allowed; opacity: .4; }
.st-del svg { width: 15px; height: 15px; }
.st-add { margin-top: 4px; padding: 5px 12px; font-size: 12px; }
.st-empty { padding: 12px 0 2px; color: var(--muted); font-size: 12px; }
