/* ============================================================
   线索后台 · 精炼金融级主题（叠加在 Bootstrap 5 之上）
   统一色系：Slate 石板冷灰 + 单一皇家蓝 #2563eb
   字体：Geist（拉丁/数字）+ 系统中文回退
   ============================================================ */

@font-face { font-family: "Geist"; font-weight: 400; font-display: swap; src: url("/static/vendor/fonts/geist/latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 500; font-display: swap; src: url("/static/vendor/fonts/geist/latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 600; font-display: swap; src: url("/static/vendor/fonts/geist/latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 700; font-display: swap; src: url("/static/vendor/fonts/geist/latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-weight: 800; font-display: swap; src: url("/static/vendor/fonts/geist/latin-800-normal.woff2") format("woff2"); }

:root {
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-active: #1e40af;
  --brand-soft: #eff6ff;

  /* 单一 slate 色阶，让内容区与 navy 侧栏同源 */
  --ink: #0f172a;        /* slate-900 = 侧栏底色，标题用它，天然呼应 */
  --ink-2: #334155;      /* slate-700 正文 */
  --muted: #64748b;      /* slate-500 次要 */
  --faint: #94a3b8;      /* slate-400 */
  --line: #e2e8f0;       /* slate-200 边框 */
  --line-soft: #eef2f6;  /* 更浅分割线 */
  --bg: #f1f5f9;         /* slate-100 内容底 */
  --surface: #ffffff;

  --side-bg: #0f172a;
  --side-bg-2: #0b1120;
  --side-text: #cbd5e1;
  --side-muted: #5b6b86;
  --side-icon: #8895ad;

  --font-sans: "Geist", -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;

  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-border-color: var(--line);
  --bs-body-color: var(--ink-2);
  --bs-body-bg: var(--bg);
  --bs-border-radius: .6rem;
  --bs-font-sans-serif: var(--font-sans);
}

body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* 数字统一等宽，表格/统计读数更整齐（金融级细节）*/
.table, .stat-value, .topbar, .badge-soft, .page-title, .pagination, dd { font-variant-numeric: tabular-nums; }

/* ---- 品牌色覆盖 ---- */
.btn { --bs-btn-font-size: .85rem; font-weight: 500; }
.btn-sm { --bs-btn-font-size: .8rem; }
.btn-primary {
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-hover);
  --bs-btn-hover-border-color: var(--brand-hover);
  --bs-btn-active-bg: var(--brand-active);
  --bs-btn-active-border-color: var(--brand-active);
  --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-active);
}
/* 次要按钮统一成 slate 描边，不再是 Bootstrap 灰 */
.btn-outline-secondary {
  --bs-btn-color: #475569; --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #f8fafc; --bs-btn-hover-border-color: #cbd5e1;
  --bs-btn-active-bg: #f1f5f9; --bs-btn-active-border-color: #cbd5e1; --bs-btn-active-color: var(--ink);
}
.btn-light {
  --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-color: #475569;
  --bs-btn-hover-bg: #f8fafc; --bs-btn-hover-border-color: #cbd5e1; --bs-btn-hover-color: var(--ink);
}
.form-control, .form-select { color: var(--ink-2); border-color: var(--line); }
.form-control:focus, .form-select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .15); }
.form-label { font-size: .82rem; color: #475569; margin-bottom: .35rem; font-weight: 500; }

/* ============================================================
   外壳：深色 slate 侧栏 + 顶栏 + 内容
   ============================================================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  --bs-offcanvas-width: 248px;
  --bs-offcanvas-bg: var(--side-bg);
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  height: 60px;
  display: flex; align-items: center; gap: 11px;
  padding: 0 18px;
  font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em;
  color: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
  flex: none;
}
.sidebar .brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .5);
}
.sidebar .nav { padding: 14px 12px; overflow-y: auto; }
.sidebar .nav-section {
  font-size: .67rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--side-muted); font-weight: 600;
  padding: 16px 12px 7px;
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: .56rem .75rem; margin: 3px 0;
  border-radius: .55rem;
  color: var(--side-text); font-size: .9rem; font-weight: 500; line-height: 1.2;
  transition: background .15s, color .15s;
}
.sidebar .nav-link .bi { font-size: 1.05rem; width: 20px; text-align: center; color: var(--side-icon); transition: color .15s; }
.sidebar .nav-link:hover { background: rgba(148, 163, 184, .1); color: #fff; }
.sidebar .nav-link:hover .bi { color: #cbd5e1; }
.sidebar .nav-link.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, .55);
}
.sidebar .nav-link.active .bi { color: #fff; }

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

.topbar {
  height: 60px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: .85rem; color: var(--muted); }
.topbar .crumb b { color: var(--ink); font-weight: 600; }
.topbar .me { display: flex; align-items: center; gap: 14px; }
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 600;
}
.topbar .who { font-size: .85rem; color: var(--ink); line-height: 1.2; }
.topbar .who small { display: block; color: var(--muted); font-size: .72rem; }

.content { padding: 26px 28px; flex: 1; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--ink); }
.page-sub { font-size: .85rem; color: var(--muted); margin-top: 3px; }

@media (min-width: 768px) {
  .sidebar.offcanvas-md {
    position: fixed; top: 0; left: 0; bottom: 0; width: 248px;
    transform: none; visibility: visible; z-index: 1030;
  }
  .app-main { margin-left: 248px; }
}

/* ============================================================
   卡片 / 表格 / 徽章
   ============================================================ */
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
}
.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
  padding: 1rem 1.25rem;
  font-weight: 600; font-size: .95rem; color: var(--ink);
  border-top-left-radius: 14px; border-top-right-radius: 14px;
}

