/* ============================================================
   学历业绩计算系统 · 现代化亮色主题
   共享样式（用于 design-preview 原型预览）
   ============================================================ */

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;

  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef2ff;
  --violet: #7c3aed;
  --teal: #14b8a6;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --sky: #0ea5e9;

  --grad: #4f46e5;
  --grad-soft: #eef2ff;

  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #eceff5;
  --border-strong: #e2e6ef;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.10);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  --sidebar-w: 208px;
  --topbar-h: 58px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* ---------- 布局框架 ---------- */
.app { min-height: 100vh; }
.app-body { padding-left: var(--sidebar-w); }
.main {
  padding: 20px 28px 36px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---------- 顶栏与侧边栏：同一套磨砂常量，视觉一致 ---------- */
:root {
  --glass-bg: rgba(248, 249, 252, 0.66);
  --glass-blur: saturate(150%) blur(20px);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(226, 230, 239, 0.7);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 40;
}
.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}
.topbar .search {
  flex: 0 1 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted-2);
  margin-left: 8px;
}
.topbar .search input {
  border: 0; outline: none; background: transparent;
  flex: 1; font-size: 13px; color: var(--text);
}
.topbar .spacer { flex: 1; }
.topbar .icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--muted);
  transition: 0.15s;
}
.topbar .icon-btn:hover { color: var(--primary); border-color: #ddd6fe; }
.topbar .icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
}
.topbar .user {
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; border-left: 1px solid var(--border);
}
.topbar .user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad-soft);
  color: var(--primary-strong);
  font-weight: 700;
  display: grid; place-items: center;
}
.topbar .user .meta .name { font-weight: 600; font-size: 13px; }
.topbar .user .meta .role { font-size: 11px; color: var(--muted-2); }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid rgba(226, 230, 239, 0.7);
  padding: 14px 12px 20px;
  overflow-y: auto;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.sidebar .group {
  margin-bottom: 2px;
}
.sidebar .group-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 12px 12px 6px;
  font-weight: 700;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  transition: 0.15s;
  margin-bottom: 1px;
}
.sidebar .nav-item i {
  width: 17px; text-align: center;
  color: var(--muted-2);
  transition: 0.15s;
}
.sidebar .nav-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar .nav-item:hover i { color: var(--primary); }
.sidebar .nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 600;
}
.sidebar .nav-item.active i { color: var(--primary); }
.sidebar .nav-item .count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: grid; place-items: center;
  padding: 0 5px;
}
.sidebar .foot {
  margin-top: auto;
  padding: 14px 12px 4px;
  font-size: 11px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
}

