:root {
  /* Soft SaaS surfaces */
  /* 统一浅灰底：相对原选中灰 #eef0f3 浓度约 60%（更靠白） */
  --surface-muted: #f5f6f8;
  --bg: var(--surface-muted);
  --surface: #ffffff;
  --surface-soft: var(--surface-muted);
  --surface-hover: var(--surface-muted);
  --line: #eceef2;
  --line-strong: var(--line);
  --text: #14161a;
  --text-done: #9ca3af;
  --muted: #9ca3af;
  /* 主强调：近黑（对齐参考图主按钮/勾选） */
  --accent: #14161a;
  --accent-hover: #2a2e36;
  --accent-soft: var(--surface-muted);
  --accent-ring: rgba(20, 22, 26, 0.12);
  --accent-text: #14161a;
  /* 交互蓝：链接 / 蓝 CTA / focus·选中 */
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --link-soft: #eef4ff;
  --link-text: #1e3a8a;
  /* 选区/focus 亮边：由 link 混白，不再单独养亮蓝 */
  --link-focus: color-mix(in srgb, var(--link) 55%, #fff);
  --ok: #16a34a;
  --ok-soft: #e8f8ee;
  --green: var(--ok);
  --green-soft: var(--ok-soft);
  --orange: #ea580c;
  --orange-soft: #fff1e7;
  /* P2 / 提示琥珀 */
  --amber: #a16207;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  /* 深错误底（toast / 暂停强样式字色） */
  --red-deep: color-mix(in srgb, var(--red) 72%, #000);
  --gray-soft: var(--surface-muted);
  --radius: 1px;
  --radius-sm: 1px;
  --radius-lg: 1px;
  /* 控件圆角：与筛选组织下拉（.cselect-trigger）一致 */
  --radius-control: 1px;
  /* 用户头像圆角 */
  --radius-avatar: 5px;
  --font: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --fs-display: 22px;
  --fs-title: 16px;
  --fs-body: 13px;
  --shadow: none;
  --shadow-card: none;
  --shadow-float: none;
  /* 阶段 4 档：未开始 / 进行中 / 验收 / 上线·暂停（类名仍用 sch-*，色相并入档位） */
  --sch-tier-idle-fg: #5a6b7d;
  --sch-tier-idle-bg: var(--surface-muted);
  --sch-tier-idle-strong-fg: #334155;
  --sch-tier-idle-strong-bg: color-mix(in srgb, var(--sch-tier-idle-strong-fg) 16%, #fff);
  --sch-tier-idle-bar: color-mix(in srgb, var(--sch-tier-idle-strong-fg) 12%, #fff);

  --sch-tier-active-fg: var(--link-text);
  --sch-tier-active-bg: var(--link-soft);
  --sch-tier-active-strong-fg: var(--link-hover);
  --sch-tier-active-strong-bg: color-mix(in srgb, var(--link) 16%, #fff);
  --sch-tier-active-bar: color-mix(in srgb, var(--link) 20%, #fff);

  --sch-tier-review-fg: var(--ok);
  --sch-tier-review-bg: var(--ok-soft);
  --sch-tier-review-strong-fg: color-mix(in srgb, var(--ok) 82%, #000);
  --sch-tier-review-strong-bg: color-mix(in srgb, var(--ok) 16%, #fff);
  --sch-tier-review-bar: color-mix(in srgb, var(--ok) 20%, #fff);

  --sch-tier-live-fg: color-mix(in srgb, var(--ok) 72%, #000);
  --sch-tier-live-bg: var(--ok-soft);
  --sch-tier-live-strong-fg: color-mix(in srgb, var(--ok) 88%, #000);
  --sch-tier-live-strong-bg: color-mix(in srgb, var(--ok) 26%, #fff);
  --sch-tier-live-bar: color-mix(in srgb, var(--ok) 28%, #fff);

  --sch-tier-pause-fg: color-mix(in srgb, var(--red) 55%, #6b7280);
  --sch-tier-pause-bg: var(--red-soft);
  --sch-tier-pause-strong-fg: var(--red-deep);
  --sch-tier-pause-strong-bg: color-mix(in srgb, var(--red) 14%, #fff);
  --sch-tier-pause-bar: var(--red-soft);

  /* 甘特任务条：12 色柔和色块（排期 / Word 内嵌共用） */
  --gantt-bar-0: #daeede;
  --gantt-bar-1: #f0e9d7;
  --gantt-bar-2: #d2f1ef;
  --gantt-bar-3: #f4e3e3;
  --gantt-bar-4: #f5ecc2;
  --gantt-bar-5: #ddebbc;
  --gantt-bar-6: #e9d8f2;
  --gantt-bar-7: #d1deef;
  --gantt-bar-8: #f3d3e0;
  --gantt-bar-9: #e5ecd8;
  --gantt-bar-10: #fef9c3;
  --gantt-bar-11: #d5e7fd;

  /* 业务阶段别名 → 4 档（JS/class 名不变） */
  --sch-pending-fg: var(--sch-tier-idle-fg);
  --sch-pending-bg: var(--sch-tier-idle-bg);
  --sch-pending-strong-fg: var(--sch-tier-idle-strong-fg);
  --sch-pending-strong-bg: var(--sch-tier-idle-strong-bg);
  --sch-pending-bar: var(--sch-tier-idle-bar);

  --sch-ui-fg: var(--sch-tier-active-fg);
  --sch-ui-bg: var(--sch-tier-active-bg);
  --sch-ui-strong-fg: var(--sch-tier-active-strong-fg);
  --sch-ui-strong-bg: var(--sch-tier-active-strong-bg);
  --sch-ui-bar: var(--sch-tier-active-bar);
  --sch-client-fg: var(--sch-tier-active-fg);
  --sch-client-bg: var(--sch-tier-active-bg);
  --sch-client-strong-fg: var(--sch-tier-active-strong-fg);
  --sch-client-strong-bg: var(--sch-tier-active-strong-bg);
  --sch-client-bar: var(--sch-tier-active-bar);
  --sch-fe-fg: var(--sch-tier-active-fg);
  --sch-fe-bg: var(--sch-tier-active-bg);
  --sch-fe-strong-fg: var(--sch-tier-active-strong-fg);
  --sch-fe-strong-bg: var(--sch-tier-active-strong-bg);
  --sch-fe-bar: var(--sch-tier-active-bar);
  --sch-dev-fg: var(--sch-tier-active-fg);
  --sch-dev-bg: var(--sch-tier-active-bg);
  --sch-dev-strong-fg: var(--sch-tier-active-strong-fg);
  --sch-dev-strong-bg: var(--sch-tier-active-strong-bg);
  --sch-dev-bar: var(--sch-tier-active-bar);

  --sch-test-fg: var(--sch-tier-review-fg);
  --sch-test-bg: var(--sch-tier-review-bg);
  --sch-test-strong-fg: var(--sch-tier-review-strong-fg);
  --sch-test-strong-bg: var(--sch-tier-review-strong-bg);
  --sch-test-bar: var(--sch-tier-review-bar);

  --sch-live-fg: var(--sch-tier-live-fg);
  --sch-live-bg: var(--sch-tier-live-bg);
  --sch-live-strong-fg: var(--sch-tier-live-strong-fg);
  --sch-live-strong-bg: var(--sch-tier-live-strong-bg);
  --sch-live-bar: var(--sch-tier-live-bar);

  --sch-pause-fg: var(--sch-tier-pause-fg);
  --sch-pause-bg: var(--sch-tier-pause-bg);
  --sch-pause-strong-fg: var(--sch-tier-pause-strong-fg);
  --sch-pause-strong-bg: var(--sch-tier-pause-strong-bg);
  --sch-pause-bar: var(--sch-tier-pause-bar);

  /* 雷达六态 + 旧 S* 兼容 */
  --stage-REQ: var(--sch-tier-idle-strong-fg);
  --stage-UI: var(--sch-tier-active-strong-fg);
  --stage-DEV: var(--sch-tier-active-strong-fg);
  --stage-TEST: var(--sch-tier-active-fg);
  --stage-ACCEPT: var(--sch-tier-review-fg);
  --stage-LIVE: var(--sch-tier-live-strong-fg);
  --stage-S0: var(--stage-REQ);
  --stage-S1: var(--stage-REQ);
  --stage-S2: var(--stage-REQ);
  --stage-S3: var(--stage-DEV);
  --stage-S4: var(--stage-DEV);
  --stage-S5: var(--stage-TEST);
  --stage-S6: var(--stage-ACCEPT);
  --stage-S7: var(--stage-LIVE);
  --stage-S8: var(--stage-LIVE);
  --stage-S9: var(--sch-tier-pause-strong-fg);
  /* 极淡几何纹理（circuit / blueprint） */
  --bg-pattern:
    radial-gradient(circle at 1px 1px, rgba(15, 17, 21, 0.045) 1px, transparent 0),
    linear-gradient(90deg, rgba(15, 17, 21, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(15, 17, 21, 0.02) 1px, transparent 1px);
  --bg-pattern-size: 24px 24px, 48px 48px, 48px 48px;
}

* { box-sizing: border-box; }

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  vertical-align: middle;
  flex-shrink: 0;
}
input[type="checkbox"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M10.2 2.6 4.6 8.2 1.8 5.4l-.8.8 3.6 3.6 6.4-6.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  background-size: var(--bg-pattern-size);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, strong, b {
  font-weight: 600;
}

.page {
  min-height: 100vh;
  padding-top: 60px;
}

.skranji-bold {
  font-family: "Skranji", system-ui;
  font-weight: 700;
  font-style: normal;
}

/* —— Top bar（全站统一 Soft）—— */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* 高于排期侧栏/组织下拉等（80–400），避免导航下拉被盖住 */
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  height: 60px;
  padding: 0 100px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  font-weight: 400;
}
/* 顶栏内文字一律常规字重（含导航/下拉/用户菜单/按钮） */
.topbar :where(
  .nav-link,
  .nav-link.is-active,
  .nav-dropdown-item,
  .nav-dropdown-item.is-active,
  .user-chip,
  .user-chip-menu-item,
  .btn,
  a.btn,
  label.btn
) {
  font-weight: 400;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}

.brand-logo {
  display: block;
  height: auto;
  width: auto;
  max-height: 22px;
  max-width: 176px;
  object-fit: contain;
}

.brand-logo-login {
  max-height: 32px;
  max-width: 256px;
  margin: 0 auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px; /* 原 2px，加大为 2 倍 */
  flex-shrink: 0;
}

.top-nav .nav-link[hidden] {
  display: none !important;
}

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  cursor: pointer;
  gap: 5px;
  padding-right: 12px;
}

.nav-dropdown-label {
  display: inline-block;
}

.nav-dropdown-caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-top: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top:5px solid var(--line);
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-dropdown-trigger:hover .nav-dropdown-caret,
.nav-dropdown.is-active .nav-dropdown-caret {
  border-top-color:var(--line);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 2100;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 1px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-dropdown-item.is-active {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 400;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-link.is-active {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 400;
}

/* —— Layout —— */
.layout {
  width: 100%;
  padding: 24px 28px 40px;
}

.date-input {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: var(--fs-body);
}

.btn,
a.btn,
label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 0 16px;
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none !important;
  box-sizing: border-box;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

a.btn:visited,
a.btn:hover,
a.btn:active,
a.btn:focus {
  text-decoration: none !important;
  color: inherit;
}

.btn:hover,
a.btn:hover,
label.btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  text-decoration: none !important;
}

.btn-primary,
a.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff !important;
  text-decoration: none !important;
  box-shadow: none;
}

.btn-primary:hover,
a.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff !important;
  text-decoration: none !important;
}

.btn-danger,
a.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff !important;
  text-decoration: none !important;
}

.btn-danger:hover,
a.btn-danger:hover {
  background: color-mix(in srgb, var(--red) 88%, #000);
  border-color: color-mix(in srgb, var(--red) 88%, #000);
  color: #ffffff !important;
  text-decoration: none !important;
}

.btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* —— Stage pills —— */
.org-bar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.org-bar-row .stage-bar {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 0;
}

.stage-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stage-pill {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 5px 10px;
  color: var(--muted);
  font-size: var(--fs-body);
}

.stage-pill .stage-count {
  color: var(--text);
  font-size: var(--fs-title);
}

.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.job-hint {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-body);
  flex: 1 1 auto;
  min-width: 0;
}

.group-search {
  appearance: none;
  flex: 0 0 180px;
  width: 180px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.group-search::placeholder {
  color: #9ca3af;
}

.group-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.group-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* —— Cards (Soft SaaS) —— */
.project-grid {
  column-width: 320px;
  column-gap: 16px;
  width: 100%;
}

.project-load-state {
  display: block;
  column-span: all;
  margin: 4px 0 18px;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.card {
  display: inline-block;
  width: 100%;
  max-width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--line-strong);
}

/* 左侧条：与「当前节点」同色（浅彩） */
.card.stage-bar-REQ::before { background: var(--stage-REQ); }
.card.stage-bar-UI::before { background: var(--stage-UI); }
.card.stage-bar-DEV::before { background: var(--stage-DEV); }
.card.stage-bar-TEST::before { background: var(--stage-TEST); }
.card.stage-bar-ACCEPT::before { background: var(--stage-ACCEPT); }
.card.stage-bar-LIVE::before { background: var(--stage-LIVE); }
.card.stage-bar-S0::before { background: var(--stage-S0); }
.card.stage-bar-S1::before { background: var(--stage-S1); }
.card.stage-bar-S2::before { background: var(--stage-S2); }
.card.stage-bar-S3::before { background: var(--stage-S3); }
.card.stage-bar-S4::before { background: var(--stage-S4); }
.card.stage-bar-S5::before { background: var(--stage-S5); }
.card.stage-bar-S6::before { background: var(--stage-S6); }
.card.stage-bar-S7::before { background: var(--stage-S7); }
.card.stage-bar-S8::before { background: var(--stage-S8); }
.card.stage-bar-S9::before { background: var(--stage-S9); }

.card:hover {
  border-color: var(--line-strong);
  box-shadow: none;
  transform: translateY(-1px);
}

.card-inner {
  padding: 16px 16px 16px 18px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-control);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--surface-soft);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.badge.on_track {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 18%, transparent);
}

.badge.at_risk,
.badge.slipping {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 18%, transparent);
}

.badge.blocked {
  background: var(--red-soft);
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 18%, transparent);
}

.badge.unknown {
  background: var(--surface-soft);
  color: var(--muted);
  border-color: var(--line);
}

.card-metrics {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.metric-main {
  display: grid;
  gap: 2px;
}

.metric-value {
  font-size: var(--fs-title);
  color: var(--text);
}

.metric-label {
  font-size: var(--fs-body);
  color: var(--muted);
}

.metric-side {
  text-align: right;
}

.card-panel {
  background: var(--surface-soft);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow: hidden;
  max-width: 100%;
}

/* 雷达页：白底 + 顶栏与其他页一致（schedule-topbar） */
body.radar-app,
body.radar-app .page {
  background: #fff;
}

body.radar-app .page {
  padding-top: 0;
}

body.radar-app .card-panel {
  /* 相对 --surface-muted 灰度 60%，更靠白 */
  background: color-mix(in srgb, var(--surface-muted) 60%, #fff);
}

/* TG 社区追踪：群列表卡片 */
body.radar-app .project-grid .card {
  border-radius: 12px;
  /* 投影收紧，避免大模糊铺太开 */
  box-shadow: 0 2px 8px rgba(15, 17, 21, 0.06), 0 1px 2px rgba(15, 17, 21, 0.04);
}
body.radar-app .project-grid .card:hover {
  box-shadow: 0 4px 12px rgba(15, 17, 21, 0.08), 0 1px 2px rgba(15, 17, 21, 0.04);
}

body.radar-app .card-rows li {
  min-height: 28px;
  line-height: 28px;
}

.card-panel-title {
  margin: 0 0 8px;
  font-size: var(--fs-body);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.card-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-rows li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  min-height: 23px;
  line-height: 23px;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
  color: var(--text);
  overflow: hidden;
}

.card-rows .row-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  word-break: break-word;
}

.card-rows li:last-child {
  border-bottom: 0;
}

.row-meta {
  flex-shrink: 0;
  color: var(--muted);
}

.card-panel-empty {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-body);
}

.card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: var(--fs-body);
}

/* —— Centered modal —— */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  top: 56px; /* 避开吸顶顶栏 */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1900; /* 低于顶栏(2000)，高于页面内浮层；遮罩从顶栏下方铺开 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
}
#workAssigneeModal {
  z-index: 1950; /* 叠在权限设置弹窗之上 */
}

body.modal-open {
  overflow: hidden;
}

/* 弹窗打开时压低页面内自定义下拉，避免浮在遮罩之上 */
body.modal-open .cselect:not(.cselect--chip),
body.modal-open .cselect-menu:not(.cselect-menu--chip),
body.modal-open .collector-bar,
body.modal-open .bindings-toolbar,
body.modal-open .sch-risk-rail,
body.modal-open .sch-risk-org {
  z-index: 1 !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.4);
}

body.radar-app #drawer {
  padding: 10px 6%;
}

body.radar-app #drawer .modal-panel {
  width: 100%;
  max-width: none;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  height: calc(100vh - 60px - 24px);
  max-height: calc(100vh - 60px - 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-title-line {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.drawer-chat-search {
  appearance: none;
  width: 168px;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-body);
  outline: none;
  box-shadow: none;
}

.drawer-chat-search::placeholder {
  color: #9ca3af;
}

.drawer-chat-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.drawer-chat-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.chat-search-mark {
  background: #fff3bf;
  color: inherit;
  padding: 0 2px;
  border-radius: 1px;
}

.modal-date {
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 400;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: var(--fs-body);
}

.modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.modal-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
}

.modal-columns.is-2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-col {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-col-left,
.modal-col-right {
  border-right: 1px solid var(--line);
}

.modal-columns.is-2col .modal-col-right {
  border-right: none;
}

@media (max-width: 860px) {
  .modal {
    padding: 8px 12px;
  }
  body.radar-app #drawer {
    padding: 8px 6%;
  }
  .modal-panel {
    height: calc(100vh - 56px - 16px);
    max-height: calc(100vh - 56px - 16px);
  }
  .modal-columns {
    grid-template-columns: 1fr;
  }
  .modal-col-left,
  .modal-col-right {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }
}

.block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
}

.modal-col .block {
  background: #ffffff;
}

.block-plain {
  border: none !important;
  padding-left: 0;
  padding-right: 0;
}

.stage-conclusion {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.stage-conclusion.is-sm {
  font-size: 13px;
}

.stage-REQ { color: var(--stage-REQ); }
.stage-UI { color: var(--stage-UI); }
.stage-DEV { color: var(--stage-DEV); }
.stage-TEST { color: var(--stage-TEST); }
.stage-ACCEPT { color: var(--stage-ACCEPT); }
.stage-LIVE { color: var(--stage-LIVE); }
.stage-S0 { color: var(--stage-S0); }
.stage-S1 { color: var(--stage-S1); }
.stage-S2 { color: var(--stage-S2); }
.stage-S3 { color: var(--stage-S3); }
.stage-S4 { color: var(--stage-S4); }
.stage-S5 { color: var(--stage-S5); }
.stage-S6 { color: var(--stage-S6); }
.stage-S7 { color: var(--stage-S7); }
.stage-S8 { color: var(--stage-S8); }
.stage-S9 { color: var(--stage-S9); }

.block h4 {
  margin: 0 0 8px;
  font-size: var(--fs-title);
  color: var(--muted);
}
body.radar-app .modal-col .block > h4 {
  font-weight: 400;
}

.version-progress-block > h4 {
  margin-bottom: 16px;
}

.block ul {
  margin: 0;
  padding-left: 1.1rem;
}

.block li {
  margin: 0.3rem 0;
  font-size: var(--fs-body);
}

.title-text {
  font-size: var(--fs-title);
  color: var(--text);
}

.evidence {
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin: 8px 0;
}

.evidence .meta {
  color: var(--muted);
  font-size: var(--fs-body);
}

.evidence .evidence-snippet {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.8;
  margin-top: 4px;
}

.mgmt-finding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.mgmt-finding-item {
  padding: 0;
}

.mgmt-finding-text {
  font-size: var(--fs-body);
  color: var(--text);
  line-height: 1.8;
}

.mgmt-signal-list {
  margin: 6px 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.mgmt-signal-list li {
  margin: 2px 0;
}

.member-insight-meta {
  margin: -2px 0 10px;
  font-size: 12px;
}

.member-insight-list {
  display: grid;
  gap: 12px;
}

.member-insight-item {
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
}

.member-insight-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 6px;
}

.member-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.member-score-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 1px;
  background: var(--surface-muted);
  color: #14161a;
  font-size: 12px;
}

.member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.member-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 1px;
  background: var(--sch-ui-bg);
  color: var(--sch-ui-strong-fg);
  font-size: 12px;
}

.member-tag.is-risk {
  background: var(--orange-soft);
  color: var(--orange);
}

.member-summary {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.8;
  color: var(--text);
}

.member-evidence {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.member-evidence summary {
  cursor: pointer;
  color: #9ca3af;
}

.member-evidence ul {
  margin: 6px 0 0;
  padding-left: 1.1rem;
}

.member-evidence li {
  margin: 3px 0;
  line-height: 1.8;
}

.member-insight-more {
  margin: 8px 0 0;
  font-size: 12px;
}

.doc-address-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.doc-address-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
}

.doc-address-label {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
  margin-bottom: 4px;
}

.doc-address-url {
  font-size: 13px;
  line-height: 1.8;
  word-break: break-all;
}

.doc-address-link {
  color: var(--link);
  text-decoration: none;
}

.doc-address-link:hover {
  text-decoration: none;
}

.doc-address-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.doc-address-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.8;
  color: #14161a;
}
.doc-address-k {
  flex: 0 0 48px;
  color: var(--muted);
}

.doc-label-mark {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 2px;
  border-radius: 1px;
}

.chat-item.has-doc-address {
  border-left: 3px solid var(--amber);
  padding-left: 8px;
}

.doc-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 1px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
  line-height: 1.4;
}

.history-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
}

.history-row:last-child { border-bottom: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  z-index: 40;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.toast[hidden] { display: none; }
.toast.error { background: var(--red); }

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-chat-header-container {
  position: sticky;
  top: -14px;
  background: #ffffff;
  z-index: 10;
  padding: 14px 0 8px;
  margin-top: -14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.chat-load-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-count-text {
  color: var(--muted);
  font-size: var(--fs-body);
}

.chat-more-btn {
  flex: 0 0 auto;
}

.chat-item {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

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

.chat-meta {
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.8;
  margin-bottom: 2px;
}

.chat-text {
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.8;
  word-break: break-word;
}

.chat-image {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  cursor: zoom-in;
  max-width: 100%;
}

.chat-image img {
  display: block;
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  background: var(--gray-soft);
}

.chat-list.is-compact .chat-image img {
  max-height: 110px;
}

/* 群聊弹窗内看图：必须高于 .modal(1900) / 顶栏(2000) */
.lightbox[hidden] { display: none !important; }
.lightbox.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 3200;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
}

.empty {
  column-span: all;
  display: block;
  width: 100%;
  text-align: center;
  color: var(--muted);
  padding: 48px 12px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 860px) {
  .project-grid { column-width: 260px; }
}

/* —— Auth / admin —— */
.user-chip-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 6px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
}

.user-chip:hover,
.user-chip-dropdown:hover .user-chip,
.user-chip-dropdown:focus-within .user-chip {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.user-chip-menu {
  position: absolute;
  top: calc(100% - 2px);
  right: 0;
  z-index: 2100;
  min-width: 148px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.user-chip-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.user-chip-dropdown:hover .user-chip-menu,
.user-chip-dropdown:focus-within .user-chip-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.user-chip-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

a.user-chip-menu-item:hover {
  text-decoration: none;
}

.user-chip-menu-sep {
  height: 1px;
  margin: 6px 8px;
  background: var(--surface-muted);
  border: 0;
}

.user-chip-menu-sep[hidden],
.user-chip-menu-item[hidden] {
  display: none !important;
}

.user-chip-menu-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.user-chip-menu-item--danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.user-chip-meta {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-avatar {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-avatar);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-muted);
}

/* 上传照片：双倍像素密度下保持锐利；色块用像素感渲染 */
.user-avatar.is-photo {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.user-avatar.is-blockie {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.user-chip-avatar {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-avatar);
}

.user-avatar-lg {
  width: 112px;
  height: 112px;
  border-radius: var(--radius-avatar);
}

.avatar-modal .avatar-modal-body {
  display: grid;
  gap: 20px;
  justify-items: stretch;
  text-align: left;
  width: 100%;
}

.account-section {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  width: 100%;
}

.account-section + .account-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.01em;
}

.account-section--avatar {
  justify-items: center;
  text-align: center;
}

.change-password-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.change-password-form .field-block {
  display: grid;
  gap: 6px;
  margin: 0;
  width: 100%;
}

.change-password-form .field-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.change-password-form .field-control {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.change-password-form .field-control::placeholder {
  color: #9ca3af;
}

.change-password-form .field-control:focus {
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.change-password-form .avatar-modal-actions {
  justify-content: flex-start;
  margin-top: 2px;
}

.change-password-form .btn-primary {
  min-width: 108px;
}

.avatar-preview-wrap {
  display: grid;
  place-items: center;
}

.avatar-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.account-section--avatar .avatar-modal-actions {
  justify-content: center;
}

.avatar-modal .avatar-upload-btn {
  color: #14161a !important;
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.stage-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.stage-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
}

.org-chip {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: var(--radius-control);
  background: var(--gray-soft);
  color: var(--muted);
  font-size: 12px;
}

.version-progress-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.version-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-chip.is-inline {
  margin-left: 6px;
  vertical-align: middle;
}

.version-chip.is-unassigned {
  background: var(--gray-soft);
  color: var(--muted);
}

.version-progress-item + .version-progress-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.version-progress-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 8px;
}

.version-progress-stage {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.version-progress-stage .stage-conclusion {
  font-size: 16px;
  font-weight: 650;
}

.version-sub-status {
  font-size: 13px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 1px;
  background: var(--gray-soft);
}

.version-progress-meta {
  margin-top: 6px;
  font-size: 13px;
}

.version-progress-compared {
  margin: 6px 0 0;
  font-size: 13px;
}

.version-progress-summary {
  margin: 8px 0 16px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

.version-day-points {
  flex: 1 1 100%;
  margin-top: 8px;
}

.version-day-points .evidence {
  margin: 6px 0;
}

.version-day-points .evidence:first-child {
  margin-top: 0;
}

.version-day-bullets {
  margin: 0;
  padding-left: 1.1rem;
}

.version-day-bullets li {
  margin: 0.25rem 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
}

.version-day-docs {
  flex: 1 1 100%;
  margin-top: 8px;
}

.version-day-docs .doc-address-list {
  gap: 8px;
}

.version-day-docs .doc-address-item {
  padding: 8px 10px;
}

.version-history {
  --version-history-list-offset: 19px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed var(--line);
}

.version-history-title {
  margin: 0 0 8px;
  font-size: var(--fs-title);
  color: var(--muted);
  font-weight: 400;
}

.version-history-list {
  list-style: none;
  margin: 0;
  margin-inline-start: 0;
  width: calc(100% + var(--version-history-list-offset));
  transform: translateX(calc(-1 * var(--version-history-list-offset)));
  padding: 0;
  padding-inline-start: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-history-item {
  display: flex;
  gap: 4px;
  align-items: start;
  width: 100%;
  margin-left: 0;
  padding-left: 0;
}

.version-history-date {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  text-align: left;
  white-space: nowrap;
}

.version-history-date::before {
  content: "🗓";
  font-size: 13px;
  line-height: 1;
}

.version-history-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.8;
}

.version-history-stage {
  font-weight: 600;
  color: var(--text);
}

.version-history-status {
  color: var(--muted);
}

.version-history-summary {
  flex: 1 1 100%;
  color: var(--text);
}

.version-history-empty {
  margin: 8px 0 0;
  font-size: 13px;
}

.version-unassigned {
  margin-top: 12px;
  font-size: 13px;
}

/* Login Soft SaaS */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  box-sizing: border-box;
  /* 背景灰浓度约为全局 --bg / 底纹的一半 */
  background-color: color-mix(in srgb, var(--surface-muted) 50%, #fff);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(15, 17, 21, 0.0225) 1px, transparent 0),
    linear-gradient(90deg, rgba(15, 17, 21, 0.01) 1px, transparent 1px),
    linear-gradient(rgba(15, 17, 21, 0.01) 1px, transparent 1px);
  background-size: var(--bg-pattern-size);
}

/* 名言 + 登录卡作为一整块居中；右栏 480px */
.login-stage {
  display: flex;
  align-items: stretch;
  width: min(96vw, 980px);
  max-width: 980px;
  box-sizing: border-box;
}

.login-quote {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 36px 40px 8px;
  box-sizing: border-box;
  min-width: 0;
}

.login-quote-figure {
  margin: 0;
  max-width: 100%;
  padding-right: 28px;
  animation: login-quote-in 0.35s ease both;
}

.login-quote-text {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
}

.login-quote-text p {
  margin: 0 0 0.15em;
}

.login-quote-text p:last-child {
  margin-bottom: 0;
}

.login-quote-author {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  font-family: var(--font);
}

@keyframes login-quote-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-panel {
  flex: 0 0 480px;
  width: 480px;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px 36px 34px;
  box-shadow: none;
  box-sizing: border-box;
}

.login-brand {
  margin-bottom: 28px;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.login-form input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.login-form input::placeholder {
  color: #9ca3af;
}

.login-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
}

.login-contact {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted); /* 与「用户名」标签同色 */
  text-align: center;
}

.login-error {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 800px) {
  .login-body {
    padding: 24px 16px 32px;
    place-items: start center;
  }

  .login-stage {
    flex-direction: column;
    width: min(96vw, 480px);
    max-width: 480px;
    gap: 20px;
  }

  .login-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }

  .login-quote {
    flex: 0 0 auto;
    padding: 28px 0 8px;
  }

  .login-quote-figure {
    padding-right: 0;
  }

  .login-quote-text {
    font-size: 18px;
    line-height: 1.65;
  }

  .login-quote-author {
    margin-top: 14px;
  }

  .login-panel {
    width: 100%;
  }

  .login-card {
    width: 100%;
    padding: 28px 22px 24px;
  }
}

/* Admin shell Soft SaaS */
.admin-page .page {
  background-color: transparent;
}

.admin-page .tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.admin-shell {
  width: calc(100% - 200px);
  margin: 28px auto 48px;
  padding: 30px 34px 34px;
  display: grid;
  gap: 22px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: 1px solid var(--line);
  box-sizing: border-box;
}

.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 24px;
}

.admin-page-title h1 {
  margin: 0;
  font-size: var(--fs-display);
  letter-spacing: -0.03em;
  color: var(--text);
  font-weight: 700;
}

.admin-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 640px;
}

.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-panel {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.collector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.collector-bar-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.collector-bar-field .field-label {
  margin: 0;
  white-space: nowrap;
  line-height: 1;
}

.collector-bar .field-control {
  min-width: 160px;
}

.collector-bar .collector-meta {
  padding: 0;
  line-height: 1;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 6px;
}

.field-inline-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field-inline-sm .field-label {
  white-space: nowrap;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
}

.field-control,
.org-change {
  height: 34px;
  min-width: 140px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
}

.field-control:focus,
.org-change:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.search-input {
  min-width: min(100%, 240px);
  flex: 1 1 200px;
}

.collector-meta {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 0;
}

.collector-meta.is-warn {
  color: var(--orange);
}

.info-banner {
  margin: 0;
  padding: 12px 16px;
  border-radius: 1px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.info-banner:empty {
  display: none;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 12px 14px;
  margin: 0 4px -1px 0;
  border-bottom: 2px solid transparent;
  border-radius: 1px 1px 0 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

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

.tab.is-active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
  background: transparent;
  font-weight: 500;
}

.admin-panel {
  display: grid;
}

.admin-panel[hidden],
.tab-panel[hidden],
.csv-preview[hidden] {
  display: none !important;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 18px 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.table-wrap {
  overflow: auto;
  background: var(--surface);
  border: none;
  border-radius: 0;
}

.admin-panel > .table-wrap:first-child {
  border-radius: 1px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
}

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

.data-table tbody tr:hover td {
  background: var(--surface-hover);
}

.data-table code {
  font-size: 13px;
  color: #14161a;
}

.col-check { width: 40px; }
.col-id { width: 64px; }
.col-mono { min-width: 120px; }
.col-status { width: 88px; }
.col-actions { width: 88px; }
.col-actions-wide { min-width: 220px; }

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px !important;
}

.btn-sm {
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: var(--radius-control);
}

.file-btn {
  cursor: pointer;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  user-select: none;
}

.err-text {
  color: var(--red);
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.csv-preview {
  margin-top: 0;
  padding: 0;
}

.row-error td { background: #fff7f7; }
.row-warning td { background: #fffaf3; }
.row-inactive td { opacity: 0.55; }

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form .field-block {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-form .field-block > .field-label,
.admin-form .field-label {
  color: var(--muted);
  font-size: 13px;
}

.admin-form .field-hint {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.4;
}

.admin-form .field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.admin-form .field-row > .field-block {
  align-self: start;
  min-width: 0;
}

/* 采集号弹窗：软上限 / 优先级始终同一行、顶部对齐 */
.collector-form .field-row-pair {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: start;
}

.collector-form .field-hint-pair {
  margin: -8px 0 0;
}

.admin-form label:not(.switch):not(.check) {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form input:not([type="checkbox"]),
.admin-form select {
  height: 40px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  box-sizing: border-box;
}

.admin-form input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.admin-form fieldset {
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 12px 14px;
  margin: 0;
}

.admin-form legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.admin-form .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--surface-soft);
}

.switch-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.switch-title {
  color: var(--text);
  font-size: 13px;
}

.switch-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 26px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: var(--surface-muted);
  transition: background 0.15s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  transition: transform 0.15s ease;
}

.switch input:checked + .switch-ui {
  background: var(--accent);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(18px);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px 12px;
  padding-top: 4px;
}

/* 管理弹窗：GenFM 风格 — 白底、大圆角、软阴影、疏朗留白 */
.modal-panel.admin-modal {
  width: min(92vw, 480px);
  height: auto;
  max-height: min(90vh, calc(100vh - 80px));
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}

.admin-modal .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 0;
  border-bottom: none;
}

.admin-modal .modal-head-main {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.admin-modal .modal-head-text {
  min-width: 0;
}

.admin-modal .modal-title-line {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: #14161a;
  letter-spacing: -0.01em;
}

.admin-modal .modal-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #9ca3af;
  font-weight: 400;
}

.admin-modal .modal-close-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: -2px -6px 0 0;
  border: none;
  border-radius: 1px;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
}

.admin-modal .modal-close-btn:hover {
  background: var(--surface-muted);
  color: #14161a;
}

.admin-modal .modal-body {
  padding: 22px 28px 28px;
  overflow: auto;
  flex: 0 1 auto;
}

.admin-modal-member .modal-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 28px 0;
  overflow: hidden;
}

.admin-modal .admin-form {
  display: grid;
  gap: 18px;
}

.admin-modal .admin-form .field-block,
.admin-modal .admin-form label:not(.switch):not(.check) {
  gap: 8px;
  color: #14161a;
}

.admin-modal .admin-form .field-label,
.admin-modal .admin-form .field-block > .field-label {
  color: #14161a;
  font-size: 13px;
  font-weight: 600;
}

.admin-modal .admin-form input:not([type="checkbox"]),
.admin-modal .admin-form select,
.admin-modal .admin-form textarea,
.admin-modal .schedule-textarea {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 14px;
  font-size: 13px;
  color: #14161a;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-modal .admin-form textarea:not(.schedule-textarea) {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.admin-modal .schedule-textarea {
  height: 400px;
  min-height: 400px;
  max-height: 400px;
  padding: 12px 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-y: auto;
  resize: none;
}

.admin-modal .admin-form input:not([type="checkbox"]):focus,
.admin-modal .admin-form select:focus,
.admin-modal .admin-form textarea:focus,
.admin-modal .schedule-textarea:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.admin-modal .admin-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.admin-modal .admin-form fieldset {
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 14px 16px;
  background: #fff;
}

.admin-modal .admin-form legend {
  color: #14161a;
  font-size: 13px;
  font-weight: 600;
}

.admin-modal .switch-row {
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
}

.admin-modal .admin-form .form-actions {
  margin-top: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 10px;
}

.admin-modal-member .admin-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}

.admin-modal-member .admin-form .form-actions {
  flex-shrink: 0;
  margin: 0 -28px 0;
  padding: 16px 28px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.admin-modal .admin-form .form-actions .btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 600;
}

.admin-modal .admin-form .form-actions .btn:not(.btn-primary):not(.btn-danger) {
  background: #fff;
  border: 1px solid var(--line);
  color: #14161a;
}

.admin-modal .admin-form .form-actions .btn:not(.btn-primary):not(.btn-danger):hover {
  background: var(--surface-muted);
  border-color: var(--line);
}

.admin-modal .admin-form .form-actions .btn-primary {
  background: #111827;
  border: 1px solid #111827;
  color: #fff;
}

.admin-modal .admin-form .form-actions .btn-primary:hover {
  background: #030712;
  border-color: #030712;
}

.admin-modal .admin-form .form-actions .btn-danger {
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
}

.admin-modal .admin-form .form-actions .btn-danger:hover {
  background: color-mix(in srgb, var(--red) 88%, #000);
  border-color: color-mix(in srgb, var(--red) 88%, #000);
}

.modal:has(.admin-modal) .modal-backdrop {
  background: rgba(17, 24, 39, 0.35);
}

.modal:has(.admin-modal-member) {
  padding: 12px 16px;
  align-items: center;
}

.modal-panel.admin-modal.admin-modal-member {
  width: min(calc(100vw - 32px), 720px);
  max-height: min(100%, calc(100vh - 56px - 24px));
  max-height: min(100%, calc(100dvh - 56px - 24px));
  display: flex;
  flex-direction: column;
}

.admin-modal-member .member-form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 36px;
  position: relative;
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.admin-modal-member .member-form-cols::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  border-left: 1px dashed var(--line);
  pointer-events: none;
}

.admin-modal-member .member-form-col {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.member-combo-wrap {
  position: relative;
}

.member-combo-wrap input {
  padding-right: 32px;
}

.member-combo-caret {
  position: absolute;
  top: 0;
  right: 0;
  width: 32px;
  height: 34px;
  border: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  cursor: pointer;
}

.member-combo-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 420;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  background: #fff;
}

.member-combo-menu.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.member-combo-empty {
  padding: 8px 10px;
  color: #9ca3af;
  font-size: 13px;
}

.member-combo-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-combo-pick {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.member-combo-item:hover {
  background: var(--surface-muted);
}

.member-combo-del {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.member-combo-del:hover {
  color: #14161a;
}

.admin-modal-member .cselect--chip {
  z-index: 120;
}

.admin-modal-member .cselect--chip.is-open {
  z-index: 13000;
}

.admin-modal-member .cselect--chip .cselect-trigger {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font-size: 13px;
  box-shadow: none;
}

.admin-modal-member .cselect--chip .cselect-trigger:focus {
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.cselect--chip .cselect-menu,
.cselect-menu.cselect-menu--chip {
  z-index: 13000;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
}

.cselect--chip .cselect-option {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.cselect--chip .cselect-option:hover:not(:disabled),
.cselect--chip .cselect-option.is-active {
  color: var(--text);
  background: var(--surface-hover);
}

.admin-modal-member .member-hired-trigger {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  box-sizing: border-box;
}

.admin-modal-member .member-hired-trigger:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.admin-modal-member .org-people-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.admin-modal-member .org-people-trigger:focus {
  outline: none;
  border-color: var(--line);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

@media (max-width: 720px) {
  .modal:has(.admin-modal-member) {
    padding: 8px;
    align-items: stretch;
  }

  .modal-panel.admin-modal.admin-modal-member {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
  }

  .admin-modal.admin-modal-member .modal-head {
    padding: 18px 16px 0;
  }

  .admin-modal-member .modal-body {
    padding: 16px 16px 0;
  }

  .admin-modal-member .member-form-cols {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .admin-modal-member .member-form-cols::before {
    display: none;
  }

  .admin-modal-member .admin-form .form-actions {
    margin: 0 -16px 0;
    padding: 14px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .admin-modal-member .admin-form .form-actions .btn {
    flex: 1 1 auto;
  }
}

.org-people-label.is-placeholder {
  color: #9ca3af;
}

.org-people-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.org-people-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: #14161a;
  font-size: 13px;
}

.org-people-chip-del {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.org-people-chip-del:hover {
  color: #14161a;
}

@media (max-width: 360px) {
  .admin-form .field-row:not(.field-row-pair) {
    grid-template-columns: 1fr;
  }
}

.col-ops {
  vertical-align: middle !important;
  min-width: 280px;
}

.ops {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 320px;
}

.ops .btn {
  position: static;
  margin: 0;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

.status-pill.status-ready { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 18%, transparent); }
.status-pill.status-need_login { background: var(--orange-soft); color: var(--orange); border-color: color-mix(in srgb, var(--orange) 18%, transparent); }
.status-pill.status-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 18%, transparent); }

.load-warn { color: var(--orange); }
.load-crit { color: var(--red); }
.path-cell {
  display: block;
  max-width: 220px;
  font-size: 12px;
  word-break: break-all;
  color: #14161a;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.4;
}

.cmd-box {
  margin: 12px 0;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .topbar {
    padding: 0 24px;
  }

  .admin-shell {
    width: calc(100% - 48px);
    margin: 16px auto 32px;
    padding: 22px 20px 24px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 14px;
    gap: 10px;
  }

  .topbar-left {
    gap: 10px;
    overflow: visible;
  }

  .top-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 1;
    min-width: 0;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .admin-shell {
    width: calc(100% - 28px);
    border-radius: 1px;
    gap: 16px;
  }

  .admin-page-title h1 {
    font-size: 22px;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
  }

}

/* —— 产品排期（全屏工作台） —— */
body.schedule-app {
  background: var(--surface-muted);
  min-height: 100vh;
}

body.schedule-app .page {
  padding-top: 0;
}

.schedule-topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.schedule-workspace {
  display: grid;
  grid-template-columns: 280px 280px 1fr;
  min-height: calc(100vh - 56px);
  background: var(--surface-muted);
  box-sizing: border-box;
}

.sch-risk-panel {
  width: 280px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  box-sizing: border-box;
  min-height: 0;
  /* 左右不设 padding，避免分割线被内边距/overflow 裁断；水平间距放在头/卡片内 */
  padding: 20px 0;
  background: #fff;
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  /* 勿用 overflow:hidden，否则组织下拉会被裁切/盖住 */
  overflow: visible;
  z-index: 80;
}

.sch-risk-org {
  flex: 0 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 100;
}

.sch-risk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 20px;
  flex: 0 0 auto;
}

.sch-risk-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border-radius: 1px;
}

.sch-risk-tab {
  border: none;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.sch-risk-tab.is-active {
  background: #fff;
  color: #14161a;
  box-shadow: none;
}

.sch-risk-full-link {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: none;
  white-space: nowrap;
}

.sch-risk-full-link:hover {
  color: var(--accent);
}

.sch-risk-meta {
  margin: 0;
  padding: 0 20px;
  font-size: 12px;
  line-height: 1.4;
  flex: 0 0 auto;
}

.sch-risk-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
}

.sch-risk-empty {
  margin: 24px 20px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.sch-risk-card {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  margin: 0;
  padding: 10px 20px 16px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sch-risk-card:hover {
  background: var(--surface-muted);
}

.sch-risk-card-line1,
.sch-risk-card-line2,
.sch-risk-card-line3,
.sch-risk-card-actions {
  transition: transform 0.2s ease;
}

.sch-risk-card:hover .sch-risk-card-line1,
.sch-risk-card:hover .sch-risk-card-line2,
.sch-risk-card:hover .sch-risk-card-line3,
.sch-risk-card:hover .sch-risk-card-actions {
  transform: translateX(6px);
}

.sch-risk-card.is-p0,
.sch-risk-card.is-p1,
.sch-risk-card.is-p2,
.sch-risk-card.is-ok {
  border-left: none;
}

.sch-risk-card-line1 {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sch-risk-card-line2,
.sch-risk-card-line3 {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: #14161a;
  line-height: 25px;
  overflow-wrap: anywhere;
}

.sch-risk-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  opacity: 1;
  pointer-events: auto;
}

.sch-risk-card-actions .btn {
  font-size: 13px;
  padding: 2px 8px;
}

.sch-left-rail {
  width: 280px;
  margin: 0;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  box-sizing: border-box;
  min-height: 0;
  background: #fff;
  z-index: 1;
}

.sch-org-select {
  position: relative;
  z-index: 100;
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #14161a;
  box-sizing: border-box;
  box-shadow: none;
}

.sch-org-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* —— 自定义白底下拉（替代系统灰底弹出层）—— */
.cselect {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  z-index: 100;
}

.cselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.cselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: none;
}

.cselect-trigger:hover:not(:disabled) {
  border-color: var(--line);
}

.cselect-trigger:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.cselect-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cselect-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cselect-caret {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.cselect-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 400;
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
}

.cselect-menu.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}

.cselect-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.cselect-option:hover:not(:disabled),
.cselect-option.is-active {
  background: var(--surface-muted);
}

#timezoneModal .admin-modal,
#timezoneModal .admin-modal .modal-body {
  overflow: visible;
}

#timezoneModal .cselect {
  z-index: 20 !important;
}

#timezoneModal .cselect-trigger {
  height: 42px;
  padding: 0 13px;
  border-radius: 1px;
  font-size: 13px;
}

#timezoneModal .cselect-menu {
  z-index: 30 !important;
  padding: 6px;
  border-radius: 1px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

#timezoneModal .cselect-option {
  position: relative;
  min-height: 38px;
  padding: 9px 34px 9px 11px;
  border-radius: 1px;
  font-size: 13px;
}

#timezoneModal .cselect-option.is-active {
  color: #14161a;
  font-weight: 600;
}

#timezoneModal .cselect-option.is-active::after {
  content: "✓";
  position: absolute;
  right: 12px;
  color: var(--ok);
  font-weight: 700;
}

