/* ===========================================================
   CRM365 设计系统 v2
   风格：Data-Dense Dashboard × Enterprise Gateway
   配色：Navy 主色 (#1E40AF) + 蓝色数据色 (#3B82F6) + 琥珀强调 (#F59E0B)
   规则：8px 间距栅格、12px 圆角、150-200ms 过渡、无 emoji 图标
   =========================================================== */

/* ---------- 设计 Token ---------- */
:root {
  --navy-900: #0f1e3d;
  --navy-800: #142850;
  --navy-700: #1b3568;
  --primary: #1e40af;
  --primary-600: #254fd0;
  --primary-050: #eef3ff;
  --accent: #f59e0b;
  --accent-dim: #fff5e6;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e9f2;
  --border-strong: #d3dbe8;

  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --ok: #15803d;
  --ok-bg: #e8f7ee;
  --warn: #b45309;
  --warn-bg: #fef4e6;
  --danger: #b91c1c;
  --danger-bg: #fdecec;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --sh-2: 0 4px 14px rgba(15, 23, 42, 0.08);
  --sh-3: 0 18px 46px rgba(15, 23, 42, 0.16);

  --side-w: 192px;
  --top-h: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-family: "Inter", "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 数字用等宽字形，表格/金额对齐更专业 */
.n,
.stat .n,
.hb-val,
.c-axis,
table td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.warn-text {
  color: var(--warn);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ===========================================================
   登录页
   =========================================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.login-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: 100%;
  min-height: 100vh;
}

.login-brand {
  position: relative;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--primary) 140%);
  color: #fff;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* 品牌区背景纹理（纯 CSS，无图片依赖） */
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.28), transparent 50%);
  pointer-events: none;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-brand h1 {
  color: #fff;
  font-size: 30px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.brand-sub {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  margin: 0 0 32px;
}

.brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
}

.brand-points svg {
  flex: none;
  color: var(--accent);
}

.brand-foot {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: 34px 32px;
}

.login-card h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.login-card .muted {
  font-size: 13px;
  margin: 0 0 22px;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.pw-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-icon {
  position: absolute;
  left: 12px;
  color: var(--muted-2);
  pointer-events: none;
}

.pw-field input {
  width: 100%;
  padding: 11px 42px 11px 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.pw-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.pw-toggle {
  position: absolute;
  right: 8px;
  border: none;
  background: none;
  color: var(--muted-2);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--r-sm);
  display: flex;
  transition: color 0.18s;
}

.pw-toggle:hover {
  color: var(--primary);
}

.login-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted-2);
}

.err {
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
  margin: 10px 0 0;
}

/* ===========================================================
   应用外壳：侧边栏 + 顶栏
   =========================================================== */
.app {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 14px;
}

.sidebar .brand-name {
  font-size: 15.5px;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-md);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s, color 0.16s;
}

.sidebar nav a svg {
  flex: none;
  opacity: 0.85;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.9), rgba(37, 79, 208, 0.55));
  color: #fff;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #41270a;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: none;
}

.side-user {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  overflow: hidden;
}

.side-user b {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.side-user .muted {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

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

.topbar {
  height: var(--top-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.tb-left #pageTitle {
  font-size: 16px;
  font-weight: 600;
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--r-md);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.bell:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-050);
}

.bell b {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.content {
  padding: 22px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===========================================================
   通用组件：按钮 / 卡片 / 表格 / 徽标
   =========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, color 0.16s;
}

.btn:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: var(--sh-1);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn.gray {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border-strong);
}

.btn.gray:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-block {
  width: 100%;
  margin-top: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-1);
}

.card > h3,
.content > h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text);
}

.content > h3 {
  margin-top: 4px;
}