/* ---------- 页面标题 ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 20px; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; margin: 0; }
.page-head .sub i { margin-right: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: 0.15s;
  color: var(--text);
  background: var(--surface);
}
.btn i { font-size: 13px; }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-primary {
  background: var(--grad);
  border-color: var(--grad);
  color: #fff;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(99, 102, 241, 0.4);
}
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--muted); }
.btn-ghost:hover { color: var(--primary); border-color: #ddd6fe; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- 快捷键徽章（⌘K 提示） ---------- */
.kbd {
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
}
.card-head .icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-size: 13px;
}
.card-head .icon.teal { background: #ccfbf1; color: #0d9488; }
.card-head .icon.amber { background: #fef3c7; color: #d97706; }
.card-head .icon.rose { background: #ffe4e6; color: #e11d48; }
.card-head .icon.violet { background: #ede9fe; color: #7c3aed; }
.card-head .hint { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted-2); }
.card-body { padding: 16px; }

/* ---------- KPI 卡片 ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.kpi::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 110px; height: 110px;
  background: var(--grad-soft);
  border-radius: 50%;
  transform: translate(40%, -40%);
  opacity: 0.7;
}
.kpi .kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi .kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 17px;
}
.kpi .kpi-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.kpi .kpi-icon.teal { background: #ccfbf1; color: #0d9488; }
.kpi .kpi-icon.amber { background: #fef3c7; color: #d97706; }
.kpi .kpi-title { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .kpi-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 12px 0 6px;
  line-height: 1.1;
}
.kpi .kpi-value small { font-size: 14px; color: var(--muted-2); font-weight: 500; }
.kpi .kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

.trend-up { color: var(--green); }
.trend-down { color: var(--red); }
.trend-flat { color: var(--muted-2); }

/* 进度条 */
.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  margin: 14px 0 8px;
}
.progress .bar {
  height: 100%;
  background: var(--grad);
  border-radius: 6px;
  transition: width 0.4s ease;
}

/* ---------- 网格 / 卡片行 ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-2eq { grid-template-columns: 1fr 1fr; }
.mb-18 { margin-bottom: 18px; }

/* ---------- 图表 ---------- */
.chart-box { width: 100%; height: 320px; }
.chart-box.sm { height: 260px; }

/* ---------- 指标行（薪资拆分） ---------- */
.breakdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.breakdown .b-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
}
.breakdown .b-item .b-label { font-size: 12px; color: var(--muted-2); }
.breakdown .b-item .b-value { font-size: 14px; font-weight: 700; margin-top: 3px; }

/* ---------- 拆分明细 ---------- */
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.split-item .s-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
}
.split-item .s-label { font-size: 13px; color: var(--muted); }
.split-item .s-amount { font-size: 15px; font-weight: 700; margin-top: 1px; }
.split-item .s-count { margin-left: auto; text-align: right; }
.split-item .s-count b { font-size: 18px; }
.split-item .s-count span { display: block; font-size: 11px; color: var(--muted-2); }