@media (max-width: 560px) {
  #timezoneModal .admin-modal {
    width: min(94vw, 480px);
  }

  #timezoneModal .admin-modal .modal-head {
    padding: 22px 20px 0;
  }

  #timezoneModal .admin-modal .modal-body {
    padding: 18px 20px 22px;
  }
}

.cselect-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cselect--risk-org {
  width: auto;
  min-width: 140px;
}

.cselect--risk-org .cselect-trigger {
  height: 32px;
  border-radius: 1px;
  border-color: var(--line);
  box-shadow: none;
}

.cselect--schedule .cselect-trigger {
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 1px;
}

.cselect--field .cselect-trigger {
  height: 34px;
  min-width: 140px;
}

.sch-risk-org .cselect,
.risk-org-switcher .cselect {
  z-index: 120;
}

.sch-sidebar {
  width: 240px;
  margin: 0;
  border-radius: 1px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.sch-sidebar-head {
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--line);
}

.sch-search {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.sch-search:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.sch-product-list {
  overflow: auto;
  flex: 1;
  padding: 0;
}

.sch-list-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 12px;
  line-height: 1.6;
}

.sch-product-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 8px 8px;
  margin: 0;
  font: inherit;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

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

.sch-product-item:hover {
  background: var(--surface-muted);
}

