/* ============ 客户跟踪管理系统 · 设计系统 v3.1（可用性修复版） ============ */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --ink: #1F2D3D;
  --ink-2: #5B6B7E;          /* 加深：白底对比度 5.4:1（原 #7B8794 不达 AA） */
  --line: #E8EDF3;
  --line-2: #F0F3F8;
  --primary: #2F6BE4;
  --primary-hover: #2460D8;
  --primary-soft: #EBF2FE;
  --navy: #1C2B4A;
  --navy-deep: #152340;
  --orange: #D9820F;
  --orange-soft: #FDF3E4;
  --teal: #0E97A5;
  --teal-soft: #E5F6F8;
  --ok: #28A05C;
  --ok-soft: #E7F6EE;
  --danger: #E0473D;
  --danger-soft: #FCEBE9;
  --danger-hover: #C93A31;
  --th-bg: #F8FAFD;
  --hover-tint: #F7FAFF;
  --chip-bg: #F1F4F9;
  --chip-ink: #5A6B85;
  --mask: rgba(15, 27, 45, .5);
  /* 说明：stage-1~4 为流程推进色，不承担警告/成功语义；警告用 --orange，成功用 --ok */
  --radius: 8px;
  --shadow: 0 1px 2px rgba(31, 45, 61, .05);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid rgba(47, 107, 228, .45); outline-offset: 1px; }
.sidebar :focus-visible, .sidebar *:focus-visible { outline-color: rgba(255, 255, 255, .65); }

/* ============ 左侧深蓝导航 ============ */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
  color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.brand-mark {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-mark::before {
  content: ""; width: 13px; height: 13px; border-radius: 3px;
  background:
    linear-gradient(#fff, #fff) 50% 0/2px 100% no-repeat,
    linear-gradient(#fff, #fff) 0 50%/100% 2px no-repeat,
    var(--primary);
}
.sidebar nav { padding: 12px 12px; flex: 1; }
.nav-group-label { font-size: 12px; color: rgba(255,255,255,.38); padding: 12px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px;
  margin: 3px 0;
  border-radius: 7px;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 4px 10px rgba(47,107,228,.35); }
.nav-ico { width: 16px; height: 16px; flex-shrink: 0; }

/* 移动端侧边栏遮罩（由 app.js 注入） */
.sidebar-mask {
  position: fixed; inset: 0;
  background: var(--mask);
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
  z-index: 65;
}
.sidebar-mask.show { opacity: 1; visibility: visible; }

/* ============ 顶栏（白色） ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.crumb { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.crumb strong { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 44px; height: 44px;           /* 触控目标 ≥44px */
  border-radius: 8px;
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--ink);
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); white-space: nowrap; }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.user-chip em { font-style: normal; color: var(--ink-2); font-size: 12px; }
/* chip-act：修改密码入口（不用 .logout，避免命中退出清理会话的拦截） */
.user-chip .logout,
.user-chip .chip-act {
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  margin-left: 6px;
  transition: all .15s;
}
.user-chip .logout:hover,
.user-chip .chip-act:hover { color: var(--primary); border-color: var(--primary); }

/* ============ 内容区（贴边铺满，不再居中限宽） ============ */
.content-head { padding: 20px 24px 0; }
.content-head h2 { font-size: 18px; font-weight: 600; }
.content-head p { color: var(--ink-2); font-size: 12px; margin-top: 2px; }
.content { padding: 14px 24px 48px; }