/* 工具栏：新建 + 搜索 + 筛选 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: -2px;
}

.toolbar .kw {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  min-width: 200px;
  font-size: 13.5px;
  outline: none;
  background: var(--surface);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.toolbar .kw:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.toolbar .flt {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  outline: none;
}

.toolbar .flt:focus {
  border-color: var(--primary);
}

/* 表格 */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: auto;
  box-shadow: var(--sh-1);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f4f9;
  color: var(--text-2);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: #f7f9ff;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.16s;
}

th.sortable:hover {
  color: var(--primary);
}

th.sorted {
  color: var(--primary);
}

.row-actions {
  white-space: nowrap;
  text-align: right;
}

.row-actions button {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--r-sm);
  padding: 5px 11px;
  font-size: 13px;
  cursor: pointer;
  margin-left: 6px;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}

.row-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-050);
}

.row-actions .del:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.empty {
  color: var(--muted-2);
  padding: 34px 16px;
  text-align: center;
  font-size: 13.5px;
}

/* 徽标 */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: #eef2f7;
  color: #5b6b82;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge.danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge.muted {
  background: #eef2f7;
  color: var(--muted);
}

/* ===========================================================
   指标卡 / 图表
   =========================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--sh-1);
  min-width: auto;
}

.stat .n {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text);
}

.stat .l {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.stat.warn {
  border-color: #f6d9d9;
  background: linear-gradient(180deg, #fffafa, #fff);
}

.stat.warn .n {
  color: var(--danger);
}

.stat-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 13.5px;
}

.stat-inline b {
  font-weight: 600;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

/* 卡片/弹窗标题行：标题居左，操作按钮居右 */
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.row-head h3 {
  margin-bottom: 0;
}

/* 小号按钮（标题行内使用） */
.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

/* 仪表盘首行：数据中心 / 日程安排 / 重要提醒 同行三列（≥1200px）。
   数据中心为窄列：三组指标纵向排布、2×2 紧凑化；本月概要钉在卡片底部；
   三卡等高拉伸，列表弹性高度内部滚动（不出现中部空洞或底部空白）。 */
.dash-row {
  display: grid;
  /* v14：按用户标注比例调整为 ≈1.6 : 1.4 : 1（数据中心 : 日程安排 : 重要提醒）。
     v14.1 可读性优先：数据中心 1.6→1.75fr（在 ±0.15fr 容差内），
     换取 1366 下大额金额单行、指标标签不被省略号截断。
     v15：用户要求「日程安排与重要提醒宽度对半分」——数据中心 1.75fr 不变，
     剩余 2.4fr 由两卡平分（1.2 : 1.2），日程安排略收窄、重要提醒略加宽。 */
  grid-template-columns: 1.75fr 1.2fr 1.2fr;
  gap: 14px;
  align-items: stretch;
}

.dash-row .card {
  display: flex;
  flex-direction: column;
  height: 430px; /* 三卡统一可视高度（约 430px，用户红框量级）；卡内 flex 承载，列表内部滚动 */
}

/* 卡片作为 grid 项时，高度不再被最高卡撑开；内容由内部弹性列表消化 */
.dash-row > .card {
  min-height: 0;
}

.dash-data .row-head {
  margin-bottom: 8px;
}