.sch-product-item.is-active {
  background: var(--surface-muted);
}

.sch-product-item.is-active:hover {
  background: var(--surface-muted);
}

.sch-product-item:hover .sch-product-main,
.sch-product-item:hover .sch-product-edit {
  transform: translateX(6px);
}

.sch-product-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 2px 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform 0.2s ease;
}

.sch-product-edit {
  flex-shrink: 0;
  margin-top: 2px;
  padding: 2px 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #14161a;
  border-color: var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.2s ease;
}

.sch-product-item:hover .sch-product-edit,
.sch-product-item:focus-within .sch-product-edit {
  opacity: 1;
  pointer-events: auto;
}

.sch-product-edit:hover {
  color: #14161a;
  background: #fff;
}

.sch-product-link-hint {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.2;
}

.sch-product-link-hint.is-on {
  color: #9ca3af;
}

.product-link-hint {
  margin: 0 0 8px;
  font-size: 13px;
}

input.is-readonly {
  background: var(--surface-muted);
  color: #9ca3af;
  cursor: default;
}

.sch-product-title {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
}

.sch-product-code,
.sch-product-name {
  font-weight: 400;
  font-size: 13px;
  color: #14161a;
}

.sch-product-stage {
  margin-top: 2px;
  line-height: 1.3;
  min-width: 0;
}

.sch-product-stage .stage-name-text {
  font-size: 13px;
  font-weight: 600;
}

.sch-product-stage.is-empty {
  font-size: 12px;
  color: var(--muted);
}

.sch-main {
  position: relative;
  min-width: 0;
  /* 右侧：浮动导航 right(10) + 宽(160) + 与列表间距(20) */
  padding: 24px calc(10px + 160px + 20px) 48px 0;
  background: #fff;
}

.sch-empty {
  color: var(--muted);
  padding: 80px 20px;
  text-align: center;
}

.sch-product-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.sch-product-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #14161a;
}

.sch-product-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sch-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.sch-columns.sch-columns-no-radar {
  grid-template-columns: minmax(0, 1fr);
}

.sch-version-list {
  min-width: 0;
}

/* 版本列表右侧浮动导航 */
.version-nav {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 160px;
  max-height: min(70vh, calc(100vh - 120px));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  scrollbar-width: thin;
}

.version-nav[hidden] {
  display: none !important;
}

.version-nav-item {
  display: block;
  width: 100%;
  max-width: 140px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 13px;
  line-height: 35px;
  height: 35px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border-radius: 0;
}

.version-nav-item:hover {
  color: #14161a;
}

.version-nav-item.is-active {
  color: #14161a;
  font-weight: 500;
}

.version-nav-item.is-closed {
  opacity: 0.65;
}

.version-block {
  position: relative;
  padding: 0 0 28px 24px;
  border-left: 1px solid var(--line);
  margin-left: 6px;
  scroll-margin-top: 72px;
}

.version-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.version-head-main {
  display: flex;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.version-head-text {
  min-width: 0;
  flex: 1;
  /* 与下方甘特图 / 评论同左缘（圆点绝对定位，不占位） */
  margin: 0;
  padding: 0;
}

.version-dot {
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #fff;
  pointer-events: none;
}

.version-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
}

.version-title {
  font-size: 16px;
  font-weight: 600;
  color: #14161a;
}

.version-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.version-meta {
  margin-top: 8px;
  font-size: 13px;
  line-height: 18px;
}

/* 知识库文档内嵌甘特（复用 .version-gantt / .gantt-* 样式） */
.kb-embed-gantt {
  margin: 12px 0 16px;
  max-width: 100%;
}
.kb-embed-gantt-body {
  max-width: 100%;
}
.kb-embed-gantt .version-gantt.kb-doc-gantt {
  margin: 0;
  max-width: 100%;
}
.kb-embed-gantt .gantt-row-key {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
  border-radius: 1px;
  padding: 2px 4px;
  margin: 0 -4px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.kb-embed-gantt .gantt-row-key.is-editing,
.kb-embed-gantt .gantt-bar-label.is-editing {
  outline: 1px solid var(--link-focus);
  background: #fff;
  white-space: normal;
}
.kb-embed-gantt .gantt-row-key.is-editing {
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  cursor: text;
}
.kb-embed-gantt .gantt-add-row {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-top:1px solid var(--line);
}
.kb-embed-gantt .gantt-add-row .gantt-label-col {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 8px;
}
.kb-embed-gantt .gantt-add-task-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.kb-embed-gantt .gantt-add-task-btn:hover {
  border-color: var(--line);
  color: #14161a;
  background: var(--surface-muted);
}
.kb-embed-gantt .gantt-row-key.is-pressing {
  cursor: grabbing;
  background: var(--surface-muted);
}
.kb-embed-gantt .gantt-row.is-dragging {
  opacity: 0.45;
}
.kb-embed-gantt .gantt-row.is-drop-before {
  box-shadow: inset 0 2px 0 0 var(--link-focus);
}
.kb-embed-gantt .gantt-row.is-drop-after {
  box-shadow: inset 0 -2px 0 0 var(--link-focus);
}
.kb-doc-gantt-menu {
  position: fixed;
  z-index: 10050;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
}
.kb-doc-gantt-menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 1px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  line-height: 18px;
  color: #14161a;
  cursor: pointer;
}
.kb-doc-gantt-menu-item:hover {
  background: var(--surface-muted);
}
.kb-doc-gantt-menu-item.kb-doc-gantt-menu-danger {
  color: var(--red);
}
.kb-doc-gantt-menu-item.kb-doc-gantt-menu-danger:hover {
  background: #fef3f2;
}

.version-gantt {
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  overflow: hidden;
}

.version-gantt.is-readonly {
  opacity: 0.72;
}

.gantt-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

.gantt-inner {
  position: relative;
  min-width: 100%;
}

.gantt-row {
  display: flex;
  align-items: stretch;
  min-height: var(--gantt-row-h, 36px);
}

.gantt-header {
  display: flex;
  align-items: stretch;
  height: 28px;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

.gantt-header .gantt-label-col {
  height: 28px;
  min-height: 28px;
  border-bottom: 1px solid var(--line);
}

.gantt-label-col {
  width: var(--gantt-label-w, 110px);
  flex: 0 0 var(--gantt-label-w, 110px);
  box-sizing: border-box;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #14161a;
  border-right: 1px solid var(--line);
  background: #fff;
  position: sticky;
  left: 0;
  z-index: 1;
}

.gantt-corner {
  font-weight: 600;
  color: #9ca3af;
  background: #fff;
  z-index: 4;
}

.gantt-stage-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.gantt-stage-check {
  flex: 0 0 auto;
  margin: 0;
  width: 13px;
  height: 13px;
  accent-color: var(--accent, var(--link));
  cursor: pointer;
}

.gantt-row-key {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.gantt-timeline {
  display: flex;
  height: 100%;
}

.gantt-tick {
  flex: 0 0 auto;
  box-sizing: border-box;
  border-right: 1px solid var(--line);
  position: relative;
  height: 100%;
}

.gantt-tick.is-week {
  border-right-color: var(--line);
}

.gantt-tick span {
  position: absolute;
  left: 2px;
  top: 6px;
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
}

.gantt-body {
  position: relative;
}

.gantt-body .gantt-row {
  border-bottom: 1px solid var(--line);
}

.gantt-body .gantt-row:last-child {
  border-bottom: none;
}

.gantt-track {
  position: relative;
  /* 不用固定 height：左侧任务名换行撑高行时，竖向灰线随行拉满 */
  min-height: var(--gantt-row-h, 36px);
  height: auto;
  align-self: stretch;
  background: #fff;
  background-image: repeating-linear-gradient(
    to right,
    transparent,
    transparent calc(var(--gantt-day-w, 28px) - 1px),
    var(--line) calc(var(--gantt-day-w, 28px) - 1px),
    var(--line) var(--gantt-day-w, 28px)
  );
}

.gantt-bar {
  position: absolute;
  top: 7px;
  height: 22px;
  border-radius: 1px;
  background: var(--gantt-bar-0);
  color: #14161a;
  font-size: 12px;
  line-height: 22px;
  padding: 0 8px;
  box-sizing: border-box;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: none;
}

.gantt-bar.is-hidden {
  display: none;
}

.version-gantt.is-readonly .gantt-bar {
  cursor: default;
}

.gantt-bar-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
}

.gantt-bar-label.is-editing {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
  padding: 0 4px;
  cursor: text;
}

.gantt-handle {
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  z-index: 1;
}

.gantt-handle-l {
  left: 0;
}

.gantt-handle-r {
  right: 0;
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--red) 55%, #fff);
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
}

/* 序号色块：任务行按 index 循环 */
.gantt-tone-0 { background: var(--gantt-bar-0); }
.gantt-tone-1 { background: var(--gantt-bar-1); }
.gantt-tone-2 { background: var(--gantt-bar-2); }
.gantt-tone-3 { background: var(--gantt-bar-3); }
.gantt-tone-4 { background: var(--gantt-bar-4); }
.gantt-tone-5 { background: var(--gantt-bar-5); }
.gantt-tone-6 { background: var(--gantt-bar-6); }
.gantt-tone-7 { background: var(--gantt-bar-7); }
.gantt-tone-8 { background: var(--gantt-bar-8); }
.gantt-tone-9 { background: var(--gantt-bar-9); }
.gantt-tone-10 { background: var(--gantt-bar-10); }
.gantt-tone-11 { background: var(--gantt-bar-11); }
/* 排期阶段 class → 固定色块（互不撞色） */
.gantt-tone-sch-pending { background: var(--gantt-bar-0); }
.gantt-tone-sch-ui { background: var(--gantt-bar-1); }
.gantt-tone-sch-client { background: var(--gantt-bar-2); }
.gantt-tone-sch-fe { background: var(--gantt-bar-3); }
.gantt-tone-sch-dev { background: var(--gantt-bar-4); }
.gantt-tone-sch-test { background: var(--gantt-bar-5); }
.gantt-tone-sch-live { background: var(--gantt-bar-6); }
.gantt-tone-sch-pause { background: var(--gantt-bar-7); }
.gantt-tone-sch-other { background: var(--gantt-bar-11); }

.gantt-legend {
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.version-req-block {
  margin-top: 18px;
}

.version-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #14161a;
  line-height: 1.3;
}

.version-content {
  margin: 0;
  padding: 0;
  color: #14161a;
  font-size: 13px;
  line-height: 24px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.version-owners {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.version-followups {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.version-risk-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 1px;
  border: none;
  /* 条底再混白（同 row-error #fff7f7 / sch-tier 浅底思路），保证正文可读 */
  background: color-mix(in srgb, var(--red-soft) 42%, #fff);
}

.version-risk-bar.is-acked {
  opacity: 0.95;
}

.version-risk-bar-body {
  min-width: 0;
  flex: 1;
}

.version-risk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.version-risk-actions .btn.btn-risk-act {
  height: 34px;
  min-width: 72px;
  padding: 0 16px;
  border: 1px solid #fff;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  background: var(--surface-muted);
  color: #14161a;
}
.version-risk-actions .btn.btn-risk-act:hover {
  background: var(--surface-muted);
  border: 1px solid #fff;
}
.version-risk-actions .btn.btn-risk-act[data-risk-act="acknowledge"] {
  background: var(--link-soft);
  color: var(--link-hover);
}
.version-risk-actions .btn.btn-risk-act[data-risk-act="acknowledge"]:hover {
  background: color-mix(in srgb, var(--link) 22%, #fff);
}
.version-risk-actions .btn.btn-risk-act[data-risk-act="resolve"] {
  background: var(--ok-soft);
  color: var(--ok);
}
.version-risk-actions .btn.btn-risk-act[data-risk-act="resolve"]:hover {
  background: color-mix(in srgb, var(--ok) 22%, #fff);
}
.version-risk-actions .btn.btn-risk-act[data-risk-act="false_positive"] {
  background: var(--surface-muted);
  color: #14161a;
}

.version-risk-status {
  font-size: 13px;
  color: var(--amber);
  font-weight: 500;
}

.version-risk-bar.is-p1 {
  border: none;
  background: color-mix(in srgb, var(--orange-soft) 42%, #fff);
}

.version-risk-bar.is-p2 {
  border: none;
  background: color-mix(in srgb, var(--amber-soft) 38%, #fff);
}

.version-risk-bar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.version-risk-level {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 1px;
  font-size: 12px;
  font-weight: 700;
  background: var(--red-soft);
  color: var(--red);
}

.version-risk-bar.is-p1 .version-risk-level {
  background: var(--orange-soft);
  color: var(--orange);
}

.version-risk-bar.is-p2 .version-risk-level {
  background: var(--amber-soft);
  color: var(--amber);
}

.version-risk-rule {
  font-size: 13px;
  color: #9ca3af;
  font-family: ui-monospace, monospace;
}

.version-risk-title {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
}

.version-risk-more {
  font-size: 13px;
  color: #9ca3af;
}

.version-risk-bar-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  font-size: 13px;
  line-height: 1.45;
}

.version-risk-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}

.version-risk-link:hover {
  text-decoration: none;
}

/* 风险提醒「持续第 N 天」：与阶段对比条同色系 */
.nudge-persist-hint {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 1px;
  background: var(--surface-muted);
  color: #14161a;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .version-risk-bar {
    flex-direction: column;
  }
}

.version-owners .version-section-title,
.version-followups .version-section-title {
  margin-bottom: 10px;
}

.version-followups .activity-form {
  margin-top: 0;
  margin-bottom: 0;
  padding-bottom: 20px;
}

.version-followups .activity-thread {
  margin-top: 0;
}

.version-followups .activity-thread .activity-item:first-child {
  padding-top: 20px;
}

.version-followups .activity-thread .activity-empty {
  margin: 0;
  padding: 20px 0;
}

.version-owners-empty {
  margin: 0;
  font-size: 13px;
}

.version-owners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px 12px;
}

.version-owner-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 1px;
  background: #fff;
  border: 1px solid var(--line);
  min-width: 0;
}

.version-owner-role {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.3;
}

.version-owner-name {
  font-size: 13px;
  color: #14161a;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.version-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.prio {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 1px 7px;
}

.prio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.prio-badge.is-strong {
  font-size: 13px;
  padding: 5px 12px;
  box-shadow: none;
}

.prio-p0 { background: var(--red-soft); color: var(--red); }
.prio-p1 { background: var(--orange-soft); color: var(--orange); }
.prio-p2 { background: var(--amber-soft); color: var(--amber); }
.prio-p3 { background: var(--surface-muted); color: #14161a; }
.prio-other { background: var(--surface-muted); color: #9ca3af; }

.activity-thread {
  margin-top: 16px;
  padding-left: 2px;
}

.activity-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 20px 0;
  position: relative;
}

.activity-item.is-comment {
  align-items: start;
}

.activity-reply-box {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  padding: 2px 12px;
  box-sizing: border-box;
}

.activity-item.is-reply {
  display: block;
  grid-template-columns: unset;
  gap: 0;
  padding: 10px 0;
  margin: 0;
  border: none;
  background: transparent;
}

.activity-item.is-reply + .activity-item.is-reply {
  border-top: 1px solid var(--line);
}

.activity-item.is-reply .activity-text > strong {
  margin-bottom: 2px;
}

.activity-item.is-reply .activity-meta-row {
  margin-top: 2px;
}

.activity-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--accent-text);
  font-size: 12px;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.activity-text {
  font-size: 13px;
  line-height: 24px;
  color: #14161a;
  white-space: normal;
  word-break: break-word;
}

.activity-text > strong {
  display: block;
  color: var(--accent-text);
  font-weight: 600;
  margin-bottom: 2px;
}

.activity-html {
  font-size: 13px;
  line-height: 24px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.activity-html a {
  cursor: pointer;
}

/* 系统通知等 body 常包在 <p> 内；清掉默认外边距，避免顶开昵称/时间的 2px 间距 */
.activity-html > p {
  margin: 0;
}

.activity-html > p + p {
  margin-top: 2px;
}

.activity-html img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 8px 0 4px;
  border-radius: 1px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.activity-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.activity-time {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}

button.activity-action-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400 !important;
  font-synthesis: none;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

button.activity-action-btn:hover {
  color: #9ca3af;
  font-weight: 400 !important;
}

.activity-at {
  color: var(--accent-text);
  font-weight: 600;
  margin-right: 2px;
}

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

.reply-textarea {
  width: 100%;
  min-height: 160px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
  white-space: pre-wrap;
}

.reply-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.mention-tag {
  display: inline;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: inherit;
  margin: 0 2px 0 0;
  vertical-align: baseline;
  user-select: none;
  white-space: nowrap;
  background: none;
  box-shadow: none;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mention-tag.mention-urgent {
  background-image: linear-gradient(135deg, var(--sch-ui-strong-fg) 0%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.mention-tag.mention-date {
  background-image: linear-gradient(135deg, var(--ok) 0%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* 评论里「版本状态变更为：x」的阶段名：只用字色，不要徽章底色 */
.stage-name-text,
.stage-name-text.sch-pending,
.stage-name-text.sch-ui,
.stage-name-text.sch-client,
.stage-name-text.sch-fe,
.stage-name-text.sch-dev,
.stage-name-text.sch-test,
.stage-name-text.sch-live,
.stage-name-text.sch-pause,
.stage-name-text.sch-other {
  font-weight: 700;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.stage-name-text.sch-pending { color: var(--sch-pending-strong-fg); }
.stage-name-text.sch-ui { color: var(--sch-ui-strong-fg); }
.stage-name-text.sch-client { color: var(--sch-client-strong-fg); }
.stage-name-text.sch-fe { color: var(--sch-fe-strong-fg); }
.stage-name-text.sch-dev { color: var(--sch-dev-strong-fg); }
.stage-name-text.sch-test { color: var(--sch-test-strong-fg); }
.stage-name-text.sch-live { color: var(--sch-live-strong-fg); }
.stage-name-text.sch-pause { color: var(--sch-pause-strong-fg); }
.stage-name-text.sch-other { color: #9ca3af; }

.activity-html .mention-tag,
.rich-input .mention-tag {
  position: relative;
  top: 0;
}

/* 评论大图查看（排期等）；雷达页 lightbox 另用更高 z-index */
.img-viewer[hidden] { display: none; }
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 3200;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
}
.img-viewer-stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  display: grid;
  place-items: center;
  touch-action: none;
}
.img-viewer-stage.is-dragging { cursor: grabbing; }
.img-viewer-img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.img-viewer-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px 18px;
}
.img-viewer-btn {
  min-width: 44px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.img-viewer-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.kb-doc-img-viewer {
  z-index: 3600;
}
body.kb-doc-img-viewer-open {
  overflow: hidden;
}

.activity-form {
  display: block;
  margin-top: 12px;
}

.activity-form .rich-editor {
  width: 100%;
}

.activity-plain-editor .rich-input {
  white-space: pre-wrap;
}

.activity-html .assignee-at,
.activity-plain-editor .assignee-at {
  color: var(--link-text);
  font-weight: 600;
  margin: 0 2px;
  white-space: nowrap;
}

.rich-editor {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  overflow: hidden;
}

.rich-actions {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.rich-actions .rich-tool-btn,
.rich-actions .btn-sm {
  height: 32px;
  box-sizing: border-box;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rich-tool-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.rich-tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.rich-input {
  min-height: 150px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 12px 64px;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: #14161a;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.rich-input:empty::before,
.rich-input.is-empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.rich-input img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 8px 0;
  border-radius: 1px;
}

.sch-right-col {
  display: grid;
  gap: 20px;
  position: sticky;
  top: 80px;
}

.sch-card-block {
  background: transparent;
  padding: 0;
}

.sch-card-block h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
}

.radar-mini-card {
  background: #fff;
  border-radius: 1px;
  padding: 14px;
  box-shadow: none;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.radar-mini-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.team-mini-card.radar-mini-card::before {
  display: none;
}

.radar-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radar-mini-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
  padding-left: 4px;
  color: #14161a;
}

.radar-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0 4px 4px;
  line-height: 21px;
}

.radar-mini-bullets {
  margin: 8px 0 12px;
  padding-left: 18px;
  font-size: 13px;
  color: #14161a;
  line-height: 21px;
}

.radar-mini-bullets li + li {
  margin-top: 4px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 21px;
}

.team-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.team-row:first-child {
  padding-top: 0;
}

.team-role {
  color: #9ca3af;
}

.team-person {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #14161a;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-avatar);
  background: var(--accent-soft);
  color: var(--accent-text);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
}

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-avatar);
  margin-top: 1px;
}

.activity-actor-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.activity-actor-row > strong {
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
}

.sch-stage {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
}

.sch-stage.is-strong {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 1px;
  letter-spacing: 0.02em;
  box-shadow: none;
}

.sch-pending { background: var(--sch-pending-bg); color: var(--sch-pending-fg); }
.sch-ui { background: var(--sch-ui-bg); color: var(--sch-ui-fg); }
.sch-client { background: var(--sch-client-bg); color: var(--sch-client-fg); }
.sch-fe { background: var(--sch-fe-bg); color: var(--sch-fe-fg); }
.sch-dev { background: var(--sch-dev-bg); color: var(--sch-dev-fg); }
.sch-test { background: var(--sch-test-bg); color: var(--sch-test-fg); }
.sch-live { background: var(--sch-live-bg); color: var(--sch-live-fg); }
.sch-pause { background: var(--sch-pause-bg); color: var(--sch-pause-fg); }
.sch-other { background: var(--surface-muted); color: #9ca3af; }

.sch-stage.is-strong.sch-pending { background: var(--sch-pending-strong-bg); color: var(--sch-pending-strong-fg); }
.sch-stage.is-strong.sch-ui { background: var(--sch-ui-strong-bg); color: var(--sch-ui-strong-fg); }
.sch-stage.is-strong.sch-client { background: var(--sch-client-strong-bg); color: var(--sch-client-strong-fg); }
.sch-stage.is-strong.sch-fe { background: var(--sch-fe-strong-bg); color: var(--sch-fe-strong-fg); }
.sch-stage.is-strong.sch-dev { background: var(--sch-dev-strong-bg); color: var(--sch-dev-strong-fg); }
.sch-stage.is-strong.sch-test { background: var(--sch-test-strong-bg); color: var(--sch-test-strong-fg); }
.sch-stage.is-strong.sch-live { background: var(--sch-live-strong-bg); color: var(--sch-live-strong-fg); }
.sch-stage.is-strong.sch-pause { background: var(--sch-pause-strong-bg); color: var(--sch-pause-strong-fg); }

/* 排期弹窗：加宽；内容超出时在 modal-body 内滚动 */
.modal-panel.admin-modal.schedule-modal {
  width: min(92vw, 760px);
  overflow: hidden;
  max-height: min(90vh, calc(100vh - 80px));
}

.admin-modal.schedule-modal .modal-body {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.schedule-modal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.schedule-modal-foot[hidden] {
  display: none !important;
}

.schedule-modal-foot.has-delete {
  justify-content: space-between;
}

.schedule-modal-foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.schedule-modal-delete {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: #9ca3af;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.schedule-modal-delete:hover {
  color: #9ca3af;
}

/* 版本表单内「关联原型」：与筛选组织同款自定义下拉 */
.admin-modal.schedule-modal .schedule-proto-select.cselect-native,
.admin-modal.schedule-modal .field .cselect.cselect--sch-org {
  width: 100%;
}
.admin-modal.schedule-modal .field .cselect.cselect--sch-org .cselect-trigger {
  width: 100%;
}

.admin-modal.schedule-modal .schedule-form {
  gap: 20px;
}

.admin-modal.schedule-modal .schedule-form-cols {
  gap: 20px 24px;
}

.schedule-form-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 28px;
  align-items: start;
}

.schedule-form-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.schedule-form .schedule-form-col .field-block {
  margin: 0;
}

.person-pick {
  position: relative;
  width: 100%;
}

.person-pick-input {
  width: 100%;
  box-sizing: border-box;
}

.person-pick-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 600;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
}

.person-pick-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.person-pick-option:hover {
  background: var(--surface-muted);
}

.person-pick-name {
  font-weight: 550;
}

.person-pick-user {
  color: #9ca3af;
  font-size: 13px;
}

.person-pick-empty {
  padding: 10px;
  color: #9ca3af;
  font-size: 13px;
}

.version-sync-block {
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--surface-muted);
}

.version-sync-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.version-sync-hint {
  font-size: 13px;
  line-height: 1.4;
}

.version-sync-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 12px;
  max-height: 180px;
  overflow: auto;
}

.version-sync-item {
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 1px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: #14161a;
}

.version-sync-item:hover {
  border-color: var(--line);
}

.version-sync-item strong {
  font-weight: 600;
  margin-right: 4px;
}

.schedule-form select.schedule-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: pointer;
}

/* 管理/排期：下拉控件与选项列表统一白底 */
.admin-form select,
.admin-form select option,
.admin-modal select,
.admin-modal select option,
.schedule-form select,
.schedule-form select option,
.field-control,
.field-control option,
.sch-org-select,
.sch-org-select option,
.risk-org-select,
.risk-org-select option,
.dirty-prio-select,
.dirty-prio-select option,
.risk-miss-grid select,
.risk-miss-grid select option {
  background-color: #fff;
  color: #14161a;
  color-scheme: light;
}

.schedule-form select.schedule-select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236b8cae' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.admin-form textarea,
.schedule-textarea {
  width: 100%;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-y: auto;
  resize: none;
  background: var(--surface);
  box-sizing: border-box;
}

.admin-form textarea:focus,
.schedule-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.suggest-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.version-closed-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: var(--radius-control);
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.version-block.is-closed .version-title {
  color: #9ca3af;
}

.version-closed-hint {
  margin: 8px 0 0;
}

.version-close-switch {
  margin: 4px 0 12px;
}

.version-link-block {
  margin: 4px 0 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.version-link-block .field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.version-link-count {
  font-weight: 400;
}

.version-link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 10px;
}

.version-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 13px;
  color: #14161a;
}

.version-link-chip-x {
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
}

.version-link-chip-x:hover {
  color: #14161a;
}

.version-link-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.version-link-search {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
}

.version-link-search:focus {
  outline: none;
  border-color: var(--accent);
}

.version-link-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pad { padding: 8px 0 16px; }
.pad-sm { padding: 4px 0; }
.activity-empty { padding: 4px 0 8px; }

.muted {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .version-nav {
    display: none !important;
  }
  .sch-main {
    padding: 24px 15px 48px 0;
  }
  .schedule-workspace {
    grid-template-columns: 1fr;
  }
  .sch-risk-panel {
    width: 100%;
    margin: 12px 0 0;
    position: relative;
    top: 0;
    height: auto;
    max-height: 320px;
  }
  .sch-left-rail {
    width: calc(100% - 40px);
    margin: 12px 20px 0;
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
  }
  .sch-sidebar {
    width: 100%;
    max-height: 240px;
  }
  .sch-columns {
    grid-template-columns: 1fr;
  }
  .sch-right-col {
    position: static;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* —— 风险日报 / 周报 / 月报 / 运营清单（Google 简洁风） —— */
body.risk-daily-app {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: #14161a;
  font-family: "Noto Sans SC", "Google Sans", "Roboto", sans-serif;
}

body.risk-daily-app .schedule-topbar,
body.risk-daily-app .topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.risk-daily-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

.risk-daily-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.risk-daily-head h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.2px;
  color: #14161a;
}

.risk-daily-head .muted,
.risk-daily-page > .muted {
  color: #9ca3af;
  font-size: 13px;
}

.risk-daily-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.risk-daily-app .risk-daily-actions .btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 1px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--link);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

body.risk-daily-app .risk-daily-actions .btn:hover {
  background: var(--surface-muted);
  border-color: var(--line);
}

body.risk-daily-app .risk-daily-actions .btn-primary {
  background: var(--link);
  border-color: var(--link);
  color: #fff;
}

body.risk-daily-app .risk-daily-actions .btn-primary:hover {
  background: var(--link-hover);
  border-color: var(--link-hover);
}

.risk-org-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.risk-org-label {
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
}

.risk-org-select {
  min-width: 140px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  background: #fff;
  color: #14161a;
}

.risk-org-select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 1px var(--link);
}

.risk-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
  background: #fff;
}