/* ============ 卡片 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px; }

/* ============ 统计条 ============ */
.stat-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
}
.stat-strip .s { padding: 16px 22px; position: relative; }
.stat-strip .s + .s::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px;
  width: 1px; background: var(--line);
}
.stat-strip .num { font-size: 26px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-strip .num em { font-style: normal; font-size: 13px; color: var(--ink-2); font-weight: 400; margin-left: 3px; }
.stat-strip .lbl { color: var(--ink-2); font-size: 12px; margin-top: 2px; }

/* ============ 筛选区 ============ */
.filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px 14px;
  align-items: end;
}
.filters .field.range { grid-column: span 2; }
/* 行业标签固定从第二行开头开始，避免第一行过挤 */
.filters .field.tag-row { grid-column: 1; }
.field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(47, 107, 228, .12); }
/* 字段级错误态（配合 invalidField） */
.input.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(224, 71, 61, .12);
}
.req { color: var(--danger); font-style: normal; margin-left: 2px; }
textarea.input { resize: vertical; min-height: 84px; }
.range-row { display: flex; align-items: center; gap: 8px; }
.range-row .sep { color: var(--ink-2); flex-shrink: 0; }
.range-row .input { flex: 1 1 0; min-width: 0; }
.filters .field { min-width: 0; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-toggle { display: none; }

/* ============ 按钮（完整状态体系） ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-primary:active { background: #1E55C4; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: #fff; }
.btn-danger-ghost { color: var(--danger); border-color: rgba(224, 71, 61, .45); background: #fff; }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger-hover); border-color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ============ 表格（桌面） ============ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); min-width: 760px; }
.table th {
  font-size: 13px; color: var(--ink-2); font-weight: 600;
  text-align: left; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--th-bg);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover-tint); }
.table tbody tr.row-click { cursor: pointer; }
.table .num-cell { font-variant-numeric: tabular-nums; }
.table .empty-cell { text-align: center; color: var(--ink-2); padding: 40px 0; }
/* 链接保持视觉紧凑，但用透明 padding 扩大触控命中区 */
.link {
  color: var(--primary); cursor: pointer; background: none; border: none;
  padding: 10px 4px; margin: -10px -4px; font-size: 13px; position: relative;
}
.link:hover { text-decoration: underline; }
.link + .link { margin-left: 14px; }
.link-danger { color: var(--danger); }

/* ============ 移动端卡片流 ============ */
.m-list { display: none; padding: 12px; }
.m-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}
.m-card .mc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.m-card .mc-top strong { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
/* 列表行标题链接：继承文字原色，悬停变主题色 */
.row-title-link { color: inherit; }
.row-title-link:hover { color: var(--primary); }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
.m-grid .mr { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.m-grid .mr.mr-span { grid-column: 1 / -1; }  /* 独占一整行（如“所属”这类长内容） */
.m-grid .mr span { color: var(--ink-2); flex-shrink: 0; }
.m-grid .mr b { font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.m-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 9px; border-top: 1px dashed var(--line); padding-top: 8px; }

/* 悬浮新增按钮 */
.fab {
  display: none;
  position: fixed;
  right: 20px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 26px; line-height: 1;
  border: none;
  box-shadow: 0 6px 18px rgba(47, 107, 228, .45);
  z-index: 45;
  cursor: pointer;
  align-items: center; justify-content: center;
}
.fab:active { transform: scale(.94); }

/* ============ 徽章 / 标签 ============ */
.badge {
  display: inline-flex; align-items: center;
  padding: 1px 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
/* 阶段徽章文字加深一档：12px 小字达到 WCAG AA ≥4.5:1 */
.stage-1 { background: var(--primary-soft); color: #1D4FB8; }
.stage-2 { background: var(--orange-soft); color: #9A5B08; }
.stage-3 { background: var(--teal-soft); color: #0A6E79; }
.stage-4 { background: var(--ok-soft); color: #1E7A45; }
.tag-chip {
  background: var(--chip-bg); color: var(--chip-ink);
  display: inline-flex; padding: 0 8px;
  border-radius: 4px; font-size: 12px; line-height: 1.8;
  white-space: nowrap;
}
.dot-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.dot-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dot-on { color: var(--ok); }
.dot-off { color: var(--ink-2); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.modal-body .field { margin-bottom: 14px; }
.modal-body .field:last-of-type { margin-bottom: 0; }
.form-tip { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-msg { color: var(--ink); }
.confirm-echo { color: var(--danger); font-weight: 600; }

/* ============ 抽屉 ============ */
.drawer-wrap { position: fixed; inset: 0; visibility: hidden; z-index: 50; }
.drawer-wrap.open { visibility: visible; }
.drawer-mask {
  position: absolute; inset: 0;
  background: var(--mask);
  opacity: 0; transition: opacity .2s;
}
.drawer {
  position: absolute; top: 0; right: 0; height: 100%;
  width: 460px; max-width: 94vw;
  background: #fff;
  transform: translateX(100%);
  transition: transform .22s ease;
  display: flex; flex-direction: column;
  box-shadow: -6px 0 24px rgba(15, 27, 45, .16);
}
.drawer-wrap.open .drawer { transform: none; }
.drawer-wrap.open .drawer-mask { opacity: 1; }
.drawer-head {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-head h3 { font-size: 15px; font-weight: 600; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.drawer-foot {
  padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px));  /* iPhone 全面屏安全区 */
  border-top: 1px solid var(--line-2);
  display: flex; gap: 10px; justify-content: flex-end;
}
.icon-close {
  border: none; background: none; cursor: pointer;
  font-size: 17px; color: var(--ink-2); line-height: 1;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-close:hover { color: var(--ink); }

/* ============ 弹窗（手机端底部弹出样式） ============ */
.modal-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--mask);
  opacity: 0; visibility: hidden;
  transition: opacity .18s, visibility .18s;
  z-index: 60;
}
.modal {
  background: #fff;
  border-radius: 14px 14px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(24px);
  transition: transform .2s;
}
@media (min-width: 769px) {
  .modal-wrap { align-items: center; padding: 16px; }
  .modal { border-radius: 10px; transform: translateY(10px); width: 540px; }
}
.modal-wrap.open { opacity: 1; visibility: visible; }
.modal-wrap.open .modal { transform: none; }
.modal-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 68px; left: 50%;
  transform: translate(-50%, -10px);
  background: var(--navy);
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 99;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(15, 27, 45, .3);
  max-width: 86vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.toast.ok { border-left: 3px solid #5BC57E; }
.toast.err { border-left: 3px solid #E58A80; }

/* ============ 分页 ============ */
.pager { display: flex; gap: 6px; align-items: center; padding: 12px 18px; flex-wrap: wrap; }
.pager button {
  min-width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  padding: 0 6px;
  transition: all .12s;
}
.pager button:hover:not(:disabled):not(.cur) { border-color: var(--primary); color: var(--primary); }
.pager button.cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button.cur:hover { color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager-dots { min-width: 22px; height: 30px; line-height: 30px; text-align: center; color: var(--ink-2); user-select: none; }
.pager-total { color: var(--ink-2); font-size: 12px; margin-left: auto; }

/* ============ 标签页 ============ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tab {
  padding: 12px 18px;
  cursor: pointer;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 14px;
  transition: color .15s;
  background: none; border-top: none; border-left: none; border-right: none;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; padding: 18px; }
.tab-panel.active { display: block; }
.panel-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
/* 系统管理拆分后的独立页面：卡片内容区（替代原 .tab-panel 的 18px 内边距） */
.panel-body { padding: 18px; }

/* ============ 时间线 ============ */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 4px; }
.tl-dot {
  position: absolute; left: -22px; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary);
}
.tl-dot.d2 { border-color: var(--orange); }
.tl-dot.d3 { border-color: var(--teal); }
.tl-dot.d4 { border-color: var(--ok); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-time { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tl-clerk { font-size: 12px; color: var(--ink-2); }
.tl-detail {
  margin-top: 6px;
  background: var(--th-bg);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 10px 14px;
}
.tl-empty { color: var(--ink-2); padding: 24px 0; text-align: center; }

/* ============ 数据总览 ============ */
.stat-strip.cols3 { grid-template-columns: repeat(3, 1fr); }
/* 第二行首卡（第 4 张）不带左侧分隔线 */
.stat-strip.cols3 .s:nth-child(4)::before { display: none; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; margin-bottom: 14px; }
.dash-grid .card { margin-bottom: 0; }
.dash-full { margin-bottom: 14px; }
.card-head .head-tip { font-size: 12px; color: var(--ink-2); font-weight: 400; }

/* 完成进度 */
.dash-progress { padding: 18px; }
.dash-progress .big-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.dash-progress .big-num { font-size: 34px; font-weight: 600; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dash-progress .big-sub { font-size: 13px; color: var(--ink-2); }
.progress-track { height: 12px; background: var(--chip-bg); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), #5B8CEC); transition: width .6s ease; }
.progress-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.progress-legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }

/* 阶段漏斗 */
.funnel { padding: 18px; }
.funnel-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; padding: 6px 0; }
.funnel-label { font-size: 13px; color: var(--ink-2); text-align: right; white-space: nowrap; }
.funnel-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.funnel-bar-wrap { flex: 1; min-width: 0; display: flex; align-items: center; }
.funnel-bar { height: 32px; min-width: 40px; border-radius: 6px; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; font-variant-numeric: tabular-nums; padding: 0 10px; flex-shrink: 0; }
.funnel-bar b { font-size: 15px; font-weight: 600; }
.funnel-pct { font-size: 12px; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; }
.funnel-note { font-size: 12px; color: var(--ink-2); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* 本周关键节点（按客户分组） */
.node-group { padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.node-group:first-child { padding-top: 2px; }
.node-group:last-child { border-bottom: none; padding-bottom: 4px; }
.node-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.node-name { font-weight: 600; font-size: 14px; }
.node-name:hover { text-decoration: underline; }
.node-item { font-size: 13px; padding: 5px 0; }
.node-item .tl-time { margin-right: 8px; }
.node-item p { color: var(--ink); margin: 2px 0; }

@media (max-width: 768px) {
  /* 指标卡保持一行 3 列（3+2 两行），第二行首卡分隔线已在基础规则中去除 */
  .dash-grid { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 72px 1fr; }
  .dash-progress .big-num { font-size: 28px; }
}

/* ============ 详情页头部 ============ */
.detail-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-head h2 { font-size: 19px; font-weight: 600; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px 24px; margin-top: 14px;
}
.meta-grid .m label { display: block; font-size: 12px; color: var(--ink-2); }
.meta-grid .m div { font-size: 14px; margin-top: 1px; }
.time-strip {
  display: flex; gap: 36px; margin-top: 14px;
  padding: 12px 16px;
  background: var(--th-bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  flex-wrap: wrap;
}
.time-strip .t label { font-size: 12px; color: var(--ink-2); display: block; }
.time-strip .t div { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-strip .t.hot div { color: var(--primary); }

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty .empty-mark {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  border-radius: 10px;
  border: 2px dashed var(--line);
  position: relative;
}
.empty .empty-mark::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 2px; background: var(--line);
  transform: translate(-50%, -50%);
}
.empty p { margin-bottom: 12px; }

/* ============ 登录页 ============ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(155deg, #22345C 0%, #16233F 60%, #101B31 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 64px);
}
.login-page > * { position: relative; }
.login-head { text-align: center; color: #fff; margin-bottom: 26px; }
.login-head .login-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: #fff; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.login-head .login-mark::before {
  content: ""; width: 30px; height: 30px; border-radius: 7px;
  background:
    linear-gradient(#fff, #fff) 50% 0/3px 100% no-repeat,
    linear-gradient(#fff, #fff) 0 50%/100% 3px no-repeat,
    var(--primary);
}
.login-head h1 { font-size: 22px; font-weight: 600; letter-spacing: .06em; }
.login-head p { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 6px; letter-spacing: .1em; }
.login-card {
  width: 400px; max-width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 32px 36px 28px;
  box-shadow: 0 16px 48px rgba(4, 12, 28, .45);
}
.login-card h2 { font-size: 17px; font-weight: 600; margin-bottom: 20px; color: var(--ink); }
.login-card .field { margin-bottom: 15px; }
.login-card .field label { font-size: 13px; }
.login-card .btn-login {
  width: 100%; padding: 10px; font-size: 15px; margin-top: 6px;
  letter-spacing: .3em; text-indent: .3em;
}
.login-foot { margin-top: 26px; color: rgba(255,255,255,.6); font-size: 12px; text-align: center; letter-spacing: .04em; }

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .field.range { grid-column: span 2; }
  .filter-actions { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 70;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 6px 0 24px rgba(9, 18, 35, .25);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip .s:nth-child(3)::before { display: none; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .content-head, .content { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 16px; }
  /* 顶栏移动端收窄：角色说明隐藏、面包屑可截断，消除 3px 横向溢出 */
  .topbar { gap: 8px; }
  .topbar .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
  .user-chip em { display: none; }
  .user-chip { gap: 6px; }
}
@media (max-width: 768px) {
  /* 表格 -> 卡片流：仅对提供了卡片流的页面生效，其余页面保留可横滑的表格 */
  body.has-mobile-list .table-scroll { display: none; }
  body.has-mobile-list .m-list { display: block; }
  body:not(.has-mobile-list) .table-scroll {
    border-left: 1px solid var(--line-2);
    border-right: 1px solid var(--line-2);
  }
  .fab { display: flex; }
  /* FAB 预留底部空间，避免遮挡分页条（仅限有悬浮按钮的页面） */
  body.has-fab .content { padding-bottom: 104px; }
  body:not(.has-fab) .content { padding-bottom: 24px; }
  /* 筛选折叠：默认只留常用项 */
  .filters .field.adv { display: none; }
  .filters.expanded .field.adv { display: block; }
  .filter-toggle { display: inline-flex; }
  /* 输入框 16px：避免 iOS 聚焦强制放大页面 */
  .input, select.input, textarea.input { font-size: 16px; }
  /* 触控目标 ≥40px */
  .pager button { min-width: 40px; height: 40px; }
  /* 详情页按钮撑满 */
  .detail-actions { width: 100%; margin-left: 0; }
  .detail-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .filters { grid-template-columns: 1fr; }
  .filters .field.range, .filter-actions { grid-column: span 1; }
  .time-strip { gap: 14px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .login-card { padding: 26px 22px 22px; }
  .stat-strip .s { padding: 13px 16px; }
  .stat-strip .num { font-size: 22px; }
  .pager { justify-content: center; }
  .pager-total { margin-left: 0; width: 100%; text-align: center; }
}
@media (max-width: 360px) {
  .range-row { flex-direction: column; align-items: stretch; }
  .range-row .sep { display: none; }
}
/* 手机横屏/矮屏适配 */
@media (max-height: 480px) {
  .login-page { justify-content: flex-start; padding-top: 20px; }
  .login-head { margin-bottom: 14px; }
  .modal { max-height: 92vh; max-height: 92dvh; }
}
/* 尊重系统"减弱动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ============ 拜访日历（calendar.html，cal- 前缀，仅复用既有变量） ============ */
.cal-head { gap: 10px; flex-wrap: wrap; }
.cal-title { display: flex; align-items: baseline; gap: 2px; min-width: 0; }
.cal-title .cal-y { font-size: 15px; font-weight: 600; margin-right: 4px; }
.cal-title .cal-m { font-size: 20px; font-weight: 700; }
.cal-title .cal-total { font-size: 12px; color: var(--ink-2); margin-left: 10px; font-weight: 400; }
.cal-ops { display: flex; align-items: center; gap: 6px; }
/* 前后月切换按钮：复用 .pager button 的视觉规格 */
.cal-nav {
  min-width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  font-size: 15px; line-height: 1;
  padding: 0 6px;
  transition: all .12s;
}
.cal-nav:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.cal-nav:disabled { opacity: .4; cursor: default; }

/* 月历：body 内边距置 0，让格线贴卡片边缘 */
.cal-card-body { padding: 0; overflow: hidden; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--th-bg); }
.cal-dow { padding: 9px 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  position: relative;
  /* 纵向 flex 顶部对齐：日期数字与条目始终贴顶（容器用 div，兼容不支持 button flex 的旧内核） */
  display: flex; flex-direction: column; align-items: stretch;
  min-height: 96px;
  padding: 8px 10px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);   /* 内描边式格线 */
  background: #fff;
  font-family: inherit; font-size: 14px; color: var(--ink); line-height: 1.5;
  text-align: left;
  cursor: default;
  user-select: none;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:nth-child(n+36) { border-bottom: none; }
.cal-cell.has-rec { cursor: pointer; transition: background .12s; }
.cal-cell.has-rec:hover { background: var(--hover-tint); }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.cal-num { font-size: 14px; font-variant-numeric: tabular-nums; line-height: 24px; }
.cal-out .cal-num { opacity: .38; }
/* 今天：格子内描边标识（日期数字不做特殊渲染，保持普通样式） */
.cal-today { box-shadow: inset 0 0 0 2px var(--primary); }
/* 选中：主色浅底 + 内描边（与今天标识叠加时描边重合，视觉等效） */
.cal-sel { background: rgba(47, 107, 228, .08); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-count {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px;
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  flex-shrink: 0;
}
.cal-item {
  display: flex; align-items: center; gap: 5px;
  width: 100%; min-width: 0; margin-top: 4px;
  padding: 0; border: none; background: none;
  font-family: inherit; font-size: 12px; color: var(--ink); line-height: 1.5;
  text-align: left; cursor: pointer;
}
.cal-item i { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-item .ci-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-item:hover .ci-name { color: var(--primary); }
.cal-more {
  margin-top: 3px; padding: 0;
  font-family: inherit; font-size: 12px; color: var(--primary);
  text-align: left;
  cursor: pointer;
}
.cal-more:hover { text-decoration: underline; }

/* 当日跟进面板：进场 opacity 0→1 + translateY(4px)→0 */
.cal-panel { display: none; }
.cal-panel.show { display: block; animation: calPanelIn .18s ease; }
@keyframes calPanelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.cal-panel-body { padding: 18px; }
.cal-panel .tl-item { cursor: pointer; }
.cal-panel .tl-item:hover .tl-detail { border-color: rgba(47, 107, 228, .35); }

/* 记录详情弹窗：顶部元信息行 + 全文块 */
.cal-rec-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-rec-full {
  margin-top: 12px;
  background: var(--th-bg); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 14px; font-size: 14px;
}
/* 空月份提示（月历卡 body 内边距为 0，此处自行补白） */
.cal-month-empty .cal-empty-tip {
  text-align: center; color: var(--ink-2); font-size: 13px;
  padding: 4px 20px 26px; margin: 0;
}

@media (max-width: 768px) {
  .cal-cell { min-height: 72px; padding: 6px 8px; }
  .cal-item, .cal-more { display: none; }
}
@media (max-width: 640px) {
  .cal-cell { min-height: 56px; padding: 4px 6px; }
  .cal-title .cal-m { font-size: 18px; }
}

/* ============ 待协调事项（coordinate.html） ============ */
.coord-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 分组头部元信息：行业标签 + 区/街道归属 */
.coord-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px dashed var(--line); }
.coord-meta-item { font-size: 13px; color: var(--ink-2); }

/* ============ 角色管理（role.html，perm- 前缀，仅复用既有变量） ============ */
.perm-page-tip { margin: 0 24px 12px; padding: 9px 14px; background: var(--chip-bg); border-radius: 7px; }
.perm-role-desc { padding: 12px 18px 0; font-size: 13px; color: var(--ink-2); }
.perm-body { padding: 0 18px 18px; }
/* 超管锁定说明条 */
.perm-lock-note {
  margin-top: 12px;
  background: var(--orange-soft);
  color: #9A5B08;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
}
/* Tab 内锁形图标 */
.perm-lock-ico { vertical-align: -1px; margin-left: 3px; }

/* 矩阵：9+ 模块卡双列（≤900 单列） */
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 900px) {
  .perm-grid { grid-template-columns: 1fr; }
}
.perm-mod { margin-bottom: 0; min-width: 0; }
.perm-mod-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--th-bg);
  border-radius: var(--radius) var(--radius) 0 0;
}
.perm-mod-name { font-size: 14px; font-weight: 600; min-width: 0; }
.perm-mod-head input[type="checkbox"] {
  width: 15px; height: 15px; margin: 0; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer;
}
.perm-items { padding: 4px 0; }
.perm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  min-width: 0;
}
.perm-item:hover { background: var(--hover-tint); }
.perm-item input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer;
}
.perm-item-name { min-width: 0; }
.perm-item.is-view .perm-item-name { font-weight: 600; }
.perm-view-note { font-size: 12px; color: var(--ink-2); font-weight: 400; }
/* "查看"项与操作项之间的 1px 虚线分隔（挂在查看项底边） */
.perm-view-sep { border-bottom: 1px dashed var(--line); }
/* 删除类操作项前的 6px 红点 */
.perm-dot-dots { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }
/* 客户档案卡版块小标题 */
.perm-sub-label { padding: 8px 14px 2px; font-size: 12px; color: var(--ink-2); }

/* 可多选勾选列表（新增计划-关联办事员）：整行点击切换，手机端免 Ctrl 多选 */
.check-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 10px; background: var(--surface);
}
.check-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  cursor: pointer; font-size: 13px; color: var(--ink); user-select: none;
  transition: background .15s, border-color .15s;
}
.check-item:hover { background: var(--hover-tint); }
.check-item input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check-item input:checked + span { color: var(--primary); font-weight: 600; }
.check-empty { font-size: 12px; color: var(--ink-2); }

/* 底部粘性保存条：拉通卡片内边距，上边框通栏 */
.perm-savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 16px -18px -18px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 0 0 var(--radius) var(--radius);
}
.perm-dirty-tip { font-size: 13px; color: var(--ink-2); min-width: 0; }
.perm-savebar.perm-dirty { border-top-color: var(--primary); }
.perm-savebar.perm-dirty .perm-dirty-tip { color: #9A5B08; }
.perm-savebar-ops { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 768px) {
  .perm-item { padding: 9px 14px; }
}
@media (max-width: 640px) {
  .perm-savebar { flex-wrap: wrap; }
  .perm-dirty-tip { width: 100%; }
  .perm-savebar-ops { width: 100%; }
  .perm-savebar-ops .btn { flex: 1; }
}

/* ============ 登录页演示账号速选 chips（login.html） ============ */
.login-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.login-quick button {
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--chip-ink);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.login-quick button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.login-quick button:focus-visible { outline-offset: 1px; }

/* ============ 修改密码（change-password.html）：页面氛围 + 左安全栏 + 右表单 ============ */
body.pwd-page {
  background:
    radial-gradient(640px 320px at 88% -80px, rgba(47, 107, 228, .09), transparent 62%),
    radial-gradient(520px 300px at -80px 105%, rgba(14, 151, 165, .08), transparent 62%),
    var(--bg);
}
.pwd-card {
  max-width: 860px;
  margin: 16px auto 0;
  padding: 0; overflow: hidden;
  box-shadow: 0 12px 36px rgba(28, 43, 74, .10), var(--shadow);
}
.pwd-layout { display: grid; grid-template-columns: 296px 1fr; }

/* —— 左：安全说明栏 —— */
.pwd-aside {
  position: relative;
  background: linear-gradient(168deg, #26427A 0%, var(--navy) 46%, var(--navy-deep) 100%);
  color: #fff;
  padding: 32px 26px 24px;
  display: flex; flex-direction: column;
}
.pwd-aside::before,
.pwd-aside::after { content: ''; position: absolute; border-radius: 50%; z-index: 0; }
.pwd-aside::before {           /* 右上装饰环 */
  width: 190px; height: 190px;
  border: 1.5px solid rgba(255, 255, 255, .09);
  top: -70px; right: -70px;
}
.pwd-aside::after {            /* 左下柔光斑 */
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(94, 160, 255, .16), transparent 70%);
  bottom: 60px; left: -60px;
}
.pwd-aside > * { position: relative; z-index: 1; }
.pwd-aside-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(94, 160, 255, .35), rgba(94, 160, 255, .12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.pwd-aside h3 { font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.pwd-aside-sub { font-size: 12px; color: rgba(255, 255, 255, .60); margin-top: 5px; }
.pwd-tips { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 14px; }
.pwd-tips li {
  display: flex; gap: 9px;
  font-size: 12.5px; line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  padding: 9px 11px;
  background: rgba(255, 255, 255, .05);
  border-radius: 8px;
}
.pwd-tips svg { flex-shrink: 0; margin-top: 3px; }
.pwd-account {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; align-items: center; gap: 10px;
}
.pa-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #3E7BF2, #2F6BE4); color: #fff;
  box-shadow: 0 2px 8px rgba(47, 107, 228, .45);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
}
.pa-info { min-width: 0; }
.pa-info b { display: block; font-size: 13px; line-height: 1.4; }
.pa-info em { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .55); }

/* —— 右：表单区 —— */
.pwd-form-panel { padding: 30px 36px 26px; min-width: 0; }
.pwd-form-head {
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
}
.pwd-form-head h3 { font-size: 16px; font-weight: 600; }
.pwd-form-head p { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.pwd-card .field { margin-bottom: 17px; }
.pwd-input { position: relative; }
.pwd-input .input { padding-left: 38px; }
.pwd-input > svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: #93A3B6; pointer-events: none;
  transition: color .15s;
}
.pwd-input .input:focus + svg { color: var(--primary); }
.pwd-form-panel .form-tip { margin-top: 4px; }
.pwd-strength { display: flex; align-items: center; gap: 10px; margin-top: 9px; min-height: 18px; }
.ps-bars { display: flex; gap: 4px; flex: 1; max-width: 200px; }
.ps-bars i { height: 4px; flex: 1; border-radius: 99px; background: var(--line-2); transition: background .25s; }
.pwd-strength.lv-1 .ps-bars i:nth-child(1) { background: var(--danger); }
.pwd-strength.lv-2 .ps-bars i:nth-child(-n+2) { background: var(--orange); }
.pwd-strength.lv-3 .ps-bars i { background: var(--ok); }
.ps-label { font-size: 12px; color: var(--ink-2); flex-shrink: 0; }
.pwd-strength.lv-1 .ps-label { color: var(--danger); }
.pwd-strength.lv-2 .ps-label { color: var(--orange); }
.pwd-strength.lv-3 .ps-label { color: var(--ok); }
.pwd-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-2);
}
.pwd-actions .btn { min-width: 98px; }
@media (max-width: 860px) {
  .pwd-layout { grid-template-columns: 1fr; }
  .pwd-aside { padding: 20px 22px 16px; }
  .pwd-tips { display: none; }               /* 规则已并入右侧 form-tip，窄屏隐藏避免重复 */
  .pwd-account { margin-top: 14px; padding-top: 12px; }
  .pwd-form-panel { padding: 22px 20px 20px; }
  .pwd-card { margin-top: 8px; }
}
@media (max-width: 640px) {
  .pwd-actions { flex-direction: row-reverse; }
  .pwd-actions .btn { flex: 1; }
}

/* ============ 详情页计划卡片（detail.html 手机端，plan-card 前缀，仅复用既有变量） ============ */
/* 标签固定宽左对齐 + 值独占剩余宽度：长文本换行左对齐，避免"标签左值右"布局的参差感 */
.plan-card .pc-row { display: flex; gap: 10px; padding: 4px 0; font-size: 13px; line-height: 1.6; }
.plan-card .pc-label { flex-shrink: 0; width: 4em; color: var(--ink-2); }
.plan-card .pc-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ============ 日历类型标识（calendar.html，iconfont 线性风格） ============ */
/* 跟进记录：阶段色线性气泡（12px，不撑行高）；拜访计划：淡蓝底时钟（待办） */
.cal-ty { width: 12px; height: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cal-ty svg { width: 12px; height: 12px; display: block; }
.cal-ty.ty-plan { width: 14px; height: 14px; border-radius: 3.5px; background: var(--primary-soft); }
.cal-ty.ty-plan svg { width: 10px; height: 10px; }
/* 类型文字标签：详情弹窗内明确标注记录类型 */
.cal-type-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 1.7;
}
.cal-type-tag .cal-ty { width: 13px; height: 13px; }
.cal-type-tag .cal-ty svg { width: 13px; height: 13px; }
.cal-type-tag .cal-ty.ty-plan { width: 15px; height: 15px; }
.cal-type-tag .cal-ty.ty-plan svg { width: 11px; height: 11px; }
.cal-type-tag.t-follow { color: var(--ink); background: var(--chip-bg); }
.cal-type-tag.t-plan { color: var(--primary); background: var(--primary-soft); }
/* 拜访计划字段行（目的/协助事项/备注）：标签列定宽对齐，内容左对齐换行 */
.cal-fields .cf-row { display: flex; gap: 8px; padding: 2px 0; font-size: 13px; line-height: 1.65; }
.cal-fields .cf-row:first-child { padding-top: 0; }
.cal-fields .cf-row:last-child { padding-bottom: 0; }
.cal-fields .cf-label { flex: 0 0 4.5em; color: var(--ink-2); }
.cal-fields .cf-val { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* 月历头部图例 */
.cal-legend { display: inline-flex; align-items: center; gap: 12px; margin-left: 14px; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 640px) { .cal-legend { display: none; } }

/* ============ 跟进定位 + 现场图片（detail.html，followModal 与 timeline 共用变量） ============ */
/* 定位输入行：文字输入 + 一键 GPS 按钮 */
.loc-row { display: flex; gap: 8px; }
.loc-row .input { flex: 1; min-width: 0; }
.loc-row .btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* 定位结果条：成功态淡蓝底，含坐标/地图链接/清除 */
.loc-result {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  margin-top: 7px; padding: 6px 10px;
  border: 1px solid var(--primary-soft); border-radius: 6px;
  background: var(--primary-soft); color: var(--ink-2);
  font-size: 12px; line-height: 1.5;
}
.loc-result svg { color: var(--primary); flex-shrink: 0; }
.loc-result b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.loc-result a { color: var(--primary); }
.loc-result .link { margin-left: auto; }
/* 时间轴内定位行：淡色小字 + 地图链接 */
.tl-loc {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  margin-top: 6px; font-size: 12px; color: var(--ink-2);
}
.tl-loc svg { color: var(--primary); flex-shrink: 0; }
.tl-loc-text { overflow-wrap: anywhere; }
/* 时间轴图片九宫格：2 3 3 3 方形缩略图，悬停微放大 */
.tl-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tl-imgs img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
  cursor: zoom-in; transition: transform .15s, box-shadow .15s;
}
.tl-imgs img:hover { transform: scale(1.04); box-shadow: 0 3px 10px rgba(31, 45, 61, .16); }
/* 上传区：虚线框 + 加号按钮 + 缩略预览 */
.upload-zone {
  margin-top: 2px; padding: 10px;
  border: 1.5px dashed var(--line); border-radius: 8px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  transition: border-color .15s;
}
.upload-zone:hover { border-color: var(--primary); }
.up-previews { display: contents; }
.up-item { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.up-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); display: block;
}
.up-remove {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  border: none; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(31, 45, 61, .3);
}
.up-remove:hover { background: var(--danger); }
.up-add {
  width: 64px; height: 64px; flex-shrink: 0;
  border: 1.5px dashed var(--line); border-radius: 6px; background: var(--bg);
  color: var(--ink-2); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.up-add:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.up-add:disabled { opacity: .45; cursor: not-allowed; }
.up-tip { flex-basis: 100%; font-size: 11px; color: var(--ink-2); }
/* 大图预览遮罩：深色底 + 图片自适应，点击/Esc 关闭 */
.lightbox {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15, 23, 34, .88);
  display: none; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5); }
/* 窄屏：缩略图与上传块加大触达面积（配合全局 16px 输入字号规则） */
@media (max-width: 768px) {
  .tl-imgs img { width: 84px; height: 84px; }
  .up-item, .up-add { width: 76px; height: 76px; }
  .loc-row { flex-wrap: wrap; }
  .loc-row .btn { flex: 1; justify-content: center; }
}