.metric-groups {
  display: grid;
  /* 三组纵向堆叠；每组内部 4 项单行横排（见 .mg-grid）。
     组高 ≈ 97px，3 组 + 概要 + 标题在 430px 卡内完整可见（实测 412px）。 */
  grid-template-columns: 1fr;
  gap: 6px;
  padding-bottom: 6px; /* 与底部本月概要的最小间距 */
  /* 极窄窗口的兜底：指标区自身滚动，monthSummary 仍钉底，卡片绝不溢出 */
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.metric-group {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 6px 9px 6px;
}

.mg-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.mg-grid {
  display: grid;
  /* 每组 4 项单行排布：组内横向铺满数据列宽度（约 110px/项），
     使三组纵向堆叠后总高 ≈ 3×97 + 间距，能完整放进 430px 卡内（无需滚动）。 */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 5px;
  min-width: 0;
}

.metric .m-l {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric .m-v {
  font-size: 19px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  /* 不用 break-all：长金额靠 <wbr>（千分位逗号后）折行，数字本身不断裂 */
  word-break: normal;
  overflow-wrap: normal;
}

/* 长数值（如 ¥1,286,000 这类大额）降 3px，避免在单行 4 项的窄格内折行 */
.metric .m-v.sm {
  font-size: 16px;
  letter-spacing: -0.2px;
}

.dash-data .stat-inline {
  margin-top: auto; /* 卡片被拉伸时概要钉在底部，组间距保持紧凑 */
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 7px 10px;
  font-size: 13px;
}

.metric.ok {
  border-color: #cbe9d8;
  background: linear-gradient(180deg, #f7fdf9, #fff);
}

.metric.ok .m-v {
  color: var(--ok);
}

.metric.warn {
  border-color: #f6e0bd;
  background: linear-gradient(180deg, #fffcf7, #fff);
}

.metric.warn .m-v {
  color: var(--warn);
}

.metric.danger {
  border-color: #f5d3d3;
  background: linear-gradient(180deg, #fffafa, #fff);
}

.metric.danger .m-v {
  color: var(--danger);
}

/* v17：「一键标记」按钮从列表上方的独立一行，上移到标题行右侧、
   与「提醒/已处理」页签同排，释放一行高度给下方提醒列表。 */
.alert-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: none;
}

.dash-sched h3,
.dash-alerts h3 {
  margin-bottom: 0;
}

/* 日程卡：标题行与底部内边距收紧，把高度让给下方当日列表（月历已压缩） */
.dash-sched .row-head {
  margin-bottom: 5px;
}

.dash-sched {
  padding-bottom: 8px;
}

/* ---- 日程安排：整月月历（固定 6×7 = 42 格，行数恒定不跳高） ----
   v15.1：应用户要求日期数字放大（13→15px）、格间距加大（1→3px）、单元格加高（24→29px），
   日历整体约 182px → 238px；下方当日列表相应收窄（约 105px），
   列表本就是 flex:1 + overflow:auto——多条记录超出可视区时出现滚动条（与重要提醒卡一致）。 */
.cal {
  flex-shrink: 0;
  margin: 4px 0 3px;
}

.cal-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px; /* v15.1：2→5，随日历整体加高 */
}

.cal-nav,
.cal-today {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px; /* v15.1：12.5→13 */
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.cal-nav:hover,
.cal-today:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.cal-title {
  flex: 1;
  text-align: center;
  font-size: 15px; /* v15.1：14→15 */
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px; /* v15.1：1→3，与日期格间距一致 */
  margin-bottom: 4px;
}

.cal-week span {
  text-align: center;
  font-size: 13px; /* v15.1：10→12 */
  line-height: 1;
  font-weight: 600;
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px; /* v15.1：1→3，数字之间的间隔加大 */
}

.cal-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 29px; /* v15.1：24→29，日期区整体加高（用户要求"数字间隔加大、日历高度加到红框量级"） */
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 15px; /* v15.1：13→15，日期数字放大 */
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}

.cal-cell:hover {
  border-color: var(--border-strong);
}

/* 周末浅底色 */
.cal-cell.is-weekend {
  background: var(--surface-2);
}

/* 他月淡化 */
.cal-cell.is-other-month {
  color: var(--muted-2);
}

.cal-cell.is-other-month.is-weekend {
  background: transparent;
}

/* 今日：蓝色描边环（区别于选中） */
.cal-cell.is-today {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 650;
}

/* 选中：实心蓝底 + 白字（可同时是 today，二者视觉可区分） */
.cal-cell.is-sel,
.cal-cell.is-sel:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 650;
}

.cal-cell.is-sel .cal-badge {
  background: #fff;
  color: var(--primary);
}

/* 有日程的日子：右上角角标（条数）。v15.1 随单元格放大到 29px 同步放大，保持清晰 */
.cal-badge {
  position: absolute;
  top: 0;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 当日列表标题区 */
.sched-list-head {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
}

.sched-list-head-wrap {
  flex-shrink: 0;
}

.sched-list {
  flex: 1;
  min-height: 0; /* 弹性高度：由卡片固定高度决定，内部滚动（不再用绝对 max-height 撑高） */
  overflow: auto;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

.sched-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 0 6px;
}

.sched-item {
  display: grid;
  grid-template-columns: 22px 52px 1fr 22px;
  align-items: start;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
}

.sched-item:last-child {
  border-bottom: 0;
}

.sched-item.done .sched-title {
  text-decoration: line-through;
  color: var(--muted-2);
}

.sched-item.done .sched-time {
  color: var(--muted-2);
}

.sched-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.sched-check:hover {
  border-color: var(--primary);
}

.sched-item.done .sched-check {
  background: var(--ok);
  border-color: var(--ok);
}

.sched-time {
  padding-top: 1px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.sched-main {
  min-width: 0;
}

.sched-title {
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  word-break: break-word;
}

.sched-title:hover {
  color: var(--primary);
}

.sched-over {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-bg);
  border-radius: 999px;
  vertical-align: 1px;
}

.sched-meta {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.sched-del {
  padding: 2px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.sched-del:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.dash-sched .empty,
.dash-alerts .empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 8px;
  margin: 0;
}

.dash-alerts .row-head {
  flex-shrink: 0;
}

/* v14.1 修复 P2-1：第三列（重要提醒）占比收窄到 1fr/4.15 后，
   标题「重要提醒」在 1366/1440 下会被 flex 压缩并折成两行（自然宽 64.8px 被压到 57.3/62.3px）。
   禁止标题换行与压缩，改由下方窄档媒体查询收窄页签来适配。 */
.dash-alerts .row-head h3 {
  white-space: nowrap;
  flex: none;
}

/* 仅限三栏区间（1200–1500px）：把「提醒（N）/已处理（N）」页签收窄，使标题 + 页签在
   1366/1440 卡内容宽内同排共存而不横向溢出。用 min-width:1200px 圈定，确保
   ≤1199（两栏）/≤900/≤640 断点的页签外观与行为完全不变。
   实测依据：1366 卡内容宽 222px、标题自然宽 64.8px；页签原始（12.5px/5px10px）自然宽
   167.8px，仅收 5px7px 仍为 162.5px ＞可用 147px、会把按钮压成两行；故再收到
   12px / 5px 4px（自然宽约 149px），并把行内 gap 10→6px 留出余量（实测行总宽 216.2px）。
   v17：标题行右侧追加了「一键标记」按钮，窄档放不下三者同排——
   用 flex-wrap + display:contents 让按钮单独换行到第二行并右对齐
   （视觉上回到 v16 的按钮独立一行），标题不换行的 P2 修复保持不变。 */
@media (min-width: 1200px) and (max-width: 1500px) {
  .dash-alerts .row-head {
    gap: 6px;
    flex-wrap: wrap;
  }
  .dash-alerts .seg-btn {
    padding: 5px 4px;
    font-size: 13px;
  }
  .dash-alerts .alert-actions {
    display: contents;
  }
  .dash-alerts .alert-actions .btn.btn-sm {
    padding: 3px 6px;
    font-size: 13px;
    margin-left: auto; /* 换行独占一行时右对齐（同 v16 的独立按钮行） */
  }
}

.dash-alerts .reminder-list {
  background: #fffaf3;
  flex: 1;
  min-height: 0; /* 弹性高度：与日程列表口径一致，卡片固定高度内滚动 */
  overflow: auto;
}

@media (max-width: 1199px) {
  .dash-row {
    grid-template-columns: 1fr 1fr;
  }

  .dash-data {
    grid-column: 1 / -1;
  }

  /* 两列布局：数据中心单独占整行、横向三组并排，本就扁；
     此处解除数据卡固定高度（三组横排 + 概要钉底），日程/提醒保持 430px 等高。 */
  .dash-row .dash-data {
    height: auto;
    align-self: start;
  }
}

@media (max-width: 760px) {
  .dash-row {
    grid-template-columns: 1fr;
  }

  .dash-data {
    grid-column: auto;
  }

  /* 单列堆叠：解除固定高度，各卡按内容自适应 */
  .dash-row .card {
    height: auto;
  }

  /* 窄屏三组指标纵排（横向并排在窄屏会挤成每格过窄） */
  .metric-groups {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sched-item {
    grid-template-columns: 20px 44px 1fr 20px;
  }

  .cal-cell {
    min-height: 26px; /* v15.1：22→26，随基准 29px 同步上调 */
    font-size: 13px; /* v15.1：12→13 */
  }
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.c-grid {
  stroke: #eef1f6;
  stroke-width: 1;
}

.c-axis {
  font-size: 13px;
  fill: var(--muted-2);
}

.c-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.c-dot {
  cursor: pointer;
}

.c-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--muted);
}

.c-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.c-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

/* 横向条形图 */
.hbars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

/* 宽标签版：公司名完整显示（v15：12 汉字约 150px、15 字约 188px，标签列留到 200px
   防止长公司名被省略号截断/挤压条形轨道，条形整体右移），条形轨道占剩余宽度的一半 */
.hbars.wide .hbar {
  grid-template-columns: 200px 1fr 84px;
}

.hbars.wide .hb-track {
  width: 50%;
}

.hbar {
  display: grid;
  grid-template-columns: 96px 1fr 84px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.hb-label {
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-track {
  height: 10px;
  background: #f1f4f9;
  border-radius: 6px;
  overflow: hidden;
}

.hb-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.hb-val {
  text-align: right;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* 漏斗 */
.funnel-row {
  display: grid;
  grid-template-columns: 76px 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.fr-name {
  color: var(--text-2);
}

.funnel-bar {
  height: 26px;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--primary-600), #4f83e8);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  font-size: 13px;
  min-width: 42px;
  transition: width 0.4s ease;
}

/* 提醒 */
.reminder-list {
  background: #fffaf3;
  border: 1px solid #f6e2c4;
  border-radius: var(--r-lg);
  padding: 4px 16px;
}

.reminder-list .ri {
  padding: 10px 0;
  border-bottom: 1px dashed #f0e2cd;
}

.reminder-list .ri:last-child {
  border-bottom: none;
}

.reminder-list .ri b {
  color: var(--warn);
}

.reminder-list .ri.ri-overdue b {
  color: var(--danger);
}

.reminder-list .ri .btn {
  margin-top: 6px;
}

/* ===========================================================
   弹窗 / 表单
   =========================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 60;
  animation: fade 0.16s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  width: 100%;
  max-width: 690px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px 24px;
  animation: pop 0.18s ease;
}

/* 大号弹窗：提醒中心 / 明细查看（宽度统一，避免各弹窗尺寸不一） */
.modal-xl {
  max-width: 840px;
}

/* 固定尺寸弹窗：提醒中心在「提醒 / 已处理」两个视图间切换时尺寸不变 */
.modal-fixed {
  height: min(660px, calc(100vh - 72px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-fixed .row-head {
  flex-shrink: 0;
}

.modal-fixed .reminder-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.modal-fixed .modal-actions {
  flex-shrink: 0;
  margin: 14px 0 0;
}

@keyframes pop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.modal h3 {
  font-size: 16px;
  margin-bottom: 14px;
}

.modal label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin: 12px 0 6px;
}

.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.modal textarea {
  min-height: 76px;
  resize: vertical;
}

.modal input[type="checkbox"] {
  width: auto;
  margin-right: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* 明细编辑行 */
.item-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.item-row select,
.item-row input {
  flex: 1;
  margin: 0;
}

.item-row .sub {
  width: 88px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.item-row .del {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--r-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex: none;
}

.item-row .del:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* 卡片内表单（设置页等） */
.card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin: 12px 0 6px;
}

.card label.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  color: var(--text);
}

.card input,
.card select,
.card textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.card input[type="checkbox"] {
  width: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 14px;
}

/* ===========================================================
   客户 360° 视图
   =========================================================== */
.c360-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
}

.c360-head h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

/* v19：头部信息分层——原先一整段同色灰字过于拥挤。
   v20（用户反馈"层次仍不够明显、页面最小字体费劲"）：整体再放大一档——
   标签列 13px 灰、正文 14px 更深（--text），姓名 15px 加粗、标题 h3 20px；
   胶囊标签 13px/20px 行高。全系统最小字号同步统一为 13px。 */
.c360-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.c360-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 8px;
  line-height: 22px;
}

.c360-name {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.c360-name i {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.c360-lab {
  flex: none;
  width: 76px;
  color: var(--muted);
  font-size: 14px;
  /* v23：按用户要求标签不加粗（v21 的 600 撤销），仅保留与内容同号 */
}

.c360-val {
  color: var(--text);
}

.c360-phone {
  font-size: 15px;
  font-weight: 600; /* v21：电话与联系人姓名同号（15px）同粗 */
}

.c360-tag {
  display: inline-block;
  background: #f1f4f9;
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 20px;
}

.c360-tag.lvl {
  background: var(--primary-050);
  border-color: transparent;
  color: var(--primary);
  font-weight: 600;
}

.c360-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px 18px;
  max-height: 320px;
  overflow: auto;
  box-shadow: var(--sh-1);
}

.tl-item {
  padding: 12px 0;
  border-bottom: 1px dashed #eef1f6;
}

.tl-item:last-child {
  border-bottom: none;
}

.tl-head {
  font-size: 13px;
}

.tl-head b {
  color: var(--primary);
}

.tl-body {
  margin-top: 4px;
  color: var(--text-2);
  white-space: pre-wrap;
  font-size: 13.5px;
}

/* ===========================================================
   响应式
   =========================================================== */
@media (max-width: 1080px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding: 32px 28px;
  }
  .login-brand h1 {
    font-size: 24px;
  }
  .brand-row {
    margin-bottom: 28px;
  }
  .brand-points {
    display: none;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    overflow-x: auto;
  }
  .sidebar .brand {
    border-bottom: none;
    margin: 0;
    padding: 0;
  }
  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  .sidebar nav a {
    white-space: nowrap;
    padding: 7px 12px;
  }
  .side-foot {
    display: none;
  }
  .content {
    padding: 16px 14px 32px;
  }
  .topbar {
    padding: 0 14px;
  }
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .c360-head,
  .card {
    padding: 14px;
  }
  .hbar {
    grid-template-columns: 76px 1fr 72px;
  }
  /* 窄屏下宽标签版同步收窄，避免轨道被挤到只剩几十像素 */
  .hbars.wide .hbar {
    grid-template-columns: 104px 1fr 72px;
  }
  .hbars.wide .hb-track {
    width: 60%;
    min-width: 56px;
  }
  .table-wrap {
    border-radius: var(--r-md);
  }
}

/* 尊重系统"减少动效"设置 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 键盘可达性：统一焦点环 */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ================= 多用户：登录页签 / 注册 / 找回密码 ================= */
.lc-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 20px;
}

.lc-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}

.lc-tab:hover {
  color: var(--text);
}

.lc-tab.active {
  background: var(--navy-900);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 30, 61, 0.18);
}

/* 注册/找回面板中的裸输入框（登录面板的图标输入框在下方单独修正） */
.lc-panel input[type="text"],
.lc-panel input[type="tel"],
.lc-panel input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.lc-panel input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.lc-panel .pw-field input {
  padding: 11px 42px 11px 38px;
}

.err.ok {
  color: var(--ok);
}

.fg-question {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 16px 0 0;
}

#fgNext {
  margin-top: 4px;
}

#fgStep2 {
  margin-top: 14px;
}

/* ================= 多用户：账户管理 / 视角提示条 ================= */
.space-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--warn-bg);
  border: 1px solid #fde3bd;
  color: var(--warn);
  font-size: 13.5px;
}

