/* ===========================================================
   日程管理系统 —— 视觉（现代 / 简洁 / 浅色仪表盘风格）
   仅改样式，不改变任何功能与接口。所有类名与 app.js 保持一致。
   =========================================================== */

:root {
  /* 基础色板 */
  --bg-1: #f4f6fb;
  --bg-2: #eaf0f9;
  --surface: #ffffff;
  --ink: #1f2733;
  --muted: #6b7480;
  --line: #e8ecf3;
  --line-soft: #f0f3f8;

  /* 主题色（靛蓝） */
  --primary: #4f46e5;
  --primary-2: #6366f1;
  --primary-soft: #eef0fe;
  --on-primary: #ffffff;

  --success: #22c55e;
  --success-soft: #e7f8ee;
  --danger: #ef4444;
  --danger-soft: #fdecec;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.05);
  --shadow: 0 8px 24px rgba(31, 39, 51, 0.07);
  --shadow-lg: 0 18px 50px rgba(20, 28, 48, 0.22);

  /* 事件类型配色（主色只用于点缀，不做大面积填充） */
  --c-client: #f59e0b;
  --c-meeting: #0ea5e9;
  --c-travel: #8b5cf6;
  --c-study: #10b981;
  --c-personal: #ec4899;
  --c-other: #94a3b8;

  /* 各类型的浅底 / 描边 / 深色文字（用于行程卡片的轻量着色） */
  --c-client-soft: #fff8ec;   --c-client-line: #fbe3bd;   --c-client-deep: #b45309;
  --c-meeting-soft: #eff9ff;  --c-meeting-line: #c7e8fa;  --c-meeting-deep: #0369a1;
  --c-travel-soft: #f6f2ff;   --c-travel-line: #e0d3fb;   --c-travel-deep: #6d28d9;
  --c-study-soft: #ecfdf5;    --c-study-line: #bbf0d8;    --c-study-deep: #047857;
  --c-personal-soft: #fff0f7; --c-personal-line: #fad0e4; --c-personal-deep: #be185d;
  --c-other-soft: #f5f7fa;    --c-other-line: #e3e8ef;    --c-other-deep: #475569;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  /* 中文字体：优先思源黑体（Noto Sans SC），退到苹方 / 微软雅黑 UI */
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI",
    "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 数字与时间：用 Segoe UI 等宽数字，对齐更整齐、不跳动 */
.cal-num, .cal-title, .seg-time, .date-picker, .rb-time, .room-state {
  font-family: "Segoe UI", "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand .logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 22px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
.brand h1 {
  font-size: 20px; margin: 0; font-weight: 700; letter-spacing: 0.2px;
}

/* 顶部右侧：今天日期 + 实时时钟 */
.today-stamp {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 14px 6px 16px;
  border-radius: 999px;
  background: #f6f8fd;
  border: 1px solid var(--line);
}
.today-date {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.today-clock {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.date-picker {
  padding: 9px 14px;
  border: 1px solid #b9c6da;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.date-picker:hover { border-color: #9fb0c9; }
.date-picker:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------------- 按钮 ----------------
   统一口径（保持简单单调）：**白底 + 1px 实线边框 + 同色文字**，不要渐变、不要阴影、不要实心填充。
   主次只靠边框/文字颜色区分：主色 = 主操作，蓝灰 = 普通，红色 = 危险。hover 仅加一层极淡的同色底。 */
.btn {
  border: 1px solid #b9c6da;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: background .15s, border-color .15s, color .15s;
}
.btn:active { background: #f1f4fa; }

/* 主按钮：主色边框 + 主色文字 */
.btn-primary { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #f4f5ff; color: #4338ca; }
.btn-primary:active { background: #e9ebfe; }

/* 次按钮：中性蓝灰边框 */
.btn-ghost { background: #fff; color: #3d4a5c; border-color: #b9c6da; }
.btn-ghost:hover { background: #f5f8fd; border-color: #a9b6cc; color: var(--ink); }

/* 危险按钮：红色描边 */
.btn-danger { background: #fff; color: #dc2626; border-color: #eeaaaa; }
.btn-danger:hover { background: #fdf5f5; border-color: #df7c7c; color: #b91c1c; }
.btn-danger:active { background: #fbeaea; }

/* ---------------- 布局 ---------------- */
.main {
  padding: 22px 28px 40px;
  max-width: 1480px;
  margin: 0 auto;
  flex: 1 1 auto;
  min-width: 0;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 22px;
  /* 两栏都拉到同一行高：时间轴卡片与右栏底部对齐，不会一高一低 */
  align-items: stretch;
  margin-top: 18px;
}
.side { display: flex; flex-direction: column; gap: 22px; }

/* ---------------- 左侧选项卡 ---------------- */
.shell { display: flex; align-items: flex-start; }
.sidenav {
  width: 206px;
  flex: none;
  align-self: flex-start;
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
  padding: 16px 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}
.nav-cap {
  margin: 2px 0 8px 11px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, box-shadow 0.14s;
}
.nav-item:hover { background: #fff; border-color: var(--line); }
.nav-ico {
  width: 32px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #f1f4fa;
  font-size: 16px;
}
.nav-txt { display: flex; flex-direction: column; font-weight: 600; line-height: 1.25; }
.nav-sub { margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--muted); }
.nav-item.is-active {
  background: var(--primary-soft);
  border-color: rgba(79, 70, 229, 0.22);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}
.nav-item.is-active .nav-ico { background: #fff; }
.nav-item.is-active .nav-sub { color: #6366f1; }
/* 设置不是「一页」，用一条细线跟页面选项卡分开 */
.nav-sep { height: 1px; margin: 9px 10px 10px; background: #dfe5ef; }

/* ---------------- 页面容器 ---------------- */
.page { animation: pageIn 0.18s ease; }
.page.hidden { display: none; }
/* 系统设置改为独立页面：表单放进 .panel 卡片并限定宽度，去掉 .event-form 自带 padding 避免双重内边距 */
#page-settings .event-form { padding: 0; }
#page-settings .panel { max-width: 760px; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.page-head { margin: 0 0 16px; }
.page-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: 0.2px; }
.page-desc { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.page-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
}
.page-note {
  margin: 14px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: #f6f8fd;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}
/* ---------------- 操作栏（日历下方、当日行程上方） ---------------- */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-add {
  padding: 9px 22px;
  white-space: nowrap;
}

/* 搜索框 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 380px;
  background: #fff;
  border: 1px solid #b9c6da;
  border-radius: var(--radius-sm);
  padding: 0 10px 0 34px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-box:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-icon {
  position: absolute;
  left: 11px;
  font-size: 13px;
  opacity: 0.65;
  pointer-events: none;
}
.search-box input[type="search"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.search-box input[type="search"]::-webkit-search-cancel-button { display: none; }
.search-clear {
  border: none;
  background: #dfe4ee;
  color: #555f6d;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
}
.search-clear:hover { background: #cbd3e1; }
.action-tail { margin-left: auto; }

/* ---------------- 本周数据概览 ---------------- */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;              /* 四张卡等高 */
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  display: flex;
  flex-direction: column;            /* 上半图标+数字，下半明细 */
  align-items: stretch;
  gap: 10px;
  padding: 14px 17px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-c, var(--primary));
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-top { display: flex; align-items: center; gap: 13px; min-width: 0; }
.kpi-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  font-size: 18px;
  background: var(--kpi-soft, var(--primary-soft));
  flex: none;
}
.kpi-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.kpi-num {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
/* 标题行必须单行：数字下面这行标签一旦换行，四张卡就不等高了 */
.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 明细区：恒高三整行行程（3×34 + 行距 2×2 + 上内边距 8 + 分隔线 1 ≈ 115），
   不管有几条都占同样高度，四张卡才对得齐；
   四张卡的明细都是「全部列出 + 这块固定高度里滚动」（.kpi-d-list），
   不再折成「另有 N 项」——折了就看不着了。
   行程行是两行结构（时间+类型 / 谁·地点），高度按 34 算；改行结构要同步这里和
   .kpi-d-list 的 106px。 */
.kpi-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 115px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
  font-size: 12px;
  line-height: 1.55;
  color: #5b6577;
  overflow: hidden;
  position: relative;
}
/* 明细列表：3 整行行程可见（3×34 + 2×2 = 106），超出就滚——四张卡都是这个口径；
   刚好整除才不会把第 4 行切一半露半截字 */
.kpi-d-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 106px;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到底别把整页带着滚 */
  scrollbar-width: none;          /* 原生条不画（见下面自绘的那条） */
}
.kpi-d-list::-webkit-scrollbar { width: 0; height: 0; }
/* 自绘细滚动条：原生条在覆盖式滚动条环境下根本不显示，用户就看不出「下面还有」。
   轨道 + 滑块用伪元素画在明细区右边缘，滑块的高度/位置由 JS 写进 CSS 变量。 */
.kpi-detail.has-scroll .kpi-d-list { padding-right: 8px; }
.kpi-detail.has-scroll::before,
.kpi-detail.has-scroll::after {
  content: "";
  position: absolute;
  right: 2px;
  width: 4px;
  border-radius: 2px;
  pointer-events: none;
}
.kpi-detail.has-scroll::before {
  top: 9px;
  height: var(--rail-h, 0px);
  background: #eef2f8;
}
.kpi-detail.has-scroll::after {
  top: calc(9px + var(--thumb-top, 0px));
  height: var(--thumb-h, 0px);
  background: #c7d2e4;
}
.kpi-d-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.kpi-d-day { flex: none; color: #8f99aa; font-variant-numeric: tabular-nums; }
.kpi-d-txt {
  min-width: 0;
  color: #48536a;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-d-row.is-empty { color: #9aa3ae; }
/* 行程行（两行）：第一行 周几+时间 → 类型胶囊；第二行 谁/什么事 · 地点。
   类型胶囊的色跟类型走（data-type 给 --tc/--ts）。 */
.kpi-d-row.kpi-d-ev {
  display: block;
  line-height: 1.35;
  padding: 1px 0;
}
.kpi-d-ev-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.kpi-d-ev .kpi-d-day { font-size: 11.5px; }
.kpi-d-ev-sub {
  display: block;
  color: #48536a;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-d-type {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  white-space: nowrap;
  color: var(--tc, #475569);
  background: var(--ts, #eef2f6);
}
.kpi-d-ev[data-type="client"]  { --tc: var(--c-client-deep);   --ts: var(--c-client-soft); }
.kpi-d-ev[data-type="meeting"] { --tc: var(--c-meeting-deep);  --ts: var(--c-meeting-soft); }
.kpi-d-ev[data-type="travel"]  { --tc: var(--c-travel-deep);   --ts: var(--c-travel-soft); }
.kpi-d-ev[data-type="study"]   { --tc: var(--c-study-deep);    --ts: var(--c-study-soft); }
.kpi-d-ev[data-type="personal"]{ --tc: var(--c-personal-deep); --ts: var(--c-personal-soft); }
.kpi-d-ev[data-type="other"]   { --tc: var(--c-other-deep);    --ts: var(--c-other-soft); }
/* 逐天列表里的时段可能很长（多段用「、」连），窄屏就换行而不是截断——
   反正这块本来就可滚动，多一行也不影响四张卡等高。
   行程 / 客户行保持单行省略（有 title 悬浮看全），不然行高会参差 */
.kpi-d-list.is-wrap .kpi-d-row { align-items: flex-start; }
.kpi-d-list.is-wrap .kpi-d-txt { white-space: normal; word-break: break-word; }
.kpi-events  { --kpi-c: var(--primary); --kpi-soft: var(--primary-soft); }
.kpi-clients { --kpi-c: var(--c-client); --kpi-soft: var(--c-client-soft); }
.kpi-free    { --kpi-c: #10b981; --kpi-soft: #e8f9f1; }
.kpi-full    { --kpi-c: var(--danger); --kpi-soft: var(--danger-soft); }
/* 待安排 / 已排满 是单行行高（18.6+2），5 行正好 101：按这个取整，
   免得第 6 行在框底露出 3px 半截字 */
.kpi-free .kpi-d-list,
.kpi-full .kpi-d-list { max-height: 101px; }

/* ---------------- 月度日历 ---------------- */
.calendar-panel { padding: 18px 20px 20px; }
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-arrow { padding: 7px 14px; font-size: 18px; line-height: 1; min-width: 40px; }
.cal-title {
  font-size: 16px; font-weight: 700; min-width: 104px; text-align: center;
  color: var(--ink); font-variant-numeric: tabular-nums;
  white-space: nowrap;   /* 两端都带年份后文案变长，禁止折成两行把箭头挤歪 */
}

.cal-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 12px;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-chip { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-chip.rest { background: #e2e8f0; }
.cal-chip.free { background: var(--success); }
.cal-chip.busy { background: var(--primary); }
.cal-chip.full { background: var(--danger); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  /* minmax(0, 1fr)：允许列宽小于内容最小宽度，否则 nowrap 的时间/标题会把整行撑宽、末列被挤出容器 */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* 行高写死（至少 191px = 排满两条预览的高度）：整周没行程不再缩成 106px，跨周切换高度也不跳 */
  grid-auto-rows: minmax(191px, auto);
  gap: 10px;
}
.cal-cell {
  position: relative;
  /* 高度统一交给 grid-auto-rows，格子自己不再撑高/缩水 */
  min-height: 0;
  /* 七列等分时，格子必须能收缩；否则 min-width:auto 会让 grid 溢出 */
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform .1s, box-shadow .12s, border-color .12s;
}
.cal-dow { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.3px; }
.cal-cell.is-today .cal-dow { color: var(--primary); }
.cal-cell.is-selected .cal-dow { color: var(--primary); }
.cal-dots { display: flex; gap: 4px; flex-wrap: wrap; min-height: 8px; }
.cal-state { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* 周历格子上的撞车提醒：底部状态条右侧的小红标 */
.cal-conflict {
  margin-left: auto;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; line-height: 1.6;
  color: #b91c1c; background: #fdecec;
  border: 1px solid #f6c6c6; border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cal-cell.is-conflict { border-color: #f2c4c4; }
.cal-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d3d9e6; }
.cal-blank { background: transparent; border: none; cursor: default; }
.cal-blank:hover { transform: none; box-shadow: none; }

.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-num { font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-dots { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cal-dot.t-client { background: var(--c-client); }
.cal-dot.t-meeting { background: var(--c-meeting); }
.cal-dot.t-travel { background: var(--c-travel); }
.cal-dot.t-study { background: var(--c-study); }
.cal-dot.t-personal { background: var(--c-personal); }
.cal-dot.t-other { background: var(--c-other); }

.cal-state { display: flex; }
.cal-pill {
  font-size: 11.5px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  line-height: 1.6;
}
.cal-pill.rest { background: #eef1f6; color: #94a3b8; }
.cal-pill.free { background: var(--success-soft); color: #15803d; }
.cal-pill.busy { background: var(--primary-soft); color: var(--primary); }
.cal-pill.full { background: var(--danger-soft); color: #b91c1c; }

/* 周历格子内的当天安排预览 */
.cal-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 0 8px;
  min-height: 0;
  /* 行高固定后，条目多了由列表自己收，别把底部状态标签顶出格子 */
  flex: 1 1 auto;
  overflow: hidden;
}
.cal-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  font-size: 11.5px;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f3f6fb;
  border-left: 2px solid var(--c-other);
  overflow: hidden;
  min-width: 0;
}
/* 第一行：时间 + 角标（纪要/协助），宽度不够时角标不被压缩 */
.cal-item-head {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.cal-item-time {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  flex: none;
  white-space: nowrap;
  letter-spacing: -.2px;
  font-size: 10.5px;
}
/* 结束时间：跟开始时间同色系、略浅一点，但不至于发灰看不清 */
.cal-item-time i {
  font-style: normal;
  font-weight: 700;
  color: #3f4a59;
}
.cal-item-txt {
  color: #4a5361;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  min-width: 0;
  font-weight: 600;
}
.cal-item.t-client { border-left-color: var(--c-client); background: var(--c-client-soft); }
.cal-item.t-meeting { border-left-color: var(--c-meeting); background: var(--c-meeting-soft); }
.cal-item.t-travel { border-left-color: var(--c-travel); background: var(--c-travel-soft); }
.cal-item.t-study { border-left-color: var(--c-study); background: var(--c-study-soft); }
.cal-item.t-personal { border-left-color: var(--c-personal); background: var(--c-personal-soft); }
.cal-item.t-other { border-left-color: var(--c-other); background: var(--c-other-soft); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 5px; }

.cal-cell.is-rest { background: #f8fafc; }
.cal-cell.is-rest .cal-num { color: #cbd5e1; }
.cal-cell.is-free { background: #f6fbf8; border-color: #d7f0e2; }
.cal-cell.is-busy { background: #f7f8ff; border-color: #e2e4fb; }
.cal-cell.is-full { background: #fef7f7; border-color: #fadddd; }

.cal-cell.is-today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-cell.is-today .cal-num { color: var(--primary); }
.cal-cell.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary);
  background: var(--primary-soft);
}
.cal-cell.is-selected .cal-num { color: var(--primary); }

.cal-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 11px 13px;
  background: var(--primary-soft, #eef0ff);
  border: 1px solid #e1e4f6;
  border-left: 3px solid var(--primary, #4f46e5);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #4b5570;
}
.cal-tip-ico { flex: 0 0 auto; font-size: 14px; line-height: 1.5; }
.cal-tip-txt { flex: 1 1 auto; }
.cal-tip-txt b { color: var(--primary, #4f46e5); font-weight: 700; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.panel-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-title .pt-icon {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 15px;
}

/* 图例 */
.legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: -6px 0 14px;
  font-size: 12.5px; color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .dot.client { background: var(--c-client); }
.legend .dot.meeting { background: var(--c-meeting); }
.legend .dot.travel { background: var(--c-travel); }
.legend .dot.study { background: var(--c-study); }
.legend .dot.personal { background: var(--c-personal); }
.legend .dot.other { background: var(--c-other); }
.legend .dot.free { background: #cbd5e1; }

/* ---------------- 时间轴（真正的竖向时间线） ---------------- */
/* 画布高度固定：当天行程多少都只在这个高度里，多了内部滚动、少了把间距拉开，
   免得时间轴一会儿 130px 一会儿 750px，把整页顶得一跳一跳。
   高度靠 flex 撑满整行（与右栏底部齐平），再用 max-height 兜住。 */
.timeline-panel { display: flex; flex-direction: column; }
.timeline-scroll {
  /* flex-basis:0：画布自己不计入行高，行高由右栏决定，行程再多也不把整页顶长 */
  flex: 1 1 0;
  height: auto;
  min-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  /* 滚动条只在内容超高时出现，别把里侧留白占掉 */
  scrollbar-gutter: stable;
  padding-right: 2px;
}
.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 4px;
  /* 内容比画布矮时（休息日 / 只有一两条）撑满画布，靠 space-between 把空隙匀开，
     不许缩在顶上留一大片空白 */
  min-height: 100%;
  justify-content: space-between;
}
/* 空态（加载中 / 休息日 / 全部人当天没安排）在固定画布里居中，别贴在顶上 */
.timeline > .empty,
.timeline > .empty-day { margin: auto 0; }
/* 竖线穿过每个圆点的圆心（.seg 第一列宽 - 圆点 right - 圆点半径 = 96-11-6 = 79px） */
.timeline::before {
  content: "";
  position: absolute;
  left: 79px; top: 10px; bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--line), var(--line));
  border-radius: 2px;
}
/* 时间轴已不再画「现在线」（红色通栏横线已按需求去掉，2026-10-28 晚）；
   当前时刻的提示改由进行中卡片上的 .now-badge / 「还剩 X」承担。 */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: stretch;
}
/* 左侧时间列：字号放大 + 与右侧圆点/竖线留出安全距离，避免被压住 */
.seg-time {
  position: relative;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 600;
  padding-right: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.4;
}
.seg-time .t-s { color: var(--ink); font-size: 16px; }
.seg-time .t-e { font-size: 14px; }
.seg-time::after {
  content: "";
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--primary);
  box-sizing: border-box;
  box-shadow: 0 0 0 3px #fff;
}
.seg-event[data-type="client"]  .seg-time::after { border-color: var(--c-client); }
.seg-event[data-type="meeting"] .seg-time::after { border-color: var(--c-meeting); }
.seg-event[data-type="travel"]  .seg-time::after { border-color: var(--c-travel); }
.seg-event[data-type="study"]   .seg-time::after { border-color: var(--c-study); }
.seg-event[data-type="personal"] .seg-time::after { border-color: var(--c-personal); }
.seg-event[data-type="other"]   .seg-time::after { border-color: var(--c-other); }
.seg .seg-time.free-dot::after { border-color: #cbd5e1; }

.seg-body {
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 空闲块 */
.free-body {
  background: #f7f9fc;
  border: 1.5px dashed #aeb9c9;
  color: #6b7787;
  font-weight: 700;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.free-body:hover {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.1);
}
.free-txt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.free-txt::before {
  content: "☕";
  font-size: 17px;
}
/* 「（至 18:00）」这种截止提示整体不折行，窄屏时整段换到下一行，别从中间断开 */
.free-dl {
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: #8b95a6;
}
.free-add {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  border: 1px solid #dfe3f5;
  border-radius: 999px;
  padding: 4px 12px;
  opacity: .7;
  transition: all .12s;
}
.free-body:hover .free-add { opacity: 1; background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* 已经过去的那段时间（今天早些时候 / 今天以前的日期）：只作背景，不可点、不计入待安排 */
.past-body {
  background: #f3f6fa;
  border: 1.5px dashed #aeb9c9;
  color: #8a96a8;
  font-weight: 700;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: default;
}
.past-body .free-txt::before {
  content: "🕘";
  font-size: 16px;
  opacity: .5;
}
.seg .seg-time.past-dot::after { border-color: #e5e9f0; background: #f8fafc; }
.seg-past .seg-time .t-s,
.seg-past .seg-time .t-e { color: #b3bccb; }

/* 非可用时段块（落在自定义可用区间之外） */
.out-body {
  background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 8px, #eceef2 8px, #eceef2 16px);
  border: 1.5px dashed #aeb9c9;
  color: #7e8aa0;
  font-weight: 700;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.out-body .free-txt::before {
  content: "🌙";
  font-size: 17px;
}
.out-tip {
  font-size: 11.8px;
  font-weight: 600;
  color: #a8b3c2;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.seg .seg-time.out-dot::after { border-color: #cbd5e1; }

/* 「全部人」视图的中性空档块（作息不统一，不判空闲/非可用；复用 free 的结构与文字类） */
.idle-body {
  background: #f3f6fa; border: 1.5px dashed #aeb9c9; color: #7e8aa0; font-weight: 700;
  flex-direction: row; align-items: center; justify-content: space-between; gap: 14px;
  cursor: pointer; transition: background .12s, border-color .12s, box-shadow .12s;
}
.idle-body:hover { background: #fff; border-color: #b9c3d3; box-shadow: 0 6px 16px rgba(15, 23, 42, .06); }
.idle-body .free-txt::before { content: "○"; font-size: 15px; color: #cbd5e1; }
.idle-body .free-add { color: #7c8798; border-color: #e2e8f0; }
.idle-body:hover .free-add { opacity: 1; background: #64748b; color: #fff; border-color: #64748b; }
.seg .seg-time.idle-dot::after { border-color: #dbe2ea; }

/* 设置弹窗内的说明文字 */
.hint {
  margin: 4px 0 2px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  background: #f7f9fc;
  border-left: 3px solid var(--primary);
  padding: 8px 12px;
  border-radius: 6px;
}

/* 每周时间段网格 */
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 8px;
}
.field-label .muted { font-weight: 400; color: var(--muted); font-size: 12px; }
.weekly-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wd-row {
  display: grid;
  grid-template-columns: 48px 1fr 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f7f9fc;
  border: 1px solid #e6ebf2;
  border-radius: 9px;
}
.wd-row .wd-name { font-weight: 600; color: var(--text); font-size: 13px; }
.wd-row input[type="time"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
}
.wd-row input[type="time"]:disabled { background: #eef1f5; color: #b6c0cd; }
.wd-row .wd-sep { text-align: center; color: var(--muted); }
.wd-rest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.wd-rest input { accent-color: var(--primary); }

/* 事件块：浅色淡底 + 左侧色条，颜色只作点缀，不再整块高饱和填充 */
.event-body {
  background: var(--c-soft, #f5f7fa);
  color: var(--ink);
  border: 1px solid var(--c-line, #e3e8ef);
  border-left: 4px solid var(--c, #94a3b8);
  box-shadow: 0 1px 2px rgba(20, 30, 60, 0.04);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s;
  /* 左：主信息；右：资料区 + 快捷按钮。宽度不够时资料区自动换到下一行，不会把标题挤成竖排 */
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 16px 12px 18px;
}
.ev-main { flex: 1 1 300px; min-width: 0; }
.event-body:hover {
  transform: translateY(-1px);
  background: #fff;
  border-color: var(--c, #94a3b8);
  box-shadow: 0 8px 18px rgba(31, 39, 51, 0.1);
}
.event-tag {
  display: inline-block;
  align-self: flex-start;
  background: #fff;
  color: var(--c-deep, #475569);
  border: 1px solid var(--c-line, #e3e8ef);
  border-radius: 7px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.event-title { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.event-meta {
  font-size: 12.8px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
/* 时长 / 地点 / 客户 / 备注 做成小胶囊，比一串文字更撑得住宽度 */
.ev-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 260px;
  padding: 1px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--c-line, #e3e8ef);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-chip-note {
  background: rgba(255, 255, 255, .95);
  color: var(--c-deep, #475569);
  font-weight: 700;
}

/* 进行中的那条：还剩多久 */
.ev-left {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

/* 类型配色（通过 data-type 设置 CSS 变量） */
.seg-event[data-type="client"]  { --c: var(--c-client);   --c-soft: var(--c-client-soft);   --c-line: var(--c-client-line);   --c-deep: var(--c-client-deep); }
.seg-event[data-type="meeting"] { --c: var(--c-meeting);  --c-soft: var(--c-meeting-soft);  --c-line: var(--c-meeting-line);  --c-deep: var(--c-meeting-deep); }
.seg-event[data-type="travel"]  { --c: var(--c-travel);   --c-soft: var(--c-travel-soft);   --c-line: var(--c-travel-line);   --c-deep: var(--c-travel-deep); }
.seg-event[data-type="study"]   { --c: var(--c-study);    --c-soft: var(--c-study-soft);    --c-line: var(--c-study-line);    --c-deep: var(--c-study-deep); }
.seg-event[data-type="personal"]{ --c: var(--c-personal); --c-soft: var(--c-personal-soft); --c-line: var(--c-personal-line); --c-deep: var(--c-personal-deep); }
.seg-event[data-type="other"]   { --c: var(--c-other);    --c-soft: var(--c-other-soft);    --c-line: var(--c-other-line);    --c-deep: var(--c-other-deep); }

/* 事件块内的标签行 */
.event-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 5px; }
.event-tags .event-tag { margin-bottom: 0; }

/* 卡片右侧：把已有的资料摊开（单位 / 来访次数 / 上次聊了什么） */
.ev-facts {
  flex: 0 1 auto;
  min-width: 252px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 22px;
  justify-items: start;
  align-content: center;
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--c-line, #e3e8ef);
}
.ev-fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 200px;
}
.ev-k {
  font-size: 10.8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  opacity: .85;
}
.ev-v {
  font-size: 12.8px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.ev-empty {
  font-size: 12.2px;
  color: var(--muted);
  opacity: .8;
  grid-column: 1 / -1;
}
/* 「＋ 加备注」是提示不是输入框：只留一行淡灰文字，hover 时变主色 */
.ev-add-note {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  font-size: 11.8px;
  font-weight: 600;
  color: #a7aebb;
  padding: 2px 0;
  border: none;
  background: none;
  transition: color .12s;
}
.event-body:hover .ev-add-note { color: var(--primary); }

/* 卡片右侧快捷按钮：编辑 / 删除 */
.ev-act {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-left: auto;
  opacity: .5;
  transition: opacity .12s;
}
.event-body:hover .ev-act { opacity: 1; }
/* 卡片右侧的图标按钮：白底 + 统一的中性描边（三个按钮边框完全同色，避免谁看着更大一圈） */
.ev-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid #b9c6da;
  background: #fff;
  color: var(--c-deep, #475569);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s, color .12s;
}
.ev-btn:hover { background: var(--c-soft, #f5f8fd); border-color: #a9b6cc; }
.ev-btn[data-act="del"]:hover { background: var(--danger-soft); border-color: #e57373; color: #dc2626; }
/* 「提前结束」按钮：框与其他按钮同色，只用绿色图标区分（和红色的删除区分开） */
.ev-btn[data-act="end"] { border-color: #b9c6da; background: #fff; color: #047857; }
.ev-btn[data-act="end"]:hover { background: #edfdf5; border-color: #8ad4b0; color: #047857; }
/* 提前结束过的标记：显示实际结束时间 + 原定结束时间（这是标签不是按钮，淡底保留） */
.ev-early { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

/* 时间轴标题右侧的当天小结 */
.tl-sum {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  background: #f6f8fd;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 小结与冲突提示一起靠右，标题留在左边 */
.panel-head .tl-sum { margin-left: auto; }

/* 冲突提示胶囊：只在检测到冲突时出现，点一下跳到第一条冲突行程 */
.tl-conflict {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #b91c1c;
  background: var(--danger-soft);
  border: 1px solid #f6c6c6;
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, transform 0.15s;
}
.tl-conflict:hover { background: #fbd9d9; transform: translateY(-1px); }
.tl-conflict:focus-visible { outline: 2px solid var(--danger); outline-offset: 2px; }

/* 行程卡片上的冲突角标 + 红色描边（用 outline，不覆盖类型色和阴影） */
.event-warn {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  color: #b91c1c;
  background: #fdecec;
  border: 1px solid #f6c6c6;
  border-radius: 999px;
  padding: 1px 8px;
}
.seg.is-conflict .event-body { outline: 2px solid #f6c6c6; outline-offset: -1px; }

@keyframes conflictFlash {
  0%, 100% { background-color: var(--c-soft, #f5f7fa); }
  30%      { background-color: #fdecec; }
}
.seg.flash .event-body { animation: conflictFlash 0.9s ease 2; }

/* 行程状态标：已结束 / 未开始（进行中沿用 .event-live 的类型文案） */
.ev-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 9px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.ev-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .65;
}
.ev-status.is-done { background: #eef1f6; color: #78849a; }
.ev-status.is-todo { background: #eaf1ff; color: #2563eb; }
/* 已经结束的那条整体压一档，让「还在往后走」的行程更跳出来 */
.seg-event.is-done .event-title { color: #5d6779; }
.seg-event.is-done .seg-time .t-s,
.seg-event.is-done .seg-time .t-e { color: #94a3b8; }

/* 进行中的行程 */
.event-live {
  font-size: 11.5px;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 999px;
  padding: 1px 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.event-live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.6s ease-in-out infinite;
}
/* 非接待类（出差中 / 会议中…）用冷静一点的蓝紫，不要到处都是报警红 */
.event-live.is-quiet { color: #4338ca; background: #e0e7ff; }
.event-live.is-quiet::before { background: #6366f1; }
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .3; transform: scale(.75); }
}
.seg-event.is-ongoing .event-body {
  border-left-width: 6px;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.13), 0 6px 16px rgba(31, 39, 51, 0.08);
}
.seg-event.is-ongoing .seg-time .t-s { color: #dc2626; }
.now-badge {
  align-self: flex-end;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: #ef4444;
  border-radius: 999px;
  padding: 0 7px;
  margin-bottom: 3px;
  line-height: 1.7;
  letter-spacing: 0.3px;
}
/* 搜索时的淡化 / 命中 */
.seg.is-dim { opacity: 0.26; filter: grayscale(0.55); }
.seg.is-dim .event-body { box-shadow: none; }
.seg.is-hit .event-body { box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2), 0 4px 12px rgba(31, 39, 51, 0.08); }

/* ---------------- 房间现在（右栏，下一次行程下面） ---------------- */
/* 房间状态换成竖排：右栏只有 344px，横向铺一排会挤成一字马 */
.room-panel .room-strip { grid-template-columns: 1fr; }
/* 卡片高度写死：有人占用时多一行字，右栏跟着长会让整页抖 */
.room-panel .room-chip { height: 116px; overflow: hidden; }
.room-panel .room-busy { max-height: 46px; overflow: hidden; }
.room-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 12px;
  padding-top: 2px;
}
.room-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 11px 13px 11px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
/* 左侧一条状态色：绿=空闲 / 橙=用着 / 灰=已关闭 */
.room-chip::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #22c55e;
}
.room-chip.is-using::before { background: #f59e0b; }
.room-chip.is-off::before { background: #cbd5e1; }
.room-chip:hover {
  border-color: #c7cdf7;
  box-shadow: 0 6px 16px rgba(31, 39, 51, 0.08);
}
.room-chip.is-off { background: #fafbfc; }

.room-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.room-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-type {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f4f9;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.room-chip.is-off .room-name { color: #8b93a1; }
/* 开关在横条里缩小一点，别把房间名挤走 */
.room-switch { margin-left: auto; transform: scale(.82); transform-origin: right center; }

.room-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
}
.room-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.room-state.open,
.room-state.free { color: #15803d; }
.room-state.using { color: #b45309; }
.room-state.using i { animation: rcPulse 1.5s ease-in-out infinite; }
.room-state.off { color: #94a3b8; }
@keyframes rcPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

.room-busy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 66px;
  overflow-y: auto;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.room-none { font-size: 12.5px; color: var(--muted); }
.room-busy-item { display: flex; gap: 7px; min-width: 0; font-size: 12.5px; line-height: 1.45; }
.rb-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rb-title { min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-busy-item.is-now .rb-time,
.room-busy-item.is-now .rb-title { color: #b45309; font-weight: 700; }

/* 开关 */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cdd3df; transition: .2s; border-radius: 26px;
}
.slider::before {
  content: ""; position: absolute;
  height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; transition: .2s; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------------- 下一位客户 ---------------- */
.next-panel {
  background: linear-gradient(135deg, #fffaf2 0%, #ffffff 60%);
  border-color: #fbe7cd;
  /* 固定高度：空状态 / 有行程时卡片一样高，右栏不会跟着跳 */
  display: flex;
  flex-direction: column;
  height: 276px;
}
.next-visit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* 余下空间由卡片区吃掉，内容垂直居中，空状态也不会贴在顶上 */
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  justify-content: center;
}
.next-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0 8px;
}
.nv-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nv-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.nv-start { font-size: 27px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.nv-sep { color: var(--muted); font-size: 15px; }
.nv-end { font-size: 15px; color: var(--muted); font-weight: 600; }
.nv-name { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; min-width: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); }
/* 名字只占一行：卡片高度是写死的，长名字换行会把下面挤出去 */
.nv-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-type {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--c-other-soft);
  color: var(--c-other-deep);
  border: 1px solid var(--c-other-line);
}
.nv-type.t-client { background: var(--c-client-soft); color: var(--c-client-deep); border-color: var(--c-client-line); }
.nv-type.t-meeting { background: var(--c-meeting-soft); color: var(--c-meeting-deep); border-color: var(--c-meeting-line); }
.nv-type.t-travel { background: var(--c-travel-soft); color: var(--c-travel-deep); border-color: var(--c-travel-line); }
.nv-type.t-study { background: var(--c-study-soft); color: var(--c-study-deep); border-color: var(--c-study-line); }
.nv-type.t-personal { background: var(--c-personal-soft); color: var(--c-personal-deep); border-color: var(--c-personal-line); }
.nv-owner { color: var(--muted); }
.nv-assist { color: #7c3aed; font-weight: 600; }
/* 跨天行程：时间前挂「明天 / 10月31日」，避免误以为今天 */
.nv-day {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #dbe2ff;
  border-radius: 999px;
  padding: 2px 9px;
  margin-right: 2px;
  white-space: nowrap;
}
/* 中文单位字数多：「3小时45分钟」中等字号，「1天18小时24分钟」再缩一档，防止顶出卡片 */
.nv-cd-time.is-md { font-size: 22px; }
.nv-cd-time.is-sm { font-size: 19px; }
/* 只占一行：卡片高度写死，地点/标签换行会把状态条挤出去 */
.nv-meta { display: flex; align-items: center; gap: 9px; flex-wrap: nowrap; min-width: 0; font-size: 12.5px; color: var(--muted); }
.nv-loc {
  color: var(--muted);
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nv-meta .nv-dur, .nv-meta .nv-owner, .nv-meta .nv-assist { flex: none; }
.nv-dur {
  background: #f2f4f9;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11.5px;
  font-weight: 600;
}
/* 当天接待全部结束后，这一场只是「最后一场」的回顾，不必再那么抢眼 */
.nv-card.past .nv-start { font-size: 20px; color: var(--muted); }
.nv-card.past .nv-name { font-size: 14px; color: var(--muted); }
.next-hint {
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 9px;
  padding: 7px 11px;
  background: #f2f4f9;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.next-hint.is-soon { background: var(--c-client-soft); color: #b45309; }
.next-hint.is-ongoing {
  background: #fee2e2;
  color: #b91c1c;
}
.next-hint.is-ongoing::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.6s ease-in-out infinite;
}
.next-hint.is-past { background: #eef1f6; color: #94a3b8; }

/* 倒计时：突出显示「距开始 / 距结束」，只到分钟（不显示秒） */
.nv-countdown {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 13px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #dbe2ff;
}
.nv-countdown.ongoing {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border-color: #fecaca;
}
.nv-cd-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .5px;
  white-space: nowrap;
}
.nv-cd-time {
  /* 中文单位（小时/分钟）用系统字体才好看；数字仍对齐（tabular-nums） */
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 26px;
  font-weight: 800;
  color: #4f46e5;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}
/* 单位缩小成注脚，数字才是主角 */
.nv-cd-time .u {
  font-size: .52em;
  font-weight: 700;
  color: #6366f1;
  margin: 0 5px 0 1px;
}
.nv-cd-time .u:last-child { margin-right: 0; }
.nv-countdown.ongoing .nv-cd-time { color: #dc2626; }
.nv-countdown.ongoing .nv-cd-label { color: #b91c1c; }


/* ---------------- 空 / 加载 / 错误 ---------------- */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 26px 12px;
  font-size: 13.8px;
}
.empty.error { color: var(--danger); }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; }
/* 从「选择客户」弹窗里点「＋ 新增客户」时，建档弹窗要压在它上面 */
#customerNewModal { z-index: 60; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(18, 24, 40, 0.5); backdrop-filter: blur(2px); }
.modal-card {
  position: relative;
  margin: auto;
  /* 弹窗宽度统一：除客户档案（.modal-wide，内含表格要更宽）外，全部同一个宽度 */
  width: min(560px, 94vw);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fafbff, #f1f3fe);
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-close {
  border: none; background: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--muted); border-radius: 8px;
  width: 32px; height: 32px;
}
.modal-close:hover { color: var(--ink); background: #eef1f7; }

.event-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
/* 只读态（协助来的 / 别人的行程）：控件压灰、光标改成禁止，别让人以为还能改 */
.event-form.is-ro input:disabled,
.event-form.is-ro select:disabled,
.event-form.is-ro textarea:disabled {
  background: #f4f6fa;
  color: #64748b;
  cursor: not-allowed;
  -webkit-text-fill-color: #64748b;
}
.event-form.is-ro .assist-box { background: #f4f6fa; cursor: not-allowed; }
.event-form.is-ro .assist-x { display: none; }
.event-form.is-ro .loc-chips { pointer-events: none; opacity: .55; }
.event-form.is-ro .hint#eventRoTip {
  background: #f4ecff;
  border: 1px solid #e3d3ff;
  color: #6d28d9;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.field {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--muted); font-weight: 700;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
/* 类型 + 客户 这一行：客户要多选、要放标签，给宽一点 */
.row.row-cust { grid-template-columns: minmax(104px, .68fr) 1.7fr; }
/* 客户标签要与左边「类型」的裸文本标签同行对齐：去掉 .field-label 自带的外边距，字号口径统一 */
.row-cust .field > .field-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  line-height: 20px;
}
/* 客户标签换行后，输入框别被挤成一小条（否则占位文字被裁成「搜索客户，或直」） */
#custBox .assist-input { min-width: 150px; }

/* 地点：文本框随便写 + 资源快捷按钮 + 会不会占资源的说明 */
.loc-label { display: flex; align-items: baseline; gap: 6px; }
.loc-label em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: #9aa3b2;
}
/* 「必填」用主色（原来是灰色的「选填」，太容易被跳过） */
.loc-label em.is-req { color: var(--primary, #4f46e5); }
/* 没填就提交 → 输入框描红，填上（输入事件）立刻恢复 */
#f_location.is-empty { border-color: #f2b8b8; background: #fff8f8; }
#f_location.is-empty:focus { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12); }
.loc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.loc-chips:empty { display: none; }
.loc-chip {
  border: 1px solid #cfd8e8;
  background: #fff;
  color: #4a566b;
  border-radius: 999px;
  padding: 4px 11px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.loc-chip:hover { background: #f5f8fd; border-color: var(--primary-2); color: var(--primary); }
.loc-chip.is-on { background: #fff; border-color: var(--primary); color: var(--primary); }
.loc-hint { font-size: 11.5px; font-weight: 600; line-height: 1.5; }
.loc-hint.is-res { color: #15803d; }
.loc-hint.is-free { color: #b45309; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.form-actions .spacer { flex: 1; }
.hidden { display: none !important; }

/* ---------------- 轻提示 ---------------- */
.toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%);
  background: #1f2733;
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: min(560px, calc(100vw - 32px));
  text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.hidden { display: none; }

/* ---------------- 资源时段占用表（资源 × 时间 网格） ---------------- */
.grid-panel { margin-top: 18px; }

.res-grid {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.rg-row {
  display: grid;
  grid-template-columns: 118px minmax(600px, 1fr);
  min-width: 720px;
}
.rg-row + .rg-row { border-top: 1px solid var(--line-soft); }

.rg-headrow {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.rg-corner {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.rg-namecell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 7px 12px;
  border-right: 1px solid var(--line);
  background: #fcfdff;
}
.rg-rname {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rg-rtype {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rg-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 46px;
}

.rg-hcell {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.rg-hcell:last-child { border-right: none; }

.rg-cell {
  border-right: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
}
.rg-cell:last-child { border-right: none; }
.rg-cell:hover {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.35);
}

/* 占用块（跨格绝对定位） */
.rg-event {
  position: absolute;
  top: 4px;
  bottom: 4px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 8px;
  border-radius: 7px;
  border-left: 3px solid var(--c-other);
  background: #eef1f7;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  overflow: hidden;
  transition: transform .1s, box-shadow .12s;
}
.rg-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(31, 39, 51, 0.16), inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}
.rg-event.t-client   { background: #fff5e6; border-left-color: var(--c-client); }
.rg-event.t-meeting  { background: #e6f5fd; border-left-color: var(--c-meeting); }
.rg-event.t-travel   { background: #f2ecfe; border-left-color: var(--c-travel); }
.rg-event.t-study    { background: #e8f9f1; border-left-color: var(--c-study); }
.rg-event.t-personal { background: #fdeaf4; border-left-color: var(--c-personal); }
.rg-event.t-other    { background: #eef1f7; border-left-color: var(--c-other); }

.rg-ev-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #2b3644;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.rg-ev-time {
  font-size: 11px;
  color: #5b6472;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

/* 30–59 分钟的窄块：只留一行标题（两行必然都被截成「…」）。
   padding 收到 5px + 字号 12px，「接待客户」这类四字标题在 60px 宽内刚好放得下。 */
.rg-event.is-one { padding: 0 2px; }
.rg-event.is-one .rg-ev-title {
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: -0.1px;
}

/* 不到 30 分钟：宽度不足 45px，塞字只会糊成一片 → 只留色条，详情看悬浮提示 */
.rg-event.is-tiny {
  padding: 0;
  min-width: 10px;
}

/* 已关闭的资源整行淡化 */
.rg-row.is-off .rg-namecell { background: #f7f8fa; }
.rg-row.is-off .rg-rname { color: #94a3b8; }
.rg-row.is-off .rg-cell { background: #fafbfc; cursor: not-allowed; }
.rg-row.is-off .rg-cell:hover { background: #fafbfc; box-shadow: none; }
.rg-row.is-off .rg-event { opacity: .55; }

/* ---------------- 资源页下半部分：多人共同空闲 ---------------- */
/* 结构与上方资源网格同源（复用 .rg-* 骨架），这里只加 cf- 前缀的新东西，
   .rg-* 的既有规则一律不动；确实要覆盖的，都限定在 .cf-grid 作用域内。 */
.cf-panel { margin-top: 18px; }

.cf-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cf-min {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.cf-min select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #b9c6da;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cf-min select:hover { border-color: #a9b6cc; }
.cf-min select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 已选人员小标签：白底 + 1px 实线边 + 圆角 + ×，hover 边框加深（铁律：不填色/渐变/阴影） */
.cf-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0 0 10px;
}
.cf-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 220px;
  padding: 2px 4px 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.6;
}
.cf-chip:hover { border-color: #b9c6da; }
.cf-chip-nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-chip-x {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.cf-chip-x:hover { border-color: #b9c6da; color: var(--ink); }
.cf-chip-empty { font-size: 12.5px; color: #9aa3af; }

/* 图例里「全员都有空」的小色块：与绿块同一套色 */
#cfLegendCommon { background: #d1fae5; border: 1px solid #059669; }

.cf-grid {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
/* 这里的背景格只是刻度，不承担「点一下占用」，所以去掉指针与 hover 高亮 */
.cf-grid .rg-cell { cursor: default; }
.cf-grid .rg-cell:hover { background: transparent; box-shadow: none; }
.cf-grid .rg-track { height: 46px; }
.cf-grid .rg-event { cursor: default; }

/* 别人的忙块：能点，但只弹提示；颜色沿用 t-<type>，不做二次着色 */
.cf-grid .rg-event.cf-busy { cursor: pointer; }

/* 共同空闲绿块：比 study（外出学习）那块更饱和，一眼能区分开 */
.cf-grid .rg-event.is-free {
  background: #d1fae5;
  border-left: 3px solid #059669;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.28);
  cursor: pointer;
}
.cf-grid .rg-event.is-free .rg-ev-title { color: #065f46; }
.cf-grid .rg-event.is-free .rg-ev-time { color: #047857; }
.cf-grid .rg-event.is-free:hover { background: #bbf7d0; }

/* 最后一行「共同空闲」的名字格用主题绿 */
.cf-grid .rg-row.is-common .rg-namecell { background: var(--success-soft); }
.cf-grid .rg-row.is-common .cf-common-name { color: #047857; }

/* 「共同空闲」行：窗口外（不是所有人都上班）的时段铺浅灰斜纹。
   位置由 app.js 写在轨道上的 --cf-win-l / --cf-win-w（百分比），这里只用 ::before/::after 画两侧，
   作用域严格限定在 .cf-grid 的 .rg-row.is-common 下，裸 .rg-* 规则一条不动，上方资源网格不受影响。
   伪元素绝对定位，不参与轨道尺寸计算；pointer-events:none 保证不可点、不触发 hover。 */
.cf-grid .rg-row.is-common .rg-track::before,
.cf-grid .rg-row.is-common .rg-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    #eaeef5 0,
    #eaeef5 3px,
    #f8fafc 3px,
    #f8fafc 7px
  );
}
/* 窗口左侧的窗口外区域 */
.cf-grid .rg-row.is-common .rg-track::before {
  left: 0;
  width: var(--cf-win-l, 0%);
}
/* 窗口右侧的窗口外区域（左边界 = 窗口起点 + 窗口宽度） */
.cf-grid .rg-row.is-common .rg-track::after {
  left: calc(var(--cf-win-l, 0%) + var(--cf-win-w, 100%));
  right: 0;
}

/* 图例里「不是全员上班」的小色块：与斜纹同一套图案 */
.cal-chip.cf-chip-out {
  background-image: repeating-linear-gradient(
    45deg,
    #eaeef5 0,
    #eaeef5 3px,
    #f8fafc 3px,
    #f8fafc 7px
  );
  border: 1px solid #dfe5ef;
}

/* 凑不出共同空档时整行换成一句提示，不留空行 */
.cf-none {
  padding: 16px 12px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* 窄屏：允许横向滚动，别把格压到看不清 */
@media (max-width: 900px) {
  .cf-grid .rg-row {
    grid-template-columns: 96px minmax(520px, 1fr);
    min-width: 616px;
  }
}

/* ---------------- 设置里的资源管理 ---------------- */
.res-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.res-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 66px;
  gap: 8px;
  align-items: center;
}
.res-row input,
.res-row select,
.res-add-row input,
.res-add-row select {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
.res-row input:focus,
.res-row select:focus,
.res-add-row input:focus,
.res-add-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.res-row .res-del {
  padding: 8px 0;
  font-size: 12.5px;
  background: #fdecec;
  color: #b91c1c;
}
.res-row .res-del:hover { background: #fbdada; }

.res-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px 72px;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.res-add-row .btn { padding: 8px 0; font-size: 13px; }

/* ---------------- 周历格子：小时刻度 + 拖选时段 ---------------- */
.cal-cell {
  user-select: none;
  -webkit-user-select: none;
}
.cal-cell.is-dragging {
  cursor: ns-resize;
  box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow);
}
/* 淡色小时线：既分隔视觉，也是拖选时的时间参照；不参与鼠标事件 */
.cal-lines {
  position: absolute;
  left: 10px; right: 10px;
  top: 34px; bottom: 30px;
  pointer-events: none;
  z-index: 0;
}
.cal-lines i {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(31, 39, 51, 0.06);
}
.cal-top, .cal-dots, .cal-list, .cal-state { position: relative; z-index: 1; }

/* 拖拽中的半透明选区 */
.cal-drag-sel {
  position: absolute;
  left: 7px; right: 7px;
  z-index: 5;
  border-radius: 6px;
  border: 1px dashed var(--primary);
  background: rgba(79, 70, 229, 0.15);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cal-drag-sel span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 4px;
  padding: 0 5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 面板标题 + 右侧小按钮 */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.panel-head .panel-title { margin-bottom: 0; }
.mini-link {
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-link:hover { background: #e3e6fd; }

/* 客户输入框下方的「上次聊了什么」提醒 */
.customer-hint {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--c-client-deep);
  background: var(--c-client-soft);
  border: 1px solid var(--c-client-line);
  border-radius: 7px;
  padding: 5px 9px;
}

/* ---------------- 客户档案弹窗 ---------------- */
.modal-wide { width: min(880px, 94vw); }
.mh-actions { display: flex; align-items: center; gap: 10px; }
.mh-sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------------- 客户表格页（客户档案） ---------------- */
.ct-panel { padding: 0; overflow: hidden; }

/* 工具条：搜索 + 筛选 + 新建 */
.ct-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}
.ct-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  max-width: 330px;
  min-width: 170px;
}
.ct-search-ico {
  position: absolute;
  left: 10px;
  font-size: 12.5px;
  opacity: .55;
  pointer-events: none;
}
.ct-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 11px 6px 30px; /* 与筛选下拉同为 34px 高 */
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.ct-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.ct-search input::-webkit-search-cancel-button { cursor: pointer; }

/* 筛选下拉：一个维度一个「小标签 + 下拉」，选中值整框变主色，一眼看出哪几个条件在生效 */
.ct-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 9px;
  flex: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.ct-filter:hover { border-color: #d3d9e6; }
.ct-filter:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ct-filter.is-on { border-color: var(--primary); background: var(--primary-soft); }
.ct-filter-label {
  font-size: 11.5px;
  color: var(--muted);
  flex: none;
  letter-spacing: .2px;
}
.ct-filter select {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  max-width: 158px;
  padding-right: 2px;
  outline: none;
}
.ct-filter.is-on .ct-filter-label { color: var(--primary); }
.ct-filter.is-on select { color: var(--primary); }

/* 接待人是「按钮触发器」不是下拉：样式对齐其它筛选框，值过长省略，点了弹选择器 */
.ct-filter-btn { font-family: inherit; }
.ct-filter-btn:hover { border-color: #d3d9e6; }
.ct-filter-value {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-filter.is-on .ct-filter-value { color: var(--primary); }
.ct-caret { flex: none; font-size: 9px; color: #9aa3b2; line-height: 1; }
.ct-filter.is-on .ct-caret { color: var(--primary); }

.ct-new {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
}
.ct-reset {
  flex: none;
  height: 34px;
  padding: 0 12px;
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  color: #4a566b;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, opacity .14s;
}
.ct-reset:hover:not(:disabled) { background: #f5f8fd; border-color: #a9b6cc; color: var(--ink); }
.ct-reset:disabled { opacity: .45; cursor: default; }

/* 表格容器：表头 sticky，行多时在容器里滚动，页面本身不会长得没底 */
.ct-scroll {
  overflow: auto;
  max-height: calc(100vh - 310px);
  min-height: 240px;
}
.ct-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  /* 列宽由 <colgroup> 说了算：auto 布局会被超长客户名带偏，把别的列压成竖排 */
  table-layout: fixed;
}

/* 表头 */
.ct-th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0;
  background: #f6f8fc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
}
.ct-th-text { padding: 9px 12px; }
.ct-th-act { padding: 9px 12px; text-align: right; }
.ct-sort {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
  overflow: hidden;
  white-space: nowrap;
}
.ct-sort:hover { color: var(--ink); background: #eef1f9; }
.ct-arrow { flex: none; font-style: normal; font-size: 9px; line-height: 1; opacity: 0; }
.ct-th.is-sorted .ct-sort { color: var(--primary); }
.ct-th.is-sorted .ct-arrow { opacity: 1; }
.ct-th[data-dir="asc"] .ct-arrow::before { content: '▲'; }
.ct-th[data-dir="desc"] .ct-arrow::before { content: '▼'; }

/* 行 */
.ct-row { cursor: pointer; }
.ct-row td { border-bottom: 1px solid var(--line-soft); background: #fff; transition: background .12s; }
.ct-row:hover td { background: #f5f8ff; }
.ct-row.is-active td { background: var(--primary-soft); }
.ct-row:last-child td { border-bottom: none; }
.ct-td {
  height: 52px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ink);
  vertical-align: middle;
  /* fixed 布局下每格宽度都是确定的：超出就省略，绝不换行把行高撑起来 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 头像 + 名字：用 flex 排，名字 flex:1 + min-width:0 才会正确出省略号
   （靠 max-width 百分比的话，名字会被压成一个「…」，什么都看不见） */
.ct-namewrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.ct-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 700;
  flex: none;
}
.ct-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
/* 客户名下面挂职位：不占列宽，长职位省略号截断，鼠标停上去 title 看全 */
.ct-namebox {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.ct-pos {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 联系方式列：等宽感一点，长邮箱也不会把行撑高 */
.ct-td-contact { font-size: 12.5px; color: #475569; white-space: nowrap; }

/* 第 3 列：主行日期时刻 + 副行相对时间 */
.ct-main {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ct-sub {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.ct-kind {
  margin-right: 2px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f1f4f9;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

/* 第 4 列：沟通主题，单行省略，悬停看全文（宽度交给 colgroup） */
.ct-td-topic { color: #374151; }

/* 公司：从客户名里猜出来的那种给个浅色下划虚线提示 */
.ct-company {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  color: #374151;
}
.ct-company.is-derived {
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  cursor: help;
}
/* 行业标签（客户表格「行业」列） */
.ct-industry {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 12px;
  color: var(--c-client-deep);
  background: var(--c-client-soft, #eef0fe);
  border-radius: 999px;
  padding: 2px 9px;
}

.ct-badges { display: inline-flex; gap: 4px; max-width: 100%; overflow: hidden; }
/* 接待次数小徽标（表格「接待」列复用） */
.cm-badge {
  font-size: 11px; font-weight: 700;
  color: var(--c-client-deep);
  background: var(--c-client-soft);
  border-radius: 999px;
  padding: 0 7px;
  flex: none;
  white-space: nowrap;
}
.cm-badge.is-upcoming { color: #1d4ed8; background: #e3edff; }
.ct-dash { color: #b6bec9; }

/* 操作列：固定 104px，两个小按钮必须单行放得下 */
.ct-td-act { white-space: nowrap; text-align: right; padding-left: 4px; padding-right: 8px; }
/* 表格操作列的小按钮：同样「白底 + 有色描边」，不做实底 */
.ct-act {
  margin-left: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 700;
  color: #55617a;
  background: #fff;
  border: 1px solid #c3cfe2;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.ct-act:first-child { margin-left: 0; }
.ct-act:hover { background: #f4f7fd; border-color: #9dadc6; color: var(--ink); }
.ct-act.is-primary { color: var(--primary); border-color: #b4b8f7; background: #fff; }
.ct-act.is-primary:hover { background: var(--primary-soft); border-color: var(--primary); color: #4338ca; }
.ct-act.is-danger { color: #dc2626; border-color: #f2b3b3; background: #fff; }
.ct-act.is-danger:hover { background: #fef4f4; border-color: #e06a6a; color: #b91c1c; }

/* 空态 / 计数 / 分页 */
.ct-empty-row td { background: #fff; }
.ct-empty-row:hover td { background: #fff; }
.ct-empty-td {
  padding: 30px 18px;
  text-align: center;
  font-size: 12.8px;
  line-height: 1.8;
  color: var(--muted);
}
.ct-empty-td.is-error { color: var(--danger); }

.ct-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}
.ct-count { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-pager { display: flex; align-items: center; gap: 6px; }
.ct-page {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.ct-page:hover:not(:disabled) { border-color: var(--primary-2); color: var(--primary); }
.ct-page:disabled { opacity: .45; cursor: default; }
.ct-page-num { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 建档弹窗里的一句说明 */
.ct-form-hint { margin: 0; font-size: 11.8px; line-height: 1.65; color: var(--muted); }
.field em { font-style: normal; color: var(--danger); }

/* 客户档案弹窗：header 固定，body 自己滚，底部不会被裁 */
.cm-modal-card { display: flex; flex-direction: column; max-height: 84vh; }
.cm-modal-head { padding: 13px 14px 13px 20px; }
.cm-modal-head h3 { font-size: 16px; }
.cm-modal-card .cm-detail { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* 窄一点（1280 及以下）就固定成两行：搜索独占一行，四个下拉 + 重置 + 新建排第二行。
   不交给 flex-wrap 自动断，否则会像「接待人」单独掉到下一行，看着散。 */
@media (max-width: 1240px) {
  .ct-toolbar { gap: 8px; }
  .ct-search { flex: 1 1 100%; max-width: none; order: 1; }
  .ct-filter { order: 2; }
  .ct-reset { order: 3; margin-left: 0; }
  .ct-new { order: 4; margin-left: auto; }
}

/* 窄屏：表格横向滚动 */
@media (max-width: 900px) {
  .ct-scroll { max-height: calc(100vh - 250px); }
  /* 780px 是六列都还能读的下限（「10月26日 周一」整行看得全、公司列 140px、
     两个按钮单行）；窗口再窄就在 .ct-scroll 里横向滚动，不撑破页面 */
  .ct-table { min-width: 780px; }
  .cm-modal-card { max-height: 90vh; }
}

/* 手机端：筛选下拉两列排，不然四个下拉会各自占一行、工具条高达 270px */
@media (max-width: 560px) {
  .ct-filter { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .ct-filter select { max-width: none; flex: 1 1 auto; min-width: 0; }
  .ct-reset { flex: 1 1 auto; margin-left: 0; text-align: center; }
  .ct-new { flex: 1 1 auto; margin-left: 0; justify-content: center; }
}

/* 手机端 .shell 变成 column + align-items:flex-start，.main 会被内容的
   min-width 撑宽（表格有 min-width）。这里压回一屏宽，横向滚动交给 .ct-scroll。 */
@media (max-width: 760px) {
  .main { width: 100%; max-width: 100%; min-width: 0; }
}

/* 下次预约横幅 */
.cd-next {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #f0f7ff;
  border: 1px solid #d3e6fb;
}
/* 弹窗顶部「当前只看 XX 接待的」提示条：筛选了接待人时才出现 */
.cd-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--primary-soft);
  border: 1px solid #d9dcfb;
}
.cd-scope-txt { font-size: 12.5px; color: #3b3f6b; flex: 1; min-width: 0; }
.cd-scope-txt b { color: var(--primary); }
.cd-scope-clear {
  flex: none;
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--primary);
  background: #fff;
  border: 1px solid #d9dcfb;
  border-radius: 7px;
  cursor: pointer;
}
.cd-scope-clear:hover { background: var(--primary-soft); color: #4338ca; border-color: var(--primary); }

.cd-next-ico { font-size: 15px; line-height: 1.3; flex: none; }
.cd-next-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-next-txt b { font-size: 13px; font-weight: 700; color: #0c4a6e; }
.cd-next-txt i { font-style: normal; font-size: 12px; color: #47708c; }

.cd-head-main { min-width: 0; }
.cd-hosts { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.cm-detail { overflow-y: auto; padding: 18px 20px; }
.cd-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.cd-avatar {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  /* 一点点柔和投影，让这个方块从白色弹窗里浮起来 */
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
  flex: none;
}
.cd-name {
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cd-company {
  font-size: 11.5px; font-weight: 700;
  color: var(--muted);
  background: #f1f4f9;
  border-radius: 999px;
  padding: 1px 9px;
}
.cd-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cd-sub b { color: var(--ink); }

.cd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
/* 四张统计卡：左侧一条 3px 语义竖条 + 数字放大，四块不再是四个一模一样的灰方块。
   顺序跟 renderCustomerDetail 里的 DOM 一致：已接待 / 待接待 / 累计时长 / 沟通记录。
   竖条用 border-left 实现（不用伪元素），跟着卡片圆角走，不会歪、也不会撑高。 */
.cd-stat {
  display: flex; flex-direction: column;
  gap: 2px;
  background: linear-gradient(180deg, #fbfcff, #fff);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--cd-accent, var(--line));
  border-radius: 11px;
  padding: 9px 12px 9px 9px;
}
/* 颜色只用站内既有色系 / 低饱和色，不用荧光色 */
.cd-stat:nth-child(1) { --cd-accent: #16a34a; } /* 已接待 · 绿 */
.cd-stat:nth-child(2) { --cd-accent: #2563eb; } /* 待接待 · 蓝 */
.cd-stat:nth-child(3) { --cd-accent: var(--primary); } /* 累计时长 · 紫 */
.cd-stat:nth-child(4) { --cd-accent: #d97706; } /* 沟通记录 · 橙 */
.cd-stat-num {
  font-size: 19px; font-weight: 700; color: var(--cd-accent, var(--ink));
  letter-spacing: -0.2px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.cd-stat-label { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.cd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cd-field {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.cd-field-full { margin-top: 10px; }
.cd-field input {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.cd-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.cd-sec { margin-top: 18px; }
.cd-sec h4 {
  margin: 0 0 10px;
  font-size: 14.5px; font-weight: 700;
  display: flex; align-items: baseline; gap: 8px;
}
.cd-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
/* 会议纪要：视觉与「接待记录」同一套，每场接待一块常显面板（不折叠） */
.cd-mins { display: flex; flex-direction: column; gap: 10px; }
.cd-min {
  background: #fbfcfe;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--c-client);
  border-radius: 9px;
  overflow: hidden;
}
.cd-min.is-log { border-left-color: #c8d2e2; background: #fcfdff; }
.cd-min-head {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}
.cd-min-when { display: inline-flex; align-items: baseline; gap: 8px; flex: none; font-size: 13.5px; }
.cd-min-when b { font-weight: 700; color: var(--ink); }
.cd-min-when i {
  font-style: normal;
  font-weight: 600;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
}
.cd-min-host {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
}
.cd-min-host i {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8);
}
.cd-min-tag {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: #4b5a72;
  background: #e8edf6;
  border-radius: 999px;
  padding: 1px 7px;
}
.cd-min-body { padding: 2px 14px 14px; }
/* 会议主题 / 议题与讨论 / 决议三块并列：标签在上，内容框在下，空着也照样有框 */
.cd-min-row + .cd-min-row { margin-top: 10px; }
.cd-min-label { display: block; font-size: 12.5px; font-weight: 700; color: #55617a; margin-bottom: 5px; padding-left: 9px; border-left: 3px solid var(--primary, #4f46e5); }
.cd-min-box {
  padding: 7px 11px;
  min-height: 36px;
  background: #f5f8fc;
  border: 1px solid #e2e8f1;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.cd-min-box.is-none { color: #aeb7c4; }
/* 没写过的面板：整块降噪，三个框都在，框内写「未填写」 */
.cd-min.is-blank { background: #fcfdff; border-left-color: #d3dbe8; }
.cd-min.is-blank .cd-min-when b { color: #5b6577; }
.cd-min.is-blank .cd-min-box { background: #f8fafc; }
.cd-log-del {
  margin-left: auto;
  border: none; background: none;
  color: #b8c0cc; font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0 2px;
  flex: none;
}
.cd-log-del:hover { color: var(--danger); }

.cd-visits { display: flex; flex-direction: column; gap: 6px; }
.cd-visit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #fbfcfe;
  border: 1px solid var(--line-soft);
  border-left: 3px solid #dbe2ea;
}
.cd-visit.is-live { background: var(--c-client-soft); border-left-color: var(--c-client-deep); }
.cd-visit.is-future { background: #f6fbfe; border-left-color: #93c5fd; }
.cd-visit-when { display: inline-flex; align-items: baseline; gap: 7px; flex: none; }
.cd-visit-when b { font-weight: 700; color: var(--ink); }
.cd-visit-when i {
  font-style: normal;
  color: #4b5563;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.cd-visit-host {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #374151;
  font-weight: 600;
  flex: none;
}
.cd-visit-host i {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8);
}
.cd-visit-loc {
  color: #374151;
  flex: none;
  max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 同一场活动一起来的其他客户（公司自己办活动时会有） */
.cd-visit-with {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  max-width: 320px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f1f5fb;
  color: #4b5563;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cd-visit-loc::before { content: '@ '; opacity: .45; }
.cd-visit-host.is-none, .cd-visit-loc.is-none { color: #9aa3ae; font-weight: 500; }
.cd-visit-note {
  color: var(--muted);
  flex: 1 1 160px;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cd-visit-tag {
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #e3edff;
  border-radius: 999px;
  padding: 1px 7px;
  flex: none;
}
.cd-visit-tag.is-live { color: #b45309; background: #fff1d6; }
.cd-empty { font-size: 12.5px; color: var(--muted); padding: 10px 0; }

/* ---------------- 本周空闲文案弹窗 ---------------- */
.copy-body { padding: 16px 20px 18px; }
.copy-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.copy-text {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink);
  background: #fbfcfe;
  font-family: inherit;
  resize: vertical;
}
.copy-text:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}
.copy-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.copy-actions .spacer { flex: 1; }
.copy-opt {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.copy-opt input { accent-color: var(--primary); }

/* ---------------- 响应式 ---------------- */
/* 中等宽度（笔记本半屏）：标题独占一行，小结与冲突提示换到下一行，
   避免「老板当天时间轴 · 可用 09:00–18:00」被压成竖排 */
@media (max-width: 1360px) {
  .timeline-panel .panel-head { flex-wrap: wrap; row-gap: 8px; }
  .timeline-panel .panel-head .panel-title { flex: 1 1 100%; }
  .panel-head .tl-sum { margin-left: 0; }
  .timeline-panel .tl-conflict { margin-left: auto; }
}

/* 时间轴卡片：换成 flex 自动换行后不再需要断点，这里只处理手机端减负 */
@media (max-width: 760px) {
  /* 手机上画布矮一点，卡片高度也放开（内容可能换行） */
  .timeline-scroll { min-height: 440px; }
  .next-panel { height: auto; }
  .ev-facts { display: none; }
  .free-add { display: none; }
  .out-tip { display: none; }
  .ev-act { opacity: 1; }
}

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .kpi-bar { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
  /* 窄一点的屏幕先把左栏收成图标条 */
  .sidenav { width: 78px; padding: 14px 8px; }
  .nav-cap, .nav-txt { display: none; }
  .nav-item { justify-content: center; padding: 8px; }
  .nav-ico { width: 36px; height: 36px; }
}@media (max-width: 760px) {
  /* 手机上左栏改成顶部横向切换条 */
  .shell { flex-direction: column; }
  .sidenav {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }
  .nav-item { width: auto; flex: none; padding: 7px 9px; gap: 7px; }
  .nav-ico { width: 30px; height: 30px; font-size: 15px; }
  .nav-sep { width: 1px; height: 22px; margin: 0 3px; flex: none; }
  .page-title { font-size: 18px; }
  .page-desc { display: none; }

  .cal-grid { gap: 6px; grid-auto-rows: minmax(66px, auto); }
  .cal-cell { min-height: 0; padding: 6px 7px; border-radius: 9px; }
  .cal-num { font-size: 13px; }
  .cal-pill { font-size: 10.5px; padding: 1px 7px; }
  .cal-legend { gap: 10px; }
  .cal-list { display: none; }
  .cal-lines { display: none; }
  .today-stamp { padding: 5px 12px; gap: 10px; }
  .today-clock { font-size: 15px; }

  /* 客户档案详情在窄屏上收窄间距（表格自己会横向滚动） */
  .cd-fields { grid-template-columns: 1fr; }
  .cd-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .topbar { flex-direction: column; gap: 12px; align-items: stretch; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-group { flex-direction: column; align-items: stretch; }
  .action-group .date-picker,
  .action-group .btn,
  .btn-add { width: 100%; }
  .search-box { max-width: none; flex: 0 0 auto; }
  .kpi-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 11px 13px; gap: 10px; }
  .kpi-num { font-size: 20px; }
  .row { grid-template-columns: 1fr; }
  .row.row-cust { grid-template-columns: 1fr; }
  .seg { grid-template-columns: 84px 1fr; }
  .timeline::before { left: 67px; }
  .res-row { grid-template-columns: minmax(0, 1fr) 88px 58px; }
  .res-add-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- 打印当天安排 ---------------- */
@media print {
  @page { margin: 12mm; }
  html, body {
    background: #fff !important;
    font-size: 12px;
  }
  .topbar {
    position: static;
    background: #fff !important;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0 0 10px;
    border-bottom: 2px solid #1f2733;
  }
  .brand .logo { box-shadow: none; }
  .today-stamp { border: none; background: #fff; padding: 0; }
  .today-clock { color: #1f2733; }

  /* 打印时隐藏交互元素与无关区块 */
  .sidenav,
  .page-head,
  .page-bar,
  .page-note,
  .action-bar,
  .kpi-bar,
  .calendar-panel,
  .grid-panel,
  .next-panel,
  .modal,
  .toast,
  .now-badge,
  .event-live,
  .search-box,
  .cal-tip,
  .mini-link,
  .customer-hint,
  .free-add,
  .ev-act,
  .ev-empty,
  .room-switch,
  .panel-title .pt-icon { display: none !important; }

  /* 房间条：纸面上不放开关，卡片也别太大 */
  .room-strip { gap: 8px; }
  .room-chip { padding: 8px 10px 8px 13px; }
  .room-chip:hover { box-shadow: none; }

  .main { padding: 0; max-width: none; }
  .layout {
    display: block;
    margin-top: 10px;
  }
  .panel {
    box-shadow: none;
    border: 1px solid #cbd5e1;
    break-inside: avoid;
    margin-bottom: 12px;
    padding: 12px 14px;
  }
  .side { display: block; }
  .event-body, .free-body, .out-body {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
  }
  .seg { break-inside: avoid; }
}


/* ============================================================
   多用户：登录页 / 顶栏用户区 / 查看范围 / 用户管理
   ============================================================ */

/* ---------- 登录页 ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% 0%, #e8ecff 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, #e6f7f4 0%, transparent 55%),
    linear-gradient(160deg, #f7f9ff 0%, #eef2fb 100%);
}
.login-screen.hidden { display: none; }

.login-card {
  width: 100%;
  max-width: 386px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 30px 22px;
  box-shadow: 0 24px 60px rgba(31, 39, 51, 0.13);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo { font-size: 34px; line-height: 1; display: block; margin-bottom: 8px; }
.login-brand h1 {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink);
  margin: 0 0 6px;
}
.login-sub { font-size: 13px; color: var(--muted); margin: 0; }

.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form.hidden { display: none; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span { font-size: 12.5px; font-weight: 700; color: #475569; }
.login-field input {
  width: 100%;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field input:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* 注册表单的部门 / 身份下拉，跟同一列的输入框同一个长相 */
.login-field select {
  width: 100%;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-field select:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.login-error {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #b91c1c;
  background: var(--danger-soft);
  border: 1px solid #f7c9c9;
  border-radius: 9px;
  padding: 8px 11px;
}
.login-error.hidden { display: none; }

.login-submit {
  margin-top: 4px;
  padding: 11px 16px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 11px;
  cursor: pointer;
  transition: background .12s, opacity .12s;
}
.login-submit:hover { background: #f4f5ff; }
.login-submit:active { background: #e9ebfe; }
.login-submit:disabled { opacity: .55; cursor: default; }

.login-switch { margin-top: 16px; text-align: center; }
.login-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
}
.login-link:hover { text-decoration: underline; }
.login-link.hidden { display: none; }

/* 未登录时把主界面挡住，避免闪现半截页面 */
body.is-logged-out .topbar,
body.is-logged-out .shell { visibility: hidden; }

/* ---------- 顶栏右侧：日期 + 用户 ---------- */
.topbar-right { display: flex; align-items: center; gap: 16px; }

.user-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfe;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.user-chip:hover { background: #fff; border-color: #d5dced; box-shadow: var(--shadow-sm); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 800; color: var(--ink); }
.user-role { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.user-caret { font-size: 10px; color: var(--muted); margin-left: 2px; }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.user-menu.hidden { display: none; }
.user-menu button {
  text-align: left;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.user-menu button:hover { background: var(--primary-soft); color: var(--primary); }


/* ---------- 用户管理 ---------- */
.user-list { display: flex; flex-direction: column; gap: 10px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.user-row:hover { border-color: #d9e0ef; box-shadow: var(--shadow-sm); }
.user-row.is-off { opacity: .62; background: #fbfbfd; }

.user-row-avatar {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  flex: 0 0 auto;
}
.user-row-main { flex: 1 1 auto; min-width: 0; }
.user-row-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.user-row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.user-row-role {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
}
.user-row-role.role-admin { background: var(--primary-soft); color: var(--primary); }
.user-row-role.role-user { background: #f1f5f9; color: #475569; }

/* 部门 / 身份标签：跟在姓名后面，复用胶囊外观；没填的显示「—」 */
.user-pill {
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.user-pill.dept { background: #eef2ff; color: #4338ca; }
.user-pill.pos { background: #ecfdf5; color: #15803d; }
.user-pill.is-empty { background: #f4f6fa; color: #9aa3b2; }
.user-row-phone { color: #475569; font-variant-numeric: tabular-nums; }

.tag-me {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 7px;
}
.tag-off {
  font-size: 10.5px;
  font-weight: 800;
  color: #b91c1c;
  background: var(--danger-soft);
  border-radius: 999px;
  padding: 1px 7px;
}

.user-row-act { display: flex; gap: 6px; flex: 0 0 auto; }
.mini-btn {
  font-size: 12px;
  font-weight: 700;
  color: #47536b;
  background: #fff;
  border: 1px solid #c3cfe2;
  border-radius: 8px;
  padding: 6px 11px;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.mini-btn:hover { background: #f5f8fd; border-color: var(--primary-2); color: var(--primary); }
.mini-btn.primary { color: var(--primary); border-color: #b4b8f7; }
.mini-btn.danger { color: #dc2626; border-color: #f2b3b3; }
.mini-btn.danger:hover { background: #fef4f4; border-color: #e06a6a; color: #b91c1c; }

/* 小尺寸弹窗（改密码 / 新增用户） */
/* 小弹窗（改密码 / 页面内提示确认）也统一到标准宽度，不再另设 420 */
.modal-sm { width: min(560px, 94vw); max-width: none; }

/* 中尺寸弹窗（会议纪要）：与标准宽度一致 */
.modal-md { width: min(560px, 94vw); max-width: none; }

/* 会议纪要弹窗 */
.mm-body { gap: 12px; }
.mm-ev {
  background: #f6f8fc;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px;
  padding: 10px 12px;
}
.mm-ev-title { font-weight: 700; font-size: 15px; color: var(--c-deep, #1f2a44); }
.mm-ev-meta { margin-top: 4px; font-size: 12.5px; color: #6b7587; line-height: 1.5; }
.mm-text {
  width: 100%;
  resize: vertical;
  min-height: 220px;
  border: 1px solid var(--line, #e3e8ef);
  border-radius: 10px;
  padding: 12px 14px;
  font: 14px/1.7 inherit;
  color: var(--c-deep, #1f2a44);
  background: #fff;
  box-sizing: border-box;
}
.mm-text:focus { outline: none; border-color: var(--primary, #4f46e5); box-shadow: 0 0 0 3px var(--primary-soft, #eef0ff); }
.mm-text.is-ro { background: #f6f8fc; color: #6b7587; }
.mm-ro { margin: 0; font-size: 12.5px; color: #b45309; }
.mm-hint { margin-right: auto; font-size: 13px; line-height: 1.5; color: #56617a; }

/* 纪要字段：会议主题（单行）/ 议题与讨论（多行）/ 决议（多行） */
.mm-field { display: flex; flex-direction: column; gap: 7px; }
.mm-label { font-size: 12.5px; font-weight: 700; color: #3b465c; display: flex; align-items: center; gap: 6px; }
.mm-ico { font-size: 13px; line-height: 1; font-style: normal; }
.mm-ta { min-height: 0; }
/* .mm-text 默认按多行文本给的高度，单行输入框要压平 */
.mm-subject { min-height: 0; resize: none; padding: 10px 14px; font-size: 14.5px; font-weight: 600; }

/* 修改记录：做成可点的小胶囊（带展开箭头），别再是一行淡灰小字 */
.mm-log-wrap { padding-top: 2px; }
.mm-log-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  font: 600 13px/1 inherit;
  color: #47536b;
  cursor: pointer;
  padding: 6px 10px;
  margin-left: -10px; /* 向左抵掉内边距，让文字仍与正文左边缘对齐 */
  border-radius: 8px;
  transition: all .12s;
}
/* 箭头走伪元素：JS 会重写按钮的 textContent（「修改记录（3）」），伪元素不受影响 */
.mm-log-toggle::before { content: "▸"; font-size: 11px; color: #8a93a6; transition: color .12s; }
.mm-log-toggle.is-open::before { content: "▾"; color: var(--primary, #4f46e5); }
.mm-log-toggle:hover { color: var(--primary, #4f46e5); background: var(--primary-soft, #eef0ff); }
.mm-log-toggle:hover::before { color: var(--primary, #4f46e5); }
.mm-log-toggle.is-open { color: var(--primary, #4f46e5); background: var(--primary-soft, #eef0ff); }
.mm-log-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  background: var(--primary, #4f46e5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
}
.mm-log-count[hidden] { display: none; }
.mm-log { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 168px; overflow-y: auto; }
.mm-log-empty { margin: 0; font-size: 12.5px; color: #8a93a6; }
.mm-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #5b6577;
  padding: 5px 8px;
  background: #f6f8fc;
  border-radius: 8px;
}
.mm-log-when { flex: none; color: #8a93a6; font-variant-numeric: tabular-nums; }
.mm-log-who { flex: none; font-weight: 600; color: #3b465c; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-log-what { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-log-restore {
  flex: none;
  border: 1px solid var(--line, #e3e8ef);
  background: #fff;
  color: var(--primary, #4f46e5);
  border-radius: 6px;
  font: 600 11.5px/1 inherit;
  padding: 4px 8px;
  cursor: pointer;
}
.mm-log-restore:hover { border-color: var(--primary, #4f46e5); background: var(--primary-soft, #eef0ff); }

/* 周历格子里的纪要标记 */
.cal-mm { margin-left: 4px; font-style: normal; font-size: 11.5px; flex: none; }

/* 时间轴卡片上的纪要按钮：已写纪要时**只把图标换成主色**，边框和旁边两个完全一致，
   不铺底、不改边框色、不加角标 —— 否则用户会觉得这个按钮「比旁边大一圈」（报过两次）。 */
.ev-btn-mm.is-on { background: #fff; border-color: #b9c6da; color: var(--primary); }
/* is-on 的特异性高于 .ev-btn:hover，不补这条会“悬停也不变色”，和旁边两个手感不一致 */
.ev-btn-mm.is-on:hover { background: var(--primary-soft); border-color: #a9b6cc; color: #4338ca; }

/* 弹窗通用小结构（改密码弹窗在用：标题条 / 表单区 / 按钮行） */
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fafbff, #f1f3fe);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-body { display: flex; flex-direction: column; gap: 13px; padding: 18px 20px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 4px; }
/* 底部操作栏直接挂在卡片上时（纪要、页面内提示），补上内边距与分隔线，别再顶着卡片边角 */
.modal-card > .modal-actions {
  margin-top: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line, #e3e8ef);
  background: #fff;
}
/* 页面内提示弹窗正文：支持 \n 换行（用 textContent 写入，房间名里的字符不会被当成 HTML） */
.dlg-msg { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre-line; }
.form-error {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #b91c1c;
  background: var(--danger-soft);
  border: 1px solid #f7c9c9;
  border-radius: 9px;
  padding: 8px 11px;
}
.form-error.hidden { display: none; }

/* 窄屏收一下顶栏 */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .today-stamp { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 4px; }
  .user-row { flex-wrap: wrap; }
  .user-row-act { width: 100%; justify-content: flex-end; }
}

@media print {
  .login-screen, .user-chip, .scope-picker { display: none !important; }
}

/* 行程卡上的归属人标签（「全部人」视图用） */
.owner-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--oc, #94a3b8);
  border-radius: 999px;
  padding: 2px 9px 2px 7px;
  line-height: 1.5;
}

/* ================= 注册：提交后等审批 ================= */
.login-hint {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.reg-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 4px;
  text-align: center;
}
.reg-done.hidden { display: none; }
.reg-done-ico {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #15803d;
  background: var(--success-soft);
  border: 1px solid #c7ecd6;
}
.reg-done h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}
.reg-done p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.reg-done .login-submit { width: 100%; }

/* ================= 用户管理：统计卡 ================= */
.user-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat-card:hover { border-color: #d9e0ef; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.stat-num {
  font-size: 23px;
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-card.is-warn { border-color: #f6d9a8; background: #fffaf1; }
.stat-card.is-warn .stat-num { color: #b45309; }
.stat-card.is-warn .stat-label { color: #a16207; }

/* ================= 用户管理：待审批 ================= */
.panel-approval { border-color: #f6d9a8; }
.panel-approval .panel-title { color: #a16207; }
.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: #f59e0b;
}
.pending-list { gap: 9px; }
.pending-row {
  background: #fffdf7;
  border-color: #f3e3c4;
}
.pending-row:hover { border-color: #eccf9c; }
.user-row-avatar.is-pending { background: #f59e0b !important; }

/* ================= 用户管理：工具条 / 搜索 / 筛选 ================= */
.user-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
  margin-bottom: 14px;
}
/* 搜索框也带一行小标题，和筛选下拉对齐成一排 */
.uf-search-field { flex: 1 1 200px; max-width: 300px; }
.uf-search-field .user-search { flex: 1 1 auto; width: 100%; max-width: none; min-width: 0; }
.user-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 320px;
}
.user-search-ico {
  position: absolute;
  left: 11px;
  font-size: 12px;
  opacity: .55;
  pointer-events: none;
}
.user-search input {
  width: 100%;
  height: 38px;
  padding: 0 32px 0 32px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.user-search input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.user-search-clear {
  position: absolute;
  right: 7px;
  width: 20px; height: 20px;
  border: 0;
  border-radius: 50%;
  background: #eef1f7;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.user-search-clear:hover { background: #e2e8f0; color: #334155; }
.user-search-clear.hidden { display: none; }

/* 筛选下拉：上面一行小标题、下面下拉框，跟纪要页同口径 */
.uf-field { display: flex; flex-direction: column; gap: 6px; }
.uf-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}
.uf-field select {
  appearance: none;
  height: 38px;
  min-width: 122px;
  padding: 0 30px 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7480' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .15s, box-shadow .15s;
}
.uf-field select:hover { border-color: #c3ccda; }
.uf-field select:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
/* 已选非默认值时，边框点一下主色，扫一眼就知道筛过 */
.uf-field select.is-filtered {
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.uf-tail {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin-left: auto;
}
.uf-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.uf-count b { color: var(--ink); font-weight: 700; }
.uf-reset {
  border: 1px solid var(--line);
  background: var(--surface);
  color: #4a566b;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.uf-reset:hover { border-color: var(--primary); color: var(--primary); }
.uf-reset.hidden { display: none; }

.chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #4a566b;
  background: #fff;
  border: 1px solid #c3cfe2;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--primary-2); color: var(--primary); }
/* 选中态：不铺实色，只用主色边框 + 主色文字，简单明了 */
.chip.is-active {
  color: var(--primary);
  background: #fff;
  border-color: var(--primary);
}

/* ================= 用户管理：状态标签 ================= */
.user-status {
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}
.user-status.st-active { color: #15803d; background: var(--success-soft); }
.user-status.st-pending { color: #b45309; background: #fef3c7; }
.user-status.st-disabled { color: #64748b; background: #eef1f6; }
.user-status.st-rejected { color: #b91c1c; background: var(--danger-soft); }

.user-row-time { color: #94a3b8; }

/* 主要动作按钮（通过 / 启用）：主色描边，不填实色 */
.mini-btn.primary {
  color: var(--primary);
  background: #fff;
  border-color: var(--primary);
}
.mini-btn.primary:hover {
  background: #f4f5ff;
  border-color: var(--primary);
  color: #4338ca;
}

/* ================= 侧边栏待审批红点 ================= */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}
.nav-badge.hidden { display: none; }
.nav-item.has-pending .nav-ico { position: relative; }

/* ================= 窄屏适配 ================= */
@media (max-width: 720px) {
  .user-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-search { max-width: none; flex: 1 1 100%; }
  /* 搜索独占一行，三个下拉在下一行等分（.uf-field 的 flex 规则在后面，这里必须提高特异性） */
  .uf-field.uf-search-field { flex: 1 1 100%; max-width: none; }
  .user-toolbar { gap: 8px 10px; }
  .uf-field { flex: 1 1 0; min-width: 0; }
  .uf-field select { min-width: 0; width: 100%; }
  .uf-tail { margin-left: 0; height: auto; flex: 1 1 100%; justify-content: space-between; }
}

/* 侧边栏带了待审批红点后，副标题别被挤成两行 */
.nav-item .nav-txt { min-width: 0; }
.nav-item .nav-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 注册成功说明文字：两行均分，别让末行只剩一两个字 */
.reg-done p { text-wrap: pretty; }

/* ================= 时间轴空态：说清是谁 + 给切换入口 ================= */
.empty-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 38px 20px 34px;
}
.empty-day .empty-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}
.empty-day .empty-hint {
  margin: 0;
  max-width: 440px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}
.empty-acts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
}
.empty-jump {
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  background: #fff;
  border: 1px solid #b4b8f7;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.empty-jump:hover { background: var(--primary-soft); border-color: var(--primary); color: #4338ca; }

/* ================= 顶部「看谁」：搜索框 ================= */
.scope-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 178px;
  height: 40px;
  padding: 0 8px 0 10px;
  background: #fff;
  border: 1px solid #b9c6da;
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.scope-picker:hover { border-color: #9fb0c9; }
.scope-picker:focus-within,
.scope-picker.is-open {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.scope-picker-ico { flex: 0 0 auto; font-size: 12.5px; opacity: .62; }
.scope-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 2px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.scope-caret {
  flex: 0 0 auto;
  font-size: 9px;
  color: var(--muted);
  opacity: .8;
  pointer-events: none;
}
.scope-clear {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
  color: #8b95a7;
  background: #eef1f7;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .13s, color .13s;
}
.scope-clear:hover { color: var(--ink); background: #e2e7f1; }
/* 原生下拉退出视觉，只当状态源；键盘/脚本仍可读写 */
.scope-native { display: none; }

/* ================= 归属人：排给谁的小提示 ================= */
.owner-hint {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary);
}
.owner-hint.hidden { display: none; }

/* 协助人下方那句「只能选权限不高于归属人的同事」是补充说明，
   颜色压低一档，别和上面的「这条会排到 XX 名下」抢注意力 */
#assistHint {
  font-weight: 500;
  color: var(--muted);
}

/* 周历标题后面的当前查看对象 */
.cal-who {
  margin-left: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}
.cal-who.hidden { display: none; }

/* 窄屏：搜索框整行铺开，面板跟着变宽 */
@media (max-width: 720px) {
  .scope-picker { width: 100%; }
  .scope-picker .scope-panel { width: 100%; max-width: none; }
}

/* ================= 「看谁」搜索结果面板 ================= */
.scope-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  width: 262px;
  max-width: 84vw;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .13), 0 2px 6px rgba(15, 23, 42, .06);
}
.scope-panel.hidden { display: none; }

.scope-list {
  max-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.scope-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 6px 7px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: background .13s;
}
.scope-row:hover { background: #f5f7fb; }
.scope-row.is-on { background: var(--primary-soft); }
/* 键盘 ↑↓ 的高亮，和「已选中」的浅紫区分开 */
.scope-row.is-hot {
  background: #eef1fb;
  box-shadow: inset 0 0 0 1px #dfe4f6;
}

.scope-row-avatar {
  flex: 0 0 auto;
  width: 27px; height: 27px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #94a3b8;
}
.scope-row-avatar.is-fixed { background: #eef1f7; color: #64748b; font-size: 13px; }
.scope-row.is-on .scope-row-avatar.is-fixed { background: #e0e3fd; }

.scope-row-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.scope-row-txt b {
  font-size: 12.8px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-row-txt i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-row-check { font-size: 12px; font-weight: 900; color: var(--primary); }
/* 姓名后面的部门小字（「张三 · VIP部」），跟姓名同一行但更弱化 */
.scope-row-dept {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.scope-sep { height: 1px; margin: 5px 4px; background: var(--line); }

.scope-empty {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 8px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
}
.scope-empty i {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

/* ===========================================================
   新增 / 编辑用户弹窗
   =========================================================== */
.modal-user {
  width: min(560px, 94vw);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.um-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f7f8ff 0%, #eef1fe 55%, #f7f8ff 100%);
}
.um-head::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6 55%, #0ea5e9);
}
.um-avatar {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
}
.um-headmain { flex: 1 1 auto; min-width: 0; }
.um-headmain h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .2px;
  color: var(--ink);
}
.um-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

.um-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 8px;
  overflow-y: auto;
}

.um-sec { display: flex; flex-direction: column; gap: 9px; }
.um-sec-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #475569;
}
.um-sec-num {
  width: 17px; height: 17px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}
.um-sec-tag {
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f4f9;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
}

.um-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.um-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.um-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.um-label em { font-style: normal; font-weight: 800; color: var(--danger); }
.um-opt {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.um-field > input,
.um-prefix,
.um-pwd {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.um-field > input {
  width: 100%;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.um-field > input::placeholder,
.um-prefix input::placeholder,
.um-pwd input::placeholder { color: #b3bac7; }

.um-prefix { display: flex; align-items: center; padding-left: 11px; overflow: hidden; }
.um-prefix > i {
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
  color: #a3aab8;
}
.um-prefix input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 10px 0 2px;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.um-field > input:focus,
.um-prefix:focus-within,
.um-pwd:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.um-prefix.is-locked { background: #f5f7fb; border-style: dashed; }
.um-prefix.is-locked input { color: #8b93a1; }

/* 部门 / 身份下拉：外观与同排输入框保持一致 */
.um-field > select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.um-field > select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
/* 「老板」不归部门：下拉置灰但仍在原位，一眼看出这块被跳过了 */
.um-field > select:disabled {
  background: #f4f6fa;
  color: #94a3b8;
  cursor: not-allowed;
  -webkit-text-fill-color: #94a3b8;
}
.um-field.is-off .um-label { color: #94a3b8; }
.um-field.is-off .um-label em { display: none; }

.um-hint { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.um-hint.is-ok { color: #15803d; font-weight: 700; }
.um-hint.is-bad { color: #b91c1c; font-weight: 700; }

/* 密码：输入 + 眼睛 + 随机生成 */
.um-pwd { display: flex; align-items: center; padding: 0 6px 0 12px; }
.um-pwd input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: .4px;
  color: var(--ink);
}
.um-pwd-btn {
  border: none;
  background: transparent;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.um-pwd-btn:hover { background: #f1f4f9; }
.um-pwd-gen {
  margin-left: 2px;
  padding: 6px 10px;
  border: 1px solid #b9c6da;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #47536b;
  white-space: nowrap;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
}
.um-pwd-gen:hover { background: #f5f8fd; border-color: var(--primary-2); color: var(--primary); }

/* 强度条 */
.um-strength { display: flex; align-items: center; gap: 6px; }
.um-strength i {
  width: 26px; height: 4px;
  border-radius: 999px;
  background: #e6eaf2;
  transition: background .18s;
}
.um-strength b { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.um-strength[data-lv="1"] i:nth-child(1) { background: #f59e0b; }
.um-strength[data-lv="1"] b { color: #b45309; }
.um-strength[data-lv="2"] i:nth-child(-n+2) { background: #0ea5e9; }
.um-strength[data-lv="2"] b { color: #0369a1; }
.um-strength[data-lv="3"] i { background: #22c55e; }
.um-strength[data-lv="3"] b { color: #15803d; }

/* 角色卡片 */
.um-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.um-role {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 30px 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.um-role:hover { border-color: #c7cdf7; background: #fbfbff; }
.um-role.is-on {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.13);
}
.um-role-ico { font-size: 16px; line-height: 1.35; }
.um-role-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.um-role-name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.um-role.is-on .um-role-name { color: var(--primary); }
.um-role-desc { font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.um-role-tick {
  position: absolute;
  right: 9px; top: 9px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef1f7;
  font-size: 10px;
  font-weight: 800;
  color: transparent;
  transition: all .14s;
}
.um-role.is-on .um-role-tick { background: var(--primary); color: #fff; }

/* 上班时间 */
.um-hours { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.um-field-sm { width: 108px; }
.um-field-sm input { padding: 0 10px; }
.um-dash { padding-bottom: 10px; font-weight: 700; color: #a3aab8; }

/* ---------- 协助人（多选） ---------- */
.field-tip {
  font-weight: 400;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  margin-left: 4px;
}
.assist-wrap { position: relative; }

/* 搜索式多选框：标签 + 内联输入框 */
.assist-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 5px 8px;
  border: 1px solid var(--line, #e2e8f1);
  border-radius: 10px;
  background: #fff;
  cursor: text;
  transition: border-color .14s, box-shadow .14s;
}
.assist-box:focus-within {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.assist-tags { display: contents; }
.assist-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 5px 4px 9px;
  border: 1px solid #dbe6f7;
  border-radius: 8px;
  background: #eef4ff;
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
}
.assist-tag i {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
/* 点 × 是「就地删掉这个人」：命中区给足 20px，负外边距抵消占位，
   免得用户差几个像素点到名字上 → 被当成点框、反而弹出选择器。 */
.assist-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  margin: -2px -3px -2px 0;
  border-radius: 50%;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .12s, color .12s;
}
.assist-x:hover { background: #dbe6f7; color: #1e293b; }
.assist-input {
  flex: 1 1 90px;
  min-width: 90px;
  padding: 4px 2px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text, #1e293b);
  font-family: inherit;
}
.assist-input::placeholder { color: #a4adbf; font-weight: 500; }
.assist-input:disabled { cursor: not-allowed; }

/* 弹窗 .field input 的通用样式（padding 10px/字号 14px）会命中多选框里的内联输入，
   把整个框撑高一大截（客户 54px vs 类型下拉 44px），这里按更高优先级复位成内联样式 */
.field .assist-box .assist-input,
.field .assist-box .assist-input:focus {
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
  font-size: 13.5px;
}
/* 空框高度与旁边/上下的普通输入框一致，不再显得又高又空 */
.assist-box { min-height: 44px; }

/* 空框占位提示（点击选择…） */
.assist-ph { color: #a4adbf; font-weight: 500; font-size: 13.5px; user-select: none; }
.assist-box:has(.assist-ph:not(.hidden)) { cursor: pointer; }

/* ===== 通用选择器弹窗（协助人 / 归属人 / 客户） ===== */
.picker-card {
  width: min(760px, 94vw);
  /* 固定大小：不论名单多长，弹窗始终这么大，装不下就在里面滚 */
  height: min(600px, 86vh);
  display: flex;
  flex-direction: column;
}
/* 中段内容（工具栏 / 表格）补内边距：header 和 actions 自带 padding */
.picker-card .modal-header { flex: none; }
.picker-card .picker-toolbar { flex: none; margin: 4px 18px 10px; }
/* 表格区一直撑到按钮上方：底部不再有「已选标签」那一条 */
.picker-card .picker-layout { flex: 1; min-height: 0; margin: 0 18px 14px; }
.picker-card .modal-actions { flex: none; }
/* 左侧分组筛选 + 右侧表格（行高固定：minmax(0,1fr) + min-height:0，内容多就在里面滚） */
.picker-layout {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}
.picker-layout > * { min-height: 0; height: 100%; }
.picker-side {
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: #f7f9fc;
  padding: 6px;
  overflow-y: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.picker-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  user-select: none;
  white-space: nowrap;
}
.picker-side-item span, .picker-side-item { overflow: hidden; }
.picker-side-item i { font-style: normal; font-size: 11.5px; color: var(--muted); flex: none; }
.picker-side-item:hover { background: #eef2f9; }
.picker-side-item.is-on { background: var(--primary-soft, #eef3ff); color: var(--primary); font-weight: 600; }
.picker-side-item.is-on i { color: var(--primary); }
.picker-layout .picker-body { border-radius: 0 10px 10px 0; }
.picker-side.hidden, .picker-all.hidden, .picker-new.hidden { display: none; }
.picker-all { flex: none; padding: 7px 14px; font-size: 13px; }
.picker-new { flex: none; padding: 7px 14px; font-size: 13px; color: var(--primary); border-color: #cddcfb; }
.picker-toolbar { display: flex; align-items: center; gap: 10px; }
.picker-search {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
}
.picker-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.picker-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.picker-body {
  max-height: 44vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* 在固定高度的弹窗里：表格占满剩余高度，人多了内部滚动 */
.picker-layout .picker-body {
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 0 10px 10px 0;
}
.picker-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.picker-table th, .picker-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.picker-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f7f9fc;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.picker-table tbody tr:last-child td { border-bottom: 0; }
.picker-table tbody tr { cursor: pointer; }
.picker-table tbody tr:hover { background: #f4f7fd; }
.picker-table tbody tr.is-sel { background: var(--primary-soft, #eef3ff); }
.picker-table tbody tr.is-new { color: var(--primary); font-weight: 600; }
.picker-table tbody tr.is-gone .picker-name { text-decoration: line-through; color: var(--muted); }
.picker-check { width: 36px; text-align: center; }
.picker-check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; pointer-events: none; }
.picker-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.picker-name i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.picker-badge {
  margin-left: 8px;
  font-size: 11px; font-weight: 500;
  color: #b45309; background: #fef3c7;
  border-radius: 6px; padding: 1px 6px;
  white-space: nowrap;
}
.picker-spacer { flex: 1; }
.picker-empty { padding: 30px 0; text-align: center; color: var(--muted); }
/* 归属人展示框：跟其他输入框同款外观，点击弹选择器 */
.picker-box { cursor: pointer; }
.picker-box-val { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); }
.picker-box-val i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.picker-box-val:empty::before { content: '点击选择归属人…'; color: #a4adbf; font-weight: 500; }

/* 搜索结果浮层：固定定位挂到 body，避免被弹窗 overflow:hidden 裁切 */
.assist-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 90;
  max-height: 240px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .13), 0 2px 6px rgba(15, 23, 42, .06);
}
.assist-portal { position: fixed; }
.assist-panel.hidden { display: none; }
.assist-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  color: var(--text, #1e293b);
  font-family: inherit;
  transition: background .12s;
}
.assist-item:hover { background: #f5f7fb; }
/* 「＋ 新建「xxx」」那一行：看起来跟选已有客户不一样 */
.assist-item.is-new { color: #2563eb; font-weight: 600; }
.assist-item.is-new:hover { background: #eff6ff; }
.assist-item i {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.assist-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assist-item-role {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: #94a3b8;
}
.assist-empty { color: var(--muted, #94a3b8); font-size: 13px; padding: 4px 0; }
.assist-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 12.5px;
  color: #475569;
}
.assist-name i {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
/* 账号已经被删掉的人：保留原名并划一道横线，表示「这个人已经不在系统里了」。
   .assist-name / .assist-tag / .owner-chip 都是 inline-flex，text-decoration
   不会传给 flex 子项，所以名字要单独包一层 .nm 才划得到。 */
.assist-name.is-deleted,
.assist-tag.is-deleted,
.owner-chip.is-deleted,
.ev-assist-owner .is-deleted {
  color: #94a3b8;
}
.assist-name.is-deleted .nm,
.assist-tag.is-deleted .nm,
.owner-chip.is-deleted .nm,
.ev-assist-owner .is-deleted {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.assist-name.is-deleted i,
.assist-tag.is-deleted i { opacity: .45; }
.assist-tag.is-deleted { background: #f8fafc; border-color: #e5e9f0; }
/* 卡片里显示「🤝 协助：A、B」 */
.ev-assist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  width: 100%;
  margin-top: 4px;
  font-size: 12.5px;
  color: #475569;
}
/* 周历格子里的协助人角标 */
.cal-assist {
  margin-left: 4px;
  font-style: normal;
  font-size: 11.5px;
  color: #2563eb;
  background: #eaf1ff;
  border-radius: 6px;
  padding: 0 4px;
  flex: none;
}
/* ==== 协助来的行程：别人发起、我只是协助 ==== */
/* 时间轴卡片：左框改虚线 + 斜纹底，一眼跟「我自己的安排」分开；标签行写明是谁的场子 */
.seg-event.is-assist .event-body {
  border-left-style: dashed;
  background-image: repeating-linear-gradient(135deg,
    rgba(255, 255, 255, .55) 0 10px, rgba(255, 255, 255, 0) 10px 20px);
}
.ev-assist-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #7c3aed;
  background: #f4ecff;
  border: 1px solid #e3d3ff;
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
/* 周历格子：把「🤝N」换成「协助」，紫一点，跟蓝的协助人角标区分 */
.cal-assist.is-assisted { color: #7c3aed; background: #f4ecff; }
.cal-item.is-assist { border-left-style: dashed; }
.um-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.um-check input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* 底部 */
.um-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: #fafbfe;
}
.um-foot-tip { font-size: 11.5px; color: var(--muted); }
.um-foot-act { display: flex; gap: 9px; }
.um-foot-act .btn:disabled { opacity: .66; cursor: default; box-shadow: none; }

@media (max-width: 560px) {
  .um-grid,
  .um-roles { grid-template-columns: 1fr; }
  .um-body { padding: 14px 14px 6px; }
  .um-head, .um-foot { padding-left: 14px; padding-right: 14px; }
}

/* ===== 会议纪要总览页 ===== */
.mm-panel { padding: 0 0 8px; }
.mm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.mm-field { display: flex; flex-direction: column; gap: 6px; }
.mm-field-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.mm-field select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 30px 8px 12px;
  font-size: 14px;
  color: var(--ink);
  min-width: 150px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7480' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
/* 日期范围：可见的是「10月29日」这种中文按钮，原生 date 输入框藏在下面只当选择器用。
   按钮外观跟同一行的「归属人 / 类型 / 快捷」下拉保持一致（白底 + 1px 实线边 + 10px 圆角 + 14px 字）。 */
.mm-daterange {
  position: relative;      /* 隐藏的原生输入框按它定位 */
  display: flex;
  align-items: center;
  gap: 8px;
}
.mm-date {
  box-sizing: border-box;   /* 全局已是 border-box，这里显式写一遍：height:34px 含 1px 边 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;           /* 「2026年10月26日」变宽后别被 flex 压窄导致折行 */
  white-space: nowrap;
  min-width: 104px;
  height: 34px;             /* 与 .mm-field select 实测等高（35px 会比下拉高 1px） */
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 17px;
  color: var(--ink);
  cursor: pointer;
}
.mm-date:hover { border-color: #c3ccda; }
.mm-date:active { border-color: #c3ccda; }
.mm-date:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mm-date-txt { pointer-events: none; }   /* 点哪儿都算点按钮，别让 span 抢走事件目标 */
/* 原生日期输入框：不能 display:none / visibility:hidden，否则 showPicker() 会抛错。
   铺满整个 .mm-daterange + opacity:0 + pointer-events:none，既算「已渲染」又不挡点击。 */
.mm-daterange input[type=date] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.mm-dash { color: var(--muted); }
.mm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  /* 日期按钮带上年份后整行变宽，这里允许收缩到 180，避免 1280 宽时被挤到第二行 */
  flex: 0 1 auto;
  min-width: 180px;
}
.mm-search-ico { font-size: 13px; opacity: .7; }
.mm-search input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 0;          /* 9px→8px：搜索框整体 36px→34px，与同一行下拉/日期按钮齐平（左右内边距不变，文字不跳） */
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}

.mm-list { display: flex; flex-direction: column; gap: 10px; padding: 0 20px 16px; }
/* 卡片高度写死：一条 84px，不管基础信息多长、摘要多少，列表看起来永远是齐的。
   内容不在这里展开——点一下弹窗看全文。 */
.mm-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 84px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.mm-item:hover { border-color: #b9c4f5; background: #f8faff; box-shadow: 0 2px 10px rgba(79, 70, 229, .07); }
/* 没写过纪要的行程：整张降噪，让写过的那几条在列表里更显眼 */
.mm-item.is-blank { background: #fcfdff; box-shadow: none; }
.mm-item.is-blank .mm-when b { color: #5b6577; }
.mm-item.is-blank .mm-open { color: #94a3b8; }
.mm-item.is-blank:hover { background: #f8faff; }
.mm-item.is-blank:hover .mm-open { color: var(--primary); }
.mm-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mm-row1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* 基础信息一律单行：放不下时由标题让位（省略号），绝不能换行把卡片撑高 */
.mm-facts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.mm-facts > * { flex: 0 0 auto; min-width: 0; }
/* 时间轴卡片里的「🤝 协助」是占整行的，在这里必须压成单行，否则会把卡片顶高 */
.mm-facts .ev-assist { width: auto; margin-top: 0; flex-wrap: nowrap; overflow: hidden; }
.mm-facts .assist-name { margin-right: 4px; }
.mm-facts .mm-title { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.mm-open { margin-left: auto; flex: none; font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.mm-when { display: flex; flex-direction: column; flex: none; line-height: 1.3; }
.mm-when b { font-size: 14px; color: var(--ink); }
.mm-when i { font-size: 12px; color: var(--muted); font-style: normal; }
.mm-type {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}
.mm-type.t-client { background: #e7f8ee; color: #15803d; }
.mm-type.t-meeting { background: #eef0fe; color: #4338ca; }
.mm-type.t-travel { background: #fff4e0; color: #b45309; }
.mm-type.t-study { background: #e6f9f0; color: #047857; }
.mm-type.t-personal { background: #f1f0fe; color: #6d28d9; }
.mm-type.t-other { background: #eef2f6; color: #475569; }
.mm-owner { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink); }
.mm-owner i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.mm-cust { font-size: 13px; font-weight: 600; color: #15803d; }
.mm-title { font-size: 13px; color: var(--ink); }
.mm-loc { font-size: 12px; color: var(--muted); }
/* 摘要预览：一整行、超出省略，点开看全文 */
.mm-preview {
  font-size: 12.5px;
  line-height: 1.4;
  color: #5b6577;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-preview-empty { color: #aeb6c2; font-style: italic; }

/* ---------------- 纪要总览：查看弹窗 ---------------- */
.mm-view-body { max-height: min(58vh, 520px); overflow-y: auto; }
.mm-view-ev {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f9fd;
  border: 1px solid var(--line-soft);
}
.mm-view-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.mm-view-title b { font-size: 15px; font-weight: 700; color: var(--ink); }
.mm-view-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.mm-view-when { color: #5b6577; font-weight: 600; }

/* 结果计数 + 分页 + 搜索高亮 */
.mm-countbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px 4px; }
.mm-count { font-size: 12.5px; color: var(--muted); }
/* 「只看已写纪要」开关：白金底描边，开时主色淡底 */
.mm-written-toggle {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.mm-written-toggle:hover { color: var(--ink); border-color: #c3ccda; }
.mm-written-toggle.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.mm-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px 22px;
  border-top: 1px solid var(--line);
}
.mm-pg-info { font-size: 12.5px; color: var(--muted); }
.mm-pg-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.mm-pg-num, .mm-pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.mm-pg-num:hover:not(:disabled), .mm-pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.mm-pg-num.is-cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; cursor: default; }
.mm-pg-num:disabled, .mm-pg-btn:disabled { opacity: .45; cursor: default; }
.mm-pg-ellipsis { color: var(--muted); padding: 0 4px; }
.mm-pg-size { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.mm-pg-size select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 26px 6px 10px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7480' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
.mm-preview mark, .mm-title mark { background: #fff3bf; color: inherit; border-radius: 3px; padding: 0 1px; }

/* 日期按钮带上「2026年10月26日」后整行变宽：1280 这类宽度会差二十来像素被挤到第二行，
   这里把间距、日期内边距和搜索框宽度一起收一点，保住单行；1024 以下该换行还是换行。 */
@media (max-width: 1340px) {
  .mm-toolbar { gap: 8px; }
  .mm-date { padding: 0 10px; }
  .mm-search { width: 190px; min-width: 0; }
}

@media (max-width: 560px) {
  .mm-toolbar { padding: 14px; }
  .mm-search { margin-left: 0; min-width: 0; width: 100%; }
  .mm-list { padding: 14px; }
  .mm-date { min-width: 88px; padding: 0 10px; }   /* 高度固定 34px，只收窄内边距，别把高度顶回 35px */
}