.risk-kpi {
  background: #fff;
  border: none;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 18px;
}

.risk-kpi:last-child {
  border-right: none;
}

.risk-kpi-value {
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #14161a;
}

.risk-kpi-label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.35;
}

.risk-kpi-p0 .risk-kpi-value { color: var(--red); }
.risk-kpi-p1 .risk-kpi-value { color: var(--orange); }
.risk-kpi-ok .risk-kpi-value { color: var(--ok); }

.risk-section {
  margin-bottom: 36px;
}

.risk-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: #14161a;
  letter-spacing: -0.1px;
}

.risk-count {
  display: inline-block;
  margin-left: 8px;
  padding: 0 8px;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 1px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  vertical-align: middle;
}

.risk-section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.risk-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.risk-empty {
  margin: 0;
  padding: 20px 0;
  color: #9ca3af;
  font-size: 13px;
}

.risk-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 4px 14px 0;
  transition: background-color 0.15s ease;
}

.risk-row:hover {
  background: var(--surface-muted);
}

.risk-row-main {
  flex: 1;
  min-width: 0;
}

.risk-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 1px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.risk-badge-p0 { background: var(--red-soft); color: var(--red); }
.risk-badge-p1 { background: var(--orange-soft); color: var(--orange); }
.risk-badge-p2 { background: var(--orange-soft); color: var(--orange); }
.risk-badge-ok { background: var(--link-soft); color: var(--link-text); }

.risk-rule {
  font-size: 13px;
  color: #9ca3af;
  font-family: "Roboto Mono", ui-monospace, monospace;
}

.risk-product {
  font-size: 13px;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
}

.risk-product:hover {
  text-decoration: none;
}

.risk-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
  line-height: 1.45;
}

.risk-why {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #9ca3af;
}

.risk-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: #9ca3af;
}

.risk-row-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
  padding-top: 2px;
}

body.risk-daily-app .risk-row-actions .btn,
body.risk-daily-app .risk-row-actions .btn-sm {
  height: 28px;
  padding: 0 12px;
  border-radius: 1px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--link);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

body.risk-daily-app .risk-row-actions .btn:hover {
  background: var(--surface-muted);
}

.risk-preview {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.risk-preview-card {
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 0;
}

.risk-preview-head {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
}

.risk-preview-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top:1px solid var(--line);
  font-size: 13px;
  color: #14161a;
}

@media (max-width: 800px) {
  .risk-kpi-row,
  .risk-section-split {
    grid-template-columns: 1fr 1fr;
  }
  .risk-kpi:nth-child(2n) {
    border-right: none;
  }
  .risk-kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .risk-row {
    flex-direction: column;
  }
  .risk-row-actions {
    flex-direction: row;
  }
  .risk-preview-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .risk-kpi-row,
  .risk-section-split {
    grid-template-columns: 1fr;
  }
  .risk-kpi {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .risk-kpi:last-child {
    border-bottom: none;
  }
}

.risk-kpi-row-8,
.risk-kpi-row-12 {
  grid-template-columns: repeat(4, 1fr);
}

.risk-kpi-row-8 .risk-kpi:nth-child(4n),
.risk-kpi-row-12 .risk-kpi:nth-child(4n) {
  border-right: none;
}

.risk-kpi-row-8 .risk-kpi:nth-child(n + 5),
.risk-kpi-row-12 .risk-kpi:nth-child(n + 5) {
  border-top: 1px solid var(--line);
}

.risk-kpi.is-small .risk-kpi-value {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  min-height: 2.6em;
  letter-spacing: 0;
}

.risk-wow {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 500;
}

.risk-wow.is-up { color: var(--red); }
.risk-wow.is-down { color: var(--ok); }

.risk-section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.risk-section-head-row h2 {
  margin: 0;
}

.risk-miss-form {
  margin-top: 12px;
  padding: 16px 0 0;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.risk-miss-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  margin-bottom: 12px;
}

.risk-miss-grid label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: #9ca3af;
}

.risk-miss-grid input,
.risk-miss-grid select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  font: inherit;
  background: #fff;
  color: #14161a;
}

.risk-miss-grid input:focus,
.risk-miss-grid select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 1px var(--link);
}

.risk-miss-check {
  align-content: end;
  padding-bottom: 6px;
}

.risk-miss-note {
  grid-column: span 2;
}

@media (max-width: 800px) {
  .risk-kpi-row-8,
  .risk-kpi-row-12 {
    grid-template-columns: 1fr 1fr;
  }
  .risk-miss-grid {
    grid-template-columns: 1fr;
  }
  .risk-miss-note {
    grid-column: auto;
  }
}

.ops-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #9ca3af;
}

.stage-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 6px 0 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  color: #9ca3af;
}
.version-stage-compare.stage-compare,
.version-stage-compare {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 8px 0;
  font-size: 13px;
  border: none !important;
  outline: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  max-width: none;
  color: #9ca3af;
}
.version-stage-compare.is-mismatch {
  border: none !important;
  background: transparent;
  color: var(--orange);
}
.version-block.is-closed .version-stage-compare:not(.is-mismatch) {
  opacity: 0.72;
}
.stage-compare.is-mismatch {
  background: transparent;
  color: var(--orange);
  border: none;
}
.stage-compare-label {
  font-weight: 500;
  color: #9ca3af;
}
.stage-compare.is-mismatch .stage-compare-label {
  color: var(--orange);
}
.stage-compare-sep {
  color: #dadce0;
}
.stage-compare-flag {
  margin-left: 2px;
  padding: 0 6px;
  border-radius: 1px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 12px;
  font-weight: 500;
}
.risk-row.is-stage-mismatch {
  border-left: 3px solid var(--amber);
  padding-left: 10px;
}

.missing-roles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  font-size: 13px;
}
.missing-roles-label {
  font-weight: 500;
  color: #9ca3af;
}
.missing-role-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 1px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 500;
  font-size: 12px;
}

.risk-section-decide {
  padding: 0 0 8px;
  border-radius: 0;
  background: transparent;
  border: none;
  border-left: 3px solid var(--amber);
  padding-left: 16px;
}
.risk-section-decide h2 {
  color: #14161a;
}

.dirty-prio-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dirty-prio-row .risk-row-main {
  flex: 1;
  min-width: 0;
}
.dirty-raw {
  text-decoration: line-through;
  opacity: 0.7;
  color: #9ca3af;
}
.dirty-prio-select {
  height: 32px;
  padding: 0 10px;
  border-radius: 1px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
}
.dirty-prio-select:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 1px var(--link);
}

/* —— 风险日报：全宽六列看板 —— */
body.risk-daily-layout {
  background: #fff;
}

.risk-daily-full {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 12px 0 0;
  box-sizing: border-box;
}

.risk-daily-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0;
  padding: 0 16px 12px;
  border-bottom: none;
}

body.risk-daily-layout .risk-daily-toolbar .btn,
body.risk-daily-layout .risk-daily-toolbar .btn-primary {
  color: #14161a !important;
  font-weight: 400 !important;
  background: #fff !important;
  border-color: var(--line) !important;
}

body.risk-daily-layout .risk-daily-toolbar .btn:hover,
body.risk-daily-layout .risk-daily-toolbar .btn-primary:hover {
  background: var(--surface-muted) !important;
  color: #14161a !important;
}

.risk-daily-meta {
  margin: 0;
  flex: 0 1 auto;
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
}

.risk-kpi-inline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  align-items: stretch;
  gap: 8px 12px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.risk-kpi-inline .risk-kpi-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 0;
  background: #fff;
  border: none;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.risk-kpi-inline .risk-kpi-stat:last-child {
  border-right: none;
}

.risk-kpi-inline .risk-kpi-stat .version-owner-role {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.3;
}

.risk-kpi-inline .risk-kpi-stat .version-owner-name {
  font-size: 22px;
  color: #14161a;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.risk-kpi-inline .risk-kpi-p0 .version-owner-name { color: var(--red); }
.risk-kpi-inline .risk-kpi-p1 .version-owner-name { color: var(--orange); }

.risk-daily-toolbar .risk-daily-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.risk-daily-full .risk-product,
.risk-daily-full .risk-product:hover,
.risk-daily-full a.risk-product,
.risk-daily-full .card-title.risk-product {
  color: #14161a !important;
  text-decoration: none !important;
}

.risk-mini-card .row-text,
.risk-mini-card:hover .row-text,
.risk-mini-card a,
.risk-mini-card a:hover {
  text-decoration: none !important;
}

.risk-daily-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  min-height: calc(100vh - 130px);
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  box-sizing: border-box;
}

.risk-board-col {
  min-width: 0;
  padding: 12px 10px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 130px);
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.risk-board-col:last-child {
  border-right: none;
}

.risk-board-col h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
  line-height: 1.35;
}

.risk-board-col .risk-count {
  margin-left: 4px;
  font-size: 12px;
}

.risk-board-col .risk-list {
  border-top: none;
  gap: 10px;
  flex: 1;
}

.risk-board-col .risk-empty {
  padding: 8px 0;
  font-size: 13px;
}

.risk-board-col.risk-section-decide {
  border-left: none;
  padding-left: 10px;
}

.risk-mini-card.card {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  cursor: default;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  box-shadow: none;
  overflow: visible;
}

.risk-mini-card.card:hover {
  border: 1px solid var(--line);
  box-shadow: none;
}

.risk-mini-card.card::before,
.risk-mini-card.risk-bar-none::before {
  content: none !important;
  display: none !important;
  width: 0 !important;
  background: transparent !important;
}

.risk-mini-card .card-inner {
  padding: 12px;
}

.risk-mini-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.risk-mini-card .card-title {
  font-size: 13px;
  font-weight: 500;
  color: #14161a;
  text-decoration: none !important;
}

.risk-mini-card .card-panel {
  margin: 0;
  background: var(--surface-muted);
}

.risk-mini-card .card-rows li {
  font-size: 13px;
  min-height: 28px;
  line-height: 28px;
}

.risk-mini-card .risk-card-foot {
  margin-top: 8px;
  padding: 0;
  justify-content: flex-start;
}

.risk-mini-card .risk-row-actions {
  flex-direction: row;
  flex-wrap: wrap;
}

body.risk-daily-layout .risk-mini-card .risk-row-actions .btn,
body.risk-daily-layout .risk-mini-card .risk-row-actions .btn-sm {
  color: #14161a !important;
  font-weight: 400 !important;
  background: #fff !important;
  border-color: var(--line) !important;
}

body.risk-daily-layout .risk-mini-card .risk-row-actions .btn:hover {
  background: var(--surface-muted) !important;
  color: #14161a !important;
}

.risk-mini-card.is-stage-mismatch {
  border: 1px solid var(--line);
  padding-left: 0;
}

@media (max-width: 1400px) {
  .risk-daily-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .risk-board-col:nth-child(3n) {
    border-right: none;
  }
  .risk-board-col:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .risk-daily-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .risk-board-col {
    border-right: 1px solid var(--line);
    max-height: none;
  }
  .risk-board-col:nth-child(2n) {
    border-right: none;
  }
  .risk-board-col:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .risk-daily-meta {
    white-space: normal;
  }
}

@media (max-width: 640px) {
  .risk-daily-board {
    grid-template-columns: 1fr;
  }
  .risk-board-col,
  .risk-board-col:nth-child(2n) {
    border-right: none;
    border-top: 1px solid var(--line);
  }
  .risk-board-col:first-child {
    border-top: none;
  }
}

.risk-weekly-miss {
  margin: 0;
  padding: 16px 16px 32px;
  border-top: none;
}

.risk-weekly-miss .risk-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  border-top: none;
}

.risk-weekly-miss .risk-mini-card {
  margin-bottom: 0;
}

body.risk-daily-layout .risk-weekly-miss .btn {
  color: #14161a !important;
  font-weight: 400 !important;
  background: #fff !important;
  border-color: var(--line) !important;
}

/* 使用说明 1 页 */
.help-page .help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.help-card {
  margin: 0;
  padding: 16px 18px;
  border-radius: 1px;
  background: #fff;
  border: 1px solid var(--line);
}
.help-card-focus {
  border-color: var(--amber);
  background: linear-gradient(180deg, var(--orange-soft) 0%, #fff 70%);
}
.help-card-wide {
  margin-bottom: 24px;
}
.help-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
}
.help-steps,
.help-list {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.55;
  font-size: 13px;
}
.help-steps li + li,
.help-list li + li {
  margin-top: 6px;
}
.help-note {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.help-code {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 1px;
  background: #111827;
  color: var(--surface-muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-x: auto;
}
.help-table-wrap {
  overflow-x: auto;
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.help-table th,
.help-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.help-table th {
  font-weight: 600;
  color: #14161a;
  background: var(--surface-muted);
}
@media (max-width: 860px) {
  .help-page .help-grid {
    grid-template-columns: 1fr;
  }
}

.win-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  padding: 0 10px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-sizing: border-box;
  box-shadow: none;
}
.win-badge.win-ads {
  color: var(--amber);
  background: var(--orange-soft);
}
.win-badge.win-memb {
  color: var(--link-text);
  background: var(--link-soft);
}

/* 版本标题栏标签：高 25px、圆角 4px、无投影、不加粗 */
.version-badges .sch-stage.is-strong,
.version-badges .prio-badge.is-strong,
.version-badges .win-badge,
.version-badges .version-closed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-sizing: border-box;
  box-shadow: none;
}

.biz-window-block {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 1px;
  background: var(--surface-muted);
}
.biz-window-title {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
}
.biz-window-hint {
  margin: 4px 0 10px;
  font-size: 13px;
}
.biz-window-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}
.biz-window-row input[type="date"] {
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 1px;
  font: inherit;
}
@media (max-width: 720px) {
  .biz-window-row {
    grid-template-columns: auto 1fr;
  }
  .biz-window-row input[type="date"] {
    grid-column: 1 / -1;
  }
}

/* —— 大脑 · 纯回放工作流 —— */
.brain-app {
  min-height: 100vh;
  background: #fff;
}
.brain-stage {
  position: relative;
  height: calc(100vh - 56px);
  overflow: auto;
  background: #fff;
  /* 避免滚动锚定在节点重绘时把画面拽动 */
  overflow-anchor: none;
}
.brain-canvas {
  min-width: 100%;
  min-height: 100%;
  display: flex;
  justify-content: center;
  padding: 28px 40px 48px;
  box-sizing: border-box;
  background: #fff;
}
.brain-board {
  position: relative;
  flex: 0 0 auto;
}
.brain-wires {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
}
.brain-nodes {
  position: relative;
  z-index: 2;
}
.brain-wire {
  fill: none;
  stroke: #d7dbe3;
  stroke-width: 1.5;
  transition: stroke 0.25s ease;
}
.brain-wire.is-active {
  stroke: #b0b8c6;
}
.brain-wire.is-done {
  stroke: #a8b4c8;
}
.brain-wire.is-flowing {
  stroke: var(--link-focus);
  stroke-width: 2;
}
.brain-wire-flow {
  fill: none;
  stroke: var(--link);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 10 14;
  animation: brain-marquee 0.55s linear infinite;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--link) 45%, transparent));
}
@keyframes brain-marquee {
  to {
    stroke-dashoffset: -24;
  }
}
.brain-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  border-radius: var(--radius-control);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.brain-pill-yes {
  background: var(--ok-soft);
  color: var(--ok);
}
.brain-pill-no {
  background: var(--red-soft);
  color: var(--red);
}
.wf-node {
  position: absolute;
  box-sizing: border-box;
  background: #fff;
  border:1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 10px 14px 12px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.wf-node.is-active {
  border-color: var(--link-focus);
  box-shadow: 0 0 0 3px rgba(99, 130, 255, 0.16);
}
.wf-node.is-done {
  border-color: var(--ok-soft);
}
.wf-node.is-pending {
  opacity: 0.88;
}
.wf-sub.is-fresh {
  animation: brain-sub-fresh 0.45s ease;
}
@keyframes brain-sub-fresh {
  from {
    color: var(--link);
  }
  to {
    color: #9ca3af;
  }
}
.wf-node-ports {
  pointer-events: none;
}
.wf-port {
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--link-focus);
  z-index: 3;
}
.wf-port-in {
  top: -5px;
}
.wf-port-out {
  bottom: -5px;
}
.wf-node-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
}
.wf-node-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wf-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 1px;
  display: grid;
  place-items: center;
}
.wf-icon.tone-blue {
  background: var(--link-soft);
  color: var(--link);
}
.wf-icon.tone-purple {
  background: var(--sch-ui-bg);
  color: var(--sch-ui-strong-fg);
}
.wf-icon.tone-orange {
  background: var(--orange-soft);
  color: var(--orange);
}
.wf-icon.tone-green {
  background: var(--ok-soft);
  color: var(--ok);
}
.wf-icon.tone-teal {
  background: var(--sch-client-bg);
  color: var(--sch-client-strong-fg);
}
.wf-icon.tone-rose {
  background: var(--red-soft);
  color: var(--red);
}
.wf-copy {
  min-width: 0;
}
.wf-title {
  font-size: 13px;
  font-weight: 700;
  color: #14161a;
  line-height: 1.25;
}
.wf-sub {
  margin-top: 2px;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-error {
  background: var(--red-deep);
}

/* —— Soft SaaS utilities —— */
.soft-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.soft-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 1px;
  transition: background 0.15s ease;
}

