/* ============================================================
 * GEO 营销云 · 界面主题（Soft Board）
 * 设计语言：浅蓝雾面画布 + 大圆角浮层 + 白色内嵌卡片
 * 只覆盖 Bootstrap 组件，不改动任何业务 HTML 结构
 * ============================================================ */

:root {
  --canvas: #e5e9f1;
  --canvas-top: #e9edf6;
  --panel: linear-gradient(165deg, #dae2f1 0%, #dfe6f4 45%, #dce3f2 100%);
  --card: #ffffff;
  --ink: #101319;
  --ink-2: #2f3745;
  --muted: #8a93a5;
  --muted-2: #a6aebe;
  --line: rgba(18, 26, 44, .07);
  --line-2: rgba(18, 26, 44, .05);
  --accent: #12151b;
  --accent-soft: #f0f3fa;
  --blue-soft: #cfe0fb;
  --mint-soft: #c9ecd9;
  --coral-soft: #f8c3bd;
  --amber-soft: #fae5bd;
  --lilac-soft: #e2dcfa;
  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 13px;
  --shadow-card: 0 14px 34px -26px rgba(21, 34, 61, .55), 0 1px 2px rgba(21, 34, 61, .03);
  --shadow-pop: 0 28px 70px -28px rgba(18, 30, 58, .38);
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body { min-height: 100%; }

body {
  background:
    radial-gradient(1100px 520px at 12% -8%, #e6eeff 0%, rgba(230, 238, 255, 0) 62%),
    radial-gradient(900px 460px at 92% 2%, #f0ecfd 0%, rgba(240, 236, 253, 0) 58%),
    var(--canvas);
  color: var(--ink);
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  letter-spacing: -.005em;
  padding-top: 88px;
}

a { color: #2f5fbe; text-decoration: none; }
a:hover { color: #1d4287; }

::selection { background: #cfe0fb; color: #101319; }

/* 细滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6e4; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c2d4; background-clip: content-box; border: 3px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
 * 1. 顶部栏
 * ============================================================ */
.app-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  max-width: 100vw;
  height: 88px;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 30px 0 24px;
  background: linear-gradient(180deg, rgba(236, 239, 246, .96) 0%, rgba(236, 239, 246, .72) 70%, rgba(236, 239, 246, 0) 100%);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(18, 21, 27, .8);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .02em; margin-left: 2px; }

/* 主导航 */
.topnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}
.topnav-item { position: relative; }
.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: #5b6474;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.topnav-link:hover { background: rgba(255, 255, 255, .78); color: var(--ink); }
.topnav-link.active { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -14px rgba(18, 21, 27, .9); }
.topnav-link .caret { width: 13px; height: 13px; opacity: .5; transition: transform .2s ease; }
.topnav-item.show .topnav-link .caret { transform: rotate(180deg); }

/* 下拉浮层 */
.dropdown-menu {
  --bs-dropdown-border-width: 0;
  border-radius: 20px;
  padding: 8px;
  min-width: 232px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-pop);
  border: 1px solid rgba(255, 255, 255, .9);
  margin-top: 10px !important;
}
.dropdown-item {
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #39414f;
  display: flex;
  align-items: center;
  gap: 9px;
}
.dropdown-item:hover, .dropdown-item:focus { background: #f2f5fb; color: var(--ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--accent); color: #fff; }
.dropdown-divider { border-color: var(--line); margin: 6px 4px; }
.dropdown-header {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 8px 12px 4px;
  font-weight: 600;
}

/* 右侧动作 */
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #4a5364;
  box-shadow: 0 6px 16px -14px rgba(21, 34, 61, .6);
  transition: transform .16s ease, background .16s ease, color .16s ease;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: #fff; color: var(--ink); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 6px; height: 6px; border-radius: 99px;
  background: #e2604f; box-shadow: 0 0 0 2px #fff;
}

.avatar-btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 42px; padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  font-size: 13px;
  box-shadow: 0 6px 16px -14px rgba(21, 34, 61, .6);
}
.avatar-btn:hover { background: #fff; color: var(--ink); }
.avatar {
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #cfe0fb, #e2dcfa);
  color: #2b3b60; font-weight: 600; font-size: 12.5px;
  letter-spacing: 0;
}
.avatar-lg { width: 48px; height: 48px; font-size: 15px; }

/* ============================================================
 * 2. 左侧图标导轨
 * ============================================================ */
.rail {
  position: fixed;
  top: 96px;
  left: 20px;
  bottom: 22px;
  width: 60px;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.rail-btn {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #7f8899;
  transition: all .16s ease;
}
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn:hover { background: rgba(255, 255, 255, .85); color: var(--ink); border-color: rgba(255, 255, 255, .9); box-shadow: 0 8px 18px -16px rgba(21, 34, 61, .8); }
.rail-btn.active { background: #fff; color: var(--ink); box-shadow: 0 10px 22px -18px rgba(21, 34, 61, .9); border-color: rgba(255, 255, 255, .9); }
.rail-btn.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 99px; background: var(--accent);
}
.rail-sep { width: 22px; height: 1px; background: rgba(18, 26, 44, .09); margin: 6px 0; }
.rail-spacer { flex: 1 1 auto; }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* 悬浮提示 */
.rail-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  background: var(--accent); color: #fff;
  font-size: 11.5px; line-height: 1; padding: 8px 10px;
  border-radius: 9px; white-space: nowrap; z-index: 20;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .7);
}

/* ============================================================
 * 3. 主面板
 * ============================================================ */
.app-main {
  margin: 0 26px 40px 100px;
  padding: 26px 26px 34px;
  border-radius: var(--r-xl);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 40px 80px -60px rgba(20, 34, 64, .55), inset 0 1px 0 rgba(255, 255, 255, .8);
  min-height: 0;
}
.app-main > * { max-width: 1560px; }

/* 平台代管提示条 */
.act-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 18px;
  border-radius: 14px; font-size: 12.5px; color: #7a4a10;
  background: linear-gradient(90deg, #fff2dc, #fffaf2);
  border: 1px solid #f1ddba;
}
.act-bar b { color: #6b3d08; }
.act-bar .act-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #d98a1e; flex: 0 0 6px;
  box-shadow: 0 0 0 3px rgba(217, 138, 30, .15);
}
.act-bar a { margin-left: auto; font-weight: 600; color: #7a4a10; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .act-bar { flex-wrap: wrap; font-size: 11.5px; } .act-bar a { margin-left: 16px; } }

.app-foot {
  margin: 0 26px 30px 100px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .02em;
}

/* 页面标题（页面里的裸 h4 / h5）
 * 用后代选择器而非 >，因为很多页面把标题放在 d-flex 头部的 div 里，
 * 用 > 会让这些标题掉回浏览器默认的 24px/500，跟其他页面对不齐。 */
main h4 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.035em;
  color: var(--ink);
  margin: 2px 0 20px;
  line-height: 1.2;
}
main h4.mb-1 { margin-bottom: 6px; }
main h5 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink-2);
  margin: 28px 0 12px;
}
main h6 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
main > p.text-muted, main .d-flex > div > p.text-muted { color: var(--muted) !important; }

/* ============================================================
 * 4. 卡片
 * ============================================================ */
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card.p-3 { padding: 20px !important; }
.card.p-4 { padding: 26px !important; }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--line-2);
  padding: 16px 20px;
  font-size: 13.5px;
  font-weight: 600;
}
.card-body { padding: 20px; }
.card-footer { background: transparent; border-top: 1px solid var(--line-2); padding: 14px 20px; }
.card h6 { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); margin-bottom: 14px; }
.card h5 { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }

