/*
 * 时间动线样式（R42）。
 *
 * 唯一硬性布局约束：1440 / 768 / 390 三种视口都不得出现页面级横向溢出。
 * 因此时间轴容器本身 `overflow: hidden`，区段用百分比定位而不是 px，
 * 文字一律 `min-width: 0` + 省略号，避免长标题把容器撑宽。
 *
 * 状态不只靠颜色：每个区段都有状态标记字符，并有各自的纹理（斜纹 / 点阵 /
 * 虚线边框），去色打印或色觉障碍下仍然可分辨。
 */

.tl {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.tl-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, 8px);
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt, #f7f9f6);
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, 8px);
  font-size: 12px;
  color: var(--slate, #5c6672);
}

.tl-legend-item::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border: 1px solid var(--line-strong, #b3bdb0);
  border-radius: 2px;
  vertical-align: -1px;
}

.tl-legend-item.is-planned::before { background: #dfe7f3; }
.tl-legend-item.is-done::before { background: var(--seal-soft, #e2ede9); }
.tl-legend-item.is-running::before { background: #cfe3f5; }
.tl-legend-item.is-overrun::before {
  background: var(--pending-soft, #fbf0dc);
  background-image: repeating-linear-gradient(45deg, #d4922a33 0 3px, transparent 3px 6px);
}
.tl-legend-item.is-interrupted::before {
  background: var(--alarm-soft, #fae6ef);
  background-image: repeating-linear-gradient(45deg, #a81f5d33 0 3px, transparent 3px 6px);
}
.tl-legend-item.is-gap::before {
  background: transparent;
  border-style: dashed;
}

.tl-body { position: relative; padding: var(--sp-3, 12px); }

.tl-scale {
  position: relative;
  height: 18px;
  margin-left: 72px;
  border-bottom: 1px solid var(--line);
}

.tl-tick {
  position: absolute;
  top: 0;
  left: var(--seg-left, 0%);
  transform: translateX(-50%);
  font: 11px/1 var(--font-mono, monospace);
  color: var(--slate, #5c6672);
  white-space: nowrap;
}
.tl-tick:first-child { transform: translateX(0); }
.tl-tick:last-child { transform: translateX(-100%); }

.tl-tracks { position: relative; }

.tl-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: var(--sp-1, 4px) 0;
}

.tl-row-label {
  font: 12px/1.4 var(--font-display, system-ui);
  color: var(--slate, #5c6672);
  padding-right: var(--sp-2, 8px);
}

.tl-track {
  position: relative;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt, #f7f9f6);
  overflow: hidden;
}

.tl-track-plan { background: #f4f7fb; }
.tl-track-observed { background: #f5f8f4; }

.tl-gaps {
  position: absolute;
  left: 72px;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.tl-gaps .tl-seg { pointer-events: auto; }

.tl-seg {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: var(--seg-left, 0%);
  width: var(--seg-width, 4%);
  min-width: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line-strong, #b3bdb0);
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--ink, #16202b);
  font: 12px/1.25 var(--font-body, system-ui);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.tl-seg:focus-visible {
  outline: 2px solid var(--seal, #16564f);
  outline-offset: 1px;
}

.tl-seg.is-active { box-shadow: inset 0 0 0 2px var(--seal, #16564f); }

.tl-seg-mark { flex: 0 0 auto; font-size: 11px; }

.tl-seg-text { display: block; min-width: 0; overflow: hidden; }
.tl-seg-title,
.tl-seg-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-seg-time { font-size: 11px; color: var(--slate, #5c6672); }
/* 重塑：动线轴面上的“谁负责”。窄块上省略号截断，不换行不撑爆块宽。 */
.tl-seg-staff {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--seal-ink, #1f4d3f); font-weight: 600;
}

/* 状态：颜色 + 纹理 + 标记三重编码 */
.tl-seg.is-planned { background: #dfe7f3; border-style: solid; }
.tl-seg.is-running { background: #cfe3f5; border-color: #7ba7d0; }
.tl-seg.is-paused {
  background: #e6eef7;
  background-image: repeating-linear-gradient(90deg, #7ba7d044 0 2px, transparent 2px 6px);
}
.tl-seg.is-done { background: var(--seal-soft, #e2ede9); border-color: var(--seal-line, #a8ccc4); }
.tl-seg.is-partial {
  background: var(--seal-soft, #e2ede9);
  background-image: repeating-linear-gradient(135deg, #16564f22 0 3px, transparent 3px 7px);
}
.tl-seg.is-overrun {
  background: var(--pending-soft, #fbf0dc);
  border-color: var(--pending, #7a4b00);
  background-image: repeating-linear-gradient(45deg, #d4922a33 0 3px, transparent 3px 6px);
}
.tl-seg.is-interrupted {
  background: var(--alarm-soft, #fae6ef);
  border-color: var(--alarm, #a81f5d);
  border-style: dashed;
  background-image: repeating-linear-gradient(45deg, #a81f5d33 0 3px, transparent 3px 6px);
}
.tl-seg.is-cancelled { background: #eceeea; border-style: dotted; color: var(--slate, #5c6672); }
.tl-seg.is-deferred { background: #f1eee6; border-style: dashed; }

/* ── R43 Plan Editor：区段上的就地编辑控件 ──────────────────────────
 *   边缘手柄：默认几乎不可见（不干扰阅读），悬停轨道 / 聚焦时才显现。
 *   标题输入：点击标题后原地替换，宽度由区段决定，不允许撑破布局。
 */

/*
 * R43 D26 · 触控输入修复：整块拖动面的手势声明。
 *
 * 区段本体是「按住左右拖 = 整块平移」的拖拽面。它的默认 `touch-action: auto`
 * 允许浏览器把这串触摸判给平移：手指一旦越过触摸 slop，浏览器就接管手势、
 * 向页面发 `pointercancel`，产品的 pointercancel 分支随即回滚预览 ——
 * 实测表现是**区段完全不动**（390×844 真实触点：pointerdown 命中
 * SPAN.tl-seg-mark，3 次 pointermove 后 pointercancel，起止时间不变、PATCH 0）。
 *
 * 这里只收紧**需要留给自己的那一维**：`pan-y pinch-zoom` 表示纵向平移与双指
 * 缩放仍交给浏览器，横向手势不再被判给平移，Pointer Events 得以连续送到区段，
 * 于是整块拖动可用、纵向滚动与缩放不受影响。
 *
 * 范围刻意只到 `.tl-seg-plan`（计划轨道的区段）：不改 .tl-track、不改边缘手柄
 * （Grip 自带 `touch-action: none`），也不在 body / 整页上设 none。
 */
.tl-seg-plan { touch-action: pan-y pinch-zoom; }

.tl-seg-grip {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: var(--seg-left, 0%);
  width: 12px;
  margin-left: -6px;
  padding: 0;
  border: 1px solid var(--line-strong, #b3bdb0);
  border-radius: 3px;
  background: var(--surface, #fff);
  color: var(--slate, #5c6672);
  font-size: 9px;
  line-height: 1;
  cursor: ew-resize;
  touch-action: none;
  opacity: 0;
  transition: opacity 120ms linear;
  z-index: 2;
}
.tl-track-plan:hover .tl-seg-grip,
.tl-seg-grip:focus-visible { opacity: 0.75; }
.tl-seg-grip:hover { opacity: 1; }
.tl-seg-grip:focus-visible { outline: 2px solid var(--seal, #16564f); outline-offset: 1px; }
.tl-seg.is-active,
.tl-seg:hover { cursor: grab; }
.tl-seg-title-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: 12px/1.25 var(--font-body, system-ui);
  padding: 1px 3px;
  border: 1px solid var(--seal, #16564f);
  border-radius: 3px;
}
.tl-seg-title-input[hidden] { display: none; }

.tl-seg-gap {
  background: transparent;
  border: 1px dashed var(--line-strong, #b3bdb0);
  color: var(--slate, #5c6672);
}
.tl-seg-gap.is-candidate {
  background-image: repeating-linear-gradient(135deg, #d4922a22 0 3px, transparent 3px 7px);
  border-color: var(--pending, #7a4b00);
}

.tl-now {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(72px + var(--seg-left, 0%));
  width: 0;
  border-left: 2px solid var(--alarm, #a81f5d);
  pointer-events: none;
}

.tl-now.is-hidden { display: none; }

.tl-now-label {
  position: absolute;
  top: -2px;
  left: 3px;
  font: 10px/1 var(--font-mono, monospace);
  color: var(--alarm, #a81f5d);
  background: var(--surface, #fff);
  padding: 1px 3px;
  border-radius: 2px;
}

.tl-empty { padding: var(--sp-2, 8px); }

.tl-detail { margin-top: var(--sp-3, 12px); }

.tl-detail-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px var(--sp-3, 12px);
  margin: var(--sp-2, 8px) 0 0;
}
.tl-detail-list dt { color: var(--slate, #5c6672); font-size: 12px; }
.tl-detail-list dd { margin: 0; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }

.tl-table-body.is-collapsed { display: none; }

/* ---------------------------------------------------------------- 日期导航 */

.date-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-2, 8px);
}

.date-nav .field { margin: 0; }

.date-nav-state {
  font: 12px/1.4 var(--font-mono, monospace);
  color: var(--slate, #5c6672);
}

.date-nav-state.is-today { color: var(--seal, #16564f); }

.org-clock-notice {
  border-bottom: 1px solid var(--seal, #16564f);
  padding-bottom: var(--sp-2, 8px);
  font-size: 13px;
}

/* ---------------------------------------------------------------- 黑洞工作台 */

.bh-queue-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, 8px);
  align-items: flex-end;
}

.bh-queue-filters .field { margin: 0; min-width: 0; }

.bh-row.is-selected { background: var(--seal-soft, #e2ede9); }

.bh-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-2, 8px);
}

.bh-check {
  display: flex;
  gap: var(--sp-2, 8px);
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.bh-check-state { font: 12px/1 var(--font-mono, monospace); flex: 0 0 auto; }
.bh-check-pass { color: var(--seal, #16564f); }
.bh-check-fail { color: var(--alarm, #a81f5d); }

.bh-action-form { border-top: 1px solid var(--line); padding-top: var(--sp-2, 8px); }
.bh-action-form + .bh-action-form { margin-top: var(--sp-3, 12px); }

/* BETA-ENG-003：技术明细折叠面板 */
.bh-tech-panel {
  margin-top: var(--sp-1, 4px);
  padding: var(--sp-2, 8px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt, #f7f9f6);
}

.bh-tech-panel[hidden] { display: none; }

.bh-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-2, 8px);
}

.bh-kv { min-width: 0; }

/* BETA-ENG-003：planId 下拉 */
.bh-plan-select-host select {
  width: 100%;
  max-width: 360px;
}

.bh-plan-error {
  font-size: 12px;
  color: var(--alarm, #a81f5d);
  padding: 4px 0;
}

/* BETA-ENG-003：卡片队列（手机端） */
.bh-card-list { display: none; }

.bh-desktop-table { display: block; }

/* ---------------------------------------------------------------- BETA-ENG-005 */
/* 主从/互斥工作台（R2）：>=1024 双栏主从；<1024 列表/详情互斥。
 * 列表形态（9 列表格 vs 卡片）仍由现有 720 断点决定，互斥只由 1024 决定。
 * 页面级不产生横向溢出：.card table 已 overflow-x:auto，grid 列 minmax(0,1fr)。 */
.bh-workbench-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-3, 12px);
  align-items: start;
}
.bh-list-col, .bh-detail-col { min-width: 0; }
.bh-stale-notice { margin-bottom: var(--sp-2, 8px); }
/* 返回按钮：桌面主从默认隐藏（列表始终可见，无需返回）；<1024 详情互斥时显示。 */
.bh-back-to-list {
  display: none;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
}

/* <1024：列表/详情互斥（默认列表；.bh-mode-detail 时详情独占）。 */
@media (max-width: 1023px) {
  .bh-workbench-split { display: block; }
  .bh-detail-col { display: none; }
  .bh-list-col { display: block; }
  .bh-back-to-list { display: inline-flex; }
  .card.bh-mode-detail .bh-list-col { display: none; }
  .card.bh-mode-detail .bh-detail-col { display: block; }
}

/* 768：9 列表格内部横滚、页面无横滚；不做 sticky 首列。 */
@media (min-width: 721px) and (max-width: 1023px) {
  .bh-workbench-split .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bh-workbench-split .bh-desktop-table table { max-width: 100%; }
}

/* 390：卡片列表、详情互斥、44×44 触控；页面无横滚。 */
@media (max-width: 420px) {
  .bh-detail-grid { grid-template-columns: minmax(0, 1fr); }
}

.bh-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: var(--sp-2, 8px) var(--sp-3, 12px);
  margin-bottom: var(--sp-2, 8px);
  background: var(--surface, #fff);
  min-width: 0;
}

.bh-card.is-selected { background: var(--seal-soft, #e2ede9); }

.bh-card-head {
  justify-content: flex-start;
  gap: var(--sp-1, 4px);
  flex-wrap: wrap;
  margin-bottom: var(--sp-1, 4px);
}

.bh-card-body { min-width: 0; }

.bh-card-summary {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink, #16202b);
  min-width: 0;
  overflow-wrap: anywhere;
}

.bh-card-meta {
  font-size: 12px;
  color: var(--slate, #5c6672);
  min-width: 0;
}

.bh-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2, 8px);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-2, 8px);
  min-width: 0;
}

.bh-card-open {
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- 响应式 */

/*
 * 手机端改为纵向时间轴：区段从绝对定位改回静态流式块，另配左侧时间导轨，
 * 而不是把桌面宽表简单缩小 —— 缩小后的横轴在 390px 上无法点中任何区段。
 */
@media (max-width: 720px) {
  .tl-scale { display: none; }

  .tl-body { padding: var(--sp-2, 8px); }

  .tl-row {
    display: block;
    padding: 0 0 var(--sp-2, 8px);
  }

  .tl-row-label {
    display: block;
    padding: 0 0 4px;
  }

  .tl-track { min-height: 0; overflow: visible; }

  .tl-seg {
    position: static;
    width: auto;
    min-width: 0;
    margin-bottom: 4px;
    padding: 6px 8px;
  }

  .tl-seg-title,
  .tl-seg-time { white-space: normal; }

  /*
   * R43 D26 · 手机竖排下的计划段编辑区（仅 `.tl-seg-plan` 有这些控件）。
   *
   * 竖排后一段就是一行，而 Grip 是 track 的子节点 —— 默认的
   * `top:2px/bottom:2px` 参照的是**整条 track**，于是每个 Grip 跨过全部行、
   * 盖住邻段的 body；相邻段的 end/start Grip 又落在同一个 x、被 DOM 里靠后的
   * 那个抢走命中。这里把手机端的手柄定位盒改成「本段这一行」：
   *   · 纵向用 timeline.mjs 写入的 --grip-y / --grip-h（本段行的 top 与高度）；
   *   · 横向用 --grip-x（本段行的左右边缘），左右各 24px，完整落在行内、互不重叠；
   *   · 行底留出一条 28px 的拖动带（::after），让「整块平移」有真正可触达的位置，
   *     而不是靠行底几像素的侥幸坐标起手。
   * 桌面（>720px）不命中本段规则，车道几何与修复前完全一致。
   */
  .tl-seg-grip {
    top: var(--grip-y, 2px);
    bottom: auto;
    height: var(--grip-h, auto);
    left: var(--grip-x, 0%);
    width: 24px;
    margin-left: 0;
  }

  .tl-seg-grip.is-end { margin-left: -24px; }

  /* 文字块给右侧手柄留出可触宽度，避免标题被压在手柄下面。 */
  .tl-seg-text { max-width: calc(100% - 28px); }

  /* 行底的拖动带：属于本段的空白区，命中即整块平移（带一条极淡的提示线）。 */
  .tl-seg-plan {
    flex-wrap: wrap;
    padding-bottom: 4px;
  }

  .tl-seg-plan::after {
    content: '';
    flex: 1 0 100%;
    height: 28px;
    background-image: linear-gradient(
      to right,
      transparent,
      var(--line, #d8ded6) 20%,
      var(--line, #d8ded6) 80%,
      transparent
    );
    background-repeat: no-repeat;
    background-position: center;
    background-size: 56% 2px;
  }

  .tl-gaps {
    position: static;
    pointer-events: auto;
  }

  .tl-now { display: none; }

  .tl-detail-list { grid-template-columns: minmax(0, 1fr); }
  .tl-detail-list dt { margin-top: 6px; }

  .date-nav { gap: var(--sp-1, 4px); }
}

/* 超窄屏：任何可能的横向溢出都在这里被兜住。 */
@media (max-width: 420px) {
  .tl-head { flex-direction: column; align-items: flex-start; }
  .tl-legend { font-size: 11px; }
}

/* BETA-ENG-003：≤720px 手机队列卡片化，隐藏桌面表格 */
@media (max-width: 720px) {
  .bh-desktop-table { display: none; }
  .bh-card-list { display: block; }
  .bh-card-open { min-height: 44px; min-width: 44px; }
  .bh-queue-open { min-height: 44px; min-width: 44px; }
  .bh-plan-select-host select { max-width: 100%; }
}

@media print {
  .tl-now { display: none; }
  .tl-seg { border-style: solid; }
}

/* ---------------------------------------------------------------- */
/* R42：宽表不得把页面撑出横向溢出。工作台队列、治理表等在卡片内滚动，   */
/* 页面级（body）永远只出现纵向滚动。三视口（1440/768/390）均适用。     */
/* ---------------------------------------------------------------- */
.card { min-width: 0; }
.card table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* 表单行在窄视口与字段较多时换行，而不是把页面撑出横向滚动。 */
.card .row,
.page-head .row {
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- */
/* PRE-BETA UX-03：就地编辑的排程表（真实 <table>）。                  */
/*                                                                  */
/* 这里曾经是一串用 grid 排的 <div>，放在另一张「排程调整（助教）」卡里。*/
/* 现在它就是「计划与执行」卡里那一张表：三栏（计划时间 / 内容 / 操作），  */
/* 有权限时单元格变成输入控件。Q-027 起内容栏收拢标题、类型与事实摘要。     */
/* 窄视口不换行、不重排：整张表在 .table-scroll 内横向滚动，            */
/* 页面级（body）永远只有纵向滚动。                                     */
/* ---------------------------------------------------------------- */
.wys-table { min-width: 860px; width: 100%; table-layout: fixed; }
.wys-table th:nth-child(1), .wys-table td.wys-cell-time { width: 30%; }
.wys-table th:nth-child(2), .wys-table td.wys-cell-content { width: 46%; }
.wys-table th:nth-child(3), .wys-table td.wys-cell-ops { width: 24%; }
/* Q-025：操作列粘性固定在右缘 —— 默认视口再窄，「更多操作」也永远看得见、点得到；
   横向滚动只发生在内容区，不再把操作列带出视口。 */
.wys-table th:last-child, .wys-table td.wys-cell-ops {
  position: sticky; right: 0; background: #fff;
  box-shadow: -6px 0 8px -6px rgba(20, 80, 60, 0.25);
}
.wys-content-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wys-content-head .wys-title { flex: 1 1 160px; }
.wys-content-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.wys-content-meta .wys-duration { margin-right: 2px; }
.wys-actions-for { flex-basis: 100%; margin: 0; color: #145a50; }
/* 展开的操作区用左缘色带点名归属，不再与上下行脱节（Q-027）。 */
.wys-action-row > td { border-left: 4px solid #145a50; }
.wys-table td { vertical-align: middle; }
.wys-time-cell { display: flex; align-items: center; gap: 4px; }
/* 起止时刻已由两个 time 输入框表达，纯文本区间只留给读屏与文本抽取。 */
.wys-time-range { display: none; }
.wys-row.is-cancelled { opacity: 0.55; }
.wys-row.is-fixed td:first-child { box-shadow: inset 3px 0 0 var(--warn, #b7791f); }
.wys-row.is-dragging { outline: 2px dashed var(--accent, #2563eb); outline-offset: -2px; }
.wys-handle {
  cursor: grab;
  touch-action: none;
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  padding: 6px 4px;
  min-width: 28px;
  min-height: 36px;
  color: var(--muted, #666);
}
.wys-handle.is-active { cursor: grabbing; color: var(--accent, #2563eb); }
/*
 * R43 计划时间控件：用户操作的是**两个真实选择器**（小时 / 分钟），
 * `.wys-time` 退化为隐藏的值载体（承载 canonical HH:MM 与既有 data-* 钩子）。
 * 隐藏必须写成 `[hidden]`：上面 `.wys-time` 设了固定宽度，同权重靠顺序取胜。
 */
.wys-time[hidden] { display: none; }
.wys-time-picker { display: inline-flex; align-items: center; gap: 2px; }
.wys-time-picker select { min-width: 0; box-sizing: border-box; }
.wys-time-picker .wys-time-hour { width: 58px; }
.wys-time-picker .wys-time-minute { width: 64px; }
.wys-time-sep { color: var(--muted, #666); font-weight: 600; }
/* 历史非标值（如 20:03）以「原值」标出：它不在档位上是**有原因的**，不该看起来像 bug。 */
.wys-time-picker .is-legacy { color: #936114; }
/*
 * R43：「保存时段」不再是真实 UI 步骤（时间改完即入本地缓冲）。保留它只是为了
 * 既有脚本仍能用 `data-wys-save-time` 触发同一条入缓冲路径，因此在页面上不可见。
 * 必须写成 `[hidden]`：上面 `display: block` 与 `[hidden]` 同权重，靠顺序取胜。
 */
.wys-save-time[hidden] { display: none; }
.wys-duration { width: 66px; min-width: 0; box-sizing: border-box; margin-right: 3px; }
.wys-cell-expected { white-space: nowrap; }
.wys-title { width: 100%; min-width: 0; box-sizing: border-box; }
.wys-kind { width: 100%; max-width: 100%; }
/*
 * R43 活动类型：可输入选择器。候选走浏览器原生 datalist 下拉，
 * 输入框本身是自由文本 —— 列表里没有的词也能敲进去，不会被拦下。
 * 提示行说明「新词会被归到哪个内部类型」，让「统计口径」这件事在界面上可见。
 */
.wys-kind-hint { display: block; width: 100%; color: #145a50; }
.wys-action-row[hidden] { display: none; }
.wys-action-row > td { background: #f3f8f5; padding: 12px 18px; }
.wys-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wys-actions .btn { width: auto; min-width: 92px; text-align: center; white-space: nowrap; }
.wys-more-trigger { white-space: nowrap; }
.wys-insert-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end; gap: 10px; white-space: normal; padding: 12px 0 0; }
.wys-insert-form > strong, .wys-insert-form > .wys-insert-buttons { grid-column: 1 / -1; }
.wys-insert-form[hidden] { display: none; }
.wys-insert-form label { display: grid; gap: 2px; font-size: 12px; }
.wys-insert-form input, .wys-insert-form select { width: 100%; min-width: 0; box-sizing: border-box; }
/* R43：插入表单里的小时 / 分钟选择器平分所在列宽，不撑破 4 列网格。 */
.wys-insert-form .wys-time-picker { width: 100%; }
.wys-insert-form .wys-time-picker select { flex: 1 1 0; width: auto; }
.wys-insert-form .wys-insert-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.wys-help { margin-top: 12px; color: var(--muted, #666); }
.wys-help summary { cursor: pointer; }
.wys-cell-actions { white-space: nowrap; }
.wys-change-list { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 4px; }
.wys-change-link { border: 0; padding: 3px 0; color: #145a50; background: transparent;
  text-align: left; font: inherit; text-decoration: underline; cursor: pointer; }
.wys-change-link:focus-visible { outline: 2px solid #145a50; outline-offset: 2px; }
.wys-row.is-edited > td { background: #f8faf0; }
.wys-time-dirty { display: inline-block; margin: 3px 0 0 25px; color: #936114;
  font-size: 11px; font-weight: 600; white-space: nowrap; }
.wys-class-fields { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.wys-class-fields[hidden] { display: none; }
.wys-insert-form label[hidden], .wys-axis-fields label[hidden] { display: none; }
.wys-class-fields label { display: grid; gap: 3px; min-width: min(160px, 100%); }
.wys-class-fields > p { flex-basis: 100%; margin: 0; }
.wys-published-notice { border-left: 4px solid #145a50; }
.wys-published-notice p { margin-bottom: 0; }
.wys-axis-label { margin: 0 0 8px; color: #145a50; font-weight: 650; }
.wys-axis-label.is-pending { color: #814b00; }
.wys-axis-panel { padding: 10px 12px; border: 1px solid #dbe5df;
  border-top: 0; border-radius: 0 0 8px 8px; background: #f6f9f7; }
.wys-axis-panel > p { margin: 0; }
.wys-axis-label + .tl .tl-track-plan { cursor: crosshair; }
.wys-axis-label + .tl .tl-track-plan:focus-visible { outline: 2px solid #145a50; outline-offset: 2px; }
/* R43：拖动边界已由时间轴自己渲染（.tl-seg-grip），旧的面板附件样式随之删除。 */
.wys-axis-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 9px; align-items: end; min-width: 0; }
.wys-axis-fields > strong { grid-column: 1 / -1; }
.wys-axis-fields > label { display: grid; gap: 3px; min-width: 0; font-size: 12px; }
.wys-axis-fields input[type="time"] { width: 118px; }
.wys-axis-fields input[type="number"] { width: 90px; }
.wys-axis-fields input[type="text"] { min-width: 190px; max-width: 100%; }
.wys-axis-fields > .btn { min-height: 36px; }
.wys-axis-fields > output, .wys-axis-fields > [role="status"] { align-self: center; }
.wys-axis-fields input, .wys-axis-fields select { max-width: 100%; box-sizing: border-box; }
@media (max-width: 640px) {
  .wys-insert-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wys-axis-fields > label { flex: 1 1 120px; }
}

.time-plan-workflow {
  padding: 18px clamp(16px, 2vw, 24px);
  background: #fff;
  border: 1px solid #ccd9d1;
  border-left: 4px solid #145a50;
  border-radius: 12px;
}
.time-plan-workflow-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.time-plan-workflow h2 { margin: 2px 0 0; font-size: clamp(20px, 1.6vw, 26px); }
.time-plan-workflow > p { margin: 8px 0; }
.time-plan-workflow .time-plan-actions { padding: 10px 0 0; border: 0; }
.time-day-type { padding: 12px 0; border-block: 1px solid #e3eae6; }
.time-day-type-copy { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.time-day-type > p { margin: 6px 0; }
.time-day-type-exceptions { margin-top: 10px; }
.time-day-type-exceptions > summary { cursor: pointer; color: #145a50; font-weight: 600; }
.time-day-type-actions { align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.time-day-type-actions select { min-height: 38px; max-width: 100%; }
.time-day-type .notice { margin-top: 10px; }
.time-plan-actions { align-items: center; flex-wrap: wrap; gap: 10px; }
.time-date-panel { padding: 18px 22px; border-radius: 12px; background: #f6f9f6; border: 1px solid #dbe5df; }
.time-date-panel > p { margin: 6px 0 12px; }

/* PRE-BETA UX-04：计划行状态 = 时间位置 × 完成事实（例如「已过去 · 未记录」）。
   两段文字必须一起读，折行会把「未记录」和它的时间位置拆开。 */
.tag-plan-state { white-space: nowrap; }

/* 机构时间安排：把每日工作与低频治理区分成清晰的阅读层级。 */
.time-desk {
  --time-ink: #18322e;
  --time-line: #dbe5df;
  --time-wash: #f3f8f5;
  width: 100%;
  max-width: 1520px;
  margin-inline: auto;
  padding-bottom: var(--sp-8);
}

.time-desk .time-page-head {
  margin: 0;
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--time-line);
  border-radius: 10px;
  background: linear-gradient(110deg, #eef5f0, #f9fbf9 72%);
}
.time-page-head h1 { margin: var(--sp-3) 0 var(--sp-2); font-size: 28px; color: var(--time-ink); }
.time-page-head p { max-width: 76ch; margin: 0; line-height: 1.6; }
.time-page-head .eyebrow { max-width: 520px; }

.time-desk .card {
  border-color: var(--time-line);
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(24, 50, 46, .035);
}
.time-desk .card-head { margin-bottom: var(--sp-3); }
.time-desk .card-head h2 { font-size: 17px; color: var(--time-ink); }
.time-desk .card > .small.muted { max-width: 82ch; line-height: 1.65; }

.time-context-card { background: #fff; }
.time-context-fields {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(350px, 1.5fr);
  gap: var(--sp-6);
  align-items: start;
}
.time-context-block { min-width: 0; }
.time-context-label,
.time-summary-title {
  margin-bottom: var(--sp-2);
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
}
.time-context-card .student-picker select { width: 100%; min-height: 40px; }
.time-context-card .student-picker input[type="search"] { width: 100%; }
.time-context-card .student-picker .row:first-child { margin-bottom: var(--sp-2); }
.time-context-card .date-nav { gap: var(--sp-2); }
.time-context-card .date-nav-state { width: 100%; }

.time-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--time-line);
  border-radius: 9px;
  background: #eaf1ec;
}
.time-jump-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--time-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.time-jump-nav button:hover,
.time-jump-nav button:focus-visible { background: #fff; }
.time-desk [id^="time-"] { scroll-margin-top: 100px; }

.time-section-head { margin: var(--sp-5) 0 var(--sp-3); }
.time-section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--time-ink);
  font-size: 19px;
}
.time-section-head h2::before {
  content: '';
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--seal);
  flex: none;
}
.time-section-head p { margin: 5px 0 0 14px; }
.time-student-detail > .time-section-head:first-child { margin-top: var(--sp-3); }
.time-empty-state {
  margin: 0;
  padding: var(--sp-5);
  border: 1px dashed var(--time-line);
  border-radius: 10px;
  background: var(--time-wash);
  color: var(--slate);
}

.time-overview,
.time-panel-grid,
.time-governance-grid { display: grid; gap: var(--sp-4); align-items: start; }
.time-overview { grid-template-columns: minmax(320px, .9fr) minmax(0, 1.5fr); }
.time-panel-grid,
.time-governance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.time-overview > *,
.time-panel-grid > *,
.time-governance-grid > * { min-width: 0; }
.time-overview > .card,
.time-overview > .time-summary-card { height: 100%; }

.time-summary-card {
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--time-line);
  border-radius: 10px;
  background: #fff;
}
/* 列数必须随可用宽度自适应，不能写死 4 等分。
   之前是 `repeat(4, minmax(0,1fr))` + 值 `white-space: nowrap`，而这张卡在
   .time-overview 的第一列里最窄只有 260px —— 4 等分后每格约 65px，
   「未记录 840 分钟」放不下，又因为容器 overflow:hidden 被**裁掉**，
   表现为「显示不全」。auto-fit 让窄屏自动降到 2 列，而不是把数字切一半。 */
.time-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 1px; background: var(--time-line); border-radius: 6px; overflow: hidden; }
.time-metric { min-width: 0; padding: var(--sp-2) var(--sp-3); background: var(--time-wash); }
/* 值允许换行：数字再长也必须能读全，而不是被裁掉或横向溢出到相邻卡片。 */
.time-metric-value { margin-top: 3px; font-size: clamp(14px, 1.3vw, 18px); font-weight: 700; color: var(--time-ink); white-space: normal; overflow-wrap: anywhere; }
.time-metric-label { white-space: normal; overflow-wrap: anywhere; }
.time-metric.is-accent .time-metric-value { color: var(--seal); }
.time-metric.is-pending .time-metric-value { color: var(--pending); }
.time-summary-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); min-width: 0; }
/* chip 也要能换行：标签文案变长时不应把整行撑出卡片。 */
.time-summary-meta .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.time-plan-actions { padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px solid var(--time-line); }
.time-plan-actions .btn:first-child:not(.btn-primary) { border-color: var(--seal); color: var(--seal); }
.time-desk .table th { background: #f7faf8; }
.time-desk .table tbody tr:hover { background: #f3f8f5; }

@media (max-width: 1180px) {
  .time-overview { grid-template-columns: minmax(0, 1fr); }
  /* 列数交给 auto-fit，这里不再覆盖 —— 覆盖会把窄屏又拉回 4 等分。 */
}
@media (max-width: 980px) {
  .time-context-fields,
  .time-panel-grid,
  .time-governance-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .time-desk .time-page-head { padding: var(--sp-4); }
  .time-desk .card { padding: var(--sp-4); }
  .time-jump-nav { width: 100%; }
  .time-jump-nav button { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .time-summary-card { padding: var(--sp-4); }
  .time-metric-value { font-size: 16px; }
  .time-section-head { margin-top: var(--sp-5); }
}

/* 机构入口：任务卡片 → 年级/校区 → 有界学生结果 → 日期与计划。 */
.time-hub { max-width: 1200px; margin-inline: auto; }
.time-hub-head { padding: 20px 0 28px; }
.time-hub-kicker { color: var(--seal); font-size: 12px; letter-spacing: .12em; font-weight: 750; }
.time-hub-head h1 { font-size: clamp(30px, 3.2vw, 46px); margin: 8px 0 10px; }
.time-hub-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.time-hub-mode {
  display: block; text-align: left; min-width: 0; min-height: 218px; padding: 24px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink); cursor: pointer; box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.time-hub-mode:hover, .time-hub-mode:focus-visible {
  transform: translateY(-2px); border-color: var(--seal); box-shadow: 0 12px 28px -15px #16564f66;
}
.time-hub-mode > span { display: flex; flex-direction: column; align-items: flex-start; height: 100%; gap: 12px; }
.time-hub-mode strong { font-size: clamp(20px, 2vw, 27px); line-height: 1.25; }
.time-hub-mode .time-hub-index { font: 700 13px/1 var(--font-mono); color: var(--seal); }
.time-hub-mode .time-hub-arrow { margin-top: auto; font-size: 24px; color: var(--seal); }
.time-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.time-breadcrumb strong { font-size: 22px; }
.time-hub-filters, .time-hub-results, .time-date-panel {
  min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.time-hub-filters { display: grid; gap: 18px; }
.time-facet-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.time-facet-head h2, .time-facet-section h2 { font-size: 16px; }
.time-facet-section { display: grid; gap: 10px; }
.time-facet-grid, .time-student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.time-facet, .time-student-option {
  min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  text-align: left; background: var(--surface-alt); cursor: pointer;
}
.time-facet:hover, .time-student-option:hover, .time-facet.is-active {
  border-color: var(--seal); background: var(--seal-soft);
}
.time-facet > span, .time-student-option > span { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.time-facet span span, .time-student-option small { color: var(--slate); font-size: 12px; }
.time-facet-note { margin: 0; }
.time-hub-search { display: flex; flex-wrap: wrap; gap: 10px; }
.time-hub-search input { flex: 1 1 250px; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 7px; }
.time-student-grid { margin: 16px 0; }
.time-student-option { min-height: 76px; background: #fff; }
.time-student-option > span { flex-direction: column; gap: 2px; }
.time-student-option strong { font-size: 17px; }
.time-student-identity { padding: 18px 22px; border-left: 5px solid var(--seal); border-radius: 8px; background: #fff; }
.time-student-identity h1 { font-size: clamp(23px, 2.5vw, 32px); margin: 6px 0 10px; }
.time-student-workspace, .time-student-detail { min-width: 0; }
.time-date-panel { display: grid; gap: 8px; }
@media (max-width: 920px) { .time-hub-modes { grid-template-columns: 1fr; } .time-hub-mode { min-height: 150px; } }
@media (max-width: 600px) {
  .time-hub-filters, .time-hub-results, .time-date-panel { padding: 16px; }
  .time-hub-mode { padding: 18px; }
  .time-facet-grid, .time-student-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
}