.soft-row:hover {
  background: var(--surface-hover);
}

.badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 18%, transparent);
  font-size: 13px;
  font-weight: 500;
}

.badge-ok::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

@media (max-width: 1100px) {
  .topbar {
    padding: 0 24px;
  }
  .admin-shell {
    width: calc(100% - 48px);
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 12px;
    gap: 10px;
  }
  .layout {
    padding: 16px 12px 32px;
  }
  .admin-shell {
    width: calc(100% - 24px);
    padding: 20px 16px 24px;
    margin: 16px auto 32px;
  }
}

/* Phase 0：我的工作 / 组织看板 — 白底，宽度对齐上线检查清单 */
.work-app {
  min-height: 100vh;
  background: #fff;
}
.work-page {
  width: calc(100% - 200px);
  max-width: none;
  margin: 28px auto 48px;
  padding: 0 0 48px;
  box-sizing: border-box;
}
.work-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.work-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.work-org-wrap {
  flex: 0 0 220px;
  width: 220px;
  max-width: 100%;
  padding: 0;
  position: relative;
  z-index: 100;
}
.work-org-wrap .sch-org-select,
.work-org-wrap .cselect {
  width: 100%;
}
.work-task-head {
  justify-content: flex-start;
  align-items: center;
}
.work-task-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  min-width: 0;
}
.work-task-head-main h2 {
  flex: 0 0 auto;
}
.work-task-scope-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  background: var(--surface-muted);
  border-radius: 1px;
}
.work-task-scope-tab {
  border: none;
  background: transparent;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-control);
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}
.work-task-scope-tab:hover {
  color: #14161a;
}
.work-task-scope-tab.is-active {
  background: #fff;
  color: #14161a;
  box-shadow: none;
}
.work-task-scope-num {
  margin-left: 2px;
  font-weight: 500;
  color: inherit;
  opacity: 0.75;
}
.work-toolbar-compact {
  align-items: center;
  margin-bottom: 20px;
}
.work-toolbar-compact .work-tabs {
  margin-bottom: 0;
}
.work-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #14161a;
}
.work-sub {
  margin: 6px 0 0;
}
.work-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.work-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.8fr);
  gap: 12px;
  align-items: end;
}
.work-rich-input {
  min-height: 120px;
  border: none;
  border-radius: 0;
  padding: 12px 12px 64px;
  background: transparent;
}
.work-rich-input:empty:before,
.work-rich-input.is-empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}
.work-task-modal .rich-editor {
  border: 1px solid var(--line);
  border-radius: 1px;
}
.work-label-with-action {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.work-label-with-action .field-label {
  margin: 0;
}
.work-assignee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  min-height: 28px;
  align-items: center;
}
.work-subsection + .work-subsection {
  margin-top: 28px;
}
.work-task-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
}
.work-task-modal-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.assignee-at {
  color: var(--link-text);
  font-weight: 600;
}
.work-mention-panel {
  position: fixed;
  z-index: 12000;
  width: 280px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
  box-sizing: border-box;
  overflow: hidden;
}
.work-mention-panel[hidden] {
  display: none !important;
}
.work-mention-head {
  padding: 8px 10px;
  border-bottom:1px solid var(--line);
}
.work-mention-search {
  width: 100%;
  height: 32px;
  margin: 0;
  box-sizing: border-box;
}
.work-mention-list {
  flex: 1;
  min-height: 0;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
}
.work-mention-empty {
  margin: 12px 8px;
  font-size: 13px;
}
.work-mention-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 1px;
  cursor: pointer;
  font-size: 13px;
}
.work-mention-item:hover {
  background: var(--surface-muted);
}
.work-mention-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-avatar);
  flex: 0 0 auto;
  object-fit: cover;
}
.work-mention-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #14161a;
}
.work-mention-user {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
}
.work-mention-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-top:1px solid var(--line);
  background: var(--surface-muted);
}
.work-assignee-list {
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.work-assignee-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.work-assignee-item:last-child {
  border-bottom: none;
}
.work-assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-avatar);
  flex: 0 0 auto;
  object-fit: cover;
}
.work-task-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.work-task-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  color: #14161a;
}
.work-task-table col.work-task-col-main { width: 64%; }
.work-task-table col.work-task-col-date { width: 12%; }
.work-task-table col.work-task-col-assignees { width: 12%; }
.work-task-table thead th,
.work-task-table tbody td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.work-task-table thead th:last-child,
.work-task-table tbody td:last-child {
  border-right: 0;
}
.work-task-table tbody tr:last-child td {
  border-bottom: 0;
}
.work-task-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #14161a;
  padding: 10px 12px;
  background: #fff;
  vertical-align: middle;
}
.work-task-table tbody td {
  padding: 14px 12px;
  vertical-align: middle;
  text-align: left;
}
.work-task-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.work-task-col-date {
  white-space: nowrap;
  color: #14161a;
}
.work-task-col-status {
  color: #14161a;
  font-weight: 400;
}
.work-task-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.35;
}
.work-task-status-warn {
  color: var(--red);
  font-weight: 600;
  font-size: 13px;
}
.work-task-col-action {
  white-space: nowrap;
  text-align: left;
}
.work-task-table thead th.work-task-col-action {
  text-align: left;
}
.work-task-col-action .work-task-cell {
  align-items: flex-start;
}
.work-task-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}
.work-task-actions .btn-edit-task {
  background: #fff;
  border: 1px solid var(--line);
  color: #14161a;
  box-shadow: none;
}
.work-task-actions .btn-edit-task:hover {
  background: #fff;
  border-color: var(--line);
  color: #14161a;
}
.work-task-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
  color: #14161a;
  text-align: left;
  width: 100%;
}
.work-task-desc {
  margin-top: 8px;
  margin-left: 23px;
  font-size: 13px;
  color: #14161a;
  line-height: 25px;
  word-break: break-word;
  text-align: left;
  width: calc(100% - 23px);
}
.work-task-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 13px;
  line-height: 21px;
  cursor: pointer;
}
.work-task-comment-btn:hover {
  color: #9ca3af;
}
.work-task-comment-avatars {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.work-task-comment-avatar-sm {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-avatar);
  border: 1.5px solid #fff;
  box-sizing: border-box;
  margin-left: -6px;
  object-fit: cover;
  background: var(--surface-muted);
}
.work-task-comment-avatar-sm:first-child {
  margin-left: 0;
}
.work-task-comment-label {
  color: inherit;
}
.work-task-comment-count {
  color: inherit;
}
.work-task-comment-modal .modal-panel {
  width: min(560px, calc(100vw - 32px));
}
.work-task-comment-list {
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}
.work-task-comment-empty {
  margin: 8px 0 16px;
  font-size: 13px;
}
.work-task-comment-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.work-task-comment-item:last-child {
  border-bottom: none;
}
.work-task-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 13px;
}
.work-task-comment-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-avatar);
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--surface-muted);
}
.work-task-comment-author {
  font-weight: 600;
  color: #14161a;
}
.work-task-comment-time {
  color: #9ca3af;
}
.work-task-comment-body {
  font-size: 13px;
  line-height: 21px;
  color: #14161a;
  word-break: break-word;
}
.work-task-comment-body .assignee-at {
  color: var(--link-text);
  font-weight: 600;
}
.work-task-comment-editor {
  min-height: 96px;
  max-height: 200px;
  padding: 10px 12px;
}
.work-task-comment-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.work-task-desc img {
  display: block;
  max-width: 160px;
  width: auto;
  height: auto;
  margin: 8px 0 0;
  border-radius: 1px;
  cursor: zoom-in;
}
.work-task-assignee-item {
  padding: 2px 0;
  line-height: 1.45;
  text-align: left;
  width: 100%;
}
.work-task-row.is-done {
  opacity: 0.78;
}
.work-task-row.is-done .work-task-title,
.work-task-row.is-done .work-task-title-btn,
.work-task-row.is-done .work-task-title-btn.is-alert {
  color: #9ca3af;
}
.work-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #14161a;
  cursor: pointer;
  user-select: none;
}
.work-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.work-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: #14161a;
  border-radius: var(--radius-control);
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.work-tab.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.work-section {
  margin-bottom: 22px;
}
.work-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.work-section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.work-more {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}
.work-list {
  display: grid;
  gap: 10px;
}
.work-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.work-card:hover {
  border-color: var(--line);
  box-shadow: none;
}
.work-card.is-overdue {
  border-color: var(--red-soft);
  background: #fffaf9;
}
.work-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.work-card-title {
  margin-top: 6px;
  font-size: 13px;
  color: #14161a;
}
.work-card-meta {
  margin-top: 6px;
  font-size: 13px;
}
.work-stage {
  font-size: 13px;
  color: #9ca3af;
  background: var(--surface-muted);
  border-radius: var(--radius-control);
  padding: 2px 8px;
  white-space: nowrap;
}
.work-empty {
  margin: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 1px;
}
.dash-page .dash-topbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}
.dash-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-filters > .cselect,
.dash-filters > .sch-org-select {
  width: 220px;
  flex: 0 0 auto;
}
.dash-page-title {
  margin: 0 0 16px;
}
.dash-page .dash-page-title,
.dash-page .work-title,
.dash-page .dash-section-title {
  font-size: 22px;
  font-weight: 400;
  color: #14161a;
}
.dash-range {
  display: inline-flex;
  align-items: stretch;
  height: 34px; /* 与组织筛选同高 */
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.dash-range-btn {
  border: 0;
  background: transparent;
  height: 100%;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dash-range-btn.is-active {
  background: var(--surface-muted);
  color: #14161a;
  font-weight: 600;
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.dash-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 16px;
  text-align: left;
  font: inherit;
  color: inherit;
}
button.dash-kpi {
  cursor: pointer;
}
.dash-kpi.is-clickable:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}
.dash-kpi-value {
  font-size: 22px; /* 4.8rem 的一半 */
  line-height: 1.05;
  font-weight: 700;
  color: #14161a;
}
.dash-kpi-value--red {
  color: var(--red);
}
.dash-kpi-value--purple {
  color: var(--sch-ui-strong-fg);
}
.dash-kpi-label {
  margin-top: 8px;
  font-size: 13px;
  color: #9ca3af;
}
.dash-section {
  margin-bottom: 28px;
}
.dash-section-head {
  margin-bottom: 12px;
}
.dash-section-title {
  margin: 0;
}
.dash-section-sub {
  margin: 4px 0 0;
  font-size: 13px;
}
.dash-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.dash-people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-people-table th,
.dash-people-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dash-people-table th {
  color: #9ca3af;
  font-weight: 600;
  background: var(--surface-muted);
}
.dash-people-table tr:last-child td {
  border-bottom: 0;
}
.dash-people-row {
  cursor: pointer;
}
.dash-people-row:hover td {
  background: var(--surface-muted);
}
.dash-people-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.dash-people-avatar {
  display: inline-flex;
  flex: 0 0 auto;
}
.dash-people-avatar .user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-avatar);
}
.is-warn-text {
  color: var(--red);
  font-weight: 600;
}
.dash-load {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 2px 8px;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
}
.dash-load-green {
  color: var(--ok);
  background: var(--ok-soft);
}
.dash-load-yellow {
  color: var(--amber);
  background: var(--amber-soft);
}
.dash-load-red {
  color: var(--red);
  background: var(--red-soft);
}
.dash-things-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-things-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 14px 16px;
  min-width: 0;
}
.dash-panel-wide {
  min-height: 100%;
}
.dash-panel-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  color: #14161a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-link-btn {
  border: 0;
  background: transparent;
  color: var(--link-hover);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.dash-link-btn:hover {
  text-decoration: none;
}
.dash-dist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-dist-row {
  display: grid;
  grid-template-columns: 52px 1fr 32px;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: #14161a;
  text-align: left;
  cursor: pointer;
}
.dash-dist-row:disabled {
  cursor: default;
}
.dash-dist-bar {
  height: 8px;
  background: var(--surface-muted);
  border-radius: 1px;
  overflow: hidden;
}
.dash-dist-bar i {
  display: block;
  height: 100%;
  background: #98a2b3;
  border-radius: inherit;
}
.dash-dist-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dash-plan-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: #14161a;
  margin-bottom: 8px;
}
.dash-plan-bar {
  height: 10px;
  background: var(--surface-muted);
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 14px;
}
.dash-plan-bar i {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: inherit;
}
.dash-plan-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dash-plan-metric {
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--surface-muted);
  padding: 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.dash-plan-metric:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}
.dash-plan-metric strong {
  display: block;
  font-size: 16px;
  color: #14161a;
}
.dash-plan-metric span {
  font-size: 13px;
  color: #9ca3af;
}
.dash-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.dash-mini-item {
  display: block;
  padding: 10px 12px;
  border-radius: 1px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.dash-mini-item:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}
.dash-mini-item.is-overdue {
  border-color: var(--red-soft);
  background: #fff8f6;
}
.dash-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
}
.dash-mini-meta {
  margin-top: 4px;
  font-size: 13px;
}
.dash-empty-inline {
  margin: 0;
  font-size: 13px;
}
.dash-schedule-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.dash-sch-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: default;
}
button.dash-sch-kpi {
  cursor: pointer;
}
button.dash-sch-kpi:hover {
  background: var(--surface-muted);
}
/* 排期异常：取消红边/红底，数字标题用红色标示 */
.dash-page .dash-sch-kpi.is-warn,
.dash-page .dash-sch-kpi.is-danger {
  border-color: var(--line);
  background: #fff;
}
.dash-page .dash-sch-kpi.is-warn strong,
.dash-page .dash-sch-kpi.is-danger strong {
  color: var(--red);
}
.dash-page .work-card.is-overdue {
  border-color: var(--line);
  background: #fff;
}
.dash-page .work-card.is-overdue .work-card-top strong,
.dash-page .work-card.is-overdue .work-card-title {
  color: var(--red);
}
.dash-sch-kpi strong {
  font-size: 22px;
  color: #14161a;
}
.dash-sch-kpi span {
  font-size: 13px;
  color: #9ca3af;
}
.dash-schedule-tabs {
  margin-bottom: 12px;
}
.dash-drawer[hidden] {
  display: none !important;
}
.dash-drawer {
  position: fixed;
  inset: 0;
  z-index: 2400;
}
.dash-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}
.dash-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.dash-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.dash-drawer-head h2 {
  margin: 0;
  font-size: 16px;
}
.dash-drawer-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 18px 24px;
}
.dash-drawer-count {
  margin: 0 0 10px;
  font-size: 13px;
}
.sch-mine-check {
  display: flex;
  margin-top: 8px;
  font-size: 13px;
}
@media (max-width: 1100px) {
  .work-page {
    width: calc(100% - 48px);
  }
}
@media (max-width: 820px) {
  .work-page {
    width: calc(100% - 24px);
    margin: 16px auto 32px;
  }
}
@media (max-width: 1100px) {
  .dash-things-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-panel-wide {
    grid-column: 1 / -1;
  }
  .dash-schedule-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .dash-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-kpi-value {
    font-size: 22px;
  }
  .dash-things-grid,
  .dash-things-lists,
  .dash-schedule-kpis,
  .dash-plan-metrics {
    grid-template-columns: 1fr;
  }
}

/* 平台按钮统一去掉投影 */
.btn,
a.btn,
label.btn,
.btn:hover,
a.btn:hover,
label.btn:hover,
.btn:focus,
a.btn:focus,
.btn:active,
a.btn:active,
.btn-primary,
a.btn-primary,
.btn-primary:hover,
a.btn-primary:hover,
.btn-danger,
a.btn-danger,
.btn-danger:hover,
a.btn-danger:hover,
.btn-ghost,
.btn-sm,
.icon-btn,
.icon-btn:hover,
.rich-tool-btn,
.rich-tool-btn:hover,
.img-viewer-btn,
.img-viewer-btn:hover,
.user-chip,
.user-chip:hover,
.user-chip-menu-item,
.cselect-trigger,
.cselect-trigger:hover,
.cselect-trigger:focus,
.stage-pill,
.sch-risk-tab,
.sch-risk-tab.is-active,
.work-task-scope-tab,
.work-task-scope-tab.is-active,
.work-tab,
.work-tab.is-active,
.activity-action-btn,
.sch-product-edit,
.version-risk-actions .btn,
.cl-btn-text-muted,
.work-task-actions .btn-edit-task,
.work-task-actions .btn-edit-task:hover,
button.btn,
input[type="submit"].btn,
input[type="button"].btn {
  box-shadow: none !important;
}

/* —— 我的工作增强：焦点 / 通知 / 看板 / 日历 —— */
.work-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.work-view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 1px;
}
.work-view-tab {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-control);
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
}
.work-view-tab.is-active {
  background: #fff;
  color: #14161a;
  font-weight: 600;
}
.work-focus-section {
  margin-bottom: 18px;
}
.work-focus-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.work-focus-empty {
  margin: 0;
  font-size: 13px;
}
.work-focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .work-focus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .work-focus-grid { grid-template-columns: 1fr; }
}
.work-focus-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 10px;
  min-height: 72px;
}
.work-focus-col-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #14161a;
}
.work-focus-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface-muted);
  border-radius: 1px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
}
.work-focus-item:hover { background: var(--surface-muted); }
.work-focus-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.work-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
}
.work-filter-select {
  width: auto;
  min-width: 120px;
}
.work-filter-uline-pair {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.work-priority-dd {
  position: relative;
  flex: 0 0 auto;
}
.work-priority-uline,
.work-search-uline {
  box-sizing: border-box;
  height: 28px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background-color: transparent;
  padding: 0;
  font-size: 13px;
  line-height: 28px;
  color: #9ca3af;
  box-shadow: none;
}
button.work-priority-uline {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: max-content;
  min-width: 5.5em;
  padding: 0 16px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  cursor: pointer;
  font: inherit;
  text-align: left;
  white-space: nowrap;
}
.work-priority-label {
  display: inline-block;
  white-space: nowrap;
}
.work-priority-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  min-width: 100%;
  width: max-content;
  padding: 4px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  z-index: 40;
}
.work-priority-option {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  color: #9ca3af;
  text-align: left;
  padding: 7px 12px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
}
.work-priority-option:hover,
.work-priority-option.is-selected {
  color: #14161a;
  background: #fff;
}
.work-search-uline {
  width: min(220px, 100%);
  min-width: 140px;
}
.work-search-uline::placeholder {
  color: #9ca3af;
}
.work-priority-uline:hover,
.work-priority-uline:focus,
.work-priority-dd.is-active .work-priority-uline,
.work-search-uline:hover,
.work-search-uline:focus {
  border-bottom-color:var(--line);
  color: #14161a;
  outline: none;
}
.work-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #14161a;
}
.work-task-table col.work-task-col-main { width: 64%; }
.work-task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.work-task-done-check,
.work-task-sub-check {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, #14161a 16%, #fff);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.45s ease;
}
.work-task-row:hover .work-task-done-check,
.work-task-row:hover .work-task-sub-check {
  border-color: var(--accent);
}
.work-task-done-check:checked,
.work-task-sub-check:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M10.2 2.6 4.6 8.2 1.8 5.4l-.8.8 3.6 3.6 6.4-6.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
}
.work-task-done-check:disabled,
.work-task-sub-check:disabled {
  cursor: default;
  opacity: 0.45;
}
.work-task-sublist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 4px 23px;
}
.work-task-subitem {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #14161a;
  cursor: pointer;
}
.work-task-subitem.is-done span {
  color: #9ca3af;
  text-decoration: line-through;
}
.work-drawer-actions {
  position: relative;
  margin-top: 8px;
}
.work-drawer-action-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.work-drawer-action-item {
  display: flex;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.work-drawer-action-item:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.work-drawer-action-item--danger:hover {
  color: var(--red);
  background: var(--red-soft);
}
.work-drawer-form {
  margin-bottom: 8px;
}
/* .admin-form { display:grid } 会盖掉 [hidden]，查看态必须强制藏表单 */
.work-drawer [hidden],
.work-drawer-form[hidden],
.work-drawer:not(.is-create) .work-drawer-form,
.work-drawer.is-create #taskDetailView,
.work-drawer.is-create #taskDetailDepsBlock,
.work-drawer.is-create #taskDetailCommentBlock {
  display: none !important;
}
.work-daterange {
  position: relative;
  width: 100%;
}
.work-daterange-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.work-daterange-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-daterange-trigger .is-placeholder {
  color: #9ca3af;
}
.work-daterange-panel {
  position: fixed;
  z-index: 12600;
  width: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-sizing: border-box;
}
.work-daterange-panel[hidden] {
  display: none !important;
}
.work-daterange-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.work-daterange-title {
  min-width: 7em;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}
.work-daterange-weekdays,
.work-daterange-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.work-daterange-weekdays {
  margin-bottom: 4px;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}
.work-daterange-cell.is-pad {
  min-height: 30px;
}
.work-daterange-day {
  height: 30px;
  border: 0;
  background: transparent;
  color: #14161a;
  font: inherit;
  font-size: 13px;
  border-radius: 1px;
  cursor: pointer;
}
.work-daterange-day:hover {
  background: var(--surface-muted);
}
.work-daterange-day.is-today {
  font-weight: 700;
}
.work-daterange-day.is-in {
  background: var(--accent-soft, var(--link-soft));
}
.work-daterange-day.is-start,
.work-daterange-day.is-end,
.work-daterange-day.is-start.is-today,
.work-daterange-day.is-end.is-today {
  background: var(--accent);
  color: #fff !important;
}
.work-daterange-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.work-drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.work-cal-chip.is-done {
  color: #9ca3af;
}
.work-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border-radius: 1px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-muted);
  color: #14161a;
}
.work-priority-P0 { background: var(--red-soft); color: var(--red); }
.work-priority-P1 { background: var(--orange-soft); color: var(--orange); }
.work-priority-P2 { background: var(--amber-soft); color: var(--amber); }
.work-priority-P3 { background: var(--surface-muted); color: var(--muted); }
.work-task-title.is-alert {
  color: var(--red);
}
.work-task-row.is-done .work-task-title.is-alert {
  color: var(--red);
  opacity: 0.75;
}
.work-task-source {
  display: inline-block;
  margin: 4px 0 2px;
  font-size: 13px;
  color: var(--link-text);
  font-weight: 600;
  text-decoration: none;
}
.work-task-source:hover { text-decoration: none; }
.work-task-progress { font-size: 13px; margin-top: 4px; }
.work-task-assignee-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
  line-height: 1.4;
}
.work-task-assignee-item.is-done { color: #9ca3af; }
.work-task-assignee-st {
  font-size: 12px;
  color: #9ca3af;
}
.work-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  margin-left: 4px;
}
.work-task-row.has-unread .work-task-title { font-weight: 700; }
.work-notif-wrap {
  position: relative;
  z-index: 2100;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.work-notif-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.work-notif-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.work-notif-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url(/static/notice-bell.png?v=20260818notif1) center / contain no-repeat;
  mask: url(/static/notice-bell.png?v=20260818notif1) center / contain no-repeat;
}
.work-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  pointer-events: none;
}
.work-notif-dot[hidden] {
  display: none !important;
}
.work-notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  width: min(360px, 92vw);
  max-height: 420px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  z-index: 95;
  padding: 10px;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