/* 可点击卡片 */
a.card { color: inherit; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 22px 44px -30px rgba(21, 34, 61, .6); color: inherit; }

/* 统计数字 */
.stat-num {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.045em;
  color: var(--ink);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .01em;
  margin-top: 6px;
}
/* 当 label 是卡片第一行（快捷入口卡）时，不需要额外的上边距 */
.stat-label:first-child { margin-top: 0; }

/* 快捷入口卡：标题/说明两级层次，右侧箭头暗示可点，整卡等高 */
.quick-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  height: 100%;
  min-height: 86px;
  padding: 16px 18px !important;
  position: relative;
  border-radius: 20px;
}
.quick-card .qc-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  line-height: 1.35;
  padding-right: 16px;
}
.quick-card .qc-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.quick-card::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-top: 1.6px solid var(--muted-2);
  border-right: 1.6px solid var(--muted-2);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .16s ease, transform .16s ease;
}
.quick-card:hover::after { opacity: 1; transform: translateX(2px) rotate(45deg); }
.quick-card:hover .qc-title { color: #1d4287; }

/* 统计卡：数字与标签之间留出呼吸位，避免多行标签贴住数字 */
.stat-card { padding: 18px 20px !important; display: flex; flex-direction: column; justify-content: center; gap: 8px; height: 100%; }
.stat-card .stat-label { margin-top: 0; }

/* 语义色描边卡片：只做极淡的色相提示，不抢白色卡片的主体感 */
.card.border-info { border-color: #dce8fb !important; }
.card.border-info .stat-num { color: #3b66c4; }
.card.border-primary { border-color: #d7e4fa !important; }
.card.border-danger { border-color: #f7dbd7 !important; }
.card.border-success { border-color: #d3ecdd !important; }
.card.border-warning { border-color: #f6e6c8 !important; }
.card.border-secondary { border-color: #e2e6ef !important; }
.card.border-dark { border-color: #d9dde5 !important; }

/* ============================================================
 * 5. 表格
 * ============================================================ */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink-2);
  margin-bottom: 0;
  font-size: 13px;
  border-color: var(--line-2);
}
.table > :not(caption) > * > * {
  padding: 12px 14px;
  border-bottom-color: var(--line-2);
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
}
.table > thead > tr > th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  padding-top: 6px;
  padding-bottom: 9px;
  white-space: nowrap;
}
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: #f7f9fd; }
.table-sm > :not(caption) > * > * { padding: 11px 12px; }
.table-responsive { border-radius: var(--r-md); }
.card > .table-responsive { padding: 2px 6px 6px; }
.table td .small, .table td small { color: var(--muted); }

/* 数字列：等宽数字 + 右对齐，避免位数不同的数值左右乱跳 */
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 窄屏下表格按内容撑开横向滚动，而不是把每列压成一个字宽 */
.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > td { min-width: 62px; }
.table-responsive > .table > thead > tr > th:first-child,
.table-responsive > .table > tbody > tr > td:first-child { min-width: 180px; }

/* ============================================================
 * 5.1 分页条（统一由 paginate_render() 输出）
 * ============================================================ */
.pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 15px 2px 2px;
  margin-top: 12px;
  border-top: 1px solid var(--line-2);
}
.pager-info { font-size: 12px; color: var(--muted); margin-right: auto; }
.pager-info b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager-sep { margin: 0 6px; color: var(--muted-2); }
.pager-range { color: var(--muted-2); }

.pager-nav { display: flex; align-items: center; gap: 3px; }
.pager-btn, .pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pager-num { padding: 0 8px; font-variant-numeric: tabular-nums; }
a.pager-btn:hover, a.pager-num:hover { background: #eef2fa; color: var(--ink); border-color: var(--line); }
.pager-num.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.pager-btn.is-disabled { color: #bcc4d3; cursor: not-allowed; }
.pager-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; color: var(--muted-2); font-size: 12px; }

.pager-size label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pager-size select {
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
}
@media (max-width: 860px) {
  .pager { gap: 8px 10px; padding-top: 12px; }
  .pager-info { order: 1; width: auto; flex: 1 1 auto; margin-right: 0; font-size: 11.5px; }
  .pager-range { display: none; }
  .pager-size { order: 2; margin-left: auto; flex: 0 0 auto; }
  .pager-size label { gap: 4px; }
  .pager-nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .pager-btn, .pager-num { height: 30px; min-width: 30px; padding: 0 8px; font-size: 12px; flex: 0 0 auto; white-space: nowrap; }
  /* 窄屏把「上一页/下一页」收成箭头，省出两列页码宽度 */
  .pager-btn { font-size: 0; width: 30px; padding: 0; }
  .pager-btn::before { content: "‹"; font-size: 16px; line-height: 1; }
  .pager-nav > .pager-btn:last-of-type::before { content: "›"; }
}

/* ============================================================
 * 6. 徽章 / 提示条
 * ============================================================ */
.badge {
  border-radius: 999px;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .01em;
  padding: 5px 9px;
  line-height: 1.25;
  vertical-align: middle;
}
.badge.bg-primary { background: var(--blue-soft) !important; color: #1f4485 !important; }
.badge.bg-success { background: var(--mint-soft) !important; color: #1c6444 !important; }
.badge.bg-danger  { background: var(--coral-soft) !important; color: #8f2f26 !important; }
.badge.bg-warning { background: var(--amber-soft) !important; color: #7a5518 !important; }
.badge.bg-info    { background: #cfeaf3 !important; color: #16576b !important; }
.badge.bg-secondary { background: #e6e9f1 !important; color: #4b5464 !important; }
.badge.bg-dark { background: #171a20 !important; color: #fff !important; }
.badge.bg-light { background: #f1f4fa !important; color: #596172 !important; }
.badge.bg-white { background: #fff !important; color: var(--ink-2) !important; }
.badge.border { border-color: var(--line) !important; }

/* 进度条 */
.progress { background: #eef1f7; border-radius: 999px; overflow: hidden; }
.progress-bar { border-radius: 999px; }
.progress-bar.bg-primary { background: #8fb4f2 !important; }
.progress-bar.bg-success { background: #86cda6 !important; }
.progress-bar.bg-warning { background: #f0c884 !important; }
.progress-bar.bg-danger { background: #ef9a92 !important; }
.progress-bar.bg-secondary { background: #c3cad8 !important; }
.progress-bar.bg-info { background: #92cfe0 !important; }
.progress-bar.bg-light { background: #e7ebf3 !important; }
.progress-bar.bg-dark { background: #262b34 !important; }

/* 提示条 */
.alert {
  border: 0;
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 13px;
  background: #f4f6fb;
  color: #414a59;
}
.alert-light { background: rgba(255, 255, 255, .72); color: #4a5364; border: 1px solid rgba(255, 255, 255, .9); }
.alert-primary { background: #e8f0fd; color: #22457f; }
.alert-success { background: #e4f5eb; color: #1d6446; }
.alert-danger  { background: #fdecea; color: #8d2f26; }
.alert-warning { background: #fdf3e0; color: #7a5518; }
.alert-info    { background: #e6f3f8; color: #16576b; }
.alert-secondary { background: #eef1f6; color: #4b5464; }
.alert .btn-close { opacity: .45; }
.alert a { font-weight: 500; }

/* ============================================================
 * 7. 按钮
 * ============================================================ */
.btn {
  --bs-btn-font-size: 13px;
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: 999px;
  --bs-btn-padding-x: 16px;
  --bs-btn-padding-y: 8px;
  letter-spacing: -.005em;
  transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { --bs-btn-font-size: 12px; --bs-btn-padding-x: 12px; --bs-btn-padding-y: 6px; }
.btn-lg { --bs-btn-font-size: 14px; --bs-btn-padding-x: 22px; --bs-btn-padding-y: 11px; }

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #262a33;
  --bs-btn-hover-border-color: #262a33;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-disabled-bg: #b9bfca;
  --bs-btn-disabled-border-color: #b9bfca;
  box-shadow: 0 10px 22px -16px rgba(18, 21, 27, .9);
}
.btn-dark {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: #262a33;
  --bs-btn-hover-border-color: #262a33;
}
.btn-outline-primary {
  --bs-btn-color: #2d3748;
  --bs-btn-border-color: rgba(18, 26, 44, .12);
  --bs-btn-bg: rgba(255, 255, 255, .7);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-border-color: rgba(18, 26, 44, .2);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
}
.btn-outline-secondary {
  --bs-btn-color: #59617a;
  --bs-btn-border-color: rgba(18, 26, 44, .1);
  --bs-btn-bg: rgba(255, 255, 255, .6);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: rgba(18, 26, 44, .18);
}
.btn-outline-danger {
  --bs-btn-color: #a13a2f;
  --bs-btn-border-color: #f3cdc8;
  --bs-btn-bg: #fff;
  --bs-btn-hover-bg: #fdeeec;
  --bs-btn-hover-border-color: #eab5ae;
  --bs-btn-hover-color: #8d2f26;
}
.btn-outline-success {
  --bs-btn-color: #1d6a49;
  --bs-btn-border-color: #c9e8d6;
  --bs-btn-bg: #fff;
  --bs-btn-hover-bg: #e9f7ef;
  --bs-btn-hover-border-color: #a9d9bd;
  --bs-btn-hover-color: #175a3d;
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: rgba(18, 26, 44, .08); --bs-btn-color: #3a4353; --bs-btn-hover-bg: #f5f7fb; --bs-btn-hover-color: var(--ink); }
.btn-success { --bs-btn-bg: #1f7a55; --bs-btn-border-color: #1f7a55; --bs-btn-hover-bg: #196647; --bs-btn-hover-border-color: #196647; }
.btn-danger { --bs-btn-bg: #b8453a; --bs-btn-border-color: #b8453a; --bs-btn-hover-bg: #a03b31; --bs-btn-hover-border-color: #a03b31; }
.btn-secondary { --bs-btn-bg: #e8ecf4; --bs-btn-border-color: #e8ecf4; --bs-btn-color: #40495a; --bs-btn-hover-bg: #dfe4ef; --bs-btn-hover-color: #101319; }
.btn-link { color: #2f5fbe; text-decoration: none; }
.btn-link:hover { color: #1d4287; }
.btn-group > .btn { border-radius: 999px !important; }
.btn-group { gap: 4px; }

/* ============================================================
 * 8. 表单
 * ============================================================ */
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.form-control, .form-select {
  border-radius: var(--r-sm);
  border: 1px solid rgba(18, 26, 44, .1);
  background-color: #f7f9fd;
  padding: 9px 13px;
  font-size: 13px;
  color: var(--ink);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.form-control::placeholder { color: #8d97a9; }
body.portal-page { padding-top: 0; }
body.portal-page main.container { max-width: 1560px; }

.form-control:focus, .form-select:focus {
  background-color: #fff;
  border-color: #bed0ee;
  box-shadow: 0 0 0 4px rgba(120, 152, 208, .13);
  color: var(--ink);
}
.form-control-sm, .form-select-sm { border-radius: 11px; padding: 6px 10px; font-size: 12.5px; }
textarea.form-control { border-radius: var(--r-md); }
.form-check-input { border-color: #d3dae8; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-text { font-size: 11.5px; color: var(--muted-2); }
.input-group-text { background: #f4f6fb; border: 0; border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; }
.form-switch .form-check-input { width: 2.2em; }

/* ============================================================
 * 9. 标签页 / 分页 / 其他
 * ============================================================ */
.nav-pills {
  background: rgba(255, 255, 255, .6);
  padding: 4px;
  border-radius: 999px;
  display: inline-flex;
  gap: 2px;
}
.nav-pills .nav-link {
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: #5d6676;
  padding: 7px 14px;
}
.nav-pills .nav-link:hover { color: var(--ink); }
.nav-pills .nav-link.active { background: var(--accent); color: #fff; }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link { border: 0; color: var(--muted); font-size: 13px; padding: 10px 14px; }
.nav-tabs .nav-link.active { color: var(--ink); background: transparent; border-bottom: 2px solid var(--accent); }

.pagination { gap: 4px; }
.page-link { border: 0; border-radius: 999px !important; color: #4a5364; font-size: 12.5px; padding: 7px 12px; background: rgba(255, 255, 255, .7); }
.page-item.active .page-link { background: var(--accent); color: #fff; }

code, .pre, pre {
  background: #f3f5fb;
  border-radius: 12px;
  font-size: 12px;
  color: #3b4658;
}
.pre { padding: 12px 14px; }
code { padding: 2px 6px; }

hr { border-color: var(--line); opacity: 1; }
.text-muted { color: var(--muted) !important; }
.text-dark { color: var(--ink) !important; }
.text-info { color: #3b66c4 !important; }
.text-primary { color: #2f5fbe !important; }
.text-success { color: #1f8a5b !important; }
.text-danger { color: #c04435 !important; }
.text-warning { color: #b07a1c !important; }
.fw-semibold { font-weight: 600 !important; }
.border { border-color: var(--line) !important; }
.border-bottom { border-color: var(--line) !important; }
.border-top { border-color: var(--line) !important; }
.bg-light { background: #f5f7fb !important; }
.bg-white { background: #fff !important; }
.bg-body-tertiary { background: #f4f6fb !important; }

/* 折叠面板 */
details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 6px; }

/* 登录 / 注册 */
body.auth-page { padding-top: 0; }
/* 登录/注册卡里的标题不该套用页面级 30px */
body.auth-page main h4 { font-size: 22px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 18px; }
body.auth-page main h4.mb-3 { margin-bottom: 18px; }
body.auth-page .app-topbar,
body.auth-page .rail,
body.auth-page .app-foot { display: none; }
body.auth-page .app-main {
  margin: 0; padding: 40px 20px; min-height: 100vh;
  background: transparent; border: 0; box-shadow: none;
  display: grid; place-items: center;
}
.auth-wrap { max-width: 430px; margin: 0 auto; width: 100%; }
.auth-wrap .card { padding: 34px !important; border-radius: 30px; }
.auth-wrap h4 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }

/* ============================================================
 * 10. 移动端抽屉
 * ============================================================ */
.nav-sheet {
  position: fixed;
  inset: 88px 12px auto 12px;
  z-index: 1039;
  display: none;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-pop);
  max-height: calc(100vh - 110px);
  overflow: auto;
}
body.nav-open .nav-sheet { display: block; }
.nav-sheet h6 {
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 14px 10px 6px;
  font-weight: 600;
}
.nav-sheet a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  color: #39414f;
  font-size: 13.5px;
}
.nav-sheet a:hover, .nav-sheet a.active { background: #f2f5fb; color: var(--ink); }
.nav-sheet a.active { background: var(--accent); color: #fff; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 1038;
  background: rgba(18, 24, 38, .28);
  backdrop-filter: blur(3px);
  display: none;
}
body.nav-open .sheet-backdrop { display: block; }
.menu-btn { display: none !important; }

/* ============================================================
 * 11. 全局搜索
 * ============================================================ */
.spotlight {
  position: fixed; inset: 0; z-index: 1060;
  display: none;
  padding: 12vh 20px 20px;
  background: rgba(21, 28, 42, .32);
  backdrop-filter: blur(6px);
}
.spotlight.show { display: block; }
.spotlight-card {
  width: min(620px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 50px 90px -40px rgba(10, 18, 34, .7);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .8);
}
.spotlight-input {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-2);
}
.spotlight-input svg { width: 18px; height: 18px; color: var(--muted); }
.spotlight-input input {
  border: 0; outline: 0; flex: 1; font-size: 15px; color: var(--ink); background: transparent;
}
.spotlight-list { max-height: 52vh; overflow: auto; padding: 8px; }
.spotlight-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 14px; color: #39414f; font-size: 13.5px;
}
.spotlight-item:hover, .spotlight-item.sel { background: #f2f5fb; color: var(--ink); }
.spotlight-item .kbd, .spotlight kbd {
  margin-left: auto; font-size: 10.5px; color: var(--muted-2); background: #f4f6fb;
  border-radius: 6px; padding: 3px 6px; font-family: inherit;
}
.spotlight-item .ico { width: 30px; height: 30px; border-radius: 9px; background: #f4f6fb; display: grid; place-items: center; color: #6b7686; }
.spotlight-item .ico svg { width: 15px; height: 15px; }
.spotlight-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* ============================================================
 * 12. 响应式
 * ============================================================ */
@media (max-width: 1280px) {
  .brand-sub { display: none; }
  .topnav-link { padding: 0 11px; font-size: 13px; }
}

@media (max-width: 1080px) {
  .topnav { display: none; }
  .menu-btn { display: inline-grid !important; }
  .app-main { margin: 0 16px 30px 90px; }
  .app-foot { margin-left: 90px; }
}

@media (max-width: 860px) {
  body { padding-top: 76px; }
  .app-topbar { height: 76px; padding: 0 12px; gap: 8px; }
  .topbar-actions { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; }
  .brand { font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
  .rail { display: none; }
  .app-main { margin: 0 12px 26px; padding: 18px 16px 26px; border-radius: 26px; min-height: auto; }
  .app-foot { margin: 0 16px 24px; }
  main h4 { font-size: 24px; }
  .avatar-btn span.uname { display: none; }
  .avatar-btn { padding: 4px; }
  .card.p-3 { padding: 16px !important; }
  .stat-num { font-size: 23px; }
  .nav-sheet { inset: 76px 10px auto 10px; }
  .table-responsive { border-radius: 16px; }
  .brand { font-size: 15px; }
}

/* 打印：去掉外壳，只留内容 */
@media print {
  body { background: #fff; padding: 0; }
  .app-topbar, .rail, .nav-sheet, .sheet-backdrop, .spotlight, .app-foot, .pager, .no-print { display: none !important; }
  .app-main { margin: 0; padding: 0; border: 0; box-shadow: none; background: #fff; }
  .card { box-shadow: none; border: 1px solid #e8ebf0; break-inside: avoid; }
  /* 横向滚动容器在打印时会把表格裁掉，必须放开 */
  .table-responsive { overflow: visible !important; max-height: none !important; }
  .table-responsive > .table { min-width: 0 !important; }
  .table > :not(caption) > * > * { padding: 7px 8px; font-size: 10.5px; }
  .table > thead > tr > th { font-size: 9px; }
}

/* 顶栏悬停下拉（桌面端；点击标签仍进入该板块首页） */
@media (min-width: 1081px) {
  .topnav-item.nav-drop:hover > .dropdown-menu,
  .topnav-item.nav-drop:focus-within > .dropdown-menu,
  .topnav-item.nav-drop.show > .dropdown-menu { display: block; }
  .topnav-item.nav-drop:hover .caret { transform: rotate(180deg); }
  .topnav-item.nav-drop.show > .topnav-link .caret { transform: rotate(180deg); }
  /* 菜单浮层有 10px 间距，用同高伪元素补成连续热区，否则鼠标下移瞬间下拉就消失 */
  .topnav-item.nav-drop::after {
    content: ""; position: absolute; left: -2px; right: -2px; top: 100%;
    height: 10px; display: none;
  }
  .topnav-item.nav-drop:hover::after,
  .topnav-item.nav-drop:focus-within::after,
  .topnav-item.nav-drop.show::after { display: block; }
}

/* 登录页品牌 */
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 600; letter-spacing: -.03em; color: var(--ink);
  margin-bottom: 20px;
}

/* ============================================================
 * 13. 公开榜单页
 * ============================================================ */
body.public-page { padding-top: 0; }
.public-wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.public-bar { padding: 20px 0 8px; }
.public-hero {
  margin: 14px 0 22px;
  padding: 46px 44px 40px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(700px 320px at 88% -20%, rgba(207, 224, 251, .9) 0%, rgba(207, 224, 251, 0) 70%),
    radial-gradient(520px 260px at 6% 120%, rgba(226, 220, 250, .75) 0%, rgba(226, 220, 250, 0) 70%),
    linear-gradient(160deg, #eef2fb, #e3e9f6);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: 0 40px 80px -70px rgba(20, 34, 64, .7), inset 0 1px 0 #fff;
}
.public-hero h1 { font-size: 40px; font-weight: 600; letter-spacing: -.04em; margin: 14px 0 12px; }
.public-hero .hero-lead { font-size: 14px; color: #4d5668; margin-bottom: 8px; }
.public-hero .hero-note { font-size: 12.5px; color: var(--muted); margin: 0; max-width: 720px; line-height: 1.7; }
.public-body { padding-bottom: 60px; }
.public-body .card { border-color: rgba(255, 255, 255, .8); }
@media (max-width: 700px) {
  .public-hero { padding: 28px 22px; border-radius: 26px; }
  .public-hero h1 { font-size: 27px; }
}

/* 次要修正 */
body.portal-page .pp-nav > .container { max-width: 1560px; }
.btn:disabled, .btn.disabled {
  --bs-btn-disabled-bg: #e8ecf4;
  --bs-btn-disabled-border-color: #e8ecf4;
  --bs-btn-disabled-color: #9aa4b6;
  opacity: 1;
}
.app-main .row.g-3 { --bs-gutter-x: 18px; --bs-gutter-y: 18px; }

/* 图标尺寸兜底（避免 SVG 在 flex 容器里被拉伸） */
.dropdown-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .7; }
.dropdown-item.active svg, .dropdown-item:hover svg { opacity: 1; }
.nav-sheet a svg { width: 15px; height: 15px; flex: 0 0 15px; }
.spotlight-item svg { width: 15px; height: 15px; }
.btn svg { width: 15px; height: 15px; vertical-align: -2px; }
.dropdown-menu { min-width: 246px; }
.spotlight-item .grp { margin-left: auto; color: var(--muted-2); font-size: 11.5px; }
.spotlight-item .ico svg { opacity: .55; }
.spotlight-item:hover .ico svg { opacity: .9; }

/* 安装向导 */
body.install-page { padding-top: 0; min-height: 100vh; }
body.install-page h3 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; }
body.install-page h6 { font-size: 13px; font-weight: 600; margin: 20px 0 8px; color: var(--ink-2); }
body.install-page label { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; display: block; }
.table-bordered > :not(caption) > * > * { border-color: var(--line-2); }

/* ============================================================
 * 6.1 细节修正
 * ============================================================ */

/* 卡片里的行内表单：控件之间至少留 12px，避免按钮贴住输入框 */
.card form.row.g-2 { --bs-gutter-x: 16px; --bs-gutter-y: 12px; }

/* g-2 默认只有 8px 间隙，在浅色画布上几乎粘在一起；统一抬到 14px */
.app-main .row.g-2 { --bs-gutter-x: 14px; --bs-gutter-y: 14px; }
.app-main .row.g-2.mb-0 { --bs-gutter-y: 10px; }

/* 链头哈希这类长串：整行灰条太像输入框，改成内联块 */
.card > code, .card p + code {
  display: inline-block;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f4f6fb;
  color: #3b4657;
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
}

/* 表格首列略微内缩，与卡片标题左缘对齐 */
.card > table > tbody > tr > td:first-child,
.card > table > thead > tr > th:first-child { padding-left: 4px; }

/* 引用来源结构的小格：并排 6 个，留足内边距才不显拥挤 */
.src-cell {
  border-color: var(--line) !important;
  border-radius: 14px;
  background: #fbfcff;
}
.src-cell .small:first-child { font-size: 11px; letter-spacing: .01em; }

/* ============================================================
 * v1.7.0 增长闭环：覆盖矩阵 / 评分环
 * ============================================================ */
.mx-wrap { padding-bottom: 4px; }
.mx-table { width: 100%; border-collapse: separate; border-spacing: 6px; }
.mx-table th {
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em; text-align: center; padding: 2px 4px 6px;
}
.mx-table th.mx-q { text-align: left; }
.mx-table td { vertical-align: middle; padding: 0; }
.mx-table td.mx-q { padding: 6px 10px 6px 2px; min-width: 210px; max-width: 320px; }
.mx-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 84px; padding: 9px 6px; border-radius: 12px;
  color: #fff !important; text-decoration: none; line-height: 1.25;
  transition: transform .14s ease, box-shadow .14s ease;
}
.mx-cell:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(20,34,64,.6); }
.mx-cell b { font-size: 12px; font-weight: 600; }
.mx-cell span { font-size: 10.5px; opacity: .92; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.score-ring { width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center; }
.score-ring > div { width: 90px; height: 90px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.score-ring > div > span { font-size: 28px; font-weight: 700; line-height: 1; }

@media (max-width: 860px) {
  .mx-cell { min-width: 72px; padding: 8px 4px; }
  .mx-table td.mx-q { min-width: 180px; }
}
