/* ===== reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* 🔴 必须保留：禁用移动端「字体自动放大 / Font Boosting」。
   安卓 Chrome / WebView 在宽视口（横屏）会自动把文字放大，导致"横屏字号明显大于竖屏"——
   即使两侧 CSS 写的是同一个 px 值。2026-09-29 排查确认。 */
html, body {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #1f2937;
  background: #eef1f7;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ===== layout ===== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

/* ===== sidebar ===== */
.sidebar {
  background: linear-gradient(180deg, #0e1830 0%, #0a1226 100%);
  color: #c9d3e8;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #0a1020;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(99,102,241,.35);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-title { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.brand-sub { color: #7d8db1; font-size: 12px; margin-top: 2px; }

.menu {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}
.menu-section { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.menu-group-title {
  padding: 14px 12px 6px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #5d6b8a;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #b6c2dc;
  font-size: 13.5px;
  text-decoration: none;
  /* 2026-10-09：大类菜单是 <a> 标签，而全局只有 `button { cursor: pointer }`，
     所以悬停时显示的是默认箭头（实测 cursor: auto），与站内其它可点控件不一致 → 补上 pointer。 */
  cursor: pointer;
  transition: background .15s, color .15s;
  position: relative;
}
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.active {
  background: linear-gradient(90deg, #4f6dff 0%, #5b3df3 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(63,80,225,.35);
}
.menu-item .ico {
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  color: inherit;
}
.menu-item .ico svg { width: 18px; height: 18px; }
.menu-item.sub { padding-left: 14px; font-size: 13px; }

.badge {
  margin-left: auto;
  background: #21305e;
  color: #cdd7f3;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 11.5px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04);
  padding: 9px 10px;
  border-radius: 10px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.user-name { color: #fff; font-size: 12.5px; font-weight: 600; }
.user-role { color: #6f7da2; font-size: 11px; }

/* ===== main ===== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #f5f7fb;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: #fff;
  border-bottom: 1px solid #e7ebf3;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;          /* 锁定顶栏高度，避免不同页面因副标题/控件差异导致高度漂移 */
}
.topbar-left {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 56%;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-left .title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.topbar-left h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}
.topbar-left p {
  margin: 0;
  font-size: 12.5px;
  color: #6b7689;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
/* 默认 display:contents，保证横屏之外 .topbar-right 仍为 flex 行时，
   手动上传 / 导出表格两按钮与 .topbar-end 都是同一 flex 容器内的子项；
   横屏下会覆盖为 grid 让两按钮并排。 */
.land-filter-actions { display: contents; }

/* 顶栏筛选控件组（②时间快捷 + ③下拉 + ④日期框）整体左移。
   用 position:relative + left 偏移（不是 transform）——不新建层叠上下文，
   .ms-pop / .drp-popover 的 z-index 层级不变，弹层仍随触发器一起移动。
   ⑤导出表格按钮 与 ⑥后台同步/退出 保持原位不动。

   2026-10-09 偏移由 -100px 调为 -206px：「手动上传」按钮被隐藏后，.topbar-right
   少了一个 94px 宽的按钮 + 12px gap = 106px，而 .topbar 是 space-between 右对齐，
   .topbar-right 变窄 → 整组右移 106px（实测 1920 宽：553 → 659）。
   为把这 106px 补回来、让筛选组回到改动前的绝对位置，偏移需再加 106px。
   ⚠️ 手机端（竖屏 + 横屏）本来就没有这个按钮、布局从未受影响，
      故在下方移动端媒体查询里**显式写回 left:-100px**，避免被这里带偏。 */
.time-quick,
.extra-filter,
.date-range {
  position: relative;
  left: -206px;
}

/* 「口径说明」页是纯文档页：筛选控件（时间快捷 / 三个下拉 / 日期框）与「导出表格」在那里无用，
   2026-10-09 用户要求隐藏这几项；「后台同步状态」与「退出」保留。
   用 body class（由 app.js 的 showPage() 切换）+ 首帧用 html[data-yk-init="spec"]，两段都要有。 */
body.yk-spec-page .time-quick,
body.yk-spec-page .extra-filter,
body.yk-spec-page .date-range,
body.yk-spec-page #exportPageBtn,
html[data-yk-init="spec"] .time-quick,
html[data-yk-init="spec"] .extra-filter,
html[data-yk-init="spec"] .date-range,
html[data-yk-init="spec"] #exportPageBtn { display: none; }

/* 顶栏最右端的「退出」按钮正上方一栏：用于放置后台同步状态条 */
.topbar-end {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  margin-left: 4px;
}

.time-quick {
  display: flex;
  align-items: center;
  background: #f1f4fb;
  border: 1px solid #e3e8f2;
  border-radius: 9px;
  padding: 2px;
  height: 34px;
  box-sizing: border-box;
}
.time-quick button {
  border: none;
  background: transparent;
  padding: 0 12px;
  height: 26px;
  line-height: 1;
  font-size: 12.5px;
  color: #586479;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.time-quick button:hover { color: #1f2937; }
.time-quick button.active {
  background: linear-gradient(180deg, #5b6bff, #4f5ee5);
  color: #fff;
  box-shadow: 0 3px 8px rgba(79,94,229,.35);
}

.extra-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.extra-filter select {
  border: 1px solid #e3e8f2;
  background: #fff;
  border-radius: 9px;
  padding: 0 22px 0 10px;
  height: 34px;
  line-height: 1;
  font-size: 12.5px;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
  transition: border-color .15s;
}
/* extra-filter select hover/focus 已合并到 .ms-trigger 块，色调统一 */

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 9px;
  padding: 0 10px;
  height: 34px;
  box-sizing: border-box;
}
.date-range input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0 4px;
  height: 100%;
  line-height: 1;
  font-size: 13px;
  color: #1f2937;
}

/* 日期范围：单一可点击按钮 + 双月日历 popover（一个框，点开直接出日历） */
.date-range {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 9px;
  padding: 0 10px;
  height: 34px;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  user-select: none;
  min-width: 220px;
  box-sizing: border-box;
  transition: border-color .15s;
}
.date-range:hover { border-color: #c4b5fd; }
.date-range:focus { outline: 2px solid #a78bfa; outline-offset: 1px; }

.drp-popover {
  position: absolute;
  top: 38px;
  left: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid #e3e8f2;
  border-radius: 9px;
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
  font-size: 12.5px;
  color: #1f2937;
}
.drp-popover[hidden] { display: none; }
.drp-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.drp-nav {
  background: transparent;
  border: 1px solid #e3e8f2;
  border-radius: 6px;
  padding: 2px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #1f2937;
  line-height: 1.4;
}
.drp-nav:hover { background: #f1f5f9; }
.drp-grid { display: flex; gap: 18px; }
.drp-month { min-width: 175px; }
.drp-month-title {
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
  color: #0f172a;
}
.drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 25px);
  gap: 2px;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 4px;
}
.drp-weekdays > span { text-align: center; padding: 4px 0; }
.drp-days {
  display: grid;
  grid-template-columns: repeat(7, 25px);
  grid-auto-rows: 25px;
  gap: 2px;
}
.drp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #1f2937;
}
.drp-day.empty { cursor: default; }
.drp-day:hover:not(.empty) { background: #f5f3ff; }
.drp-day.edge { background: #7c3aed; color: #fff; font-weight: 600; }
.drp-day.in-range { background: #ede9fe; }

.btn-ghost, .btn-primary, .btn-text {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #e3e8f2;
  background: #fff;
  color: #4b5568;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-ghost:hover { background: #f8fafc; }
/* 2026-10-09 用户要求「目前先去掉」顶栏的「手动上传」按钮。
   该按钮点开只是「手动上传规则」说明框（app.js: openUploadInfo），并无上传功能；
   同样的规则文字在「口径说明」页已有一份（index.html 的 .spec-principle「手动上传规则」条），
   所以隐藏它不会丢任何信息。用 CSS 隐藏而非删 HTML/JS —— 以后要恢复，删掉这一段即可。
   ID 选择器特异性 (1,0,0) 高于 .btn-ghost 的 (0,1,0)，放在此处不会被后面的规则覆盖。 */
#manualUploadBtn { display: none; }
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(99,102,241,.3);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-text {
  background: transparent;
  border-color: transparent;
  color: #6b7689;
}
.btn-text:hover { background: #f1f4fb; color: #1f2937; }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}
.dot.live { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }

/* ===== page wrap ===== */
.page-wrap {
  padding: 22px 28px 36px;
  overflow-y: auto;
}
.page { display: none; }
.page.active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-head {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-title { font-size: 18px; font-weight: 700; color: #0f172a; }
.section-sub { font-size: 12.5px; color: #6b7689; }

/* cards row */
.card-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.info-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  border: 1px solid #eef1f7;
  position: relative;
  overflow: hidden;
}
.info-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
}
.info-card.blue::before   { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.info-card.green::before  { background: linear-gradient(90deg, #10b981, #34d399); }
.info-card.violet::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.info-card.amber::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.info-label { color: #6b7689; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.info-value { margin-top: 6px; font-size: 32px; font-weight: 700; }
.info-card.blue   .info-value { color: #2563eb; }
.info-card.green  .info-value { color: #059669; }
.info-card.violet .info-value { color: #7c3aed; }
.info-card.amber  .info-value { color: #d97706; }
.ico-mini { font-size: 14px; }

/* panel */
.card-panel {
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  border: 1px solid #eef1f7;
  margin-bottom: 16px;
}
.panel-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 15px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.panel-title-row .panel-title {
  margin-bottom: 0;
}
.panel-sub {
  font-size: 12.5px;
  color: #64748b;
}
.profit-panel { margin-top: 16px; }
/* 盈亏正负着色：中国惯例 — 盈利红、亏本绿 */
.data-table .num.pos { color: #dc2626; font-weight: 700; }   /* 盈利 = 红 */
.data-table .num.neg { color: #16a34a; font-weight: 700; }   /* 亏本 = 绿 */
.data-table .num.zero { color: #64748b; font-weight: 700; } /* ¥0 = 中性灰 */
.mth { font-size: 11px; font-weight: 400; color: #94a3b8; margin-left: 4px; white-space: nowrap; } /* 工资列：实际在职月数小字 */
.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

/* 表三 panel-toolbar 内的视图切换（仅含 .seg，靠右） */
.panel-toolbar .seg { margin-left: auto; }

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #0f172a;
}
.legend-dot {
  width: 4px; height: 14px;
  border-radius: 2px;
  display: inline-block;
  background: #4f6dff;
}
.legend-dot.blue { background: #4f6dff; }

.search-input {
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  outline: none;
  background: #fff;
  min-width: 220px;
  position: relative;
}
.search-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
/* × 清空按钮（输入有值时显示） */
.panel-toolbar .search-wrap {
  position: relative;
  display: inline-block;
  margin-left: auto; /* 搜索框靠右；以后 toolbar 加新元素会自动让位 */
}
.panel-toolbar .search-clear {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  border: none; background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  display: none;
  padding: 0;
}
.panel-toolbar .search-clear:hover { background: #f1f5f9; color: #475569; }
.panel-toolbar .search-input.has-value ~ .search-clear { display: inline-flex; align-items: center; justify-content: center; }

.seg {
  display: inline-flex;
  border: 1px solid #e3e8f2;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-size: 12.5px;
  color: #586479;
}
.seg button.active {
  background: linear-gradient(180deg, #5b6bff, #4f5ee5);
  color: #fff;
}

/* data table */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(90deg, #c7d2fe 0%, #ddd6fe 100%);
}
.data-table thead th {
  background: transparent;
  color: #0f172a;
  text-align: left;
  /* 2026-10-07 表头与数据行同高：padding 10 → 11px，表头 40 → 42px，与数据行对齐。 */
  padding: 11px 12px;
  font-weight: 600;
  border-bottom: 1px solid #e3e8f2;
  /* 2026-10-07 表头字号 12.5 → 13px：与合计行 / 数据行一致（用户要求"表头改成和合计一样的"）。
     字号变大不影响行高（仍 42px，实测确认）。 */
  font-size: 13px;
}
.data-table thead th.num,
.data-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #d1d9e6;
  color: #1f2937;
}
.data-table tbody tr:not(.total-row):hover td { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .highlight-amber { color: #d97706; font-weight: 700; }
.data-table tfoot tr,
.data-table tr.total-row {
  background: linear-gradient(90deg, #e0e7ff 0%, #ede9fe 100%);
}
.data-table tfoot td,
.data-table tr.total-row td {
  font-weight: 700;
  background: transparent;
  color: #0f172a;
  /* 2026-10-07 合计行与数据行同高（42px）：原来那条 2px `border-top` 会把行撑到 43px，
     改用 `box-shadow: inset` 画同样的分隔线（不占布局高度），并把 padding-top 补 1px
     （加粗后的行盒比普通行少 1px）→ 12 + 11 + 19 = 42px，与表头 / 数据行完全一致。 */
  border-top: 0;
  box-shadow: inset 0 2px 0 0 #cfdcf5;
  padding-top: 12px;
}

/* 表四·目标完成率 · 可双击编辑的目标单元格 */
.editable-cell {
  display: inline-block;
  min-width: 48px;
  /* 2026-10-07 统一行高：原 padding 2px + 行盒 18px = 22px，比普通单元格的行盒(20px)高，
     会把「目标完成率」「人员情况」的行撑到 45 / 49px。现固定为 19px（≤ 普通单元格行盒 20px），
     并加 nowrap / middle，保证任何内容都不再把行顶高 —— 全站数据行统一 42px。 */
  box-sizing: border-box;
  height: 19px;
  line-height: 17px;
  padding: 0 8px;
  white-space: nowrap;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px dashed transparent;
  cursor: text;
  color: #1e293b;
  transition: background .12s, border-color .12s;
}
.editable-cell:hover {
  background: #fff7ed;
  border-color: #fdba74;
}
.editable-cell .editable-empty {
  color: #94a3b8;
  font-size: 12px;
}
.editable-cell .editable-input {
  width: 72px;
  padding: 2px 6px;
  border: 1px solid #f97316;
  border-radius: 4px;
  background: #fffbeb;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}
.editable-cell .editable-input:focus {
  box-shadow: 0 0 0 2px rgba(249,115,22,.18);
}
.data-table th .edit-hint {
  display: inline-block;
  font-weight: 400;
  color: #f97316;
  font-size: 10.5px;
  margin-left: 4px;
  letter-spacing: 0.5px;
}
.table-hint {
  font-size: 12px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.cloud-status { font-size: 12px; color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.cloud-status.synced { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.btn-mini {
  font-size: 12px; padding: 5px 12px; border: 1px solid #cbd5e1;
  background: #f8fafc; border-radius: 6px; cursor: pointer; color: #334155;
}
.btn-mini:hover { background: #eef2ff; border-color: #a5b4fc; }
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.pill.ok    { background: #dcfce7; color: #166534; }
.pill.warn  { background: #fef3c7; color: #92400e; }
.pill.bad   { background: #fee2e2; color: #991b1b; }
.pill.gray  { background: #f1f5f9; color: #475569; }
/* 2026-10-07 统一行高：表格里的胶囊徽标（如状态列「落后 / 完成」）原先上下 padding 2px，
   整体 20px 高、比普通单元格行盒略高，会把该行顶高 1px。行内上下 padding 收到 1px，
   使徽标不参与撑高，配合 .editable-cell 的收紧 —— 全站数据行统一 42px。 */
.data-table .pill { padding: 1px 9px; }

/* 表三客服公司子区块分隔 */
.table-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 18px 0 12px;
}
/* 2026-10-07：.sub-section-title 已删除 —— 「客服开发率」页两个子视图里重复的小标题
   （按转潜公司汇总 / 按客服人员明细）已随冗余文案一起去掉，页面里不再有该 class，
   这条规则随之成为死代码，一并清除。注意：子容器 .sub-section 本身从未有过 CSS 规则
   （只是靠 hidden 属性切换显示的普通 div），下面的 .sub-section .data-table th 仍在用，勿删。 */
.sub-section .data-table th {
  /* 2026-10-07 统一行高：原先此处单独把字号压到 12px，导致「客服开发率」两个子表的表头
     比其它表矮 2px（38 vs 40）。删掉该覆盖，表头字号回归全站统一（桌面 12.5px / 手机 11.5px）。 */
  color: #0f172a;
  background: transparent;
}

/* KPI grid */
.banner {
  background: linear-gradient(90deg, #eef2ff, #ede9fe);
  border: 1px solid #e0e7ff;
  color: #4338ca;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}
.banner b { color: #312e81; }
.banner .sep { color: #a5b4fc; margin: 0 6px; }
.banner-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #6366f1;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  border: 1px solid #eef1f7;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 84px;            /* 统一高度：有值/空值/hover 都不变 */
  display: flex;                /* 内容垂直居中，避免空值卡片视觉偏低 */
  flex-direction: column;
  justify-content: center;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.kpi-card:hover {
  /* 不再 translateY：保持边框与邻居完全对齐，仅用阴影/边框色提示悬停 */
  box-shadow: 0 8px 20px rgba(99,102,241,.12);
  border-color: #c7d2fe;
}
.kpi-card::after {
  content: '查看明细 ▸';
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.kpi-card:hover::after { opacity: 1; }
.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
}
.kpi-card.blue::before    { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.kpi-card.cyan::before    { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.kpi-card.violet::before  { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.kpi-card.teal::before    { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.kpi-card.pink::before    { background: linear-gradient(90deg, #ec4899, #f472b6); }
.kpi-card.amber::before   { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.kpi-card.green::before   { background: linear-gradient(90deg, #10b981, #34d399); }
.kpi-card.emerald::before { background: linear-gradient(90deg, #059669, #10b981); }
.kpi-card.orange::before  { background: linear-gradient(90deg, #f97316, #fb923c); }
.kpi-card.indigo::before  { background: linear-gradient(90deg, #4f46e5, #6366f1); }
.kpi-card.rose::before    { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.kpi-card.slate::before   { background: linear-gradient(90deg, #475569, #64748b); }
.kpi-card.stone::before   { background: linear-gradient(90deg, #78716c, #a8a29e); }

.kpi-label { color: #6b7689; font-size: 12.5px; }
.kpi-num {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.1;
}
.kpi-card.blue    .kpi-num { color: #2563eb; }
.kpi-card.cyan    .kpi-num { color: #0e7490; }
.kpi-card.violet  .kpi-num { color: #7c3aed; }
.kpi-card.teal    .kpi-num { color: #0d9488; }
.kpi-card.pink    .kpi-num { color: #db2777; }
.kpi-card.amber   .kpi-num { color: #d97706; }
.kpi-card.green   .kpi-num { color: #059669; }
.kpi-card.emerald .kpi-num { color: #047857; }
.kpi-card.orange  .kpi-num { color: #ea580c; }
.kpi-card.indigo  .kpi-num { color: #4f46e5; }
.kpi-card.rose    .kpi-num { color: #e11d48; }
.kpi-card.slate   .kpi-num { color: #475569; }
.kpi-card.stone   .kpi-num { color: #78716c; }
.kpi-num .unit { font-size: 12px; margin-left: 2px; font-weight: 600; opacity: .8; }

.analize-text {
  margin-top: 14px;
  background: #fafbff;
  border: 1px dashed #d8def2;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.85;
}
.analize-block {
  background: #fff;
  border: 1px solid #eef1f7;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #1f2937;
  line-height: 1.85;
}
.hl-blue b, .hl-blue { color: #2563eb; font-weight: 700; }
.hl-orange { color: #ea580c; font-weight: 700; }
.hl-warn { color: #b45309; font-weight: 600; }

.spec ul { padding-left: 20px; line-height: 2; color: #334155; font-size: 13.5px; }
.spec ul li b { color: #1e293b; }
.spec .spec-principle { color: #d4380d; font-weight: 600; }
.spec .spec-principle b { color: #d4380d; }
.spec code { background: #fff1f2; color: #9f1239; padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.spec .spec-principle code { background: #fff1f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ========== 更新记录（按类型分组折叠）v20260831p ========== */
.spec-history-row { margin: 0 0 14px; padding: 8px 10px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; }
.spec-history-row:last-child { margin-bottom: 0; }
.spec-history-row .spec-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.spec-history-row .spec-history-tag { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 8px; white-space: nowrap; flex-shrink: 0; }
.spec-history-row .spec-history-count { font-size: 11px; color: #94a3b8; font-weight: 500; }
.spec-history-row ul { margin: 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.95; color: #475569; }
.spec-history-row li { display: flex; gap: 8px; align-items: baseline; }
.spec-history-row li[hidden] { display: none; }
.spec-history-row li .li-date { color: #0f172a; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.spec-history-toggle { appearance: none; -webkit-appearance: none; cursor: pointer; background: transparent; border: 0; padding: 4px 0; margin: 4px 0 0; font-size: 12px; color: #475569; font-family: inherit; -webkit-tap-highlight-color: transparent; transition: color .15s; }
.spec-history-toggle:hover { color: #1e293b; }
.spec-history-toggle:active { transform: scale(.97); }
.spec-history-toggle .arrow { display: inline-block; transition: transform .2s; margin-right: 4px; }
.spec-history-row.expanded .spec-history-toggle .arrow { transform: rotate(180deg); }
.spec-history-row.expanded { padding-bottom: 10px; }

.spec .hint {
  margin-top: 10px;
  padding: 10px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  border-radius: 10px;
}

/* scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d6dbe6; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #b0b8c8; }
::-webkit-scrollbar-track { background: transparent; }

/* responsive */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .card-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* 窄屏取消左移，避免控件挤压/覆盖标题 */
  .time-quick, .extra-filter, .date-range { left: 0; }
}

  /* ============ 安卓/手机端适配（≤640px 或 手机横屏矮屏）============
     方案对齐「逍遥游网络数据中心」：整页缩略用【纯 CSS transform: scale】——
     非 zoom、非 viewport meta；转屏纯 CSS 命中、零 JS 依赖、无闪屏。
     横竖屏走【同一个媒体查询】→ 同一个缩放倍数 → 视觉字号严格一致。 */
:root { --yk-zoom: 0.65; }
@media (max-width: 640px), (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  /* 整页缩略：布局尺寸放大 1/--yk-zoom 作补偿，缩放后正好填满视口；
     内容区在 .page-wrap 内独立滚动（避免"底部占满、划不动"）。
     --yk-zoom 默认 0.65；JS 会依据 visualViewport.scale 动态补偿，
     App 壳若额外施加了缩放，也能锁定到同一个视觉大小。 */
  html, body { height: 100%; overflow: hidden; }
  .app {
    position: fixed; top: 0; left: 0;
    width: calc(100vw / var(--yk-zoom));
    height: calc(100dvh / var(--yk-zoom));
    min-height: 0;
    transform: scale(var(--yk-zoom));
    transform-origin: top left;
  }
  .main { height: 100%; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .page-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; margin-left: 0; }

  /* 顶栏：紧凑、控件可换行占满
     🔴 2026-09-30：整页有 transform:scale(var(--yk-zoom))（默认 0.65），
     【视觉尺寸 = CSS 尺寸 × 0.65】→ 所有「手指可点控件」按 1/0.65 ≈ 1.54 倍补偿。
     统一基准 40px（视觉约 26px）——2026-09-30 用户要求"框上下缩小、直接显示在一行、不要滚动条"，
     由 64px 下调至 40px，并同步收窄内边距/间距，使整条筛选行在 680×360 下不溢出（无横向滚动条）。
     改动时【只改尺寸，不要动 font-size】——字号必须与横屏共用同一份。 */
  /* ⚠️ .topbar 必须 flex:0 0 auto —— 否则作为 .main(column flex) 的子项会被压缩，
     内容溢出后会盖住下面的提醒条（实测 clientH 98 < 内容 140）。 */
  .topbar { padding: 10px 12px 0; border-bottom: 0; flex: 0 0 auto; }
  .topbar-left h1 { font-size: 17px; }
  .topbar-left p { font-size: 11.5px; }
  /* 筛选条：只保留【底边】一条分界线（2026-09-30 用户要求"总览下方那条横杠去掉，所有大类都是"，
     故删除 border-top —— 标题行正下方不再有横线；底边线仍作为顶栏与内容区的分界）。
     ⚠️ ① 边框必须 ≥2px —— 整页 scale(0.65) 会把 1px 渲成约 0.65px，肉眼完全看不见；
     ⚠️ ② 必须 flex:0 0 auto —— 否则作为 flex 子项会被压缩（实测被压到 31px），
        再叠加 overflow-y:hidden 会把按钮的上下边整条裁掉（表现为"只看得到左右两条竖线"）。 */
  .topbar-right {
    width: 100%; gap: 6px;
    flex: 0 0 auto;
    border-top: 0;
    border-bottom: 2px solid #cbd5e1;
    padding: 4px 0;
  }
  /* 🔴 2026-10-10 修正（前一天我在这里踩了坑，务必保留本注释）：
     10-09 我在这个手机端块里写了 `.time-quick/.extra-filter/.date-range { left: -100px }`，
     本意是"保持手机端原样"，**实际却把手机端的左移又加了回来** —— 因为本文件上方
     `@media (max-width: 900px)` 里早有一条同特异性的 `left: 0`（注释："窄屏取消左移，
     避免控件挤压/覆盖标题"），手机端原本靠它把左移取消掉；我那条写在更后面 → 覆盖了它，
     于是把最左边的「全部 / 今天 / 全部运营」挤出了屏幕（实测竖屏 390：.time-quick 左边界
     到屏幕外 57px；横屏 680 同理）。
     → 这里显式写回 `left: 0`：既修复该问题，也顺带覆盖"宽 >900 的手机横屏"
       （`max-width:900px` 匹配不到）这种边角情况。
     ⚠️ 桌面端不受影响（本块是手机端媒体查询，桌面仍保持它自己的左移量）。 */
  .time-quick,
  .extra-filter,
  .date-range { left: 0; }
  /* 手机端（含横屏）：「后台同步状态」与「退出」改为横向一排，退出在右；
     基础样式是 column（为桌面设计成"状态条在退出正上方"），窄顶栏里会上下堆叠。 */
  .topbar-end { flex-direction: row; align-items: center; gap: 10px; margin-left: 0; }
  /* 时间快捷：**8 个选项共用一个容器框**（2026-09-30 用户明确："这些本来就在一个框里，
     你为什么把他们每个弄一个框？"→ 撤回上一版"每个选项独立成框"的做法）。
     容器提供浅灰底 + 描边 + 圆角；选项本身为裸文字，仅「选中态」高亮成蓝色圆角块。
     ⚠️ 容器边框 ≥2px：整页 scale(0.65) 会把 1px 渲成约 0.65px，肉眼看不见。 */
  .time-quick {
    flex: 1 1 auto; height: auto;
    background: #f1f4fb; border: 2px solid #dbe3ee; border-radius: 12px;
    padding: 2px; gap: 3px;
  }
  .time-quick button {
    padding: 0 9px; height: 34px;
    background: transparent; border: 0; border-radius: 9px;
    color: #4b5568;
  }
  .extra-filter { flex-wrap: wrap; gap: 8px; }
  .extra-filter .multi-select { flex: 1 1 0; min-width: 0; }   /* 三个下拉压成一行 */
  .ms-trigger { width: 100%; max-width: none; min-width: 0; height: 40px; }
  .date-range { flex: 1 1 100%; min-width: 0; height: 40px; }
  .cloud-status { display: inline-flex; align-items: center; height: 40px; padding: 0 9px; font-size: 12.5px; }
  .drp-grid { gap: 8px; }
  .drp-month { min-width: 140px; }
  .drp-weekdays, .drp-days { grid-template-columns: repeat(7, 20px); }
  .drp-days { grid-auto-rows: 20px; }
  .drp-day { font-size: 11px; }
  /* 顶栏按钮：高度同样按 1/0.65 补偿 → 视觉约 28.6px */
  .btn-ghost, .btn-primary, .btn-text { font-size: 12.5px; padding: 0 11px; height: 40px; }

  /* 侧边栏 → 左侧抽屉（方案对齐「逍遥游」：默认收起，点左上角汉堡从左侧滑出 + 半透明遮罩）
     2026-09-30 用户要求"把大类归到左边去"，不再使用顶部横向滚动导航条。 */
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; max-width: 82vw;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #0e1830 0%, #0a1226 100%);
    border-right: 1px solid rgba(255,255,255,.06);
    padding-top: env(safe-area-inset-top);
  }
  body.yk-drawer-open .sidebar { transform: translateX(0); }
  .brand { display: flex; }
  .sidebar-footer { display: block; }
  .menu {
    display: flex; flex-direction: column;
    padding: 8px 10px; gap: 3px;
    overflow: visible;
  }
  .menu-section { flex-direction: column; margin: 0; gap: 3px; }
  .menu-group-title { display: block; }
  .menu-item {
    justify-content: flex-start;
    padding: 9px 12px;
    gap: 10px;
    white-space: normal;
    background: transparent;
    border-radius: 8px;
  }
  .menu-item .ico { display: inline-grid; }

  /* 抽屉配色提亮（对齐「逍遥游」的观感）：底色整体抬一档、hover / active 高亮更明显。
     原因①：我们的原底色 #0e1830→#0a1226 比逍遥游的 #0A0E14→#141C28 更暗；
     原因②：整页 transform:scale(0.65) 会进一步压暗观感、把小字渲染得更细更淡。 */
  .sidebar {
    color: #e8edf7;
    background: linear-gradient(180deg, #16233f 0%, #111c31 100%);
    border-right-color: rgba(255,255,255,.08);
  }
  .menu-item { color: #dce4f4; font-weight: 500; }
  .menu-item:hover { background: rgba(255,255,255,.10); color: #ffffff; }
  .menu-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, #6b86ff 0%, #7a5cff 100%);
    box-shadow: 0 4px 14px rgba(99,125,247,.45);
  }
  .brand { border-bottom-color: rgba(255,255,255,.08); }
  .brand-title { color: #ffffff; }
  .brand-sub { color: #a9b8d4; }
  .menu-group-title { color: #a3b2ce; }
  .sidebar-footer { color: #d7e0f2; }
  .user-name { color: #e8edf7; }
  .user-role { color: #a9b8d4; }

  /* 遮罩（抽屉展开时出现，点击关闭） */
  .drawer-backdrop {
    display: none; position: fixed; inset: 0; z-index: 150;
    background: rgba(8,12,22,.45);
  }
  body.yk-drawer-open .drawer-backdrop { display: block; }

  /* 汉堡按钮：手机端显示、点开左侧抽屉。
     ⚠️ 必须带 .topbar-left 前缀提高特异性 —— 文件后面还有一条全局的
     `.land-menu-btn { display:none }`（用于桌面隐藏），不加前缀会被它覆盖掉。 */
  .topbar-left .land-menu-btn {
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 34px; height: 34px; padding: 0; margin-left: 12px;
    background: transparent; border: none; color: #475569;
    font-size: 23px; line-height: 1; cursor: pointer; box-shadow: none;
    -webkit-tap-highlight-color: transparent;
  }
  .logged-out .topbar-left .land-menu-btn { display: none; }
  body.yk-drawer-open .topbar-left .land-menu-btn { display: none; }

  /* 主区内容 */
  .page-wrap { padding: 14px 14px 28px; }

  /* KPI / 信息卡片：手机两列、字号收敛 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { min-height: 72px; padding: 12px 12px 14px; }
  .kpi-num { font-size: 20px; }
  .kpi-label { font-size: 11.5px; }
  .kpi-card::after { display: none; }   /* 手机隐藏"查看明细"角标，省空间 */
  .card-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .info-card { padding: 13px 14px; }
  .info-value { font-size: 26px; }

  /* 表格：更小内边距，外层已 overflow-x 横向滚动 */
  .data-table { font-size: 12px; }
  /* 2026-10-07 表头与数据行同高：内边距 8 → 9px（与 td 一致）、字号 11.5 → 12px
     （与 .data-table 一致），使「表头 == 数据行」；合计行补 1px 上内边距同样对齐。 */
  .data-table thead th { padding: 9px 8px; font-size: 12px; white-space: nowrap; }
  .data-table tbody td { padding: 9px 8px; }
  .data-table tr.total-row td { padding-top: 10px; }
  .data-table-wrap, .modal-table-wrap { -webkit-overflow-scrolling: touch; }

  /* 面板工具栏：搜索框占满一行 */
  .panel-toolbar { gap: 8px; }
  .panel-toolbar .search-wrap { width: 100%; margin-left: 0; }
  .search-input { width: 100%; min-width: 0; }

  /* modal 全屏化 + 🔴 跟随整页缩放（2026-10-10）
     弹窗（.modal-mask）是 body 的直接子元素、位于 .app 之外 → 原先【不在整页
     transform:scale(0.65) 的作用范围内】，所以弹窗内的一切（标题 15px、表格 12.5px…）
     都是原始 px，比页面其它内容(×0.65)大 ~54%，用户反馈"app 跳出来的卡片和文字都有点大"。
     修法：让 .modal-mask 自身先按 1/zoom 放大布局、再 scale(zoom) 回来 —— 与 .app 同一套缩放，
     弹窗从此与页面正文视觉尺寸一致（桌面端不受影响，本块是手机端媒体查询）。 */
  .modal-mask {
    padding: 0;
    width: calc(100vw / var(--yk-zoom, 0.65));
    height: calc(100dvh / var(--yk-zoom, 0.65));
    transform: scale(var(--yk-zoom, 0.65));
    transform-origin: top left;
  }
  /* ⚠️ 本行与「基础 .modal-card」（位于本文件更后方，约 1283 行）特异性相同 → 实际被其覆盖：
     手机端弹窗卡片沿用基础的 max-width:1100px / max-height:86vh / border-radius:14px。
     本次整页缩放后它会同比缩小（视觉高 ≈ 86vh × 0.65），与改前行为一致，无需另行调整。 */
  .modal-card { max-width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; }
  /* 🔴 2026-10-10（用户最终定稿：条数多就展示 85%，条数少就自适应窗口）：
     手机端卡片高度 = **上限视口 85% + 内容自适应**：
       · 行数多（内容超过 85%）→ 卡片 85% 高，表格内部滚动；
       · 行数少 → 卡片贴合内容高度，不留大片空白。
     用 calc(85dvh / --yk-zoom) 换算，视觉上限正好 = 视口 × 0.85。
     ⚠️ 必须同时写 `height: auto`：本文件手机块里原有 `.modal-card { height: 100vh }`
       （0,1,0；基础 `.modal-card` 没有 height 属性，所以它一直生效），会把卡片强制成 100vh
       （视觉 = 视口 65%，表现为"无论几行都一样高"）；不写 auto 就永远看不到自适应效果。
     ⚠️ 提特异性（body > .modal-mask > .modal-card）—— 基础 `.modal-card { max-height:86vh }`
       位于本文件更后方、同特异性，会把它盖掉（早前「改了没生效」就是这个原因）。 */
  body > .modal-mask > .modal-card { height: auto; max-height: calc(85dvh / var(--yk-zoom, 0.65)); }
  .modal-head, .modal-toolbar, .modal-table-wrap { padding-left: 16px; padding-right: 16px; }
  .modal-table { font-size: 12px; }
  .analize-text, .analize-block { font-size: 13px; }
}

/* ============ 安装为 App（standalone / fullscreen）时的全屏体验 ============ */
@media all and (display-mode: standalone), all and (display-mode: fullscreen) {
  html, body { overscroll-behavior-y: contain; }
  body { -webkit-tap-highlight-color: transparent; background: #f5f7fb; }
  /* 刘海 / 状态栏安全区：顶栏与底部留白 */
  .sidebar { padding-top: env(safe-area-inset-top); }
  .topbar { padding-top: calc(18px + env(safe-area-inset-top)); }
  .page-wrap { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* ============ 手机横屏：不再单独定义任何样式，直接沿用上方「竖屏手机」那一块 ============
   2026-09-29 统一代码路径：手机横屏与竖屏共用同一个媒体查询块
   （@media (max-width: 640px), (orientation: landscape) and (max-height: 540px) and (pointer: coarse)）
   → 横竖屏引用【同一份样式定义】，从机制上消除"横屏字号与竖屏不一致"。
   原先横屏专用的 5 列 KPI / 筛选单行 / 窄屏收窄等样式已全部移除，
   删除前的完整文件备份在 backups/styles.css.20260929-preunify.bak。 */
.land-menu-btn { display: none; }
.drawer-backdrop { display: none; }

/* ============ 竖屏专属：筛选区压缩为【两行】 ============
   2026-09-30 用户要求"竖屏这边现在是4行，集合一下放在两行里，另外手动上传去掉"。
   行1 = 时间快捷 + 日期框；行2 = 三个下拉 + 导出表格 + 已连接后台 + 退出。
   实现：用 `order` 重排（**只在竖屏生效**，横屏那一行保持原顺序），
   并给 .date-range 一个较小的 flex-basis（100px）+ flex-grow:1，使其与时间快捷同排、
   自动吃掉行内剩余宽度（日期已由 app.js 切为 MM/DD 短格式，151px 内不会截断）。
   实测容器宽 530px：行1 = 373 + 151 ✓；行2 = 281 + 94 + 142 + 间距 12 = 529 ✓。 */
@media (max-width: 640px) and (orientation: portrait) {
  .topbar-right { flex-wrap: wrap; row-gap: 6px; }
  .time-quick { order: 1; flex: 0 0 auto; }
  .date-range { order: 2; flex: 1 1 100px; min-width: 0; }
  /* 🔴 2026-09-30 修：行2 原为 276+94+142+间距12 = 524（仅剩 6px 余量），真机上「已连接后台/退出」被挤到第 3 行。
     现把三个下拉缩窄：内边距 10→5px（自然宽 88→78，文字「全部运营」仍完整不省略），
     并把 .multi-select 锁为 flex:0 0 auto、间距 6→4px → 行2 = 242+6+94+6+142 = 490，留 40px 余量。
     ⚠️ 只给 .ms-trigger 设 max-width 没用——它的父级 .multi-select 仍会被撑宽。 */
  .extra-filter { order: 3; flex: 0 0 auto; display: flex; flex-wrap: nowrap; gap: 4px; }
  .extra-filter .multi-select { flex: 0 0 auto; min-width: 0; }
  /* ⚠️ 必须写成 `.extra-filter .ms-trigger`（特异性 0,2,0）—— 基础 `.ms-trigger`（padding:6px 10px;
     max-width:200px）位于本文件【更后面】（约 1336 行），同特异性会被它覆盖，之前的覆盖一直没生效。 */
  .extra-filter .ms-trigger { width: 80px; max-width: none; padding: 0 5px; }   /* 2026-09-30 用户指定：80px */
  #exportPageBtn { order: 4; flex: 0 0 auto; }
  .topbar-end { order: 5; flex: 0 0 auto; }
  #manualUploadBtn { display: none; }   /* 用户要求：竖屏去掉「手动上传」 */
  /* 🔴 日期面板右对齐：行1 里日期框位于右端，而 .drp-popover 默认 left:0 向右展开 222px，
     右边缘会到 477 > 屏宽 360（用户反馈"日期框打开看不全"）。改为贴右边缘向左展开。 */
  .drp-popover { left: auto; right: 0; }
}

/* 手机横屏：只做【布局】适配，⚠️【本块内禁止出现任何 font-size】⚠️
   字号继续与竖屏共用同一份定义（上方 @media (max-width:640px) 共享块），保证两边字号严格一致。
   2026-09-29：先前把横屏块整块删掉后发现「筛选区纵向堆叠、占满整屏、内容看不到」，
   因此只把布局捞回来 —— 顶栏紧凑、筛选压成一行（放不下就横滑，绝不换行堆叠）。 */
@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
  #manualUploadBtn { display: none; }

  /* 顶栏：紧凑。
     ⚠️ 整页有 transform:scale(var(--yk-zoom))（默认 0.65），控件【视觉高度 = CSS 高度 × 0.65】，
     统一 40px → 视觉约 26px。2026-09-30 用户要求"框上下缩小、直接显示在一行、不要滚动条"，
     故由 64px 下调至 40px 并全面收窄宽度（本块内控件高度必须与竖屏共用块保持一致，改动两处需同步）。 */
  /* 顶栏：紧凑。2026-09-30 用户要求"把这中间空白的地方缩窄一点"（标题行与筛选条之间的竖向空隙），
     故 gap 6→2px、标题行 min-height 32→26px（标题文字实际仅需约 25px）。 */
  .topbar { padding: 8px 10px 0; gap: 2px; }
  .topbar > * { width: 100%; }
  .topbar-left { min-height: 32px; }

  /* 筛选：横向单行，全部控件压在一行内、不换行
     🔴 overflow 必须为 visible（2026-09-30 用户反馈"日期框点不开"）：
     此前用 `overflow-x:auto; overflow-y:hidden` 做横滑兜底，但日期 / 下拉的弹出面板是 absolute 定位、
     向下展开约 150px，会被该 overflow **整块裁掉**（实测面板 hidden=false 但完全不可见）。
     现内容已能一行放下（无溢出），故直接 visible，弹出面板可越过筛选条显示在内容区之上。
     内边距沿用上方手机共用块的 padding: 4px 0（2026-09-30 曾试过调成 11px 与提醒条对齐，
     被用户判定"越改越离谱"后已撤回，不要再加）。
     （上下边框与 flex:0 0 auto 来自上方手机共用块，此处只做布局） */
  .topbar-right {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    align-items: center; gap: 6px;
    width: 100%; min-width: 0;
    flex: 0 0 auto;
    overflow: visible;
  }
  .topbar-right > * { flex: 0 0 auto; }
  .time-quick { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 3px; flex: 0 0 auto; }
  .time-quick button { padding: 0 9px; height: 34px; white-space: nowrap; }   /* 不含 font-size */
  .extra-filter { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 4px; flex: 0 0 auto; }
  .extra-filter .multi-select { flex: 0 0 auto; }
  .ms-trigger {
    width: auto; max-width: 78px; height: 40px; padding: 0 7px;
    justify-content: space-between; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .date-range {
    flex: 0 0 auto; width: auto; max-width: 112px; height: 40px;
    white-space: nowrap;
    /* 🔴 绝对不要设 overflow:hidden —— .drp-popover 是 absolute 定位、由本元素向下展开约 158px，
       一旦本元素 overflow:hidden，整个日期面板会被裁掉（2026-09-30 用户反馈"日期框点不开"的根因）。
       超长日期的省略交给内部的 #dateRangeLabel 自己处理。 */
    overflow: visible;
  }
  .date-range #dateRangeLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
  .date-range svg { display: none; }
  #exportPageBtn { padding: 0 8px; height: 40px; white-space: nowrap; }   /* 不含 font-size */

  /* 内容区：正常纵向滚动，不再整屏被筛选区占满
     （2026-09-30 说明：这里曾把 padding-top 由 8px 调成 16px 想让「筛选条→提醒条」与「提醒条→卡片」对齐，
      但用户指出改错了位置——他要的是【筛选条框内】的上下留白与下方提醒条一致，
      故此处恢复原值 8px，框内留白改由上方 .topbar-right 的 padding 处理。） */
  .page-wrap { padding: 8px 10px 16px; }
}

/* 横屏较宽（真平板，如 1024×768 / 1280×800）：整体字号与间距收敛，避免偏大（v20260929b）
   🔴 必须带 max-width 限制（2026-09-29 实测定位）：
   App 壳登录后会 pageScale=0.35，此时【手机横屏】的 layout viewport 宽度 = 屏宽÷0.35 ≈ 2100px、
   高度 ≈ 1180px，会假阳性命中本块 → 横屏字号被判成 16px，比竖屏（24px）小一档，
   表现为"横屏和竖屏还是不一样"。
   真平板横屏宽度都在 1400px 以内，加 max-width:1400px 不受影响。 */
@media (orientation: landscape) and (min-height: 541px) and (max-width: 1400px) and (pointer: coarse) {
  html { font-size: 13px; }
  .kpi-num { font-size: 16px; }
  .info-value { font-size: 20px; }
  .topbar { padding: 10px 18px; }
  .topbar-left h1 { font-size: 17px; }
  .page-wrap { padding: 14px 18px 24px; }
  .card-panel { padding: 14px 16px 12px; }
  .kpi-card { min-height: 72px; padding: 12px 14px 14px; }
  .data-table { font-size: 12.5px; }
}

/* ============ KPI 明细 modal ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  animation: maskIn .15s ease;
}
.modal-mask[hidden] { display: none; }
@keyframes maskIn { from { opacity: 0 } to { opacity: 1 } }

.modal-card {
  width: 100%;
  max-width: 1100px;
  max-height: 86vh;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cardIn .18s ease;
}
@keyframes cardIn { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #eef1f7;
  background: linear-gradient(180deg, #f8faff, #ffffff);
}
.modal-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.modal-sub { font-size: 12px; color: #64748b; margin-top: 3px; }
.modal-close {
  border: none;
  background: #f1f5f9;
  color: #475569;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.modal-close:hover { background: #e2e8f0; color: #0f172a; }

.modal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid #eef1f7;
  background: #fafbff;
}
.modal-toolbar input {
  flex: 1;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color .12s ease;
}
.modal-toolbar input:focus { border-color: #6366f1; }
.modal-count {
  font-size: 12.5px;
  color: #64748b;
  white-space: nowrap;
}
.modal-export {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease;
}
.modal-export:hover { background: #e0e7ff; }

.modal-table-wrap {
  flex: 1;
  overflow: auto;
  /* 🔴 2026-10-10 修复「第一行数据跑到表头上面」：
     原来是 `padding: 14px 20px 20px` —— sticky 表头（.modal-table thead th, top:0）会钉在
     **这个 padding 的下沿**，于是表头上方留出一条 14px 的固定缝；滚动时数据行正好从这条缝里
     露出来，看起来就像"第一行跑到了表头上面"（实测 scrollTop=60 时上方露出一整行的文字）。
     改为顶部不留 padding，把 14px 间隙交给 #modalTableWrap 的首个内容用 margin 承担
     （margin 属于内容、会跟着一起滚走，不会留在原地遮挡）。
     ⚠️ 「手动上传规则」弹窗用的是内联 `padding:18px 22px`（优先于本规则），不受影响。 */
  padding: 0 20px 20px;
}
/* 顶部 14px 间隙（替代原来的 wrap padding-top，见上） */
#modalTableWrap > :first-child { margin-top: 14px; }
.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.modal-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #cbd5e1;
  z-index: 1;
  white-space: nowrap;
}
.modal-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.modal-table tbody tr:hover td { background: #f8fafc; }
.modal-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.modal-table .center { text-align: center; }
.modal-table .empty {
  text-align: center;
  color: #94a3b8;
  padding: 40px;
}
.modal-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.modal-tag.status-已到,
.modal-tag.status-检查流失,
.modal-tag.status-它病治疗 { background: #fee2e2; color: #b91c1c; }
.modal-tag.status-咨询,
.modal-tag.status-断诊流失,
.modal-tag.status-它病流失 { background: #ede9fe; color: #6d28d9; }
.modal-tag.status-未到,
.modal-tag.status-断诊治疗,
.modal-tag.status-断诊流失 { background: #fef3c7; color: #92400e; }
.modal-tag.status-等待 { background: #f1f5f9; color: #475569; }

/* 手动上传 modal：突出显示"上传通道"提示框 */
.upload-cta {
  margin-top: 14px;
  padding: 14px 18px;
  border: 2px dashed #6366f1;
  background: #eef2ff;
  border-radius: 10px;
}
.upload-cta-title {
  font-size: 14px;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 6px;
}
.upload-cta-body {
  font-size: 13px;
  line-height: 1.7;
  color: #1f2937;
}

/* ---------- 多选 popup（topbar「渠道」）---------- */
.multi-select {
  position: relative;
  display: inline-block;
}
.ms-trigger {
  appearance: none;
  background: #fff;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  white-space: nowrap;
  max-width: 200px;
}
.ms-trigger:hover,
.ms-trigger:focus {
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .12);
  outline: none;
}
.ms-trigger.has-value {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
  font-weight: 600;
}
.ms-caret {
  font-size: 10px;
  color: #71717a;
  line-height: 1;
}
.ms-trigger.has-value .ms-caret { color: #6366f1; }
.ms-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.ms-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14), 0 2px 8px rgba(15, 23, 42, .06);
  padding: 6px 0 4px;
  min-width: 120px;
  max-width: 200px;
  width: max-content;             /* 按内容收缩，避免右边空一大块 */
}
.ms-pop[hidden] { display: none; }
.ms-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 8px;
  border-bottom: 1px dashed #e5e7eb;
  margin-bottom: 4px;
}
.ms-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 2px 6px;
  font: inherit;
  font-size: 12px;
  color: #6366f1;
  cursor: pointer;
  border-radius: 4px;
}
.ms-link:hover { background: #eef2ff; }
.ms-sep { color: #d4d4d8; font-size: 12px; }
.ms-list { display: flex; flex-direction: column; max-height: 280px; overflow-y: auto; }
.ms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #1f2937;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.ms-item:hover {
  background: #f3e8ff;   /* 淡紫色 hover，原浏览器默认蓝 → 统一淡紫 */
  color: #1f2937;
}
.ms-item.selected {
  background: #ede9fe;   /* 选中态：淡紫背景作提示，文字保持普通深色 */
  color: #1f2937;
}
.ms-item input[type="checkbox"] {
  accent-color: #6366f1;
  margin: 0;
  cursor: pointer;
}

/* ============ 登录门禁 ============ */
.login-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* 兜底背景（2026-11-05 改）：原来用深紫渐变，强刷时 Canvas 还没画出来的那一两帧
     会先露出紫色，看上去就是"闪一下紫"。这里改成与星空底色一致的深蓝黑 + 极淡光晕，
     衔接几乎无感；Canvas 万一绘制失败也仍是深色夜空，不会突兀。 */
  background:
    radial-gradient(120% 90% at 52% 42%, #0b1728 0%, #050a14 46%, #03060e 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* 2026-11-05：登录页背景 = Canvas 实时绘制的「银河星带」（绘制逻辑在 index.html 页尾） */
.login-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: 320px; max-width: 90vw; padding: 32px 28px;
  background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { font-size: 19px; font-weight: 800; color: #312e81; text-align: center; }
.login-sub { font-size: 13px; color: #64748b; text-align: center; margin-top: -6px; }
.login-input {
  height: 42px; padding: 0 14px; font-size: 14px; color: #1f2937;
  border: 1px solid #d4d4d8; border-radius: 10px; outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.login-btn {
  height: 42px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff;
  font-size: 15px; font-weight: 700;
}
.login-btn:disabled { opacity: .6; cursor: default; }
.login-err { min-height: 18px; font-size: 13px; color: #dc2626; text-align: center; }
/* 未登录时隐藏整个看板 */
body.logged-out .app { display: none !important; }
/* 刷新防跳页首帧（v20260818b）：HTML 上有 data-yk-init=x 时,首帧直接显示对应页,不闪总览 */
html[data-yk-init] .page { display: none !important; }
html[data-yk-init="kpi"]    .page#page-kpi,
html[data-yk-init="table1"] .page#page-table1,
html[data-yk-init="table2"] .page#page-table2,
html[data-yk-init="table3"] .page#page-table3,
html[data-yk-init="table4"] .page#page-table4,
html[data-yk-init="profit"] .page#page-profit,
html[data-yk-init="table5"] .page#page-table5,
html[data-yk-init="spec"]   .page#page-spec { display: block !important; }
html[data-yk-init="kpi"]    .menu-item[data-page="kpi"],
html[data-yk-init="table1"] .menu-item[data-page="table1"],
html[data-yk-init="table2"] .menu-item[data-page="table2"],
html[data-yk-init="table3"] .menu-item[data-page="table3"],
html[data-yk-init="table4"] .menu-item[data-page="table4"],
html[data-yk-init="profit"] .menu-item[data-page="profit"],
html[data-yk-init="table5"] .menu-item[data-page="table5"],
html[data-yk-init="spec"]   .menu-item[data-page="spec"] {
  background: linear-gradient(90deg, #4f6dff 0%, #5b3df3 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(63,80,225,.35);
}

/* 2026-10-09「刷新闪标题」修复（配合 app.js boot() 里提前调用 applyPageTitle）：
   顶栏标题在静态 HTML 里写死为「总览 / KPI」，只有停在总览页时才是对的；
   其余大类在首屏（app.js 尚未执行、boot 里的 applyPageTitle 还没跑）会闪出「总览 / KPI」，
   看起来像"跳到总览再跳回来"（实测 ~100ms，肉眼可见）。
   这里在 html 仍带 data-yk-init（= boot 未跑完）且不是总览页时，先把标题文字隐藏；
   visibility 会保留元素占位，因此不会引起顶栏高度/位置跳动。
   总览页不隐藏（它的静态文案本来就是对的）。 */
html[data-yk-init]:not([data-yk-init="kpi"]) .title-wrap { visibility: hidden; }

/* ============ 表五·新增运营（2026-09-28） ============ */
/* 说明横幅：左文字 + 右「新增运营」按钮 */
.table-hint-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.table-hint-flex > span { flex: 1 1 260px; min-width: 0; }

.btn-addop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(99,102,241,.28);
  transition: filter .15s ease, transform .1s ease;
}
.btn-addop:hover  { filter: brightness(1.06); }
.btn-addop:active { transform: translateY(1px); }

/* 新增运营表单 */
.addop-body { padding: 16px 22px 20px; }
.addop-field { margin-bottom: 14px; }
.addop-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.addop-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 13.5px;
  color: #0f172a;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.addop-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.addop-err {
  min-height: 18px;
  font-size: 12.5px;
  color: #dc2626;
  margin: -4px 0 8px;
}
.addop-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============ 手机横屏整页缩放（已废弃：v20260929m 起改为真实字号布局，不再 scale；#mobile-zoom-btn 已从 index.html 移除）============ */