/* 悬停入口或面板时展开，留空隙防闪断 */
.work-notif-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}
.work-notif-wrap:hover .work-notif-panel,
.work-notif-wrap:focus-within .work-notif-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.work-notif-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.work-notif-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
  background: transparent;
  padding: 10px 2px;
  margin: 0;
  cursor: pointer;
}
.work-notif-item:last-child {
  border-bottom: 0;
}
.work-notif-item.is-unread { background: transparent; }
.work-notif-title { font-size: 13px; font-weight: 600; }
.work-notif-time { font-size: 12px; margin-top: 4px; }
.work-task-comment-item.is-system .work-task-comment-body {
  color: #9ca3af;
  font-size: 13px;
}
.work-checklist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.work-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 1px;
  background: var(--surface-muted);
}
.work-checklist-item.is-done span { text-decoration: line-through; color: #9ca3af; }
.work-checklist-del {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
}
.work-board[hidden],
.work-calendar[hidden],
.work-task-table-wrap[hidden] {
  display: none !important;
}
.work-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 8px;
}
.work-board-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  min-height: 220px;
  padding: 8px;
}
.work-board-col-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.work-board-card {
  background: #fff;
  border-radius: 1px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.work-board-card-meta { font-size: 13px; color: #9ca3af; margin-top: 6px; }
.work-calendar { background: #fff; border:1px solid var(--line); border-radius: 1px; padding: 12px; }
.work-cal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.work-cal-title {
  font-weight: 600;
  min-width: 7em;
  text-align: center;
}
.work-cal-nav {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.work-cal-nav:hover {
  background: var(--surface-muted);
  color: #14161a;
}
.work-cal-weekdays,
.work-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.work-cal-weekdays { margin-bottom: 6px; font-size: 13px; color: #9ca3af; text-align: center; }
.work-cal-cell {
  min-height: 84px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 6px;
  background: #fff;
}
.work-cal-cell.is-pad { background: transparent; border-color: transparent; }
.work-cal-day { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.work-cal-chip {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--link-soft);
  color: #244;
  border-radius: 1px;
  padding: 3px 5px;
  font-size: 12px;
  margin-bottom: 3px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 知识库 —— */
body.kb-app {
  background: #fff;
  min-height: 100vh;
}
body.kb-app .topbar.schedule-topbar {
  background: #fff;
}
.kb-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 28px 40px;
  background: #fff;
}
.kb-explore-strip {
  margin-bottom: 28px;
}
.kb-explore-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.kb-explore-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #14161a;
}
.kb-explore-more {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}
.kb-explore-more:hover { text-decoration: none; }
.kb-explore-page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.kb-explore-back {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}
.kb-explore-back:hover { text-decoration: none; }
.kb-explore-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  color: #14161a;
}
.kb-explore-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.kb-explore-page-label {
  font-size: 13px;
}
.kb-space-card--explore .kb-space-card-meta {
  padding-right: 0;
}
.kb-explore-hide-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  font: inherit;
  font-size: 13px;
  line-height: 20px;
  color: #14161a;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 2px 8px;
  cursor: pointer;
  transition: opacity 0.12s ease;
}
.kb-space-card:hover .kb-explore-hide-btn,
.kb-explore-hide-btn:focus {
  opacity: 1;
  pointer-events: auto;
}
.kb-explore-hide-btn:hover {
  background: var(--surface-muted);
}
.kb-meta-org {
  font-weight: 400;
  color: #14161a;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-toolbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.kb-search-wrap {
  z-index: 90;
}
.kb-search-input.sch-org-select {
  width: 100%;
  box-sizing: border-box;
}
.kb-space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 390px);
  gap: 12px;
  justify-content: start;
}
.kb-space-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 390px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 14px 16px;
  color: inherit;
  transition: border-color 0.12s ease;
  box-sizing: border-box;
  overflow: visible;
}
.kb-space-card:hover { border-color:var(--line); }
.kb-space-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.kb-space-card-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}
.kb-space-card-desc {
  font-size: 13px;
  line-height: 25px;
  min-height: 25px;
  margin-bottom: 8px;
}
.kb-space-card-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  min-height: 54px;
}
.kb-space-file-link {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 13px;
  color: inherit;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}
.kb-space-file-icon {
  flex: 0 0 auto;
  line-height: 1;
}
.kb-space-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-space-file-link:hover { text-decoration: none; }
.kb-space-card-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  line-height: 20px;
  height: 28px;
  margin-top: auto;
  padding-right: 28px; /* 给右下角三点留位 */
  overflow: hidden;
}
/* 覆盖全局 .muted { margin-top: 4px }，避免创建者/时间相对权限文案错行 */
.kb-space-card-meta > .kb-meta-vis,
.kb-space-card-meta > .kb-meta-org,
.kb-space-card-meta > .kb-meta-owner,
.kb-space-card-meta > .kb-meta-time {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 28px;
  margin: 0 !important;
  padding: 0;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}
.kb-meta-vis {
  font-weight: 400;
  color: #14161a;
}
.kb-meta-owner {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kb-space-card.is-pinned-space {
  box-shadow: inset 3px 0 0 var(--amber);
}
/* 知识库卡片右下角三点菜单 */
.kb-space-more-wrap {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.kb-space-more-wrap::before {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: 100%;
  height: 8px;
}
.kb-space-card:hover .kb-space-more-wrap,
.kb-space-more-wrap:hover,
.kb-space-more-wrap:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.kb-space-more-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
}
.kb-space-more-btn::before,
.kb-space-more-btn::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #667085;
  display: block;
}
.kb-space-more-btn span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #667085;
  display: block;
}
.kb-space-more-btn:hover { background: var(--surface-muted); }
.kb-space-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: 40;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 4px;
  display: none;
  flex-direction: column;
}
.kb-space-more-wrap:hover .kb-space-menu,
.kb-space-more-wrap:focus-within .kb-space-menu {
  display: flex;
}
.kb-space-menu-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 1px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
  white-space: nowrap;
  font-family: inherit;
}
.kb-space-menu-item:hover { background: var(--surface-muted); }
.kb-perm-modal {
  align-items: center;
  padding: 16px 20px 20px;
}
/* 权限弹窗：随内容自适应高度，避免大块空白 */
.modal-panel.admin-modal.schedule-modal.kb-perm-panel {
  width: min(92vw, 560px);
  height: auto;
  max-height: min(92vh, calc(100vh - 56px - 24px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.kb-perm-panel .modal-head,
.kb-perm-panel .work-task-modal-foot {
  flex: 0 0 auto;
}
.kb-perm-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.kb-perm-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kb-perm-collab {
  flex: 0 0 auto;
}
.kb-perm-danger {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.kb-perm-delete-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
}
.kb-perm-delete-btn:hover {
  text-decoration: none;
}
.kb-perm-delete-hint {
  margin: 0;
  font-size: 13px;
}
.kb-perm-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #14161a;
}
.kb-perm-radio {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #14161a;
  cursor: pointer;
}
.kb-perm-radio input {
  margin: 3px 0 0;
}
.kb-perm-radio-hint {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
  line-height: 1.4;
}
.kb-perm-collab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kb-perm-collab-hint {
  margin: 0;
  font-size: 13px;
}
.kb-collab-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.kb-collab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--surface-muted);
}
.kb-collab-name {
  font-size: 13px;
  color: #14161a;
}
/* 新建知识库：自适应高度，短表单无需滚动 */
.modal-panel.admin-modal.schedule-modal.kb-create-panel {
  width: min(92vw, 560px);
  height: auto;
  max-height: min(92vh, calc(100vh - 56px - 24px));
  overflow: visible;
  box-sizing: border-box;
}
.kb-create-panel .modal-body {
  overflow: visible;
  flex: 0 0 auto;
}
.kb-create-panel .admin-form textarea.kb-create-desc,
.kb-create-panel .admin-form textarea[name="description"] {
  resize: none !important;
  min-height: 72px;
  max-height: 72px;
  overflow-y: auto;
}
.kb-create-panel .kb-create-visibility {
  margin-bottom: 80px;
}
.kb-desc-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: #9ca3af;
}
.kb-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-control);
  background: var(--surface-muted);
  color: #14161a;
  font-size: 12px;
  font-weight: 600;
}
.kb-badge-doc { background: var(--link-soft); color: var(--link-hover); }
.kb-badge-sheet { background: var(--ok-soft); color: var(--ok); }
.kb-badge-slides { background: var(--orange-soft); color: var(--orange); }
.kb-hint { font-size: 13px; margin: 0 0 10px; }
.kb-back {
  display: inline-block;
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
  margin-bottom: 8px;
}

/* 公开知识库匿名只读：无访客身份，写操作/离开只读区再提示登录 */
body.kb-guest #btnNewGroup,
body.kb-guest #userChip,
body.kb-guest #userChipDropdown,
body.kb-guest .kb-file-more-wrap,
body.kb-guest .kb-create-wrap,
body.kb-guest .kb-sel-toolbar,
body.kb-guest .kb-sheet-format-bar {
  display: none !important;
}
body.kb-guest .kb-guest-login-btn {
  text-decoration: none;
}
body.kb-guest .kb-guest-comment-hint {
  margin: 0;
  padding: 8px 0 4px;
}
body.kb-guest .kb-guest-comment-login {
  color: var(--link);
  font-weight: 600;
  text-decoration: none;
}
body.kb-guest .kb-guest-comment-login:hover {
  text-decoration: none;
}
.kb-guest-access-actions {
  margin-top: 4px;
}
/* 开通权限弹窗：按内容自适应，避免套用大表单宽度 */
#kbGuestAccessModal .kb-guest-access-panel {
  width: fit-content;
  max-width: min(360px, calc(100vw - 32px));
  height: auto;
  max-height: min(80vh, calc(100vh - 48px));
  min-width: 280px;
}
#kbGuestAccessModal .kb-guest-access-panel .modal-head {
  padding: 14px 16px 6px;
  border-bottom: 0;
}
#kbGuestAccessModal .kb-guest-access-panel .modal-close-btn {
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}
#kbGuestAccessModal .kb-guest-access-panel .modal-close-btn:hover,
#kbGuestAccessModal .kb-guest-access-panel .modal-close-btn:focus {
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
}
#kbGuestAccessModal .kb-guest-access-panel .modal-body {
  flex: 0 1 auto;
  overflow: auto;
  padding: 4px 16px 18px;
}
.kb-guest-access-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #14161a;
  line-height: 1.55;
}
.kb-guest-access-body p { margin: 0; }
.kb-guest-access-email a {
  color: var(--link-text);
  font-weight: 600;
  text-decoration: none;
  word-break: break-all;
}
.kb-guest-access-email a:hover { text-decoration: none; }

/* 详情：左分组 + 右编辑 */
.kb-space-shell {
  display: flex;
  height: calc(100vh - 56px);
  background: #fff;
  overflow: hidden;
}
.kb-groups-pane {
  --kb-groups-w: 280px;
  width: var(--kb-groups-w);
  flex: 0 0 var(--kb-groups-w);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
  min-height: 0;
  position: relative;
}
.kb-groups-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  bottom: 0;
  width: 6px;
  z-index: 5;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
}
.kb-groups-resizer:hover,
body.kb-groups-resizing .kb-groups-resizer {
  background: color-mix(in srgb, var(--link) 12%, transparent);
}
body.kb-groups-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
body.kb-groups-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}
.kb-groups-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* 与右侧目录 / 文档标题同一顶边距，保持顶端对齐 */
  padding: 14px 14px 10px;
  gap: 8px;
  flex: 0 0 auto;
}
.kb-space-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
  color: #14161a;
  text-decoration: none;
  border-radius: 1px;
  padding: 2px 4px 2px 0;
  margin-left: -2px;
}
.kb-space-back:hover {
  color: var(--link-text);
  background: transparent;
}
.kb-space-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #c0c6d0;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-sizing: border-box;
  background: var(--surface-muted);
}
.kb-space-back:hover .kb-space-back-icon {
  color: #9ca3af;
  border-color: var(--line);
  background: var(--surface-muted);
}
.kb-space-back-title {
  min-width: 0;
  font-size: 16px;
  font-weight: 400;
  color: #14161a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-space-back:hover .kb-space-back-title {
  color: var(--link-text);
}
.kb-group-tree {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 8px 16px;
  min-height: 0;
}
.kb-tree-empty { padding: 8px 6px; }
.kb-tree-group { margin-bottom: 6px; }
.kb-tree-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 6px;
  border-radius: 1px;
}
.kb-tree-group-row:hover { background: var(--surface-muted); }
.kb-tree-group-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  color: #14161a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-tree-group-title::before {
  content: "📂";
  font-size: 12px;
  margin-right: 6px;
  opacity: 0.8;
}
.kb-group-rename {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  font-size: 16px;
}
.kb-tree-group-actions {
  display: none;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.kb-tree-group-row:hover .kb-tree-group-actions,
.kb-tree-group-row:focus-within .kb-tree-group-actions,
.kb-tree-group-row.is-editing .kb-tree-group-actions,
.kb-tree-group-row.is-menu-open .kb-tree-group-actions {
  display: inline-flex;
}
.kb-text-btn {
  border: 0;
  background: transparent;
  color: var(--link-text); /* 与我的任务关联产品名称 .work-task-source 一致 */
  font-size: 13px;
  font-weight: 400;
  padding: 2px 4px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.kb-text-btn:hover,
.kb-text-btn:focus {
  text-decoration: none;
  background: transparent;
  border-radius: 1px;
  color: var(--link-text);
}
.kb-text-btn:disabled {
  color: #bbb;
  cursor: not-allowed;
  text-decoration: none;
  background: transparent;
}
.kb-text-btn-danger { color: var(--red); }
.kb-text-btn-danger:hover,
.kb-text-btn-danger:focus {
  color: var(--red);
}
.kb-plus-btn {
  width: 22px;
  height: 22px;
  border:1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.kb-plus-btn:hover { background: var(--surface-muted); }
.kb-create-wrap { position: relative; }
/* 填补按钮与菜单间隙，避免移入时闪关 */
.kb-create-wrap::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 100%;
  height: 8px;
}
.kb-create-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 112px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 6px;
}
.kb-create-wrap:hover .kb-create-menu,
.kb-create-wrap:focus-within .kb-create-menu,
.kb-tree-group-row.is-menu-open .kb-create-menu {
  display: flex;
}
.kb-create-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 1px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kb-create-menu button .kb-file-type-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.kb-create-menu button:hover { background: var(--surface-muted); }
.kb-tree-files {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 15px;
}
.kb-tree-file-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  border-radius: 1px;
  position: relative;
}
.kb-tree-file-row:hover,
.kb-tree-file-row.is-menu-open,
.kb-tree-file-row.is-active {
  background: var(--surface-muted);
}
.kb-tree-file-row.is-active {
  background: var(--link-soft);
}
.kb-tree-file-row.is-renaming {
  padding: 4px 6px;
  gap: 6px;
  background: var(--surface-muted);
}
.kb-tree-file-row.is-draggable {
  cursor: grab;
}
.kb-tree-file-row.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}
.kb-tree-file-row.is-drag-over-before::before,
.kb-tree-file-row.is-drag-over-after::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--link-hover);
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}
.kb-tree-file-row.is-drag-over-before::before { top: 0; }
.kb-tree-file-row.is-drag-over-after::after { bottom: 0; }
.kb-file-rename {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  font-size: 13px;
}
.kb-tree-file {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  /* 原约 28px（6+16+6），×1.3 ≈ 36 */
  min-height: 36px;
  padding: 10px 8px;
  border-radius: 1px;
  cursor: pointer;
  color: #14161a;
  box-sizing: border-box;
}
.kb-tree-file-row.is-active .kb-tree-file {
  color: var(--link-text);
}
.kb-file-type-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}
.kb-tree-file-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.kb-file-more-wrap {
  position: relative;
  flex: 0 0 auto;
  opacity: 0;
  pointer-events: none;
  margin-right: 2px;
}
.kb-file-more-wrap::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 100%;
  height: 6px;
}
.kb-tree-file-row:hover .kb-file-more-wrap,
.kb-tree-file-row.is-menu-open .kb-file-more-wrap {
  opacity: 1;
  pointer-events: auto;
}
.kb-file-more-btn {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
}
.kb-file-more-btn::before,
.kb-file-more-btn::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #667085;
  display: block;
}
.kb-file-more-btn span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #667085;
  display: block;
}
.kb-file-more-btn:hover { background: var(--surface-muted); }
.kb-file-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  z-index: 30;
  min-width: 120px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 4px;
  display: none;
  flex-direction: column;
}
.kb-file-more-wrap:hover .kb-file-menu,
.kb-file-more-wrap:focus-within .kb-file-menu,
.kb-tree-file-row.is-menu-open .kb-file-menu {
  display: flex;
}
.kb-file-menu-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 1px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
  white-space: nowrap;
}
.kb-file-menu-item:hover { background: var(--surface-muted); }
.kb-file-menu-sep {
  height: 0;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.kb-file-menu-danger { color: var(--red); }
.kb-file-move-item {
  position: relative;
}
.kb-file-move-item.is-open > .kb-file-menu-item {
  background: var(--surface-muted);
}
.kb-file-move-flyout {
  position: fixed;
  z-index: 2400;
  width: 220px;
  max-height: min(360px, 70vh);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 6px;
  box-sizing: border-box;
}
.kb-file-move-flyout[hidden] { display: none !important; }
.kb-file-move-flyout-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kb-move-space {
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.kb-move-space:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}
.kb-move-space-title {
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  padding: 4px 10px 6px;
  letter-spacing: 0.02em;
}
.kb-move-group-item.is-disabled,
.kb-move-group-item:disabled {
  opacity: 0.55;
  cursor: default;
}
.kb-move-space.is-readonly .kb-move-space-title {
  color: var(--muted);
}
.kb-move-space-groups {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kb-move-group-item.is-current,
.kb-move-group-item:disabled {
  color: #9ca3af;
  cursor: default;
  background: transparent;
}
.kb-file-menu-empty {
  padding: 8px 10px;
  font-size: 13px;
}
.kb-editor-pane {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  /* 与左侧知识库标题行顶边距一致 */
  padding: 14px 0 0;
  overflow: hidden;
}
.kb-editor-empty {
  margin: auto;
  font-size: 13px;
}
.kb-file-workspace {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 0 30px 30px;
  box-sizing: border-box;
  overflow: hidden;
}
.kb-file-workspace[hidden] {
  display: none !important;
}
.kb-doc-layout {
  display: flex;
  align-items: stretch;
  gap: 20px;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.kb-doc-toc {
  flex: 0 0 180px;
  width: 180px;
  align-self: stretch;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  z-index: 2;
  padding: 0 0 16px;
  transition: width 0.15s ease, flex-basis 0.15s ease;
}
/* 非文档离开时隐藏；文档编辑中用 --reserved 占位，避免 hidden↔显示改列宽导致跳顶 */
.kb-doc-toc[hidden] { display: none !important; }
.kb-doc-toc.kb-doc-toc--reserved,
.kb-doc-toc.kb-doc-toc--reserved[hidden] {
  display: block !important;
  flex: 0 0 180px;
  width: 180px;
}
.kb-doc-toc.is-collapsed {
  flex: 0 0 auto;
  width: auto;
  min-width: 72px;
  overflow: visible;
}
.kb-doc-toc-head {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 10px;
}
.kb-doc-toc.is-collapsed .kb-doc-toc-head {
  margin-bottom: 0;
}
.kb-doc-toc-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 1px;
  background: transparent;
  color: #9ca3af;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.kb-doc-toc-toggle:hover {
  background: var(--surface-muted);
  color: var(--link-hover);
}
.kb-doc-toc-title {
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1.2;
}
.kb-doc-toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kb-doc-toc.is-collapsed .kb-doc-toc-list {
  display: none;
}
.kb-doc-toc-item {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 1px;
  font-size: 13px;
  color: #14161a;
  cursor: pointer;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kb-doc-toc-item:hover {
  background: var(--surface-muted);
  color: var(--link-hover);
}
.kb-doc-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  /* 标题 / 作者 / 正文 / 评论同一滚动列；勿让编辑器 flex 撑满把评论顶飞 */
  display: block;
  /* 输入/删除/占位符切换时禁止浏览器滚动锚定把页面拽回顶部 */
  overflow-anchor: none;
  overscroll-behavior: contain;
}
.kb-doc-editor--tiptap,
.kb-doc-editor-host,
.kb-doc-tiptap-root,
.kb-doc-editor-wrap,
.kb-editor {
  overflow-anchor: none;
}
.kb-member-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.kb-member-row {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  gap: 8px;
  align-items: center;
}
.kb-member-add {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px;
}
.kb-file-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0 0 16px;
  flex: 0 0 auto;
  width: 100%;
}
.kb-file-toolbar-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}
.kb-file-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 6px;
}
.kb-doc-find-open[hidden] {
  display: none !important;
}
.kb-doc-find-panel {
  position: fixed;
  z-index: 5200;
  width: min(360px, calc(100vw - 24px));
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kb-doc-find-panel[hidden] {
  display: none !important;
}
.kb-doc-find-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.kb-doc-find-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 6px 8px;
  font-size: 13px;
  color: #14161a;
  background: #fff;
}
.kb-doc-find-input:focus {
  outline: none;
  border-color: var(--link-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 12%, transparent);
}
.kb-doc-find-count {
  flex: 0 0 auto;
  min-width: 36px;
  font-size: 13px;
  color: #9ca3af;
  text-align: right;
}
.kb-doc-find-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #14161a;
  border-radius: 1px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  cursor: pointer;
}
.kb-doc-find-btn:hover {
  background: var(--surface-muted);
  border-color: var(--line);
}
.kb-doc-find-btn-text {
  min-width: auto;
  font-size: 13px;
}
.kb-doc-editor--tiptap .kb-doc-find-match {
  background: rgba(250, 204, 21, 0.45);
  border-radius: 1px;
}
.kb-doc-editor--tiptap .kb-doc-find-match.is-active {
  background: rgba(251, 146, 60, 0.65);
}
.kb-file-title {
  flex: 1;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  border-bottom: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  padding: 0;
  color: #14161a;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  field-sizing: content;
  box-sizing: border-box;
  font-family: inherit;
}
.kb-file-title:focus { outline: none; }
.kb-file-meta {
  margin: 4px 0 0 !important;
  font-size: 13px;
  line-height: 1.5;
  color: #9ca3af !important;
}
.kb-doc-comments,
.kb-doc-comments.version-followups {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 30px;
  padding-top: 30px;
  margin-bottom: 40px;
  clear: both;
  background: #fff;
}
.kb-doc-comments[hidden] {
  display: none !important;
}
.kb-editor {
  position: relative;
  z-index: 0;
  display: block;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 0;
  /* 高度随正文内容，避免 flex:1 占满视口导致评论叠到正文上 */
  min-height: 120px;
  height: auto;
  flex: none;
}
.kb-doc-editor-wrap {
  position: relative;
  min-width: 0;
  overflow: visible;
}
.kb-doc-editor {
  min-height: 80px;
  outline: none;
  /* 倍数随字号走；勿写死 px，否则小字行盒仍按 16px 撑高 */
  line-height: 1.8;
  font-size: 13px;
}
.kb-doc-editor p,
.kb-doc-editor li,
.kb-doc-editor h1,
.kb-doc-editor h2,
.kb-doc-editor h3,
.kb-doc-editor h4,
.kb-doc-editor h5 {
  line-height: 1.8;
}
/* 段落 strut 按 16px 计算会压过小字；有自定义字号时让行盒跟字号走 */
.kb-doc-editor p:has([style*="font-size"]),
.kb-doc-editor li:has([style*="font-size"]) {
  line-height: 0.01;
}
.kb-doc-editor [style*="font-size"] {
  line-height: 1.8;
}
.kb-doc-editor-host,
.kb-doc-tiptap-root {
  min-height: 80px;
}
.kb-doc-editor--tiptap {
  min-height: 240px;
  line-height: 1.8;
}
/* 不用 float：空段→上屏中文时 float 占位消失会导致行盒重排，空格确认时页面抖动 */
.kb-doc-editor--tiptap p.is-editor-empty:first-child {
  position: relative;
}
.kb-doc-editor--tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  position: absolute;
  left: 0;
  top: 0;
  color: #9ca3af;
  pointer-events: none;
  height: 0;
  white-space: nowrap;
}
.kb-doc-editor--tiptap:focus {
  outline: none;
}
.kb-embed-sheet-placeholder {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: #14161a;
}
.kb-embed-sheet-placeholder strong {
  font-size: 13px;
  color: #14161a;
}
.kb-embed-sheet-placeholder em {
  color: #9ca3af;
  font-style: normal;
  width: 100%;
}
/* TipTap 任务列表：对齐现网 kb-task-* */
.kb-doc-editor--tiptap ul.kb-task-list,
.kb-doc-editor--tiptap ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kb-doc-editor--tiptap .kb-task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.kb-doc-editor--tiptap .kb-task-item input[type="checkbox"] {
  margin: 3px 0 0 0;
}
.kb-doc-editor--tiptap .kb-task-item .kb-task-body {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}
.kb-doc-editor--tiptap .kb-task-item .kb-task-body > p {
  margin: 0;
  line-height: 1.5;
  min-height: 24px;
}
.kb-doc-editor--tiptap .kb-task-item .kb-task-body > p.is-empty:not(:focus):first-child::before,
.kb-doc-editor--tiptap .kb-task-item .kb-task-body > p.is-editor-empty:not(:focus):first-child::before {
  content: "待办事项";
  color: #9ca3af;
  float: left;
  height: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
}
.kb-doc-editor--tiptap .kb-task-item .kb-task-body > p.is-empty:focus:first-child::before,
.kb-doc-editor--tiptap .kb-task-item .kb-task-body > p.is-editor-empty:focus:first-child::before {
  content: none;
}
.kb-doc-editor--tiptap .kb-task-item.is-done .kb-task-body,
.kb-doc-editor--tiptap .kb-task-item.is-done .kb-task-body > p {
  color: #9ca3af;
  text-decoration: line-through;
}
.kb-doc-editor--tiptap .kb-code-block .kb-code-content {
  white-space: pre-wrap;
}
.kb-doc-editor--tiptap .kb-embed-sheet.ProseMirror-selectednode {
  outline: 2px solid var(--link-focus);
  outline-offset: 2px;
}
/* 「+」挂 body + fixed，避免正文区 overflow 裁切导致时隐时现 */
.kb-doc-line-plus {
  position: fixed;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #9ca3af;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 4800;
  opacity: 0.95;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: none;
  pointer-events: auto;
}
.kb-doc-line-plus[hidden] {
  display: none !important;
}
.kb-doc-line-plus:hover {
  opacity: 1;
  color: var(--link-hover);
  border-color: var(--link-focus);
  background: var(--link-soft);
}
/* 正文区单独滚动；目录与工作区保持 overflow 由上方规则控制，避免整页滚动把目录带走 */
/* 插入菜单：始终挂在 body，fixed 定位 */
.kb-doc-block-plus {
  position: fixed;
  z-index: 5000;
  width: auto;
  pointer-events: auto;
}
.kb-doc-block-plus[hidden] { display: none !important; }
.kb-doc-block-plus-btn[hidden] { display: none !important; }
.kb-doc-block-plus-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #9ca3af;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
.kb-doc-block-plus-menu {
  position: static;
  min-width: 160px;
  max-height: min(360px, calc(100vh - 80px));
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
}
.kb-doc-block-plus-menu[hidden] { display: none !important; }
.kb-doc-block-plus-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 1px;
  font-size: 13px;
  color: #14161a;
  cursor: pointer;
}
.kb-doc-block-plus-item:hover {
  background: var(--surface-muted);
}
/* `/` 过滤菜单：与「+」共用注册表视觉 */
.kb-doc-slash-menu {
  position: fixed;
  z-index: 5100;
  min-width: 200px;
  max-width: 280px;
  max-height: min(360px, calc(100vh - 80px));
  overflow-y: auto;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
}
.kb-doc-slash-menu[hidden] {
  display: none !important;
}
.kb-doc-slash-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 1px;
  font-size: 13px;
  color: #14161a;
  cursor: pointer;
}
.kb-doc-slash-item:hover,
.kb-doc-slash-item.is-active {
  background: var(--link-soft);
  color: var(--link-hover);
}
.kb-doc-slash-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #9ca3af;
}
.kb-doc-editor blockquote,
.kb-doc-editor--tiptap blockquote {
  margin: 10px 0;
  padding: 10px 14px 10px 16px;
  border-left: 3px solid var(--line);
  border-radius: 0 1px 1px 0;
  background: var(--surface-muted);
  color: #14161a;
}
.kb-doc-editor--tiptap hr {
  border: 0;
  border-top:1px solid var(--line);
  margin: 16px 0;
}
.kb-task-list {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 10px; /* 5px × 2 */
}
.kb-task-item {
  display: flex;
  /* 顶对齐：单行时与 18px 复选框同高，视觉居中；换行后复选框不跟着跳到中间 */
  align-items: flex-start;
  gap: 10px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}