.acct-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 20px; /* v22：与相邻按钮（btn-sm 28px 盒）垂直居中对齐 */
  color: var(--text-2);
  cursor: pointer;
}

.switch input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--navy-900);
  cursor: pointer;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.tag.owner {
  background: var(--navy-900);
  color: #fff;
  border-color: transparent;
}

.status {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status.active {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bfe6cd;
}

.status.pending {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #fde3bd;
}

.status.disabled {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f7c9c9;
}

.table td.num {
  font-variant-numeric: tabular-nums;
}

.login-extra {
  font-size: 13px;
  color: var(--muted);
  margin: -6px 0 10px;
}

.login-extra a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.login-extra a:hover {
  text-decoration: underline;
}

/* ================= 提醒：提醒/已处理 双视图 ================= */
.seg {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--navy-900);
  color: #fff;
}

.ri-handled {
  opacity: 0.72;
}

.ri-handled b {
  color: var(--muted);
}

.done-tag {
  display: inline-block;
  font-size: 13px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #bfe6cd;
  vertical-align: 1px;
}

/* ===========================================================
   使用说明页
   =========================================================== */
.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.guide-step {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #fbfcfe;
}

.guide-step .gs-n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guide-step b {
  font-size: 13.5px;
}

.guide-step p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.guide-faq {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.guide-faq:last-child {
  border-bottom: none;
}

.guide-faq b {
  font-size: 13.5px;
}

.guide-faq p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
}