.table { margin: 0; --bs-table-bg: transparent; color: var(--ink-2); }
.table thead th {
  background: #f8fafc; color: var(--muted);
  font-weight: 600; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); padding: .72rem 1rem; white-space: nowrap;
}
.table tbody td { padding: .82rem 1rem; font-size: .87rem; vertical-align: middle; border-color: var(--line-soft); color: var(--ink-2); }
.table tbody td.fw-semibold, .table tbody td .fw-semibold { color: var(--ink); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table .muted { color: var(--muted); }

/* 状态徽章：圆点 + 淡底 tag（克制、专业，告别糖果色）*/
.badge-soft {
  display: inline-flex; align-items: center; gap: .42em;
  font-weight: 600; font-size: .72rem;
  padding: .3em .62em .3em .56em; border-radius: 7px;
  line-height: 1.45; white-space: nowrap;
}
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-soft.success { background: #ecfdf5; color: #047857; }
.badge-soft.warning { background: #fff7ed; color: #c2410c; }
.badge-soft.danger  { background: #fef2f2; color: #b91c1c; }
.badge-soft.info    { background: #eff6ff; color: #1d4ed8; }
.badge-soft.gray    { background: #f1f5f9; color: #475569; }

/* 统计卡片 */
.stat-card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  transition: box-shadow .18s, transform .18s;
}
.stat-card:hover { box-shadow: 0 8px 24px -10px rgba(15, 23, 42, .18); transform: translateY(-2px); }
.stat-card .stat-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex: none;
}
.stat-card .stat-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.05; color: var(--ink); letter-spacing: -.02em; }
.ico-indigo { background: #dbeafe; color: #2563eb; }
.ico-green  { background: #ecfdf5; color: #059669; }
.ico-amber  { background: #fffbeb; color: #d97706; }
.ico-sky    { background: #e0f2fe; color: #0284c7; }
.ico-red    { background: #fef2f2; color: #dc2626; }

/* 弹窗 */
.modal-content { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .4); }
.modal-header, .modal-footer { border-color: var(--line-soft); }
.modal-title { color: var(--ink); font-weight: 700; letter-spacing: -.01em; }

/* 截图 */
.review-shot { max-height: 180px; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; }
.review-shot.js-shot { cursor: zoom-in; transition: transform .12s ease; }
.review-shot.js-shot:hover { transform: scale(1.02); }
.shot-fallback {
  display: inline-flex; align-items: center; justify-content: center;
  width: 120px; height: 90px; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--faint); font-size: .72rem; background: #f8fafc;
}

/* 截图灯箱 */
.lightbox { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, .88); }
.lightbox[hidden] { display: none; }
.lb-img { max-width: 90vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.lb-close, .lb-nav { position: absolute; background: rgba(255, 255, 255, .14); color: #fff; border: 0; cursor: pointer; border-radius: 999px; display: flex; align-items: center; justify-content: center; transition: background .12s ease; }
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .3); }
.lb-close { top: 20px; right: 24px; width: 44px; height: 44px; font-size: 1.7rem; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 1.5rem; }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; font-size: .85rem; background: rgba(0, 0, 0, .45); padding: 4px 14px; border-radius: 999px; }

.pagination { --bs-pagination-color: #475569; --bs-pagination-hover-color: var(--ink); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-border-color: var(--line); }