.kb-task-check {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 3px 0 0 0;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  background: #fff;
  cursor: pointer;
  position: relative;
  align-self: flex-start;
}
.kb-task-check:hover {
  border-color:var(--line);
}
.kb-task-item.is-done .kb-task-check {
  background: #98a2b3;
  border-color: var(--line);
}
.kb-task-item.is-done .kb-task-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.kb-task-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  outline: none;
  color: #14161a;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  text-decoration: none;
  padding-top: 0;
  box-sizing: border-box;
  position: relative;
}
.kb-task-body:empty::before,
.kb-task-body:has(br:only-child)::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
  text-decoration: none;
  position: absolute;
  top: 0;
  left: 0;
}
.kb-task-body:focus:empty::before,
.kb-task-body:focus:has(br:only-child)::before {
  content: none;
}
.kb-task-item.is-done .kb-task-body {
  color: #9ca3af;
  text-decoration: line-through;
}
.kb-code-block {
  position: relative;
  margin: 12px 0;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
  box-sizing: border-box;
}
.kb-code-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kb-code-select-all,
.kb-code-copy {
  border: 1px solid var(--line);
  background: #fff;
  color: #14161a;
  border-radius: 1px;
  padding: 4px 10px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}
.kb-code-select-all:hover,
.kb-code-copy:hover {
  background: var(--surface-muted);
  color: #14161a;
}
.kb-code-pre {
  margin: 0;
  padding: 0;
  overflow: auto;
  background: transparent;
}
.kb-code-content {
  display: block;
  min-height: 72px;
  padding: 12px 120px 12px 14px;
  margin: 0;
  outline: none;
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #14161a;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  box-sizing: border-box;
  text-align: left;
}
.kb-code-content:empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  display: inline;
  float: none;
}
.kb-embed-sheet {
  margin: 14px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
}
.kb-embed-sheet.is-active {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}
.kb-embed-sheet .kb-embed-sheet-json[hidden] {
  display: none !important;
}
.kb-embed-sheet .kb-sheet-wrap {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}
.kb-embed-sheet .kb-sheet-table {
  background: transparent;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  box-sizing: border-box;
}
.kb-sheet-ctx-danger {
  color: var(--red);
}
.kb-sheet-ctx-danger:hover {
  background: #fef3f2;
}
.kb-doc-editor img,
.kb-doc-editor .kb-doc-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0;
  border-radius: 1px;
}
.kb-doc-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 12px 0;
  line-height: 0;
  vertical-align: top;
  cursor: default;
}
.kb-doc-img-wrap img {
  margin: 0;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  image-rendering: auto;
}
.kb-doc-img-wrap.is-selected,
.kb-doc-editor--tiptap .kb-doc-img-wrap.ProseMirror-selectednode {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 1px;
}
.kb-doc-img-wrap.is-selected > img,
.kb-doc-editor--tiptap .kb-doc-img-wrap.ProseMirror-selectednode > img {
  cursor: zoom-in;
}
.kb-doc-editor--tiptap .kb-doc-img-wrap.ProseMirror-selectednode .kb-doc-img-handle {
  display: block;
}
.kb-doc-img-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--link);
  border-radius: 1px;
  box-sizing: border-box;
  display: none;
  z-index: 3;
  touch-action: none;
}
.kb-doc-img-wrap.is-selected .kb-doc-img-handle {
  display: block;
}
.kb-doc-img-handle[data-dir="nw"] { left: -5px; top: -5px; cursor: nwse-resize; }
.kb-doc-img-handle[data-dir="ne"] { right: -5px; top: -5px; cursor: nesw-resize; }
.kb-doc-img-handle[data-dir="sw"] { left: -5px; bottom: -5px; cursor: nesw-resize; }
.kb-doc-img-handle[data-dir="se"] { right: -5px; bottom: -5px; cursor: nwse-resize; }
body.kb-doc-resizing-img,
body.kb-doc-resizing-img * {
  cursor: nwse-resize !important;
  user-select: none !important;
}
.kb-doc-editor:empty::before {
  content: "开始输入…";
  color: #9ca3af;
}
.kb-doc-editor h1 { font-size: 28px; font-weight: 700; margin: 0.6em 0 0.35em; }
.kb-doc-editor h2 { font-size: 24px; font-weight: 700; margin: 0.55em 0 0.3em; }
.kb-doc-editor h3 { font-size: 20px; font-weight: 600; margin: 0.5em 0 0.28em; }
.kb-doc-editor h4 { font-size: 17px; font-weight: 600; margin: 0.45em 0 0.25em; }
.kb-doc-editor h5 { font-size: 15px; font-weight: 600; margin: 0.4em 0 0.22em; }
.kb-doc-editor ul {
  margin: 0.4em 0;
  padding-left: 1.4em;
  list-style: disc;
}
.kb-sel-toolbar {
  position: fixed;
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  max-width: calc(100vw - 16px);
}
.kb-sel-toolbar[hidden] { display: none !important; }
.kb-sel-item { position: relative; }
.kb-sel-btn {
  border: 0;
  background: transparent;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 1px;
  cursor: pointer;
  color: #14161a;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}
.kb-sel-btn:hover { background: var(--surface-muted); }
.kb-sel-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 156px;
  max-height: min(416px, calc(100vh - 80px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  padding: 5px;
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.kb-sel-toolbar--flip-menus .kb-sel-menu {
  top: auto;
  bottom: calc(100% + 8px);
}
.kb-sel-menu.kb-sel-menu--align-end {
  left: auto;
  right: 0;
}
.kb-sel-menu[hidden] { display: none !important; }
.kb-sel-menu > button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 13px;
  border-radius: 1px;
  font-size: 16px;
  cursor: pointer;
  color: #14161a;
  white-space: nowrap;
}
.kb-sel-menu > button:hover { background: var(--surface-muted); }
.kb-sel-menu-color {
  min-width: 380px;
  padding: 13px;
}
.kb-sel-color-label {
  font-size: 13px;
  color: #9ca3af;
  margin: 5px 0 8px;
}
.kb-sel-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.kb-sel-color-grid {
  display: grid;
  grid-template-columns: repeat(10, 31px);
  gap: 8px;
  margin-bottom: 10px;
}
.kb-sel-swatch {
  width: 31px;
  height: 31px;
  border-radius: 1px;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  box-sizing: border-box;
}
.kb-sel-swatches-gradient .kb-sel-swatch {
  width: 29px;
  height: 29px;
  border-radius: 1px;
}
.kb-sel-swatch:hover { transform: scale(1.08); }
.kb-sel-nofill {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 8px 13px;
  border-radius: 1px;
  font-size: 16px;
  cursor: pointer;
  color: #14161a;
  margin-bottom: 5px;
}
.kb-sel-nofill:hover { background: var(--surface-muted); }
.kb-sel-nofill-icon {
  width: 31px;
  height: 31px;
  border-radius: 1px;
  border: 1px solid var(--line);
  background:
    linear-gradient(to top left, transparent calc(50% - 1px), var(--red) calc(50% - 1px), var(--red) calc(50% + 1px), transparent calc(50% + 1px)),
    #fff;
  flex: 0 0 auto;
}
.kb-doc-editor--tiptap a.kb-doc-link {
  color: var(--link-hover);
  text-decoration: underline;
  cursor: pointer;
  word-break: break-word;
}
.kb-doc-editor--tiptap a.kb-doc-link:hover {
  color: var(--link-text);
}
.kb-doc-editor--tiptap mark {
  /* 覆盖 UA 默认 mark { color: black }，避免盖住已设字体色 */
  color: inherit;
  border-radius: 1px;
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.kb-sel-menu > button.is-active {
  background: var(--surface-muted) !important;
  color: #14161a;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--line);
}
.kb-doc-editor--tiptap span.kb-solid-bg,
.kb-doc-editor span.kb-solid-bg {
  /* 背景与字体色共存时，不要让背景容器强行改字色 */
  color: inherit;
}
.kb-doc-editor .kb-grad-text,
.kb-doc-editor .kb-inline-style.kb-grad-text {
  display: inline;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.kb-doc-editor li .kb-grad-text {
  /* 保证列表内渐变文字仍按行内渲染，不拆坏 li */
  display: inline;
}
.kb-sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.kb-sheet-tabs.is-reordering {
  gap: 6px;
}
.kb-sheet-tab {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  color: #14161a;
  border-radius: 1px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  touch-action: none;
  user-select: none;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}
.kb-sheet-tab.is-active {
  background: var(--link-soft);
  border-color: var(--link-focus);
  color: var(--link-hover);
  font-weight: 600;
}
.kb-sheet-tab.is-dragging {
  opacity: 0.28;
  color: transparent;
  border-style: dashed;
  cursor: grabbing;
}
/* 跟随指针的 Sheet 虚影 */
.kb-sheet-tab-ghost {
  position: fixed;
  z-index: 1400;
  pointer-events: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--link-focus);
  border-radius: 1px;
  background: rgba(239, 246, 255, 0.92);
  color: var(--link-hover);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
  will-change: left, top;
}
/* 拖拽落点：两 sheet 之间 5px 空白示意 */
.kb-sheet-tab-gap {
  display: inline-block;
  flex: 0 0 0;
  width: 0;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 1px;
  background: transparent;
  pointer-events: none;
  vertical-align: middle;
  transition: width 0.16s ease, flex-basis 0.16s ease;
  box-sizing: border-box;
}
.kb-sheet-tab-gap.is-open {
  flex-basis: 5px;
  width: 5px;
  background: transparent;
}
body.kb-sheet-tab-dragging,
body.kb-sheet-tab-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}
.kb-sheet-tab-menu {
  position: fixed;
  z-index: 1200;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  box-shadow: none;
}
.kb-sheet-tab-menu[hidden] {
  display: none !important;
}
.kb-sheet-tab-menu .kb-sheet-ctx-btn {
  width: 100%;
  text-align: left;
}
.kb-sheet-add {
  width: 30px;
  height: 30px;
  border: 1px dashed var(--line);
  border-radius: 1px;
  background: #fff;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.kb-sheet-add:hover {
  border-color: var(--link-hover);
  color: var(--link-hover);
  background: #f5f8ff;
}
.kb-sheet-format-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
}
.kb-sheet-fmt-item { position: relative; }
.kb-sheet-fmt-sep {
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: #d0d5dd;
  flex: 0 0 auto;
}
.kb-sheet-fmt-btn {
  border: 0;
  background: transparent;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 1px;
  cursor: pointer;
  color: #14161a;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.kb-sheet-fmt-btn:hover { background: var(--surface-muted); }
.kb-sheet-fmt-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.kb-sheet-fmt-btn:disabled:hover { background: transparent; }
.kb-sheet-fmt-menu {
  z-index: 20;
}
.kb-sheet-border-widths {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.kb-sheet-border-width-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 1px;
  min-width: 44px;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
}
.kb-sheet-border-width-btn:hover {
  border-color: var(--line);
  background: var(--surface-muted);
}
.kb-sheet-ctx-menu {
  position: fixed;
  z-index: 2200;
  min-width: 240px;
  /* 展开内嵌色盘（10×28px）时需要更宽，避免色块折行重叠 */
  max-width: min(380px, calc(100vw - 16px));
  max-height: min(78vh, calc(100vh - 72px));
  overflow-x: hidden;
  overflow-y: auto; /* 内容过高时可竖向滚动，避免「插入图片」被裁切 */
  overscroll-behavior: contain;
  padding: 6px 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}
.kb-sheet-ctx-menu[hidden] { display: none !important; }
.kb-sheet-ctx-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.kb-sheet-ctx-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.kb-sheet-ctx-format {
  gap: 2px;
}
.kb-sheet-ctx-palette-item {
  display: flex;
  flex-direction: column;
}
.kb-sheet-ctx-palette-trigger {
  justify-content: space-between;
  gap: 8px;
}
.kb-sheet-ctx-palette-item.is-open > .kb-sheet-ctx-palette-trigger,
.kb-sheet-ctx-palette-item:hover > .kb-sheet-ctx-palette-trigger {
  background: var(--surface-muted);
}
.kb-sheet-ctx-chevron {
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
  transition: color 0.12s ease;
}
.kb-sheet-ctx-palette-item.is-open .kb-sheet-ctx-chevron {
  color: #6b7280;
}
/* 右键菜单的二级操作面板：悬浮在主菜单侧边，不挤开菜单高度 */
.kb-sheet-ctx-palette {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(340px, calc(100vw - 16px));
  max-height: min(72vh, calc(100vh - 72px));
  overflow: auto;
  padding: 10px 8px 12px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.kb-sheet-ctx-palette[hidden] { display: none !important; }
.kb-sheet-ctx-palette-fontsize {
  padding: 8px 10px 10px;
}
.kb-sheet-ctx-fontsize-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(42px, 1fr));
  gap: 6px;
}
.kb-sheet-ctx-fontsize-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 1px;
  padding: 5px 6px;
  font-size: 12px;
  cursor: pointer;
  color: #14161a;
}
.kb-sheet-ctx-fontsize-btn:hover {
  background: var(--surface-muted);
}
.kb-sheet-ctx-palette-color .kb-sheet-ctx-swatches .kb-sel-color-grid {
  padding: 0;
  gap: 8px;
  margin-bottom: 0;
  grid-template-columns: repeat(10, 28px);
  justify-content: start;
}
.kb-sheet-ctx-palette-color .kb-sheet-ctx-swatches .kb-sel-swatch {
  width: 28px;
  height: 28px;
  border-radius: 1px;
  border: 1px solid var(--line);
}
/* 兼容旧 flyout 类名（若仍残留在 body） */
.kb-sheet-ctx-flyout {
  display: none !important;
}
.kb-sheet-ctx-title {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  padding: 2px 10px 3px;
  letter-spacing: 0.02em;
}
.kb-sheet-ctx-btn {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 5px 10px;
  border-radius: 1px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
}
.kb-sheet-ctx-btn:hover { background: var(--surface-muted); }
.kb-sheet-find-modal .kb-sheet-find-panel {
  width: min(440px, calc(100vw - 32px));
  height: auto;
  max-height: min(90vh, calc(100vh - 80px));
  border-radius: 1px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
}
.kb-sheet-find-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.kb-sheet-find-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #14161a;
}
.kb-sheet-find-close {
  width: 32px;
  height: 32px;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  border-radius: 1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}
.kb-sheet-find-close:hover {
  background: var(--surface-muted);
  color: #14161a;
}
.kb-sheet-find-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}
.kb-sheet-find-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 0 0 auto;
}
.kb-sheet-find-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-sheet-find-field > span {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
}
.kb-sheet-find-input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 12px;
  font-size: 13px;
  color: #14161a;
  background: #fff;
  outline: none;
}
.kb-sheet-find-input:focus {
  border-color: var(--link-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 15%, transparent);
}
.kb-sheet-find-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.kb-sheet-wrap { overflow: auto; width: 100%; }
.kb-sheet-table {
  --kb-sheet-rowhd-size: 30px;
  border-collapse: collapse;
  /* 宽度由 JS 按容器分配：行号列固定，数据列铺满 */
  width: max-content;
  min-width: 0;
  max-width: none;
  table-layout: fixed;
  box-sizing: border-box;
}
.kb-sheet-table .kb-sheet-corner,
.kb-sheet-table .kb-sheet-colhd,
.kb-sheet-table .kb-sheet-rowhd {
  /* 行号列 / 列标行：纯白 */
  background: #fff;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  border: 1px solid var(--line);
  user-select: none;
  position: relative;
}
.kb-sheet-table col.kb-sheet-rowhd-col {
  width: var(--kb-sheet-rowhd-size) !important;
  min-width: var(--kb-sheet-rowhd-size) !important;
  max-width: var(--kb-sheet-rowhd-size) !important;
}
.kb-sheet-table .kb-sheet-corner {
  width: var(--kb-sheet-rowhd-size) !important;
  min-width: var(--kb-sheet-rowhd-size) !important;
  max-width: var(--kb-sheet-rowhd-size) !important;
  height: var(--kb-sheet-rowhd-size);
  box-sizing: border-box;
  position: sticky;
  left: 0;
  z-index: 3;
  padding: 0 !important;
  overflow: hidden;
}
.kb-sheet-table .kb-sheet-colhd {
  height: var(--kb-sheet-rowhd-size);
  min-width: 40px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 2;
}
.kb-sheet-table .kb-sheet-rowhd {
  width: var(--kb-sheet-rowhd-size) !important;
  min-width: var(--kb-sheet-rowhd-size) !important;
  max-width: var(--kb-sheet-rowhd-size) !important;
  box-sizing: border-box;
  padding: 0 !important;
  position: sticky;
  left: 0;
  z-index: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  flex: 0 0 auto;
}
.kb-sheet-col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}
.kb-sheet-col-resizer:hover,
body.kb-sheet-resizing-col .kb-sheet-col-resizer {
  background: color-mix(in srgb, var(--link) 25%, transparent);
}
.kb-sheet-row-resizer {
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 6px;
  cursor: row-resize;
  z-index: 5;
}
.kb-sheet-row-resizer:hover,
body.kb-sheet-resizing-row .kb-sheet-row-resizer {
  background: color-mix(in srgb, var(--link) 25%, transparent);
}
body.kb-sheet-resizing-col,
body.kb-sheet-resizing-col * {
  cursor: col-resize !important;
  user-select: none !important;
}
body.kb-sheet-resizing-row,
body.kb-sheet-resizing-row * {
  cursor: row-resize !important;
  user-select: none !important;
}
.kb-sheet-table td {
  border:1px solid var(--line);
  min-width: 40px;
  height: 36px;
  padding: 4px 8px;
  font-size: 13px;
  vertical-align: middle;
  text-align: left;
  word-break: break-word;
  white-space: pre-wrap;
  cursor: default;
  user-select: none;
  overflow: visible;
  box-sizing: border-box;
}
.kb-sheet-table td[data-align="left"] { text-align: left; }
.kb-sheet-table td[data-align="center"] { text-align: center; }
.kb-sheet-table td[data-align="right"] { text-align: right; }
.kb-sheet-table td.is-selected {
  outline: 2px solid var(--link-focus);
  outline-offset: -2px;
  background-image: linear-gradient(color-mix(in srgb, var(--link) 8%, transparent), color-mix(in srgb, var(--link) 8%, transparent));
}
.kb-sheet-table td.is-editing {
  cursor: text;
  user-select: text;
  outline: 2px solid var(--link);
  outline-offset: -2px;
  background-image: none;
  white-space: pre-wrap;
}
.kb-sheet-table td:focus { outline: 2px solid var(--link-focus); outline-offset: -2px; }
.kb-sheet-table td.is-editing:focus {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}
.kb-sheet-img-wrap {
  position: relative;
  display: inline-block;
  margin-top: 4px;
  max-width: none;
  vertical-align: top;
  line-height: 0;
}
.kb-sheet-table td.is-editing .kb-sheet-img-wrap {
  cursor: grab;
}
.kb-sheet-table td.is-editing .kb-sheet-img-wrap.is-dragging {
  cursor: grabbing;
  opacity: 0.45;
}
.kb-sheet-img-wrap.is-img-selected {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 1px;
  z-index: 1;
}
.kb-sheet-cell-img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.kb-sheet-img-resizer {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 1px;
  background: var(--link);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--link) 35%, transparent);
  cursor: nwse-resize;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
