/* =========================================================
   采集平台 · 设计系统（2026-10-26 重构）
   一套变量贯穿登录页、用户端、管理端，避免各页各写各的。
   旧模板里的 .card / .stat-num / .badge-success / .dot / .mono /
   .hint / .kv / .table-wrap 等类名全部保留，只是统一了外观。
   ========================================================= */
:root {
  --brand: #4f46e5;            /* 主色：靛蓝 */
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --ink: #111827;              /* 正文 */
  --ink-2: #4b5563;            /* 次级文字 */
  --ink-3: #8a94a3;            /* 辅助文字 */
  --line: #e7e9ef;
  --bg: #f5f6fa;
  --card: #ffffff;
  --ok: #0f9d6e;
  --warn: #d97706;
  --bad: #dc2626;
  --sidebar: #0e1526;
  --sidebar-ink: #a7b0c2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 16px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 600; letter-spacing: 0; }

/* ===== 通用卡片 ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card > h6, .card h6.mb-0 { font-size: .95rem; }
.stat-num {
  font-size: 1.75rem; font-weight: 650; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.text-primary { color: var(--brand) !important; }
.text-muted { color: var(--ink-3) !important; }

/* ===== 按钮 ===== */
.btn { border-radius: var(--radius-sm); font-size: .875rem; }
.btn-primary {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(79,70,229,.25);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-dark); border-color: var(--brand-dark);
}
.btn-outline-primary { color: var(--brand); border-color: #c7d0ff; }
.btn-outline-primary:hover { background: var(--brand-soft); color: var(--brand-dark); border-color: #c7d0ff; }
.btn-outline-secondary { color: var(--ink-2); border-color: var(--line); }
.btn-outline-secondary:hover { background: #f2f3f7; color: var(--ink); border-color: var(--line); }
.btn-outline-success { color: var(--ok); border-color: #bfe6d5; }
.btn-outline-success:hover { background: #eafaf3; color: var(--ok); border-color: #bfe6d5; }
.btn-sm { padding: .3rem .6rem; }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #c7cbd4 transparent;
}
table td, table th { vertical-align: middle; }
.table { margin-bottom: 0; }
.table thead th {
  background: #fafbfc; color: var(--ink-2);
  font-size: .76rem; font-weight: 500; letter-spacing: .02em;
  border-bottom: 1px solid var(--line);
  padding-top: .6rem; padding-bottom: .6rem;
}
.table tbody td { border-bottom: 1px solid #f1f2f6; padding-top: .55rem; padding-bottom: .55rem; }
.table-hover tbody tr:hover td { background: #fafbfe; }
.table-sm td, .table-sm th { font-size: .85rem; }
.mono { font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace; font-size: .8rem; }
code { color: var(--brand-dark); }
code.key { background: #fff7e0; padding: 2px 6px; border-radius: 4px; user-select: all; }

/* ===== 徽标 / 状态点 ===== */
.badge { border-radius: 6px; font-weight: 500; padding: .3em .55em; }
.badge-success { background: #e7f7f0; color: var(--ok); }
.badge-warn { background: #fdeaea; color: var(--bad); }
.bg-info { background: #e8f1fd !important; color: #1d4ed8; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-bad { background: var(--bad); }

/* ===== 辅助文字 / 描述列表 ===== */
.hint { font-size: .78rem; color: var(--ink-3); }
.kv { font-size: .85rem; }
.kv dt { color: var(--ink-3); font-weight: 400; }
.kv dd { margin-bottom: .5rem; }
.form-label-sm { font-size: .8rem; color: var(--ink-2); margin-bottom: 2px; }
.form-control, .form-select { border-color: var(--line); border-radius: var(--radius-sm); }
.form-control:focus, .form-select:focus {
  border-color: #a5b0ff; box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-label { font-size: .85rem; color: var(--ink-2); }
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .88rem; }
.alert-success { background: #eafaf3; color: #0b6b4b; border-color: #c7eddc; }
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fbd5d5; }
.alert-warning { background: #fff8e6; color: #92500a; border-color: #f7e5b8; }

/* =========================================================
   应用外壳：侧边导航 + 顶栏 + 内容区（用户端与管理端共用）
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: 0 0 232px; background: var(--sidebar); color: var(--sidebar-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #7c3aed 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .95rem; letter-spacing: -.02em;
  box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.sidebar-brand a {
  color: #fff; font-weight: 600; text-decoration: none; font-size: .98rem;
  display: block; line-height: 1.25;
}
.sidebar-brand .small { color: #6d7890; font-size: .7rem; margin-top: 2px; display: block; }
.sidebar-nav { padding: 8px 10px 12px; overflow-y: auto; flex: 1; }
.nav-group {
  padding: 14px 10px 6px; font-size: .68rem; letter-spacing: .1em;
  color: #5d687e; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin-bottom: 1px;
  color: var(--sidebar-ink); text-decoration: none;
  font-size: .89rem; border-radius: 8px; border-left: none;
  transition: background .12s, color .12s;
}
.nav-item .nav-ico { width: 16px; text-align: center; opacity: .75; font-size: .95rem; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.28), rgba(99,102,241,.12));
  color: #fff; font-weight: 500;
}
.nav-item.active .nav-ico { opacity: 1; }
.sidebar-foot {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: .76rem; color: #6d7890;
}
.sidebar-foot a { color: #93a0b8; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 58px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 22px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-title h1 { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.topbar-title .crumb { font-size: .74rem; color: var(--ink-3); }
.topbar-user { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.topbar-user .uname { font-size: .85rem; color: var(--ink-2); }
.topbar-user .role-chip {
  font-size: .7rem; background: var(--brand-soft); color: var(--brand-dark);
  border-radius: 20px; padding: 2px 8px;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; width: 34px; height: 32px; color: var(--ink-2);
  align-items: center; justify-content: center; font-size: 1rem;
}
.app-content { padding: 22px; max-width: 1600px; width: 100%; }
.brand-inline { font-weight: 600; color: var(--ink); text-decoration: none; margin-right: 8px; }
.top-link { color: var(--ink-2); text-decoration: none; font-size: .9rem; margin-right: 12px; }
.top-link:hover { color: var(--ink); }
.top-link.active { color: var(--brand); font-weight: 500; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 29;
}

/* 页面区块标题（老模板沿用 h6，这里统一观感） */
.page-note { color: var(--ink-3); font-size: .85rem; margin-top: 4px; }
.page-heading, .card-heading { gap: 12px; }
.page-heading > div, .card-heading > div { min-width: 0; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30; height: 100vh;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: 8px 0 30px rgba(0,0,0,.25);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .nav-toggle { display: inline-flex; }
  .app-content { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .topbar-user .uname { display: none; }
  .topbar-user { gap: 8px; }
  .page-heading { align-items: flex-start !important; flex-wrap: wrap; }
  .page-heading .btn { flex: 0 0 auto; white-space: nowrap; }
  .card-heading { align-items: flex-start !important; flex-wrap: wrap; }
  .metrics-heading { flex-direction: column; gap: 4px; }
  .table-wrap { padding-bottom: 3px; }
  .table-wrap > .table { min-width: 560px; }
  .table-wrap > .table.endpoint-table { min-width: 1080px; }
}

@media (max-width: 600px) {
  .page-heading { flex-direction: column; }
  .page-heading .btn { align-self: flex-start; }
}

@media (max-width: 420px) {
  .app-content { padding: 12px; }
  .app-content > .row { --bs-gutter-x: .75rem; }
  .stat-num { font-size: 1.55rem; }
}

/* =========================================================
   认证页：左品牌面板 + 右表单区
   客服信息放进品牌面板，不再用通栏白条，消除"拼接感"
   ========================================================= */
.auth-shell { display: flex; min-height: 100vh; }
.auth-aside {
  width: 42%; max-width: 520px; flex: 0 0 42%;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(99,102,241,.35), transparent 60%),
    linear-gradient(160deg, #131a2e 0%, #1b2240 55%, #241a3f 100%);
  color: #e6e9f2; padding: 46px 44px; display: flex; flex-direction: column;
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.15rem; border-radius: 12px; }
.auth-brand-name { font-size: 1.3rem; font-weight: 650; letter-spacing: .02em; }
.auth-brand-sub { font-size: .8rem; color: #9aa3bd; margin-top: 2px; }
.auth-hero { margin-top: 54px; }
.auth-hero h2 { color: #fff; font-size: 1.55rem; font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
.auth-hero p { color: #a8b0c8; font-size: .92rem; line-height: 1.9; margin: 0; }
.auth-points { margin-top: 30px; display: grid; gap: 14px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: #c3c9dc; }
.auth-point .tick {
  flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%;
  background: rgba(99,102,241,.25); color: #b9bffd;
  display: inline-flex; align-items: center; justify-content: center; font-size: .68rem;
}
.auth-support {
  margin-top: auto; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 16px;
}
.auth-support-qr {
  width: 88px; height: 88px; flex: 0 0 88px; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 5px;
}
.auth-support-text { font-size: .82rem; color: #a8b0c8; line-height: 1.8; }
.auth-support-text b { color: #e6e9f2; font-weight: 500; display: block; margin-bottom: 2px; }
.auth-support-text a { color: #b9bffd; text-decoration: none; font-variant-numeric: tabular-nums; }
.auth-support-text a:hover { text-decoration: underline; }

.auth-main {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box > .card { padding: 28px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.auth-box-title { font-size: 1.25rem; margin-bottom: 4px; }
.auth-box-desc { font-size: .85rem; color: var(--ink-3); margin-bottom: 20px; }
.auth-box .nav-tabs { border-bottom: 1px solid var(--line); }
.auth-box .nav-tabs .nav-link {
  border: none; border-bottom: 2px solid transparent; color: var(--ink-2);
  font-size: .9rem; padding: .5rem .8rem;
}
.auth-box .nav-tabs .nav-link.active {
  color: var(--brand); border-bottom-color: var(--brand); background: none; font-weight: 500;
}
.auth-box .nav-tabs .nav-link:hover { border-color: transparent; color: var(--brand); }
.auth-box .btn-primary { padding: .55rem; font-weight: 500; }
.auth-mobile-brand { display: none; }
.auth-mobile-support { display: none; }

/* 窄屏：品牌面板收起，只留顶部一行品牌 + 底部一行客服 */
@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-aside {
    width: 100%; max-width: none; flex: 0 0 auto;
    padding: 16px 20px; flex-direction: row; align-items: center; gap: 12px;
  }
  .auth-aside .auth-hero, .auth-aside .auth-points, .auth-aside .auth-support { display: none; }
  .auth-brand .brand-mark { width: 30px; height: 30px; flex-basis: 30px; font-size: .95rem; border-radius: 9px; }
  .auth-brand-name { font-size: 1.05rem; }
  .auth-brand-sub { font-size: .72rem; }
  .auth-main { padding: 26px 14px; justify-content: flex-start; }
  .auth-box > .card { padding: 20px; box-shadow: var(--shadow); }
  .auth-mobile-support {
    display: flex; align-items: center; gap: 16px; justify-content: flex-start;
    margin-top: 18px; padding: 14px 16px; font-size: .85rem; color: var(--ink-3);
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow);
  }
  .auth-mobile-support img {
    width: 96px; height: 96px; flex: 0 0 96px; object-fit: contain;
    background: #fff; padding: 4px; border-radius: 8px; border: 1px solid var(--line);
  }
  .auth-mobile-support-text { line-height: 1.8; }
  .auth-mobile-support-text b { display: block; color: var(--ink); font-size: .95rem; margin-bottom: 2px; }
  .auth-mobile-support a { color: var(--brand); text-decoration: none; font-variant-numeric: tabular-nums; }
  .auth-mobile-support a:hover { text-decoration: underline; }
}

/* CLI 授权页卡片内的联系我们（任何屏幕尺寸都展示） */
.auth-contact {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px; padding: 12px 14px;
  border: 1px dashed var(--line); border-radius: 12px; background: var(--bg);
  font-size: .8rem; color: var(--ink-3); line-height: 1.75;
}
.auth-contact img {
  width: 84px; height: 84px; flex: 0 0 84px; object-fit: contain;
  background: #fff; padding: 4px; border-radius: 8px; border: 1px solid var(--line);
}
.auth-contact b { display: block; color: var(--ink); font-size: .86rem; margin-bottom: 2px; }
.auth-contact a { color: var(--brand); text-decoration: none; font-variant-numeric: tabular-nums; }
.auth-contact a:hover { text-decoration: underline; }
/* CLI 页卡片内已有「联系我们」，隐藏侧栏/底部重复的客服模块 */
.auth-cli-page .auth-aside .auth-support,
.auth-cli-page .auth-mobile-support { display: none; }

/* 兼容旧登录页类名（若还有模板引用） */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.login-main { flex: 1 0 auto; width: 100%; max-width: 424px; margin: 0 auto; padding: 40px 12px 28px; }
.login-title { margin: 0 0 22px; text-align: center; font-size: 1.65rem; font-weight: 600; }
.login-foot { padding: 20px 12px 24px; text-align: center; color: var(--ink-3); font-size: .82rem; }
.login-qr { display: block; width: 128px; height: 128px; margin: 0 auto 10px; object-fit: contain; }
.login-tel a { color: var(--brand); text-decoration: none; font-variant-numeric: tabular-nums; }