@media (max-width: 1080px) {
  .guide-steps {
    grid-template-columns: 1fr;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================================================
   登录页左栏：时间 / 日期 / 星期 / 每日一句
   =========================================================== */
/* 时钟/日期/每日一句：固定在左栏（蓝底）右下角 */
.brand-clock {
  position: absolute;
  right: 44px;
  bottom: 36px;
  z-index: 1;
  text-align: right;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-clock .bc-time {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.brand-clock .bc-date {
  margin-top: 6px;
  font-size: 14px; /* 与每日一句同字号（用户要求两者一样大） */
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.5px;
}

.brand-clock .bc-quote {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap; /* 素材库已保证 ≤15 字，单行完整显示，绝不截断 */
}

.brand-clock .bc-quote::before {
  content: "「 ";
  color: rgba(255, 255, 255, 0.45);
}

.brand-clock .bc-quote::after {
  content: " 」";
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 1080px) {
  .brand-clock {
    right: 28px;
    bottom: 24px;
    padding-top: 14px;
  }
  .brand-clock .bc-time {
    font-size: 26px;
  }
}

/* ===========================================================
   表单弹窗：并排字段 + 可重复列表（备用抬头 / 更多联系人）
   =========================================================== */
.form-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0 14px;
}

/* 显式固定列数（schema 字段上的 cols: N）：行业|地区 = 2 列；来源|第一介绍人|第二介绍人 = 3 列。
   新增规则，不改动上面无 cols 标记时走的 auto-fit 路径。 */
.form-cols.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-cols.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 窄屏降列：3 列在 ≤640px 挤成 1 列（每字段独占一行，避免输入框过窄）；
   2 列在 ≤480px 才降为 1 列（两列在窄屏仍可用）。 */
@media (max-width: 640px) {
  .form-cols.cols-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .form-cols.cols-2 {
    grid-template-columns: 1fr;
  }
}

.rep-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.rep-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rep-row input {
  flex: 1 1 120px;
  width: auto;
  min-width: 0;
}

.rep-row .rep-title {
  flex: 0 1 140px;
}

.rep-row .btn-sm {
  flex-shrink: 0;
}

.rep-add {
  align-self: flex-start;
}