.kb-sheet-table td.is-selected .kb-sheet-img-resizer,
.kb-sheet-img-wrap:hover .kb-sheet-img-resizer,
.kb-sheet-img-wrap.is-img-selected .kb-sheet-img-resizer {
  opacity: 1;
  pointer-events: auto;
}
body.kb-sheet-resizing-img,
body.kb-sheet-resizing-img * {
  cursor: nwse-resize !important;
  user-select: none !important;
}
.kb-sheet-img-ghost {
  position: fixed;
  z-index: 10050;
  margin: 0;
  pointer-events: none;
  opacity: 0.88;
  outline: 2px solid var(--link);
  outline-offset: 2px;
  box-shadow: none;
}
body.kb-sheet-dragging-img,
body.kb-sheet-dragging-img * {
  cursor: grabbing !important;
  user-select: none !important;
}
.kb-sheet-table td.kb-sheet-td-img-drop {
  outline: 2px dashed var(--link);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--link) 6%, transparent);
}
.kb-sheet-link-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding: 8px 10px 8px 12px;
  max-width: 100%;
  border: 1px solid var(--link-focus);
  border-left: 3px solid var(--link);
  border-radius: 1px;
  /* 简单底色区分：与普通单元格文字明显分开 */
  background: var(--link-soft);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  user-select: none;
  pointer-events: auto;
}
.kb-sheet-link-card:hover {
  border-color: var(--link-focus);
  border-left-color: var(--link);
  background: var(--link-soft);
}
.kb-sheet-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--link-text);
  line-height: 1.3;
  word-break: break-word;
}
.kb-sheet-link-url {
  font-size: 12px;
  color: #3b6ea5;
  line-height: 1.35;
  word-break: break-all;
}
.kb-sheet-table td:has(> a.kb-sheet-link-card),
.kb-sheet-table td:has(a.kb-sheet-link-card) {
  vertical-align: top;
}
.kb-sheet-find-hit {
  background: #fef08a;
  color: inherit;
  padding: 0 1px;
  border-radius: 1px;
}
.kb-sheet-insert-item {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 3px 10px; /* 压缩「插入」区行距 */
  border-radius: 1px;
  font-size: 13px;
  cursor: pointer;
  color: #14161a;
  white-space: nowrap;
}
.kb-sheet-insert-item:hover { background: var(--surface-muted); }
.kb-sheet-insert-item input[type="number"] {
  width: 48px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 0 4px;
  font-size: 13px;
  text-align: center;
}
.kb-slides-toolbar { margin-bottom: 12px; }
.kb-slides-list { display: flex; flex-direction: column; gap: 12px; }
.kb-slide-card {
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 12px;
  background: var(--surface-muted);
}
.kb-slide-card-head {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 8px;
}
.kb-slide-title { margin-bottom: 8px; font-weight: 600; }
.kb-slide-body { width: 100%; resize: vertical; }

/* ——— 画板（Fabric 最小白板） ——— */
.kb-editor:has(.kb-board-page) {
  padding: 0;
  overflow: hidden;
  position: relative;
  display: block;
  height: calc(100vh - 170px);
  min-height: 560px;
}
.kb-board-page,
.kb-board-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.kb-board-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}
.kb-board-scene.has-side-toolbar {
  flex-direction: row;
  align-items: stretch;
}
.kb-board-scene.has-side-toolbar > .kb-board-legacy-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}
.kb-board-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.kb-embed-board-fallback {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #9ca3af;
  background: #fff;
}
.kb-embed-board-fallback strong {
  color: #14161a;
  font-size: 13px;
}
.kb-embed-board-fallback em {
  font-style: normal;
  font-size: 13px;
  color: #9ca3af;
}
.kb-embed-board-body,
.kb-embed-board-mount {
  width: auto;
  max-width: 100%;
}
.kb-board-legacy-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--orange-soft);
  border-bottom: 1px solid var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  z-index: 2;
}
.kb-board-toolbar {
  flex: 0 0 148px;
  width: 148px;
  max-width: 148px;
  min-height: 0;
  align-self: stretch;
  margin: 8px 0 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 8px;
  border: 0;
  border-right: 0;
  border-radius: 1px;
  background: var(--surface-muted);
  z-index: 2;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
.kb-board-tool-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-height: 0;
  padding-bottom: 8px;
}
.kb-board-tool-section {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.kb-board-tool-section-label {
  margin: 0;
  padding: 0 2px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  user-select: none;
}
.kb-board-tool-section-tools {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 6px;
  justify-content: start;
}
.kb-board-tool-section-actions {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.kb-board-tool-col,
.kb-board-tool-col-label,
.kb-board-tool-col-tools,
.kb-board-tool-col-actions,
.kb-board-tool-groups,
.kb-board-tool-group,
.kb-board-tool-row {
  display: none;
}
.kb-board-tool {
  border: 1px solid var(--line);
  background: #fff;
  color: #14161a;
  border-radius: 1px;
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.kb-board-tool-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #14161a;
}
.kb-board-tool-icon svg {
  display: block;
}
.kb-board-tool:hover:not(:disabled) {
  border-color: var(--link-focus);
  color: var(--link-hover);
}
.kb-board-tool.is-active {
  border-color: var(--link);
  background: #eff6ff;
  color: var(--link-hover);
}
.kb-board-tool:disabled {
  opacity: 0.4;
  cursor: default;
}
.kb-board-toolbar-sep {
  display: none;
}
.kb-board-stylebar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  pointer-events: auto;
}
.kb-board-style-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #9ca3af;
}
.kb-board-style-field select {
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font-size: 13px;
  padding: 3px 6px;
  min-width: 88px;
}
.kb-board-style-color {
  position: relative;
}
.kb-board-color-trigger {
  width: 28px;
  height: 22px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kb-board-color-trigger.is-open,
.kb-board-color-trigger:hover {
  border-color: var(--link-focus);
}
.kb-board-swatch,
.kb-board-color-opt {
  display: block;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.kb-board-swatch {
  width: 22px;
  height: 16px;
}
.kb-board-swatch.is-transparent,
.kb-board-color-opt.is-transparent {
  background:
    linear-gradient(
      to bottom right,
      transparent calc(50% - 1px),
      #dc2626 calc(50% - 1px),
      #dc2626 calc(50% + 1px),
      transparent calc(50% + 1px)
    ),
    #fff;
}
.kb-board-color-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.kb-board-color-pop--wide {
  grid-template-columns: repeat(10, 22px);
  left: 50%;
  transform: translateX(-50%);
}
.kb-board-color-opt {
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
}
.kb-board-color-opt.is-active {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}
.kb-board-color-opt.is-light {
  border-color: #dee2e6;
}
.kb-board-align-btns {
  display: inline-flex;
  gap: 4px;
}
.kb-board-align-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #14161a;
  border-radius: 1px;
  padding: 3px 8px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  min-width: 32px;
}
.kb-board-align-btn:hover {
  border-color: var(--link-focus);
}
.kb-board-align-btn.is-active {
  border-color: var(--link);
  background: #fff;
  color: var(--link-hover);
}
.kb-board-canvas-host {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
/* 尺寸由 Fabric setDimensions 写入；禁止 100% 拉伸 backing store，否则文字发糊 */
.kb-board-canvas-host .canvas-container {
  max-width: 100%;
  max-height: 100%;
}
.kb-embed-board {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
  background: #ffffff;
  max-width: 100%;
}
.kb-embed-board-card {
  display: block;
  width: auto;
  max-width: 100%;
  border: 0;
  background: #ffffff;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.kb-embed-board-preview {
  box-sizing: border-box;
  width: auto;
  max-width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  overflow: auto;
}
.kb-embed-board-empty {
  min-height: 120px;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
}
/* 用 HTML width/height 作逻辑尺寸；位图已按 DPR 超采样。勿 width:auto 撑到物理像素 */
.kb-embed-board-thumb {
  display: block;
  max-width: none;
  max-height: none;
  object-fit: fill;
  background: #ffffff;
  flex: 0 0 auto;
  image-rendering: auto;
}
.kb-embed-board-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}
.kb-embed-board-label {
  font-size: 13px;
  font-weight: 400;
  color: #9ca3af;
}
.kb-embed-board-hint {
  font-size: 13px;
  color: #9ca3af;
}
.kb-board-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2400;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}
.kb-board-fullscreen-panel {
  width: 100%;
  height: 100%;
  max-width: none;
  background: #fff;
  border-radius: 1px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kb-board-fullscreen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.kb-board-fullscreen-title {
  font-size: 16px;
  color: #14161a;
}
.kb-board-fullscreen-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kb-board-fullscreen-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
.kb-board-scene-fs {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
body.kb-board-fs-open {
  overflow: hidden;
}

@media (max-width: 800px) {
  .kb-space-shell { flex-direction: column; height: auto; min-height: calc(100vh - 56px); }
  .kb-groups-pane {
    width: 100%;
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 40vh;
  }
  .kb-groups-resizer { display: none !important; }
  .kb-space-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .kb-space-card { width: 100%; }
}


/* —— 我的任务 · Meegle 化工作台（谷歌改版前回滚恢复） —— */
.work-inbox-section,
.work-workload-section {
  margin-bottom: 18px;
}
.work-inbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.work-inbox-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 12px;
  min-height: 120px;
}
.work-inbox-col-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}
.work-inbox-item + .work-inbox-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.work-inbox-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  font-size: 13px;
}
.work-inbox-link:hover { text-decoration: none; }
.work-inbox-gen { margin-top: 6px; }

.work-workload-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 96px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
}
.work-workload-day {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.work-workload-col {
  width: 100%;
  max-width: 36px;
  border-radius: 1px 1px 1px 1px;
  background: color-mix(in srgb, var(--accent-soft, var(--link-soft)) 80%, var(--link-focus));
}
.work-workload-day.is-today .work-workload-col {
  background: color-mix(in srgb, var(--accent, var(--link)) 55%, var(--link-focus));
}
.work-workload-count {
  font-size: 13px;
  font-weight: 650;
}
.work-workload-label {
  font-size: 12px;
  color: var(--muted);
}

.work-task-title-btn {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 650;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.work-task-title-btn:hover { text-decoration: none; }
.work-task-title-btn.is-alert { color: var(--red); }
.work-task-row.is-done .work-task-title-btn,
.work-task-row.is-done .work-task-title-btn.is-alert {
  color: #9ca3af;
}
.work-task-blocked-hint {
  margin-top: 4px;
  margin-left: 23px;
  width: calc(100% - 23px);
  font-size: 12px;
  color: var(--amber);
}
.work-status-select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  font-size: 13px;
  padding: 0 6px;
}

.work-drawer[hidden] { display: none !important; }
.work-drawer {
  position: fixed;
  inset: 0;
  z-index: 2500;
}
.work-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}
.work-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  /* 原 520px × 1.5；窄屏自适应 */
  width: min(780px, 92vw, 100%);
  height: 100%;
  background: #fff;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.work-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  background: #fff;
}
.work-drawer-head-main { min-width: 0; flex: 1; }
.work-drawer-source {
  margin-bottom: 6px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.work-drawer-source-sep { color: #c0c4cc; }
.work-drawer-delete-link {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.work-drawer-delete-link:hover {
  text-decoration: none;
}
.work-drawer-title {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
}
.work-drawer-title.is-editable {
  cursor: text;
  border-radius: 1px;
}
.work-drawer-title.is-editable:hover,
.work-drawer-title[data-editing="1"] {
  outline: 1px dashed var(--line);
}
.work-drawer-title[data-editing="1"] {
  padding: 6px 8px;
}
.work-drawer-desc.is-editable {
  cursor: text;
  min-height: 48px;
  border-radius: 1px;
}
.work-drawer-desc.is-editable:hover,
.work-drawer-desc.is-editing {
  outline: 1px dashed var(--line);
}
.work-drawer-desc.is-editing {
  padding: 8px 10px;
}
.work-inline-priority,
.work-inline-range {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: default;
}
.work-inline-priority.is-editable,
.work-inline-range.is-editable {
  cursor: pointer;
}
.work-inline-priority.is-editable:hover,
.work-inline-range.is-editable:hover {
  text-decoration: none;
}
.work-inline-priority.is-editing,
.work-inline-priority.is-editing:hover {
  text-decoration: none;
}
.work-inline-priority-select {
  height: 28px;
  min-width: 110px;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: #fff;
  color: #14161a;
  font: inherit;
  font-size: 13px;
}
.work-status-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-status-chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 1px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.work-status-chip.is-active {
  background: var(--accent-soft, var(--link-soft));
  color: var(--text);
  font-weight: 650;
  border-color: transparent;
}
.work-status-chip:disabled {
  opacity: 0.55;
  cursor: default;
}
.work-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 24px;
}
.work-drawer-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.work-drawer-block {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.work-drawer-block:first-of-type {
  margin-top: 20px;
}
.work-drawer-block h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 650;
}
.work-drawer-desc {
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.work-stage-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 1px;
  background: var(--accent-soft, var(--link-soft));
  font-size: 13px;
  font-weight: 600;
  margin-right: 8px;
}
.work-drawer-foot[hidden] {
  display: none !important;
}
.work-drawer .work-checklist-add {
  width: 100%;
}
.work-drawer .work-checklist-add .field-control,
.work-drawer .work-checklist-add .work-checklist-input {
  width: 100%;
  box-sizing: border-box;
}
.work-checklist-input {
  height: auto;
  min-height: 34px;
  max-height: 88px;
  padding: 6px 12px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 20px;
}
.work-checklist-input:empty::before,
.work-checklist-input.is-empty::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}
.work-checklist-input .assignee-at {
  display: inline;
}
.work-deps-group { margin-bottom: 10px; }
.work-deps-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.work-deps-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
}
.work-deps-item.is-done { opacity: 0.65; text-decoration: line-through; }
.work-deps-del {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}
.work-deps-add {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}
.work-deps-add .field-control {
  flex: 1;
  height: 34px;
  box-sizing: border-box;
}
.work-deps-add .btn {
  height: 34px;
  box-sizing: border-box;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.work-drawer-comment-editor {
  margin-top: 12px;
  overflow: visible;
}
.work-drawer-comment-editor .work-task-comment-editor,
.work-drawer .work-task-comment-editor.rich-input {
  min-height: 60px;
  max-height: none;
  height: auto;
  overflow: visible;
  padding: 10px 12px 48px;
  white-space: pre-wrap;
  word-break: break-word;
}
.work-drawer .work-task-comment-list,
.work-drawer .work-task-comment-list.activity-thread {
  max-height: none;
  overflow: visible;
  margin-top: 0;
  margin-bottom: 0;
}
.work-drawer .activity-html {
  white-space: pre-wrap;
  word-break: break-word;
}
.work-task-row {
  cursor: pointer;
}
.work-task-comment-btn.is-static {
  pointer-events: none;
  border: 0;
  background: transparent;
  padding: 0;
}

@media (max-width: 960px) {
  .work-inbox-grid { grid-template-columns: 1fr; }
  .work-board { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .work-drawer-panel {
    width: min(780px, 100%);
  }
}

/* —— 用户悬浮卡片 —— */
.user-hover-tip {
  position: fixed !important;
  inset: auto;
  margin: 0;
  transform: none;
  z-index: 4200;
  width: min(300px, calc(100vw - 16px));
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  box-shadow: none;
  pointer-events: auto;
  box-sizing: border-box;
}
.user-hover-tip[hidden] { display: none !important; }
.user-hover-tip-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.user-hover-tip-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-avatar);
  flex: 0 0 auto;
  object-fit: cover;
}
.user-hover-tip-identity { min-width: 0; }
.user-hover-tip-name {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
  color: #14161a;
  word-break: break-word;
}
.user-hover-tip-sub {
  margin-top: 2px;
  font-size: 13px;
}
.user-hover-tip-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 12px;
  color: #14161a;
}
.user-hover-tip-meta .muted { margin-right: 8px; }
.user-hover-tip-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.user-hover-tip-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.user-hover-tip-stat strong {
  font-size: 16px;
  font-weight: 650;
  color: #14161a;
}
.user-hover-tip-stat span {
  font-size: 12px;
  color: #9ca3af;
}
.user-hover-tip-error {
  font-size: 13px;
  padding: 4px 0;
}
.user-hover-name,
.assignee-at[data-uid],
.user-avatar[data-user-id] {
  cursor: default;
}

/* 全局：去掉鼠标经过下划线；正文里本身就带下划线的链接保持下划线 */
a:hover,
button:hover,
[role="button"]:hover,
[role="link"]:hover {
  text-decoration: none !important;
}
.kb-doc-editor--tiptap a.kb-doc-link:hover,
.kb-doc-editor a.kb-doc-link:hover,
.kb-doc-editor a:hover,
.activity-html a:hover {
  text-decoration: underline !important;
}

/* ——— 知识库面板（列 + 卡片，样式对齐知识库 / 我的任务看板） ——— */
.kb-doc-main:has(.kb-kanban-page) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kb-doc-main:has(.kb-kanban-page) > .kb-file-toolbar {
  flex: 0 0 auto;
}
.kb-editor:has(.kb-kanban-page) {
  padding: 0;
  overflow: hidden;
  position: relative;
  display: block;
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
.kb-kanban-page,
.kb-kanban-host {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.kb-kanban {
  display: flex;
  height: 100%;
  min-height: 0;
  background: #fff;
  color: #14161a;
  font-size: 13px;
}
.kb-kanban-board {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 12px 0;
  box-sizing: border-box;
}
.kb-kanban-col {
  flex: 0 0 260px;
  width: 260px;
  height: auto;
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 8px;
  box-sizing: border-box;
  box-shadow: none;
}
.kb-kanban-col.is-dragging {
  opacity: 0.45;
}
.kb-kanban-col.is-drop-before {
  border-color: #14161a;
}
.kb-kanban-col-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.kb-kanban-col-title {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #14161a;
  border-radius: 1px;
}
.kb-kanban-col-title:focus {
  outline: none;
}
.kb-kanban-col-title[readonly] {
  cursor: default;
}
.kb-kanban-col-tools {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 22px;
}
.kb-kanban-col-count {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}
.kb-kanban-col-del {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 2px 0 0;
  padding: 2px 4px;
  color: #9ca3af !important;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.kb-kanban-col:hover .kb-kanban-col-del,
.kb-kanban-col-head:focus-within .kb-kanban-col-del,
.kb-kanban-col-del:focus {
  opacity: 1;
  pointer-events: auto;
}
.kb-kanban-col-del:hover,
.kb-kanban-col-del:focus {
  color: #9ca3af !important;
}
@media (hover: none) {
  .kb-kanban-col-del {
    opacity: 1;
    pointer-events: auto;
  }
}
.kb-kanban-col-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.kb-kanban-add-btn,
.kb-kanban-add-form {
  flex: 0 0 auto;
}
.kb-kanban-col-body.is-drop-target {
  background: var(--surface-muted);
}
.kb-kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: none;
  color: #14161a;
}
.kb-kanban-card.is-selected {
  border-color: #14161a;
}
.kb-kanban-card.is-dragging {
  opacity: 0.45;
}
.kb-kanban-card.is-drop-before {
  border-top: 1px solid #14161a;
}
.kb-kanban-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: #14161a;
  word-break: break-word;
}
.kb-kanban-card-title .work-priority {
  flex: 0 0 auto;
}
.kb-kanban-card-title-text {
  min-width: 0;
}
.kb-kanban-card-note {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #9ca3af;
  word-break: break-word;
}
.kb-kanban-add-btn,
.kb-kanban-add-list {
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 400;
  padding: 6px 4px;
  cursor: pointer;
  text-align: left;
  border-radius: 1px;
  box-shadow: none;
}
.kb-kanban-add-btn:hover,
.kb-kanban-add-list:hover,
.kb-kanban-add-btn:focus,
.kb-kanban-add-list:focus {
  color: #14161a;
  background: var(--surface-muted);
  outline: none;
}
.kb-kanban-add-list {
  flex: 0 0 260px;
  width: 260px;
  min-height: 80px;
  border: 1px dashed var(--line);
  padding: 10px;
  align-self: flex-start;
}
.kb-kanban-add-form,
.kb-kanban-add-list-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}
.kb-kanban-add-list-form {
  margin-top: 0;
}
.kb-kanban-add-input.field-control {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.kb-kanban-add-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.kb-kanban-detail {
  flex: 0 0 280px;
  width: 280px;
  border-left: 1px solid var(--line);
  padding: 12px 14px;
  overflow-y: auto;
  background: #fff;
}
.kb-kanban-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kb-kanban-detail-head strong {
  font-size: 13px;
  font-weight: 600;
  color: #14161a;
}
.kb-kanban-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.kb-kanban-field span {
  font-size: 13px;
  color: #9ca3af;
}
.kb-kanban-note.field-control {
  height: auto;
  min-height: 120px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
}
.kb-kanban.is-readonly .kb-kanban-card {
  cursor: default;
}