.formula-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--grad-soft);
  border-radius: var(--radius-xs);
  font-size: 13px;
}
.formula-bar .sep { color: var(--muted-2); font-weight: 700; }
.formula-bar .neg { color: var(--red); font-weight: 600; }
.formula-bar .result { font-weight: 800; color: var(--primary-strong); }
.formula-bar .mode {
  margin-left: auto;
  background: #fff;
  border: 1px solid #e9d5ff;
  color: var(--violet);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 阶梯 ---------- */
.tier-current {
  background: var(--primary-soft);
  border-radius: var(--radius-xs);
  padding: 14px;
}
.tier-current .t-rate { font-size: 22px; font-weight: 800; color: var(--primary-strong); }
.tier-current .t-range { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tier-next {
  margin-top: 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px;
}
.tier-next .tier-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px;
}
.tier-next .metric {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
}
.tier-next .metric span { font-size: 11.5px; color: var(--muted); }
.tier-next .metric b { font-size: 13.5px; font-weight: 700; color: var(--text); }
.tier-next .gain {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
  font-weight: 700;
  color: var(--green);
  display: flex; justify-content: space-between;
}

/* ---------- 提醒列表 ---------- */
.reminder-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}
.reminder-item:last-child { border-bottom: 0; }
.reminder-item .r-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); color: var(--primary);
  display: grid; place-items: center; font-weight: 600;
}
.reminder-item .r-name { font-weight: 600; }
.reminder-item .r-sub { font-size: 12px; color: var(--muted); }
.reminder-item .spacer { flex: 1; }
.reminder-item.highlight { background: #fff7ed; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.badge.gray { background: #f1f5f9; color: #64748b; }
.badge.red { background: #fee2e2; color: #dc2626; }
.badge.green { background: #dcfce7; color: #16a34a; }
.badge.blue { background: #dbeafe; color: #2563eb; }
.badge.violet { background: #ede9fe; color: #7c3aed; }
.badge.teal { background: #ccfbf1; color: #0d9488; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted-2);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
table.data tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafbff; }
table.data .num { font-variant-numeric: tabular-nums; font-weight: 600; }
table.data .neg { color: var(--red); }

.cell-actions { display: flex; gap: 6px; }
.icon-action {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff; color: var(--muted);
  display: grid; place-items: center;
  font-size: 12.5px;
  transition: 0.15s;
}
.icon-action:hover { color: var(--primary); border-color: #ddd6fe; background: var(--primary-soft); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted-2);
}
.empty i { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.5; }

/* ---------- 响应式 ---------- */
/* ============================================================
   简洁配色收敛
   原则：单一主色(indigo) + 中性灰打底；
        绿色=正向/成功，红色=负向/警示，其余一律统一为主色系。
   ============================================================ */

/* 统一所有强调图标底色为同一柔和主色，消除花哨的多彩色 */
.kpi-icon.teal, .kpi-icon.amber,
.card-head .icon.teal, .card-head .icon.amber,
.card-head .icon.rose, .card-head .icon.violet {
  background: var(--primary-soft);
  color: var(--primary);
}

/* 标签：收敛为 主色/绿/红/灰 四种语义 */
.badge.violet, .badge.teal, .badge.blue {
  background: #eef2ff; color: #4f46e5;
}
.badge.green { background: #ecfdf5; color: #059669; }
.badge.red { background: #fef2f2; color: #dc2626; }
.badge.gray { background: #f1f5f9; color: #64748b; }

/* KPI 卡片装饰圆统一为主色系柔和渐变 */
.kpi::before {
  background: var(--grad-soft);
}

/* 业绩拆分图标：统一柔和主色底 */
.split-item .s-icon {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

/* 搜索框在筛选栏里不再重复描边，弱化工具感 */
.card .search { border-color: var(--border); background: var(--surface-2); }

@media (max-width: 992px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-2eq { grid-template-columns: 1fr; }
  .breakdown { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .app-body { padding-left: 0; }
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.login-left {
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 72px;
}
.login-left .brand-lg { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 800; margin-bottom: 28px; }
.login-left .brand-lg .logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
.login-left h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 14px; }
.login-left h1 span { color: var(--primary); }
.login-left .lead { color: var(--muted); font-size: 15px; max-width: 420px; margin: 0 0 30px; }
.feature-list { display: flex; flex-direction: column; gap: 14px; }
.feature-list .f {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-sm);
}
.feature-list .f i {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: var(--primary);
  background: var(--primary-soft); font-size: 14px;
}
.feature-list .f b { display: block; font-size: 14px; }
.feature-list .f span { font-size: 12.5px; color: var(--muted); }

.login-right {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 36px 34px;
}
.login-card h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-card .sub { color: var(--muted-2); font-size: 13px; margin: 0 0 24px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.field .input-wrap {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 0 14px;
  background: var(--surface-2);
  transition: 0.15s;
}
.field .input-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.field .input-wrap i { color: var(--muted-2); }
.field .input-wrap input {
  flex: 1; border: 0; outline: none; background: transparent;
  padding: 13px 0; font-size: 14px; color: var(--text);
}
.field .extra { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

.login-card .btn-primary { width: 100%; justify-content: center; padding: 13px; font-size: 14px; margin-top: 6px; }
.login-card .foot {
  margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted);
}
.login-card .foot a { color: var(--primary); font-weight: 600; }

@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
}

/* 背景光斑已按需求移除（原 body::before/::after 淡蓝/淡青圆斑） */
.app,
.login-page,
.app-body { position: relative; z-index: 1; }

/* ============================================================
   真实系统适配（top_nav 顶栏高度、通知面板、搜索下拉）
   ============================================================ */
body.app-body {
  padding-top: var(--topbar-h);
  min-height: 100vh;
  margin: 0;
}
@media (max-width: 900px) {
  body.app-body { padding-left: 0; }
}

/* 顶栏右侧间距 */
.topbar .topbar-right { display: flex; align-items: center; gap: 10px; }

/* 通知面板（hover / focus 显示） */
.topbar-notify { position: relative; display: inline-flex; align-items: center; }
.topbar-notify-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 320px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1200;
  display: none; overflow: hidden; text-align: left;
}
.topbar-notify:hover .topbar-notify-panel,
.topbar-notify:focus-within .topbar-notify-panel { display: block; }
.topbar-notify-head {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface-2);
}
.topbar-notify-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.topbar-notify-item:last-child { border-bottom: 0; }
.topbar-notify-name { font-size: 13px; color: var(--text); font-weight: 600; }
.topbar-notify-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-notify-action {
  white-space: nowrap; font-size: 11.5px; border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 3px 8px; color: var(--muted); text-decoration: none; align-self: center;
}
.topbar-notify-action:hover { color: var(--primary); border-color: #ddd6fe; background: var(--primary-soft); }
.topbar-notify-foot {
  padding: 8px 14px; background: var(--surface-2); border-top: 1px solid var(--border); text-align: right;
}
.topbar-notify-foot a { font-size: 12px; color: var(--primary); font-weight: 600; }

/* 搜索下拉 */
.topbar-search-wrap { position: relative; flex: 0 1 360px; margin-left: 8px; }
.topbar-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; display: none;
}
.topbar-search-dropdown.show { display: block; }
.topbar-search-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.topbar-search-item:hover { background: var(--primary-soft); }
.topbar-search-item .title { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar-search-item .sub { font-size: 11.5px; color: var(--muted); }
.topbar-search-item .tag { font-size: 11px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 10px; }

/* ============================================================
   宽屏布局均衡：KPI 等高，并排卡片顶部对齐、保持自然紧凑高度
   主要用于 1280~1920 桌面端，避免空旷或纵向拉伸
   ============================================================ */
@media (min-width: 993px) {
  /* KPI 卡片等高，底部信息统一贴底 */
  .kpi-grid > .card.kpi { height: 100%; display: flex; flex-direction: column; }
  .kpi-grid > .card.kpi .kpi-foot { margin-top: auto; padding-top: 12px; }

  /* 并排卡片（业绩拆分 / 提成阶梯）等高对齐，内部内容上下分布、底部对齐 */
  .grid-2 > .card,
  .grid-2eq > .card { height: 100%; display: flex; flex-direction: column; }
  .grid-2 > .card .card-body,
  .grid-2eq > .card .card-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: space-between; }

  /* 业绩拆分卡：4 个小块填满中间区域、上下均分，公式条贴底，消除中段空白 */
  .grid-2 .split-grid { flex: 1 1 auto; grid-auto-rows: 1fr; align-content: stretch; }
}

/* ============================================================
   全站统一主题兜底：覆盖旧 app.css / bootstrap 残留的蓝色与细节
   让未单独重写的页面也呈现统一的 indigo 亮色风格
   ============================================================ */

/* 内容容器统一：加宽到 1600 并居中（覆盖各页 inline max-width:1400） */
body.app-body .container-fluid {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* 页面标题统一 */
body.app-body h2 { color: var(--text); }

/* 旧卡片 .stats-card 对齐主题卡片的边框与阴影 */
.stats-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stats-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }

/* 旧卡片标题 .card-header-clean 对齐主题 card-head */
.card-header-clean {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
  background: var(--surface);
}
.card-header-clean i { color: var(--primary); }

/* ============================================================
   主操作按钮：白字 + indigo 底，清晰醒目（修复深色字压底问题）
   ============================================================ */
.btn-primary-soft,
.btn-primary-soft:active,
.btn-primary-soft:focus {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}
.btn-primary-soft:hover {
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  color: #fff;
  box-shadow: 0 9px 22px rgba(79, 70, 229, 0.38);
  transform: translateY(-1px);
}

/* 次级描边按钮统一 ghost 风格（更清晰的中性描边） */
.btn-outline-light-special {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: #475569;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.btn-outline-light-special:hover {
  background: var(--primary-soft);
  border-color: #c7d2fe;
  color: var(--primary);
}

/* 实心危险按钮（删除类主操作）：白字 + 红底，与主按钮同风格 */
.btn-danger-soft,
.btn-danger-soft:active,
.btn-danger-soft:focus {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.22);
}
.btn-danger-soft:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
  transform: translateY(-1px);
}

/* 危险描边按钮（删除类）统一红系语义 */
.btn-outline-danger-soft {
  border: 1px solid #fecaca;
  border-radius: var(--radius-xs);
  color: #dc2626;
  background: var(--surface);
}
.btn-outline-danger-soft:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* 中性次级按钮（重置等）统一为柔和 ghost */
.btn-outline-secondary {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: var(--surface);
}
.btn-outline-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

/* 表单控件主题化 */
.form-control, .form-select {
  border-color: var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--text);
  background-color: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.form-label { color: var(--text); }

/* 表格主题化 */
.table > thead > tr > th {
  background: var(--surface-2);
  color: var(--muted-2);
  border-bottom-color: var(--border);
}
.table > :not(caption) > * > * {
  border-bottom-color: var(--border);
}

/* 徽章：蓝 → indigo */
.badge-soft-primary { background: var(--primary-soft); color: var(--primary); }
.fee-type-badge.install { background: var(--primary-soft); border-color: #ddd6fe; color: var(--primary); }

/* 进度条 / 头像 / 加载动画 → indigo */
.progress-bar { background: var(--primary); border-radius: 30px; }
.avatar-placeholder { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.save-loading-content, .save-loading-icon { color: var(--primary); }

/* 筛选栏 / 工具栏 → 主题柔和色 */
.list-filter, .filter-bar {
  background: var(--surface);
  border-color: var(--border);
}
.list-toolbar { background: var(--surface-2); border-bottom-color: var(--border); }

/* Bootstrap 语境色 → indigo 收敛（消除残留蓝色：日志图标、报表金额、还差异徽章） */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-info { background-color: var(--primary-soft) !important; color: var(--primary-strong) !important; }

/* 次级页 h2 页面标题与 .page-head h1 视觉统一 */
body.app-body h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* ============================================================
   移动端底部 Dock 导航（仅 ≤900px 侧边栏隐藏时显示；桌面端不受影响）
   ============================================================ */
@media (max-width: 900px) {
  /* 给内容区预留 Dock 高度，避免遮挡 */
  body.app-body { padding-bottom: 64px; }

  .mobile-dock {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.06);
  }
  .mobile-dock .dock-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: 0;
    padding: 4px 2px;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-dock .dock-item i { font-size: 17px; }
  .mobile-dock .dock-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-dock .dock-item:active { background: var(--primary-soft); }
  .mobile-dock .dock-item.active,
  .mobile-dock .dock-item.active i { color: var(--primary); font-weight: 600; }

  /* “更多”展开抽屉 */
  .mobile-drawer-backdrop {
    position: fixed;
    left: 0; top: 0; right: 0; bottom: 0;
    z-index: 999;
    background: rgba(15, 23, 42, 0.32);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .mobile-drawer-backdrop.open { opacity: 1; visibility: visible; }

  .mobile-drawer {
    position: fixed;
    left: 0; right: 0; bottom: 56px;
    z-index: 1001;
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.12);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-height: 58vh;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.24s ease, opacity 0.2s ease, visibility 0.2s ease;
  }
  .mobile-drawer.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .mobile-drawer .drawer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 4px;
    border-radius: 12px;
    color: var(--text);
    font-size: 12px;
    text-decoration: none;
  }
  .mobile-drawer .drawer-item i { font-size: 16px; color: var(--muted-2); }
  .mobile-drawer .drawer-item:active { background: var(--primary-soft); }
  .mobile-drawer .drawer-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
  .mobile-drawer .drawer-item.active i { color: var(--primary); }
}

/* 桌面端（≥901px）隐藏移动端 Dock 与抽屉 */
@media (min-width: 901px) {
  .mobile-dock, .mobile-drawer, .mobile-drawer-backdrop { display: none; }
}

/* ============================================================
   统一操作反馈 Toast（磨砂玻璃弹出式）
   ============================================================ */
.tea-toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}
.tea-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-14px) scale(0.95);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1);
}
.tea-toast.in { opacity: 1; transform: translateY(0) scale(1); }
.tea-toast.out { opacity: 0; transform: translateY(-10px) scale(0.95); transition: opacity .32s ease, transform .32s ease; }
.tea-toast i { font-size: 15px; }
.tea-toast-success i { color: var(--green); }
.tea-toast-danger i { color: var(--red); }
.tea-toast-info i { color: var(--primary); }

/* ============================================================
   首页“上次登录”浮窗：磨砂玻璃 + 主题配色（覆盖 app.css 默认白底）
   ============================================================ */
.last-login-toast {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.last-login-toast .toast-title { color: var(--text); border-bottom: 1px solid var(--border); }
.last-login-toast .toast-title i { color: var(--primary); }
.last-login-toast .toast-row { color: var(--muted); }
.last-login-toast .toast-row i { color: var(--primary); }

/* ============================================================
   公司分期还款页（.repayments-page）专用样式
   （原 repayments.css，并入主题 CSS，避免在 theme.css 之后单独加载造成覆盖冲突）
   ============================================================ */
.repayments-page .empty-hint { color: #7b8798; line-height: 1.6; }
.repayments-page .btn-outline-light-special.btn-sm { border-radius: 12px; font-weight: 600; }
.repayments-page .card-header-clean { font-size: 0.88rem; }
.repayments-page .stats-card .p-4 { padding: 1rem !important; }
.repayments-page .table-modern td:nth-child(2),
.repayments-page .table-modern td:nth-child(3),
.repayments-page .table-modern td:nth-child(4) { white-space: nowrap; }

/* 已还清折叠区域 */
.repayments-page details.settings-fold {
    border: 1px solid #e5e7eb;
    border-radius: var(--card-radius);
    background: #fff;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.repayments-page details.settings-fold > summary {
    cursor: pointer;
    list-style: none;
    padding: 0.72rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    background: #f8fafc;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
    transition: background 0.2s ease;
    user-select: none;
}
.repayments-page details.settings-fold > summary::-webkit-details-marker { display: none; }
.repayments-page details.settings-fold > summary::before {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.repayments-page details.settings-fold[open] > summary {
    border-bottom-color: #e2e8f0;
}
.repayments-page details.settings-fold[open] > summary::before {
    transform: rotate(180deg);
}
.repayments-page details.settings-fold > summary:hover {
    background: #f1f5f9;
}
.repayments-page details.settings-fold .fold-body {
    padding: 0;
}
.repayments-page details.settings-fold .fold-body .table-responsive {
    margin-bottom: 0;
}
/* summary-badge 在 summary 行右侧 */
.repayments-page .summary-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-left: auto;
}

/* 还款明细区域统计卡片行 */
.repayments-page .repay-stat-item {
    background: #f8fafc;
    border-left: 3px solid #4f46e5;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
}
.repayments-page .repay-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.repayments-page .repay-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2px;
    letter-spacing: -0.01em;
}

/* 剩余期数提示 */
.repayments-page .repay-remain-hint {
    font-size: 0.82rem;
    color: #6b7280;
    background: #f8fafc;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    line-height: 1.5;
}

/* 还款记录列表 */
.repayments-page .repay-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.repayments-page .repay-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-left: 3px solid #4f46e5;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    transition: background 0.15s;
}
.repayments-page .repay-record-item:hover {
    background: #eef2ff;
}
.repayments-page .repay-record-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.repayments-page .repay-record-period {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
}
.repayments-page .repay-record-date {
    font-size: 0.78rem;
    color: #6b7280;
}
.repayments-page .repay-record-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}
.repayments-page .repay-record-amount {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.01em;
}
.repayments-page .repay-record-diff {
    font-size: 0.72rem;
    font-weight: 500;
}
.repayments-page .repay-record-diff.diff-plus {
    color: #0e7b32;
}
.repayments-page .repay-record-diff.diff-minus {
    color: #d97706;
}