/* ============================================================
   言知生产系统 - 全局样式
   风格：商务极简，顶级律所调性
   ============================================================ */

@font-face {
  font-family: "IBM Plex Sans SC";
  src: url("/static/fonts/ibm-plex-sans-sc/IBMPlexSansSC-Light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans SC";
  src: url("/static/fonts/ibm-plex-sans-sc/IBMPlexSansSC-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans SC";
  src: url("/static/fonts/ibm-plex-sans-sc/IBMPlexSansSC-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --font-brand: "IBM Plex Sans SC", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* 品牌色 */
  --primary: #245FAC;
  --primary-hover: #1d4e8e;
  --primary-light: #eef3fa;

  /* 语义色（克制使用） */
  --danger: #c0392b;
  --warning: #d4790e;
  --success: #27784e;
  --info: #245FAC;

  /* 基础色 */
  --bg: #FAF9F5;
  --card-bg: #ffffff;
  --text: #2c2c2c;
  --text-secondary: #5f6b73;
  --text-light: #5f6b73;
  --border: #e8e6e1;
  --border-light: #f0eeea;

  /* 尺寸 */
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-hover: 0 2px 8px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-brand);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  background: #1f4e7d;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-home {
  display: flex;
  align-items: center;
  border-radius: 3px;
}

.header-home:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.header-logo {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav a[hidden] { display: none; }
.portal-layer-switch { display: inline-flex; flex-shrink: 0; }
.portal-layer-switch select { min-height: 40px; padding: 7px 28px 7px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 3px; background: transparent; color: rgba(255,255,255,.88); font: inherit; font-size: 14px; cursor: pointer; }
.portal-layer-switch select:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.5); color: #fff; }
.portal-layer-switch select:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.portal-layer-switch option { background: #fff; color: #222; }

.header-status {
  min-width: 0;
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  white-space: nowrap;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
}

.user-info img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.header .btn-outline {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.3);
}
.header .btn-outline:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
}

.btn-large {
  padding: 12px 36px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.inline-retry-btn {
  margin-left: 8px;
  padding: 4px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: transparent;
  color: var(--primary);
  font: 600 13px var(--font-brand);
  cursor: pointer;
}
.inline-retry-btn:hover { background: var(--primary-light); }
.inline-retry-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.resource-unavailable { color: var(--text-secondary); font-size: 14px; }

/* ============================================================
   Layout
   ============================================================ */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* 新版工作台拥有独立的全宽画布；离开路由后由 app.js 自动恢复原布局。 */
.main.wb2-active {
  max-width: none;
  padding: 0;
}

/* 工具总览与生产工作台使用同一宽画布。 */
.main.tools-active {
  max-width: none;
  min-height: calc(100vh - 56px);
  padding: 0;
  background: #fbfbf9;
}

.main.system-active {
  max-width: none;
  min-height: calc(100vh - 56px);
  padding: 0;
}

/* 工具页保持原有阅读宽度，只有首页卡片墙铺满 */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  text-align: center;
}

.auth-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 48px);
}

#authChecking,
#loginPanel {
  width: 244px;
}

.auth-spinner {
  width: 30px;
  height: 30px;
  margin-bottom: 24px;
  border: 2px solid rgba(36,95,172,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin { to { transform: rotate(360deg); } }

.login-page h1 {
  width: 100%;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
  text-align: center;
  text-indent: 0.08em;
}

.login-page p {
  width: 100%;
  color: var(--text-secondary);
  margin: 0 0 36px;
  font-size: 15px;
  text-align: center;
}

.feishu-login-btn {
  width: 100%;
  min-height: 52px;
  background: var(--primary);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  border: 0;
  outline: 0;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.04em;
}
.feishu-login-btn:hover { background: var(--primary-hover); }
.feishu-login-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(36, 95, 172, 0.18);
}

/* ============================================================
   Tool Selection
   ============================================================ */
.tool-selection {
  --tool-ink: #202421;
  --tool-sub: #69706c;
  --tool-faint: #66737b;
  --tool-line: #d5d2cb;
  --tool-paper: #fbfbf9;
  width: min(1440px, calc(100% - 72px));
  text-align: center;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  padding: 58px 0 104px;
  color: var(--tool-ink);
  background: var(--tool-paper);
}

.tool-selection > h2 {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--tool-ink);
  color: var(--tool-ink);
  font-size: clamp(42px, 4.5vw, 62px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.02em;
  text-align: left;
}
.tool-selection > h2 span {
  color: var(--tool-faint);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}

/* 单元组 */
.tool-system-group {
  margin: 0;
  padding: 42px 0 68px;
  border-bottom: 1px solid var(--tool-line);
}

.tool-system-title {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 20px;
  margin: 0 0 24px;
  text-align: left;
}
.tool-system-title b {
  color: var(--tool-ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .025em;
}
.tool-system-title h3 {
  margin: 0;
  color: var(--tool-ink);
  font-size: clamp(28px, 2.6vw, 38px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.012em;
}
.tool-system-title span {
  color: var(--tool-faint);
  font-size: 14px;
}

.tool-catalog-heading {
  grid-template-columns: minmax(0, 1fr) auto;
}

.tool-load-error .tool-catalog-heading {
  align-items: center;
}

.tool-load-error .tool-catalog-heading > span {
  grid-column: 1;
  grid-row: 2;
}

.tool-load-error .tool-catalog-heading > button {
  grid-column: 2;
  grid-row: 1 / 3;
}

.tool-cards-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--tool-line);
}

.tool-cards {
  margin: 0;
}

.tool-card {
  display: block;
  width: 100%;
  min-height: 184px;
  padding: 28px 24px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--tool-line);
  border-radius: 0;
  box-shadow: none;
  text-align: left;
  transition: background .18s ease, box-shadow .18s ease;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
}
.tool-card:nth-child(4n) { border-right: 0; }
.tool-card:nth-child(n+5) { border-top: 1px solid var(--tool-line); }

.tool-card:hover {
  background: #f3f3ef;
  box-shadow: inset 0 3px 0 rgba(36,95,172,.42);
}
.tool-card:focus-visible,
.header-nav a:focus-visible,
.wb2-stage:focus-visible,
.wb2-unit-card:focus-visible,
.wb2-child:focus-visible,
.wb2-document:focus-visible,
.wb2-tool-card:focus-visible,
.wb2-crumb a:focus-visible,
.wb2-state button:focus-visible,
.wb2-state a:focus-visible,
.sys-nav a:focus-visible,
.sys-filter button:focus-visible,
.sys-l2-card a:focus-visible,
.sys-priority-list button:focus-visible,
.sys-panel-head button:focus-visible,
.sys-group-foot button:focus-visible,
.sys-comparison-table button:focus-visible,
.sys-text-link:focus-visible,
.sys-flow-node:focus-visible,
.sys-live button:focus-visible,
.sys-state button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}

/* 路由切换后用程序化焦点通知读屏，但标题不属于键盘可操作控件，
   不显示浏览器默认的大块焦点框。 */
h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus,
h3[tabindex="-1"]:focus,
.progress-text[tabindex="-1"]:focus { outline: none; }

/* 状态标签 */
.tool-card .status-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-tag.status-dev {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #c4d5ed;
}

.status-tag.status-planned {
  background: #f5f5f3;
  color: var(--text-light);
  border: 1px solid var(--border);
}

/* 开发中卡片 */
.tool-card.dev {
  background: transparent;
}

.tool-card.dev:hover {
  background: #f3f3ef;
}

/* 灰显卡片（规划中） */
.tool-card.disabled {
  background: #f5f5f2;
  cursor: default;
  opacity: .62;
}

.tool-card.disabled:hover {
  background: #f5f5f2;
  box-shadow: none;
}

.tool-card.disabled h3,
.tool-card.disabled p {
  color: var(--text-light);
}

/* 规划中区块：从可用工具里分出来，单独收在页尾 */
.tool-planned {
  padding-top: 42px;
  border-bottom: 0;
}

.tool-planned .tool-system-title {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 8px;
}

.tool-planned .tool-planned-note {
  font-size: 14px;
  color: var(--text-light);
  text-align: left;
  margin: 0 0 16px;
}

.tool-planned .tool-cards-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.tool-planned .tool-card {
  min-height: 122px;
  padding: 20px;
}

.tool-planned .tool-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.tool-planned .tool-card p {
  font-size: 14px;
}

.tool-card .tool-icon {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.tool-card h3 {
  margin: 0 0 12px;
  color: var(--tool-ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

.tool-card > p {
  color: var(--tool-sub);
  font-size: 15px;
  margin-bottom: 0;
  line-height: 1.72;
}

.tool-card .tool-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  overflow-wrap: anywhere;
}

/* 紧凑工具目录：以筛选和归属定位为主，不在卡片展开内部建设说明。 */
.tool-directory {
  padding-bottom: 36px;
  border-bottom: 0;
}

.tool-filter-bar {
  display: grid;
  grid-template-columns: minmax(170px, .85fr) minmax(230px, 1.35fr) repeat(2, minmax(150px, .72fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--tool-line);
  border-top: 3px solid #2b67b1;
  background: #f4f7fa;
  text-align: left;
}

.tool-filter {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.tool-filter > span {
  color: #66737b;
  font-size: 14px;
  font-weight: 600;
}

.tool-filter input,
.tool-filter select {
  width: 100%;
  height: 40px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #bcc6ce;
  border-radius: 2px;
  background: #fff;
  color: #5e6971;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
}

.tool-filter input::placeholder { color: #8a949b; opacity: 1; }

.tool-filter input:focus,
.tool-filter select:focus {
  outline: 0;
  border-color: #2b67b1;
  box-shadow: 0 0 0 2px rgba(43, 103, 177, .13);
}

.tool-filter-reset {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #aeb9c1;
  border-radius: 2px;
  background: transparent;
  color: #69757d;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.tool-filter-reset:hover:not(:disabled) { background: #e9eff5; }
.tool-filter-reset:disabled { opacity: .42; cursor: default; }
.tool-filter-reset:focus-visible { outline: 2px solid #2b67b1; outline-offset: 2px; }

.tool-result-summary {
  min-height: 20px;
  margin: 15px 0 2px;
  color: var(--tool-faint);
  font-size: 13px;
  text-align: right;
}

.tool-group-block {
  padding: 24px 0 6px;
  border-top: 1px solid var(--tool-line);
}

.tool-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  text-align: left;
}

.tool-group-heading h4 {
  margin: 0;
  color: var(--tool-ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .01em;
}

.tool-group-heading span {
  color: var(--tool-faint);
  font-size: 13px;
}

.tool-unit-branch {
  padding: 14px 0 18px;
}

.tool-unit-branch + .tool-unit-branch {
  border-top: 1px solid #e1e5e8;
}

.tool-unit-branch-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  text-align: left;
}

.tool-unit-branch-heading h5 {
  margin: 0;
  color: #34424d;
  font-size: 15px;
  font-weight: 600;
}

.tool-unit-branch-heading span {
  color: var(--tool-faint);
  font-size: 13px;
}

.tool-common-heading {
  margin: 13px 0 8px;
  color: #78838b;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.tool-group-common {
  margin-top: 2px;
}

.tool-compact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.tool-compact-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 9px;
  min-width: 0;
  min-height: 104px;
  padding: 14px 15px 13px;
  border: 1px solid #c5cdd3;
  border-left: 3px solid #2b67b1;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tool-compact-card:hover {
  border-color: #7e9ab7;
  background: #f7faff;
  transform: translateY(-1px);
}

.tool-compact-card:focus-visible {
  outline: 2px solid #2b67b1;
  outline-offset: 2px;
}

.tool-compact-card.is-disabled {
  border-left-color: #b8c0c6;
  background: #f7f7f5;
}

.tool-compact-card.is-disabled:hover {
  border-color: #c5cdd3;
  border-left-color: #b8c0c6;
  background: #f7f7f5;
  transform: none;
}

.tool-compact-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.tool-compact-top h5 {
  min-width: 0;
  margin: 0;
  color: #18212a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-open-cue {
  flex: 0 0 auto;
  color: #2b67b1;
  font-size: 12px;
}

.is-disabled .tool-open-cue { color: #88939a; }

.tool-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-compact-meta span {
  padding: 2px 7px;
  border: 1px solid #cad7e3;
  border-radius: 999px;
  background: #f2f6fa;
  color: #345d86;
  font-size: 12px;
  line-height: 1.35;
}

.tool-compact-unit {
  min-width: 0;
  color: #66737b;
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-empty {
  margin-top: 20px;
  padding: 54px 18px;
  border: 1px dashed #b8c2ca;
  color: var(--tool-faint);
  font-size: 15px;
  text-align: center;
}

@media (max-width: 1180px) {
  .tool-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-filter-search { grid-column: auto; }
  .tool-filter-reset { grid-column: 2; justify-self: end; }
  .tool-compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .tool-selection { width: min(100% - 48px, 960px); }
  .tool-cards-row,
  .tool-planned .tool-cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card:nth-child(4n) { border-right: 1px solid var(--tool-line); }
  .tool-card:nth-child(2n) { border-right: 0; }
  .tool-card:nth-child(n+3) { border-top: 1px solid var(--tool-line); }
  .tool-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-filter-search { grid-column: 1 / -1; }
  .tool-filter-reset { grid-column: 2; justify-self: end; }
  .tool-compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Tool Pages
   ============================================================ */
.tool-page { display: none; }

.tool-header {
  margin-bottom: 36px;
}

.tool-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 16px 0 6px;
  color: var(--text);
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ============================================================
   Upload Area
   ============================================================ */
.upload-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  border: 1px dashed var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 24px;
}

.upload-card:hover, .upload-card.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-card:focus-visible {
  outline: 3px solid rgba(36,95,172,.34);
  outline-offset: 3px;
  border-color: var(--primary);
}

.upload-card .icon {
  font-size: 32px;
  margin-bottom: 16px;
  color: var(--text-light);
}

.upload-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.upload-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

.upload-card input[type="file"] { display: none; }

/* Upload pair */
.upload-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upload-half { padding: 32px 20px; }
.upload-half .icon { font-size: 28px; }

/* ============================================================
   Progress
   ============================================================ */
.progress-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  display: none;
  border: 1px solid var(--border);
}

.progress-bar {
  height: 2px;
  background: var(--border-light);
  border-radius: 1px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   Report
   ============================================================ */
.report { display: none; }

.report-header {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.report-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-item {
  padding: 16px 12px;
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
}

.stat-item .number {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.stat-item .label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.stat-item.error .number { color: var(--danger); }
.stat-item.warning .number { color: var(--warning); }
.stat-item.success .number { color: var(--success); }
.stat-item.note .number { color: var(--info); }

/* ============================================================
   Issue Cards
   ============================================================ */
.section { margin-bottom: 20px; }

.section-title {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 0;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.section-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.section-toggle-icon { margin-left: auto; font-size: 13px; color: var(--text-secondary); }

.issue-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
}

.issue-card.error { border-left-color: var(--danger); }
.issue-card.warning { border-left-color: var(--warning); }
.issue-card.safe { border-left-color: var(--success); }

.issue-card .seg-id {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.issue-card .text-row {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.issue-card .text-row .label {
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 12px;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.issue-card .issue-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
}

.issue-card .issue-detail .tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-right: 6px;
  font-weight: 600;
}

.tag-missing { background: #fdf0ef; color: var(--danger); }
.tag-extra { background: #fef6ed; color: var(--warning); }

/* Error type tags */
.error-type-tag {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.error-type-missing {
  background: #fef6ed;
  color: var(--warning);
  border: 1px solid #f5dfc4;
}
.error-type-wrong {
  background: #fdf0ef;
  color: var(--danger);
  border: 1px solid #e8c4c0;
}
.error-type-code {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid #c4d5ed;
}

/* Problem items */
.issue-problems { margin-top: 10px; }

.problem-item {
  margin-bottom: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-left: 2px solid var(--text-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
}

.issue-card.error .problem-item {
  border-left-color: var(--danger);
}

.problem-num {
  font-weight: 600;
  color: var(--text);
}

.problem-text { line-height: 1.6; }

.problem-suggestion {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Debug panel */
.debug-toggle {
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: 400 13px var(--font-brand);
  cursor: pointer;
}
.debug-toggle:hover { color: var(--primary); }
.debug-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.debug-panel {
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
}

/* ============================================================
   File list & Match preview
   ============================================================ */
.file-list {
  margin-top: 12px;
  text-align: left;
  font-size: 14px;
}

.file-list-item {
  padding: 6px 10px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-light);
}

.file-list-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-list-item .remove-btn {
  cursor: pointer;
  color: var(--text-light);
  margin-left: auto;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-family: inherit;
}
.file-list-item .remove-btn:hover,
.file-list-item .remove-btn:focus-visible { color: var(--danger); background: #f7ecea; }

.match-preview {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 16px;
  border: 1px solid var(--border);
}

.match-preview h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.match-header {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 2px;
  font-size: 14px;
}

.match-row > * { min-width: 0; overflow-wrap: anywhere; }

.match-row:nth-child(odd) { background: var(--bg); }
.match-row .arrow { text-align: center; color: var(--text-light); }
.match-row .src-name { color: var(--text-secondary); }
.match-row .tgt-name { font-weight: 600; }
.match-row.unmatched { background: #fef6ed; }
.match-row.unmatched .tgt-name { color: var(--warning); }

/* ============================================================
   History
   ============================================================ */
.history-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  width: 100%;
  color: var(--text);
  font-family: var(--font-brand);
  text-align: left;
}

.history-item:hover {
  border-color: var(--primary);
}

.history-item .hi-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.history-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.history-item .hi-name { min-width: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.history-item .hi-meta { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.history-item .hi-badge {
  padding: 3px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}
.hi-badge.pass { background: #edf7f0; color: var(--success); }
.hi-badge.fail { background: #fdf0ef; color: var(--danger); }
.hi-badge.warn { background: #fef6ed; color: var(--warning); }

/* ============================================================
   Check table (DocCheck)
   ============================================================ */
.check-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.check-table thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.check-table .cat-row td {
  background: var(--bg);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.check-table .check-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.check-table .check-row.fail td { background: #fdf8f7; }
.check-table .check-row.warn td { background: #fefcf4; }

.check-table .code-cell { width: 70px; color: var(--text-secondary); font-family: 'SF Mono', Monaco, 'Courier New', monospace; font-size: 13px; }
.check-table .item-cell { width: 120px; font-weight: 600; }
.check-table .icon-cell { width: 50px; text-align: center; white-space: nowrap; }
.check-table .detail-cell { color: var(--text-secondary); }

/* ============================================================
   Term check
   ============================================================ */
.term-issue-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--danger);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
}

.term-issue-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fdf8f7;
  border-bottom: 1px solid var(--border-light);
}

.term-seg {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: var(--radius);
}

.term-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.term-src-tag { font-weight: 600; color: var(--text); }
.term-arrow { color: var(--text-light); }
.term-tgt-tag { font-weight: 600; color: var(--danger); }

.term-issue-body { padding: 14px 20px; }

.term-text-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.7;
}
.term-text-row:last-child { margin-bottom: 0; }

.term-label {
  flex-shrink: 0;
  width: 32px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  padding-top: 2px;
  letter-spacing: 0.02em;
}

.term-text { flex: 1; color: var(--text); }

mark.term-src-hl {
  background: #fef3cd;
  color: var(--text);
  padding: 1px 2px;
  border-radius: 2px;
}

.term-missing-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  background: #fdf0ef;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid #e8c4c0;
}

.file-selected {
  margin-top: 8px;
  min-width: 0;
  font-size: 14px;
  color: var(--success);
  overflow-wrap: anywhere;
}

#stamperFileHint,
#w2pFileHint { min-width: 0; overflow-wrap: anywhere; }

.file-item { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }

.history-panel {
  margin-bottom: 24px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .main { padding: 24px 16px; }
  .upload-card { padding: 32px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .header { padding: 0 16px; }
  .upload-pair { grid-template-columns: 1fr; }
  .transcribe-options { display: grid !important; grid-template-columns: 1fr; width: 100%; }
  .transcribe-model-field { min-width: 0 !important; width: 100%; }
  #transcribeModelSelect { min-width: 0 !important; width: 100%; }
  .stamper-primary-grid,
  .stamper-advanced-grid { grid-template-columns: 1fr !important; }
  .stampclean-item { grid-template-columns: 1fr; align-items: start; }
  .tool-selection { width: calc(100% - 34px); padding: 38px 0 72px; }
  .tool-selection > h2 { display: block; padding-bottom: 24px; font-size: 42px; }
  .tool-selection > h2 span { display: block; margin-top: 8px; }
  .tool-system-group { padding: 32px 0 48px; }
  .tool-system-title { grid-template-columns: 56px minmax(0, 1fr); gap: 13px; }
  .tool-catalog-heading { grid-template-columns: minmax(0, 1fr) auto; }
  .tool-system-title h3 { font-size: 28px; }
  .tool-system-title > span { grid-column: 2; }
  .tool-catalog-heading > span { grid-column: 2; }
  .tool-cards-row,
  .tool-planned .tool-cards-row { grid-template-columns: 1fr; }
  .tool-card,
  .tool-card:nth-child(2n),
  .tool-card:nth-child(4n) { min-height: 150px; border-right: 0; }
  .tool-card:nth-child(n+2) { border-top: 1px solid var(--tool-line); }
  .tool-planned .tool-system-title { grid-template-columns: 1fr auto; }
  .tool-planned .tool-system-title > span { grid-column: 2; }
  .tool-filter-bar { grid-template-columns: 1fr; padding: 14px; }
  .tool-filter-search,
  .tool-filter-reset { grid-column: auto; }
  .tool-filter-reset { justify-self: stretch; }
  .tool-result-summary { text-align: left; }
  .tool-compact-grid { grid-template-columns: 1fr; }
  .tool-group-block { padding-top: 20px; }
}

/* ============================================================
   Dev Placeholder
   ============================================================ */
.dev-placeholder {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  border: 1px solid var(--border);
  margin-top: 24px;
}

.dev-icon {
  font-size: 48px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.dev-placeholder h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.dev-placeholder p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.dev-progress {
  max-width: 400px;
  margin: 0 auto;
  text-align: left;
}

.dev-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 8px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
}

.dev-progress-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.dev-progress-status.done {
  color: var(--success);
}

.dev-progress-status.inprogress {
  color: var(--primary);
  animation: spin 2s linear infinite;
}

.dev-progress-status.pending {
  color: var(--text-light);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Hidden utility */
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   Align Editor - 对齐编辑界面
   ============================================================ */

.align-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.align-toolbar-left, .align-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.align-stats {
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

.align-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
}

.align-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.align-table thead {
  background: #f8f7f4;
  position: sticky;
  top: 0;
  z-index: 2;
}

.align-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

.align-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.align-col-num { width: 40px; text-align: center; }
.align-col-src { width: 42%; }
.align-col-tgt { width: 42%; }
.align-col-type { width: 50px; text-align: center; }
.align-col-score { width: 55px; text-align: center; }

.align-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.align-table tbody tr:hover {
  background: var(--primary-light);
}

.align-table tbody tr:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.align-table tbody tr.selected {
  background: #dbeafe;
}

/* 行状态颜色 */
.align-table tbody tr.row-unmatched {
  background: #fff9e6;
}
.align-table tbody tr.row-unmatched:hover {
  background: #fff3cc;
}

.align-table tbody tr.row-multi {
  background: #eef5ff;
}
.align-table tbody tr.row-multi:hover {
  background: #ddeaff;
}

.align-table tbody tr.row-lowscore {
  background: #fff0e6;
}
.align-table tbody tr.row-lowscore:hover {
  background: #ffe0cc;
}

/* 类型标签 */
.align-type-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
}

.align-type-tag.t-11 { background: #e8f5e9; color: #2e7d32; }
.align-type-tag.t-12, .align-type-tag.t-21 { background: #e3f2fd; color: #1565c0; }
.align-type-tag.t-10, .align-type-tag.t-01 { background: #fff3e0; color: #e65100; }

/* 相似度数值颜色 */
.score-high { color: #2e7d32; }
.score-mid { color: #f57f17; }
.score-low { color: #c62828; }

/* TermExtract: 定义词表格 */
.terms-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.terms-table th { background: var(--primary-light, #eef3fa); color: var(--primary); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.terms-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.terms-table tr:hover { background: #fafaf7; }
.td-index { width: 40px; text-align: center; color: var(--text-light); }
.td-term { font-weight: 600; white-space: nowrap; }
.td-variants { color: var(--text-secondary); font-size: 14px; }
.td-clause { white-space: nowrap; color: var(--text-secondary); }
.td-context { font-size: 14px; color: var(--text-secondary); max-width: 300px; overflow: hidden; text-overflow: ellipsis; }

/* TermExtract: 质量检查面板 */
.check-group-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 20px 0 8px; padding-left: 2px; }
.check-group-title:first-child { margin-top: 0; }
.check-panel { border: 1px solid var(--border-light); border-radius: var(--radius); margin-bottom: 6px; overflow: hidden; }
.check-header { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 8px 12px; border: 0; cursor: pointer; background: #fafaf7; color: var(--text); font-family: var(--font-brand); text-align: left; }
.check-header:hover { background: #f5f4f0; }
.check-header:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.check-header-left { display: flex; align-items: center; gap: 8px; }
.check-name { font-size: 14px; font-weight: 600; }
.check-badge { font-size: 13px; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.check-badge.clean { background: #e8f5e9; color: #2e7d32; }
.check-badge.issue { background: #fff3e0; color: #e65100; }
.check-badge.error { background: #ffebee; color: #c62828; }
.check-toggle { font-size: 14px; color: var(--text-light); transition: transform 0.2s; }
.check-toggle.open { transform: rotate(180deg); }
.check-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 12px; }
.check-body.open { max-height: 2000px; padding: 10px 12px; }
.check-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.check-empty { font-size: 14px; color: var(--text-light); padding: 4px 0; }
.check-item { padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.check-item:last-child { border-bottom: none; }
.check-item.error-item { border-left: 3px solid var(--danger); padding-left: 8px; }
.item-term { font-weight: 600; font-size: 14px; }
.item-detail { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* ========== StampClean - 印章去底色 ========== */
.stampclean-item {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.stampclean-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}
.stampclean-preview-missing {
  min-height: 110px;
  padding: 18px;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}
.stampclean-meta { min-width: 0; display: grid; gap: 12px; overflow-wrap: anywhere; }
.stampclean-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.stampclean-result-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 8px);
  padding: 12px;
  background: var(--card-bg, #fff);
}
.stampclean-result-item .preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  /* 棋盘格背景表现透明 */
  background-image:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius, 4px);
  margin-bottom: 8px;
  overflow: hidden;
}
.stampclean-result-item .preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.stampclean-result-item .name {
  font-size: 14px;
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: 6px;
  line-height: 1.4;
}
.stampclean-result-item .download-btn {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  display: inline-block;
}
.stampclean-result-item .download-btn:hover {
  text-decoration: underline;
}



/* 术语提取：类别勾选 */
.kind-picker { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--border, #e5e5e5); border-radius: 8px; background: #fafafa; }
.kind-picker-title { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.kind-picker label { display: block; margin: 6px 0; font-size: 14px; cursor: pointer; }
.kind-picker input { margin-right: 8px; }
.kind-hint { color: var(--text-light, #5f6b73); font-size: 14px; margin-left: 8px; }

/* ============================================================
   生产工作台 —— 浅色，按 B34.1-S01 品牌视觉标准取值
   该标准明文：「页面主体以中性灰阶与留白承载内容；同一视觉面只保留少量品牌色锚点」。
   所以这里不做深色、不做渐变、不做辉光——留白和字号撑起层级，
   言知蓝只出现在链接和「当前位置」上。
   文字色阶取自标准，白底实测对比度：正文 15.1:1、辅助 8.9:1、链接 6.3:1。
   标签灰 #8C8C8C 只有 3.4:1，仅用于分隔线与极少量大字标签，不用来写正文。
   ============================================================ */
#workbenchPage{
  --ink:#262626;        /* 正文与标题 */
  --sub:#4A4A4A;        /* 辅助说明 */
  --meta:#6B6B6B;       /* 元信息，比标准的 8C8C8C 深一档以过 AA */
  --line:#E6E4E1;
  --line-2:#D2CFCB;
  --brand:#245FAC;
  --brand-soft:#F1F5FA;
  --surface:#FFFFFF;
  --mono:ui-monospace,Consolas,"Microsoft YaHei",monospace;

  max-width:1120px;margin:0 auto;padding:0 8px 96px;text-align:left;
  color:var(--ink);font-size:16.5px;line-height:1.78;
}
#workbenchPage a{text-decoration:none;color:inherit}
.wb-loading,.wb-err{padding:90px 0;text-align:center;color:var(--sub);font-size:16px}
.wb-err{color:#9A4B2E}

/* ── 首屏 ── */
.wb-hero{padding:44px 0 34px;margin-bottom:44px;border-bottom:2px solid var(--ink)}
.wb-kicker{font-size:14px;color:var(--brand);font-weight:600;margin:0 0 16px;letter-spacing:.02em}
.wb-hero h1{font-size:42px;line-height:1.2;font-weight: 600;color:var(--ink);margin:0 0 16px;letter-spacing:-.01em}
.wb-lede{font-size:18px;color:var(--sub);margin:0 0 34px;max-width:38em;line-height:1.7}

.wb-figs{display:flex;flex-wrap:wrap;gap:52px}
.wb-figs div{display:flex;flex-direction:column;gap:4px}
.wb-figs b{font-size:38px;font-weight: 600;color:var(--ink);line-height:1;font-variant-numeric:tabular-nums}
.wb-figs span{font-size:15px;color:var(--sub)}

/* ── 生产环节 ── */
.wb-band{margin-bottom:56px}
.wb-band-h{display:flex;align-items:baseline;justify-content:space-between;gap:20px;
  padding-bottom:12px;margin-bottom:20px;border-bottom:1px solid var(--line-2)}
.wb-band-t{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.wb-band-no{font-family:var(--mono);font-size:15px;font-weight: 600;color:var(--brand)}
.wb-band-t h2{font-size:26px;font-weight: 600;color:var(--ink);margin:0}
.wb-band-t p{font-size:16px;color:var(--sub);margin:0}
.wb-band-f{display:flex;gap:20px;font-size:15px;color:var(--meta);white-space:nowrap}

.wb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.wb-card{display:flex;flex-direction:column;gap:7px;padding:22px 24px;
  background:var(--surface);border:1px solid var(--line);border-radius:4px;
  transition:border-color .14s,box-shadow .14s}
.wb-card:hover{border-color:var(--brand);box-shadow:0 2px 14px -6px rgba(36,95,172,.35)}
.wb-card-no{font-family:var(--mono);font-size:14px;font-weight: 600;color:var(--brand)}
.wb-card-name{font-size:20px;font-weight: 600;color:var(--ink);line-height:1.35}
.wb-card-goal{font-size:15.5px;color:var(--sub);line-height:1.7}
.wb-card-meta{display:flex;flex-wrap:wrap;gap:16px;margin-top:8px;font-size:15px;color:var(--meta)}
.wb-card-meta i{font-style:normal}
.wb-card-meta i.on{color:var(--brand);font-weight:600}

/* ── 面包屑与页头 ── */
.wb-crumb{font-size:15.5px;color:var(--meta);margin:36px 0 26px}
.wb-crumb a{color:var(--brand)}
.wb-crumb a:hover{text-decoration:underline}
.wb-crumb i{margin:0 10px;font-style:normal;color:var(--line-2)}

.wb-head{padding-bottom:28px;margin-bottom:36px;border-bottom:2px solid var(--ink)}
.wb-chip{display:inline-block;font-family:var(--mono);font-size:15px;font-weight: 600;
  color:var(--brand);background:var(--brand-soft);border:1px solid #CFDDEE;
  padding:4px 12px;border-radius:4px}
.wb-chip.sm{font-size:13px;padding:2px 9px}
.wb-head h1{font-size:34px;font-weight: 600;color:var(--ink);margin:16px 0 0;line-height:1.25}
.wb-goal{font-size:17px;color:var(--sub);margin:16px 0 0;max-width:50em;line-height:1.78}

.wb-contract{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px 22px;margin:28px 0 0;font-size:16px}
.wb-contract dt{font-size:15px;font-weight: 600;color:var(--brand);white-space:nowrap}
.wb-contract dd{margin:0;color:var(--sub);line-height:1.78}

/* ── 小节标题 ── */
.wb-sec{font-size:15px;font-weight: 600;color:var(--ink);margin:0 0 18px;
  padding-bottom:9px;border-bottom:1px solid var(--line-2)}
.wb-sec span{color:var(--meta);font-weight:400;margin-left:5px}

/* ── 工序链 ── */
.wb-flow{display:flex;flex-direction:column}
.wb-step{display:grid;grid-template-columns:52px minmax(0,1fr);gap:20px;
  padding:24px 0;border-bottom:1px solid var(--line)}
.wb-step:hover .wb-step-h b{color:var(--brand)}
.wb-step-i b{display:flex;align-items:center;justify-content:center;width:38px;height:38px;
  border-radius:50%;font-family:var(--mono);font-size:15px;font-weight: 600;
  color:var(--brand);background:var(--brand-soft);border:1px solid #CFDDEE}
.wb-step-h{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.wb-step-h b{font-size:21px;font-weight: 600;color:var(--ink);transition:color .14s}
.wb-step-h em{font-style:normal;font-size:14px;color:var(--meta);
  border:1px solid var(--line-2);border-radius:3px;padding:2px 10px}
.wb-step-b p{margin:10px 0 0;font-size:16px;color:var(--sub);line-height:1.75}
.wb-step-f{display:flex;flex-wrap:wrap;gap:8px 22px;margin:12px 0 8px;font-size:15px;color:var(--meta)}
.wb-step-f .out{color:var(--sub)}

.wb-own{margin-top:48px;padding-top:32px;border-top:1px solid var(--line-2)}

/* ── 两栏：文档 / 工具 ── */
.wb-cols{display:grid;grid-template-columns:1fr 1fr;gap:48px}
@media (max-width:960px){.wb-cols{grid-template-columns:1fr;gap:38px}}

.wb-doclist{display:flex;flex-direction:column;gap:26px}
.wb-dt-h{display:flex;align-items:center;gap:9px;font-size:15px;color:var(--sub);
  margin-bottom:10px;font-weight:600}
.wb-dt-h span{font-family:var(--mono);font-weight: 600;font-size:13px;color:var(--brand);
  background:var(--brand-soft);border:1px solid #CFDDEE;border-radius:3px;padding:2px 8px}
.wb-doc{display:flex;align-items:baseline;justify-content:space-between;gap:18px;
  padding:12px 0;border-bottom:1px solid var(--line)}
.wb-doc a{color:var(--brand);font-size:17px;font-weight: 600}
.wb-doc a:hover{text-decoration:underline}
.wb-doc>span:first-child{font-size:17px;color:var(--ink)}
.wb-ext{font-style:normal;font-size:12.5px;color:var(--meta);border:1px solid var(--line-2);
  border-radius:3px;padding:1px 6px;margin-left:8px}
.wb-doc-meta{font-family:var(--mono);font-size:13.5px;color:var(--meta);white-space:nowrap}
.wb-warn{color:#9A4B2E;font-style:normal;font-weight:600}

.wb-tool{padding:20px 22px;border:1px solid var(--line);border-radius:4px;margin-bottom:12px;
  background:var(--surface);transition:border-color .14s}
.wb-tool:hover{border-color:var(--brand)}
.wb-tool.off{opacity:.62}
.wb-tool-h{display:flex;align-items:baseline;justify-content:space-between;gap:14px}
.wb-tool-h a{color:var(--brand);font-weight: 600;font-size:18px}
.wb-tool-h a:hover{text-decoration:underline}
.wb-tool-h span{font-weight: 600;font-size:18px;color:var(--ink)}
.wb-tool-h em{font-style:normal;font-size:13.5px;color:var(--meta);
  border:1px solid var(--line-2);border-radius:3px;padding:2px 9px;white-space:nowrap}
.wb-tool p{margin:10px 0 0;font-size:15.5px;color:var(--sub);line-height:1.72}
.wb-from{margin-top:10px;font-size:14px;color:var(--meta)}
.wb-inh-h{font-size:15px;color:var(--sub);font-weight:600;margin:26px 0 12px}
.wb-empty{color:var(--meta);font-size:16px}

/* ── 数据缺口 ── */
.wb-gaps{margin-top:60px;padding:26px 28px;border:1px solid #E0CFC5;
  border-left:4px solid #9A4B2E;border-radius:4px;background:#FCF8F6}
.wb-gaps-h{font-size:19px;font-weight: 600;color:var(--ink);margin-bottom:18px}
.wb-gaps-h b{color:#9A4B2E;margin:0 4px}
.wb-gaps-h span{display:block;font-size:15.5px;font-weight:400;color:var(--sub);margin-top:6px;line-height:1.7}
.wb-gap{margin-bottom:20px}
.wb-gap:last-child{margin-bottom:0}
.wb-gap-t{font-size:16.5px;font-weight: 600;color:var(--ink)}
.wb-gap-t i{font-style:normal;color:#9A4B2E;margin-left:7px}
.wb-gap-why{font-size:15px;color:var(--sub);margin:4px 0 11px}
.wb-gap-list{display:flex;flex-wrap:wrap;gap:8px}
.wb-gap-list span{font-size:15px;padding:6px 13px;background:#fff;
  border:1px solid var(--line-2);border-radius:3px;color:var(--sub)}

/* ── 顶部导航 ── */
.header-nav{display:flex;gap:4px;margin-right:20px}
.header-nav a{font-size:15px;font-weight:600;color:#C4C4C4;text-decoration:none;
  padding:8px 16px;border-radius:4px;transition:color .14s,background .14s}
.header-nav a:hover{color:#fff;background:rgba(255,255,255,.1)}
.header-nav a.on{color:#fff;background:rgba(255,255,255,.16)}

@media (max-width:640px){
  #workbenchPage{font-size:16px;padding:0 4px 72px}
  .wb-hero h1{font-size:32px}
  .wb-figs{gap:28px}
  .wb-figs b{font-size:30px}
  .wb-step{grid-template-columns:44px minmax(0,1fr);gap:14px}
}

/* ============================================================
   生产能力目录 v2 —— 深海蓝 × 暖白 × IBM Plex Sans SC
   中英文字、数字与业务编码使用同一字体家族；层级来自字号、字重、
   留白、线条和材质反差；品牌蓝只承担产品结构与交互强调。
   ============================================================ */
#myWorkPage,
#workbenchV2Page {
  --wb2-dark: #1b3348;
  --wb2-dark-2: #234157;
  --wb2-dark-3: #31536b;
  --wb2-ivory: #f4f4f0;
  --wb2-paper: #fbfbf9;
  --wb2-ink: #20282f;
  --wb2-sub: #4d5a62;
  --wb2-faint: #5f6b73;
  --wb2-line: #d8dad6;
  --wb2-line-dark: rgba(240, 242, 239, .17);
  --wb2-accent: #245fac;
  --wb2-type: var(--font-brand);

  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--wb2-ink);
  background: var(--wb2-paper);
  text-align: left;
  font-family: var(--wb2-type);
  font-synthesis: none;
  font-variant-numeric: lining-nums tabular-nums;
}

#workbenchV2Page * { box-sizing: border-box; }
#workbenchV2Page a { color: inherit; text-decoration: none; }
.wb2-shell { width: min(1440px, calc(100% - 72px)); margin: 0 auto; }

.wb2-state {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  background: var(--wb2-dark);
  color: #e7e4dc;
  letter-spacing: .08em;
}
.wb2-state b { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.wb2-state span { color: #aeb2af; letter-spacing: 0; }
.wb2-state button, .wb2-state a {
  margin-top: 12px;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,.3);
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

/* 首屏 */
.wb2-hero {
  background: var(--wb2-dark);
  color: #f3f4f1;
  border-bottom: 1px solid var(--wb2-line-dark);
}
.wb2-hero-main {
  padding: 58px 0 48px;
}
.wb2-hero h1 {
  margin: 0;
  font-family: var(--wb2-type);
  font-size: clamp(48px, 5.2vw, 76px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.025em;
}

/* 三个生产单元组 */
.wb2-stage-wrap { padding: 42px 0 76px; background: var(--wb2-dark); color: #f2f3f0; }
.wb2-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 42px;
  margin-bottom: 26px;
}
.wb2-section-head > div > span {
  display: block;
  margin-bottom: 9px;
  color: #aeb2ae;
  font-size: 13px;
  letter-spacing: .22em;
}
.wb2-section-head h2 {
  margin: 0;
  font-family: var(--wb2-type);
  font-size: 36px;
  font-weight: 300;
  line-height: 1.2;
}
.wb2-section-head > p {
  max-width: 480px;
  margin: 0;
  color: #aeb2ae;
  font-size: 15px;
  line-height: 1.8;
  text-align: right;
}
.wb2-stage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--wb2-line-dark);
}
.wb2-stage {
  min-height: 304px;
  padding: 30px;
  border: 0;
  border-right: 1px solid var(--wb2-line-dark);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: color .2s ease, background .2s ease;
}
.wb2-stage:last-child { border-right: 0; }
.wb2-stage:hover { background: rgba(255,255,255,.035); }
.wb2-stage.is-active { background: var(--wb2-ivory); color: var(--wb2-ink); }
.wb2-stage-top {
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(240, 242, 239, .16);
}
.wb2-stage-top .wb2-stage-number {
  min-width: 2.15ch;
  font: 300 clamp(60px, 4.7vw, 74px)/.82 var(--wb2-type);
  font-style: normal;
  letter-spacing: -.025em;
  color: #f1f2ef;
  font-variant-numeric: lining-nums tabular-nums;
}
.wb2-stage-top > b { padding-top: 3px; font: 600 15px var(--wb2-type); letter-spacing: .035em; color: #b3b7b3; font-variant-numeric: lining-nums tabular-nums; }
.wb2-stage.is-active .wb2-stage-top { border-bottom-color: rgba(39,43,41,.18); }
.wb2-stage.is-active .wb2-stage-top .wb2-stage-number { color: var(--wb2-ink); }
.wb2-stage.is-active .wb2-stage-top > b { color: var(--wb2-sub); }
.wb2-stage > strong {
  margin-top: 34px;
  font: 300 clamp(38px, 3.2vw, 52px)/1.2 var(--wb2-type);
  letter-spacing: -.01em;
}
.wb2-stage-note {
  max-width: 29em;
  margin-top: 24px;
  color: #b6b9b5;
  font-size: 15px;
  line-height: 1.75;
}
.wb2-stage.is-active .wb2-stage-note { color: var(--wb2-sub); }
.wb2-stage-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 30px;
  color: #a9adaa;
  font-size: 15px;
}
.wb2-stage-count > span { display: inline-flex; align-items: baseline; gap: 3px; }
.wb2-stage-count b { font: 600 18px/1 var(--wb2-type); color: currentColor; font-variant-numeric: lining-nums tabular-nums; }
.wb2-stage-count i, .wb2-stage-count em { font-style: normal; }
.wb2-stage-count em { margin: 0 3px; color: rgba(169,173,170,.56); }
.wb2-stage.is-active .wb2-stage-count { color: #69706c; }
.wb2-stage.is-active .wb2-stage-count em { color: rgba(105,112,108,.5); }

/* 一级单元卡片 */
.wb2-unit-wrap { padding: 104px 0 118px; background: var(--wb2-ivory); }
.wb2-unit-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  padding-bottom: 31px;
  border-bottom: 1px solid var(--wb2-ink);
}
.wb2-unit-kicker { display: flex; align-items: baseline; gap: 12px; color: var(--wb2-sub); }
.wb2-unit-kicker b { font: 600 22px/1 var(--wb2-type); letter-spacing: .025em; color: var(--wb2-ink); font-variant-numeric: lining-nums tabular-nums; }
.wb2-unit-head h2 { margin: 10px 0 0; font: 300 52px/1.15 var(--wb2-type); letter-spacing: -.015em; }
.wb2-unit-summary { display: flex; align-items: baseline; gap: 10px; color: var(--wb2-sub); }
.wb2-unit-summary b { color: var(--wb2-ink); font: 400 40px/1 var(--wb2-type); font-variant-numeric: lining-nums tabular-nums; }
.wb2-unit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wb2-unit-card {
  min-height: 288px;
  padding: 35px 38px 32px 0;
  border-bottom: 1px solid var(--wb2-line);
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  column-gap: 25px;
  position: relative;
}
.wb2-unit-card:nth-child(odd) { padding-right: 46px; border-right: 1px solid var(--wb2-line); }
.wb2-unit-card:nth-child(even) { padding-left: 46px; }
.wb2-unit-code {
  grid-row: 1 / span 4;
  width: max-content;
  padding-top: 4px;
  font: 600 20px/1.15 var(--wb2-type);
  letter-spacing: .015em;
  color: var(--wb2-ink);
}
.wb2-unit-code::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin-top: 10px;
  background: var(--wb2-faint);
}
.wb2-unit-card > strong { font: 300 32px/1.35 var(--wb2-type); letter-spacing: -.01em; transition: transform .2s ease; }
.wb2-unit-card > p {
  margin: 17px 0 0;
  color: var(--wb2-sub);
  font-size: 16px;
  line-height: 1.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wb2-unit-meta { align-self: end; padding-top: 22px; color: var(--wb2-faint); font-size: 15px; }
.wb2-unit-go { margin-top: 13px; font-size: 15px; letter-spacing: .04em; }
.wb2-unit-card:hover > strong { transform: translateX(5px); }
.wb2-stage-foot {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 42px;
  color: var(--wb2-sub);
  font-size: 15px;
}

/* 详情页共用 */
.wb2-light { min-height: calc(100vh - 56px); padding: 1px 0 120px; background: var(--wb2-paper); }
.wb2-crumb { display: flex; flex-wrap: wrap; gap: 11px; margin: 38px 0 70px; color: var(--wb2-faint); font-size: 15px; }
.wb2-crumb a { color: var(--wb2-sub); }
.wb2-crumb a:hover { color: var(--wb2-ink); }
.wb2-crumb i { font-style: normal; color: var(--wb2-line); }
.wb2-detail-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, .75fr); gap: 64px; align-items: end; padding-bottom: 48px; border-bottom: 1px solid var(--wb2-ink); }
.wb2-detail-code, .wb2-leaf-code { display: flex; align-items: baseline; gap: 12px; color: var(--wb2-sub); }
.wb2-detail-code b, .wb2-leaf-code b { font: 600 20px/1 var(--wb2-type); letter-spacing: .025em; color: var(--wb2-ink); font-variant-numeric: lining-nums tabular-nums; }
.wb2-detail-code span, .wb2-leaf-code i { font-style: normal; font-size: 15px; letter-spacing: .06em; }
.wb2-detail-head h1 { grid-column: 1; margin: 13px 0 0; font: 300 clamp(56px, 6.8vw, 104px)/1.06 var(--wb2-type); letter-spacing: -.025em; }
.wb2-detail-head > p { grid-column: 2; grid-row: 1 / span 2; margin: 0; color: var(--wb2-sub); font-size: 17px; line-height: 1.95; }

/* 从项目事实到实际工序，说明“单元不是工序” */
.wb2-assembly {
  margin: 72px 0 98px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  border-top: 1px solid var(--wb2-line);
  border-bottom: 1px solid var(--wb2-line);
}
.wb2-assembly > div { min-height: 178px; padding: 28px 25px; }
.wb2-assembly > div:first-child { padding-left: 0; }
.wb2-assembly > div:last-child { padding-right: 0; }
.wb2-assembly > i { align-self: center; font-style: normal; color: var(--wb2-faint); font-size: 23px; }
.wb2-assembly span { display: block; margin-bottom: 25px; color: var(--wb2-faint); font: 600 14px var(--wb2-type); letter-spacing: .08em; }
.wb2-assembly b { font: 300 24px var(--wb2-type); }
.wb2-assembly p { margin: 13px 0 0; color: var(--wb2-sub); font-size: 14px; line-height: 1.75; }
.wb2-section-head-light { color: var(--wb2-ink); }
.wb2-section-head-light > div > span { color: var(--wb2-faint); }
.wb2-section-head-light > p { color: var(--wb2-sub); }
.wb2-children { padding-top: 30px; margin-bottom: 94px; }
.wb2-child-list { border-top: 1px solid var(--wb2-ink); }
.wb2-child {
  min-height: 146px;
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) 180px;
  gap: 28px;
  align-items: center;
  border-bottom: 1px solid var(--wb2-line);
  transition: background .18s ease, padding .18s ease;
}
.wb2-child:hover { background: var(--wb2-ivory); padding: 0 18px; }
.wb2-child-code { font: 600 17px var(--wb2-type); letter-spacing: .015em; color: var(--wb2-ink); font-variant-numeric: lining-nums tabular-nums; }
.wb2-child-name strong { display: block; font: 300 27px/1.35 var(--wb2-type); letter-spacing: -.008em; }
.wb2-child-name span { display: block; margin-top: 10px; color: var(--wb2-sub); font-size: 15px; line-height: 1.75; }
.wb2-child-res { display: flex; gap: 18px; color: var(--wb2-faint); font-size: 15px; }

/* 叶子单元 */
.wb2-leaf-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .55fr);
  align-items: end;
  gap: 70px;
  padding-bottom: 58px;
  border-bottom: 1px solid var(--wb2-ink);
}
.wb2-leaf-title h1 { margin: 14px 0 0; font: 300 clamp(52px, 6vw, 88px)/1.1 var(--wb2-type); letter-spacing: -.022em; }
.wb2-leaf-head > p { margin: 0; color: var(--wb2-sub); font-size: 16px; line-height: 1.9; }
.wb2-contract, .wb2-resources { margin-top: 90px; }
.wb2-l1-contract { margin-top: 0; }
.wb2-contract-grid { border-top: 1px solid var(--wb2-ink); }
.wb2-contract-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 42px;
  min-height: 112px;
  padding: 27px 0;
  border-bottom: 1px solid var(--wb2-line);
  align-items: start;
}
.wb2-contract-row > span { padding-top: 1px; color: var(--wb2-ink); font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.wb2-contract-row > p { max-width: 960px; margin: 0; color: var(--wb2-sub); font-size: 17px; line-height: 1.85; }

/* 真实资源入口 */
.wb2-own-resources { margin-top: 70px; }
.wb2-resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
.wb2-resource-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--wb2-ink);
}
.wb2-resource-title span { font: 300 24px var(--wb2-type); }
.wb2-resource-title b { font: 600 18px var(--wb2-type); color: var(--wb2-faint); font-variant-numeric: lining-nums tabular-nums; }
.wb2-document, .wb2-tool-card {
  min-height: 132px;
  padding: 23px 34px 23px 0;
  border-bottom: 1px solid var(--wb2-line);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: padding .18s ease, background .18s ease;
}
.wb2-document:hover, .wb2-tool-card:hover { padding-left: 16px; background: var(--wb2-ivory); }
.wb2-document > i, .wb2-tool-card > i { position: absolute; right: 3px; top: 22px; font-style: normal; font-size: 21px; }
.wb2-doc-type, .wb2-tool-status { margin-bottom: 10px; color: var(--wb2-faint); font-size: 14px; letter-spacing: .05em; }
.wb2-document > strong, .wb2-tool-card > strong { padding-right: 25px; font: 400 19px/1.5 var(--wb2-type); }
.wb2-document > small, .wb2-tool-card > small { margin-top: auto; padding-top: 11px; color: var(--wb2-faint); font-size: 15px; }
.wb2-tool-card > p { margin: 10px 0 0; color: var(--wb2-sub); font-size: 15px; line-height: 1.75; }
.wb2-document.is-muted, .wb2-tool-card.is-muted { opacity: .58; }
.wb2-document.is-muted:hover, .wb2-tool-card.is-muted:hover { padding-left: 0; background: transparent; }
.wb2-empty { margin: 0; padding: 28px 0; border-bottom: 1px solid var(--wb2-line); color: var(--wb2-faint); font-size: 15px; }
.wb2-context-note { margin-top: 88px; padding: 27px 0; border-top: 1px solid var(--wb2-ink); border-bottom: 1px solid var(--wb2-line); display: grid; grid-template-columns: 180px 1fr; gap: 42px; }
.wb2-context-note span { color: var(--wb2-faint); font-size: 14px; letter-spacing: .08em; }
.wb2-context-note p { margin: 0; color: var(--wb2-sub); font-size: 15px; }

@media (max-width: 1024px) {
  .wb2-shell { width: min(100% - 48px, 960px); }
  .wb2-stage { min-height: 292px; padding: 25px; }
  .wb2-unit-card { grid-template-columns: 65px minmax(0, 1fr); }
  .wb2-child { grid-template-columns: 85px minmax(0, 1fr) 135px; gap: 20px; }
}

@media (max-width: 760px) {
  .header { padding: 0 14px; }
  .header-logo { height: 22px; }
  .header-right { gap: 7px; }
  .header-nav { gap: 0; margin-right: 0; }
  .header-nav a { min-height: 44px; padding: 7px 8px; font-size: 13px; display: inline-flex; align-items: center; }
  .header .logout-btn { display: inline-flex; min-width: 44px; min-height: 44px; justify-content: center; padding: 7px 9px; }
  .header-status { display: none; }
  .user-info span { display: none; }

  .wb2-shell { width: calc(100% - 34px); }
  .wb2-hero-main { padding: 38px 0 32px; }
  .wb2-hero h1 { font-size: 48px; }

  .wb2-stage-wrap { padding: 34px 0 58px; }
  .wb2-unit-wrap { padding: 70px 0 80px; }
  .wb2-section-head { display: block; margin-bottom: 27px; }
  .wb2-section-head h2 { font-size: 34px; }
  .wb2-section-head > p { margin-top: 16px; text-align: left; }
  .wb2-stage-grid { display: block; }
  .wb2-stage { width: 100%; min-height: 270px; border-right: 0; border-bottom: 1px solid var(--wb2-line-dark); }
  .wb2-stage:last-child { border-bottom: 0; }
  .wb2-stage > strong { margin-top: 34px; font-size: 40px; }
  .wb2-unit-head { align-items: flex-start; }
  .wb2-unit-head h2 { font-size: 40px; }
  .wb2-unit-summary span { display: none; }
  .wb2-unit-grid { display: block; }
  .wb2-unit-card, .wb2-unit-card:nth-child(odd), .wb2-unit-card:nth-child(even) { min-height: 250px; padding: 29px 0; border-right: 0; grid-template-columns: 58px minmax(0, 1fr); }
  .wb2-unit-card > strong { font-size: 27px; }
  .wb2-stage-foot { display: block; line-height: 1.8; }
  .wb2-stage-foot span { display: block; }

  .wb2-light { padding-bottom: 76px; }
  .wb2-crumb { margin: 28px 0 50px; }
  .wb2-detail-head, .wb2-leaf-head { display: block; padding-bottom: 38px; }
  .wb2-detail-head h1, .wb2-leaf-title h1 { font-size: clamp(48px, 15vw, 68px); }
  .wb2-detail-head > p, .wb2-leaf-head > p { margin-top: 30px; font-size: 15px; }
  .wb2-assembly { display: block; margin: 50px 0 70px; }
  .wb2-assembly > div { min-height: auto; padding: 24px 0; border-bottom: 1px solid var(--wb2-line); }
  .wb2-assembly > div:last-child { border-bottom: 0; }
  .wb2-assembly > i { display: none; }
  .wb2-assembly span { margin-bottom: 13px; }
  .wb2-child { min-height: 156px; grid-template-columns: 61px minmax(0, 1fr); gap: 13px; padding: 20px 0; }
  .wb2-child:hover { padding: 20px 8px; }
  .wb2-child-name strong { font-size: 23px; }
  .wb2-child-res { display: none; }
  .wb2-contract, .wb2-resources { margin-top: 70px; }
  .wb2-contract-row { grid-template-columns: 88px minmax(0, 1fr); gap: 19px; min-height: 100px; }
  .wb2-contract-row > p { font-size: 16px; }
  .wb2-resource-grid { display: block; }
  .wb2-resource-column + .wb2-resource-column { margin-top: 56px; }
  .wb2-context-note { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 600px) {
  .header { height: auto; min-height: 56px; }
  .header-left, .user-info { display: none; }
  .header-right { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding-top: 6px; }
  .portal-layer-switch { grid-row: 1; grid-column: 1; justify-self: end; }
  .header .logout-btn { grid-row: 1; grid-column: 2; }
  .header-nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 420px) {
  .header-nav a { padding: 7px 6px; font-size: 13px; }
  .wb2-hero h1 { font-size: 42px; }
  .wb2-unit-card, .wb2-unit-card:nth-child(odd), .wb2-unit-card:nth-child(even) { grid-template-columns: 49px minmax(0, 1fr); }
  .wb2-child { grid-template-columns: 53px minmax(0, 1fr); }
  .wb2-child-code { font-size: 15px; }
}

@media (max-width: 360px) {
  .header { padding: 0 8px; }
  .header-logo { height: 18px; }
  .header-nav a { padding: 7px 4px; font-size: 13px; }
  .header .logout-btn { min-width: 44px; padding: 7px 6px; font-size: 13px; }
}

/* ============================================================
   系统建设视图
   ============================================================ */
.system-dashboard-page {
  --sys-bg: #f4f5f2;
  --sys-surface: #f7f8f6;
  --sys-paper: #fff;
  --sys-ink: #20282f;
  --sys-ink-2: #46535c;
  --sys-muted: #66737b;
  --sys-line: #dcdeda;
  --sys-line-dark: #bcc3c5;
  --sys-accent: #245fac;
  --sys-accent-deep: #173d66;
  --sys-accent-soft: #e8f0fa;
  --sys-critical: #884d45;
  --sys-critical-soft: #f0dfdb;
  --sys-good: #4c6558;
  --sys-good-soft: #dce5df;
  min-height: calc(100vh - 56px);
  max-width: none;
  margin: 0;
  color: var(--sys-ink);
  background: linear-gradient(145deg, rgba(36, 95, 172, .045), transparent 32%), var(--sys-bg);
  font-family: var(--font-brand);
  font-size: 16px;
  line-height: 1.55;
  font-variant-numeric: lining-nums tabular-nums;
}

.system-dashboard-page button,
.system-dashboard-page a { font: inherit; }

.sys-app { min-height: calc(100vh - 56px); display: grid; grid-template-columns: 232px minmax(0, 1fr); }

.sys-sidebar {
  min-height: calc(100vh - 56px);
  padding: 28px 16px 24px;
  border-right: 1px solid var(--sys-line);
  background: rgba(255, 255, 255, .86);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
}

.sys-side-title { padding: 0 12px 24px; border-bottom: 1px solid var(--sys-line); }
.sys-side-title strong { display: block; font-size: 21px; font-weight: 400; letter-spacing: .01em; }
.sys-side-title span { display: block; margin-top: 5px; color: var(--sys-muted); font-size: 15px; }
.sys-nav { display: grid; gap: 4px; padding-top: 18px; }
.sys-nav a { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 12px; border-radius: 4px; color: var(--sys-ink-2); font-size: 16px; text-decoration: none; transition: background .16s ease, color .16s ease; }
.sys-nav a:hover { color: var(--sys-accent-deep); background: rgba(36, 95, 172, .06); }
.sys-nav a.is-active { color: var(--sys-accent-deep); background: var(--sys-accent-soft); box-shadow: inset 3px 0 var(--sys-accent); font-weight: 600; }
.sys-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--sys-accent-deep); font-size: 14px; font-weight: 600; letter-spacing: .08em; }
.sys-eyebrow::before { content: ""; width: 16px; height: 2px; flex: 0 0 auto; background: var(--sys-accent); }

.sys-main { min-width: 0; padding: 54px clamp(30px, 4.2vw, 74px) 90px; }
.sys-page-head { display: flex; justify-content: space-between; gap: 54px; align-items: flex-end; padding-bottom: 35px; border-bottom: 1px solid var(--sys-line-dark); }
.sys-page-head h1 { margin: 7px 0 10px; font-size: clamp(42px, 4vw, 64px); line-height: 1.05; font-weight: 300; letter-spacing: -.025em; }
.sys-page-head p { max-width: 800px; margin: 0; color: var(--sys-ink-2); font-size: 17px; line-height: 1.75; }
.sys-live { flex: 0 0 auto; min-width: 180px; padding-left: 20px; border-left: 1px solid var(--sys-line); display: grid; gap: 4px; }
.sys-live span { color: var(--sys-good); font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.sys-live b { color: var(--sys-muted); font-size: 15px; font-weight: 400; }
.sys-live button,
.sys-panel-head button,
.sys-group-foot button { width: max-content; padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--sys-ink); background: transparent; font-size: 14px; cursor: pointer; }

.sys-structure-hero { position: relative; overflow: hidden; margin-top: 28px; border-top: 3px solid #3277c5; color: #fff; background: linear-gradient(118deg, #17334c 0%, #214d73 100%); }
.sys-structure-hero::after { content: ""; position: absolute; width: 540px; height: 540px; right: -210px; top: -330px; border-radius: 50%; background: rgba(255,255,255,.055); pointer-events: none; }
.sys-structure-head { position: relative; z-index: 1; min-height: 62px; padding: 16px 30px; border-bottom: 1px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.sys-structure-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .06em; }
.sys-structure-head span { color: rgba(255,255,255,.66); font-size: 14px; letter-spacing: .09em; }
.sys-structure-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sys-structure-grid article { min-height: 174px; padding: 30px 36px 28px; display: grid; align-content: center; border-right: 1px solid rgba(255,255,255,.18); }
.sys-structure-grid article:last-child { border-right: 0; }
.sys-structure-grid strong { color: #fff; font-size: 54px; font-weight: 300; line-height: 1; letter-spacing: -.035em; }
.sys-structure-grid span { margin-top: 12px; color: #fff; font-size: 18px; font-weight: 600; }
.sys-structure-grid small { margin-top: 7px; color: rgba(255,255,255,.68); font-size: 14px; line-height: 1.55; }

.sys-text-link { color: var(--sys-accent-deep); font-size: 14px; text-decoration: none; border-bottom: 1px solid currentColor; }
.sys-text-link:hover { color: var(--sys-accent); }

.sys-metric-section { margin-top: 44px; }
.sys-metric-grid { display: grid; grid-template-columns: minmax(310px, 1.42fr) repeat(2, minmax(225px, 1fr)); gap: 14px; }
.sys-metric-card { min-width: 0; min-height: 190px; padding: 23px 24px 21px; border: 1px solid var(--sys-line); border-top: 2px solid transparent; background: rgba(255,255,255,.78); display: flex; flex-direction: column; }
.sys-metric-card:hover { border-top-color: var(--sys-accent); }
.sys-metric-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.sys-metric-heading > span { color: var(--sys-ink-2); font-size: 15px; font-weight: 600; }
.sys-metric-heading > strong { color: var(--sys-ink); font-size: 39px; font-weight: 300; line-height: 1; letter-spacing: -.025em; white-space: nowrap; }
.sys-metric-heading > strong small { color: var(--sys-muted); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.sys-distribution-bar { height: 8px; margin-top: auto; overflow: hidden; display: flex; background: var(--sys-line); }
.sys-distribution-bar i { height: 100%; }
.sys-distribution-bar .tone-1,
.sys-status-legend .tone-1 { background: #245fac; }
.sys-distribution-bar .tone-2,
.sys-status-legend .tone-2 { background: #7898ba; }
.sys-distribution-bar .tone-3,
.sys-status-legend .tone-3 { background: #bcc8d4; }
.sys-distribution-bar .tone-4,
.sys-status-legend .tone-4 { background: #d9dddf; }
.sys-status-legend { margin-top: 17px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.sys-status-legend span { display: grid; grid-template-columns: 8px auto 1fr; gap: 7px; align-items: center; color: var(--sys-muted); font-size: 14px; }
.sys-status-legend i { width: 8px; height: 8px; border-radius: 50%; }
.sys-status-legend b { color: var(--sys-ink); font-size: 15px; font-weight: 600; }
.sys-resource-breakdown { margin-top: auto; padding-top: 19px; border-top: 1px solid var(--sys-line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.sys-resource-breakdown span { color: var(--sys-muted); font-size: 13px; white-space: nowrap; }
.sys-resource-breakdown b { margin-right: 5px; color: var(--sys-ink); font-size: 15px; font-weight: 600; }

.sys-section { margin-top: 62px; }
.sys-section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.sys-section-head h2,
.sys-panel-head h2 { font-size: 23px; font-weight: 400; }
.sys-section-head h2 { padding-left: 13px; border-left: 3px solid var(--sys-accent); }
.sys-section-head p,
.sys-panel-head p { margin: 5px 0 0; color: var(--sys-muted); font-size: 15px; }
.sys-section-head > span { color: var(--sys-muted); font-size: 14px; }
.sys-group-comparison { margin-top: 50px; }
.sys-comparison-table-wrap { overflow-x: auto; border: 1px solid var(--sys-line); background: rgba(255,255,255,.72); }
.sys-comparison-table { width: 100%; min-width: 850px; border-collapse: collapse; table-layout: fixed; }
.sys-comparison-table th,
.sys-comparison-table td { padding: 18px 20px; border-bottom: 1px solid var(--sys-line); text-align: left; vertical-align: middle; }
.sys-comparison-table tbody tr:last-child th,
.sys-comparison-table tbody tr:last-child td { border-bottom: 0; }
.sys-comparison-table thead th { padding-top: 12px; padding-bottom: 12px; color: var(--sys-muted); background: rgba(36,95,172,.035); font-size: 13px; font-weight: 500; }
.sys-comparison-table thead th:first-child { width: 28%; }
.sys-comparison-table thead th:last-child { width: 96px; }
.sys-comparison-table tbody th { display: flex; align-items: baseline; gap: 12px; }
.sys-comparison-table tbody th b { color: var(--sys-accent-deep); font-size: 17px; }
.sys-comparison-table tbody th span { color: var(--sys-ink); font-size: 18px; font-weight: 400; }
.sys-comparison-table td > strong { color: var(--sys-ink); font-size: 21px; font-weight: 400; }
.sys-comparison-table td > span { margin-left: 4px; color: var(--sys-muted); font-size: 13px; }
.sys-comparison-table button { padding: 0 0 2px; border: 0; border-bottom: 1px solid currentColor; color: var(--sys-accent-deep); background: transparent; font-size: 14px; cursor: pointer; white-space: nowrap; }
.sys-overview-foot { margin-top: 24px; display: flex; justify-content: flex-end; gap: 24px; }
.sys-overview-foot a { color: var(--sys-ink-2); font-size: 14px; text-decoration: none; border-bottom: 1px solid currentColor; }
.sys-overview-foot a:hover { color: var(--sys-accent); }

.sys-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.sys-panel { min-width: 0; border: 1px solid var(--sys-line); background: rgba(255,255,255,.56); }
.sys-panel-head { min-height: 79px; padding: 18px 22px; border-bottom: 1px solid var(--sys-line); display: flex; justify-content: space-between; gap: 22px; align-items: center; }
.sys-panel-head > span { color: var(--sys-muted); font-size: 14px; }
.sys-bars { padding: 18px 22px 22px; display: grid; gap: 13px; }
.sys-bar-row { display: grid; grid-template-columns: 140px 1fr 38px; gap: 12px; align-items: center; font-size: 15px; }
.sys-bar-row > span { color: var(--sys-ink-2); }
.sys-bar-row > div { height: 4px; background: var(--sys-line); }
.sys-bar-row i { display: block; height: 100%; background: var(--sys-accent); }
.sys-bar-row b { text-align: right; font-size: 14px; font-weight: 400; }
.sys-priority-list { display: grid; }
.sys-priority-list > button { width: 100%; min-height: 63px; padding: 11px 20px; border: 0; border-bottom: 1px solid var(--sys-line); background: transparent; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.sys-priority-list > button:last-child { border-bottom: 0; }
.sys-priority-list > button:hover { background: var(--sys-surface); }
.sys-priority-list > button > span { color: var(--sys-muted); font-size: 14px; }
.sys-priority-list strong { display: block; font-size: 15px; font-weight: 600; }
.sys-priority-list small { display: block; margin-top: 4px; color: var(--sys-muted); font-size: 14px; }
.sys-priority-list em { padding: 3px 7px; color: var(--sys-accent-deep); background: var(--sys-accent-soft); font-size: 14px; font-style: normal; font-weight: 600; white-space: nowrap; }
.sys-method-note { margin-top: 44px; padding: 22px 0; border-top: 1px solid var(--sys-line-dark); display: grid; grid-template-columns: 100px 1fr; gap: 26px; }
.sys-method-note strong { font-size: 14px; }
.sys-method-note p { margin: 0; color: var(--sys-muted); font-size: 15px; line-height: 1.75; }

.sys-filter { display: flex; gap: 8px; margin: 26px 0 18px; }
.sys-filter button { min-width: 130px; min-height: 46px; padding: 0 16px; border: 1px solid var(--sys-line); background: rgba(255,255,255,.46); color: var(--sys-ink-2); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sys-filter button[aria-pressed="true"] { color: var(--sys-accent-deep); background: var(--sys-accent-soft); border-color: rgba(36, 95, 172, .42); font-weight: 600; }
.sys-filter button b { font-size: 15px; }
.sys-filter button span { font-size: 15px; }
.sys-capability-tree { margin-top: 18px; }
.sys-capability-branches { display: grid; gap: 30px; }
.sys-capability-branch { overflow: hidden; border: 1px solid var(--sys-line-dark); border-left: 4px solid var(--sys-accent); background: rgba(255,255,255,.74); }
.sys-capability-branch-head { min-height: 78px; padding: 15px 22px; display: flex; justify-content: space-between; gap: 24px; align-items: center; background: rgba(36,95,172,.065); }
.sys-capability-branch-title { min-width: 0; color: inherit; text-decoration: none; }
.sys-capability-branch-title > span { display: block; margin-bottom: 5px; color: var(--sys-muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.sys-capability-branch-head h3 { min-width: 0; margin: 0; display: flex; gap: 12px; align-items: baseline; }
.sys-capability-branch-head h3 b { flex: 0 0 auto; color: var(--sys-accent-deep); font-size: 19px; }
.sys-capability-branch-head h3 strong { min-width: 0; color: var(--sys-ink); font-size: 22px; font-weight: 500; }
.sys-capability-branch-title:hover h3 strong { color: var(--sys-accent-deep); }
.sys-capability-branch-title:focus-visible,
.sys-capability-branch-meta a:focus-visible,
.sys-l2-card:focus-visible { outline: 2px solid rgba(36,95,172,.5); outline-offset: 3px; }
.sys-capability-branch-meta { flex: 0 0 auto; display: flex; align-items: baseline; gap: 18px; color: var(--sys-muted); font-size: 14px; white-space: nowrap; }
.sys-capability-branch-meta a { color: var(--sys-accent-deep); text-decoration: none; border-bottom: 1px solid currentColor; }
.sys-l2-directory { padding: 20px 22px 22px; border-top: 1px solid var(--sys-line-dark); background: rgba(255,255,255,.42); }
.sys-l2-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sys-l2-card { min-width: 0; min-height: 112px; padding: 15px 16px 13px; border: 1px solid var(--sys-line); color: inherit; background: rgba(255,255,255,.88); display: grid; grid-template-rows: auto 1fr; gap: 15px; text-decoration: none; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.sys-l2-card:hover { border-color: rgba(36,95,172,.58); background: var(--sys-accent-soft); transform: translateY(-1px); }
.sys-l2-identity { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.sys-l2-identity b { flex: 0 0 auto; color: var(--sys-accent-deep); font-size: 16px; }
.sys-l2-identity strong { min-width: 0; color: var(--sys-ink); font-size: 17px; font-weight: 500; line-height: 1.45; }
.sys-l2-relations { align-self: end; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--sys-muted); font-size: 13px; }
.sys-l2-relation { display: inline-flex; gap: 6px; align-items: baseline; }
.sys-l2-relation i { color: var(--sys-muted); font-style: normal; }
.sys-l2-relation em { color: var(--sys-ink-2); font-style: normal; font-variant-numeric: tabular-nums; }
.sys-l2-relation-empty { color: #89939a; }
.sys-branch-empty { grid-column: 1 / -1; margin: 0; padding: 18px; color: var(--sys-muted); font-size: 15px; }

.sys-relation-contract-state { display: grid; gap: 7px; margin-top: 28px; padding: 22px 24px; border: 1px solid var(--sys-line); border-left: 3px solid var(--sys-critical); background: rgba(255,255,255,.72); }
.sys-relation-contract-state b { color: var(--sys-ink); font-size: 18px; }
.sys-relation-contract-state span { color: var(--sys-ink-2); font-size: 15px; line-height: 1.65; }
.sys-relation-overview { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 18px 0 12px; padding: 11px 2px; border-top: 1px solid var(--sys-line); border-bottom: 1px solid var(--sys-line); }
.sys-relation-summary { display: flex; gap: 10px; align-items: baseline; color: var(--sys-ink); }
.sys-relation-summary strong { font-size: 25px; font-weight: 400; line-height: 1; }
.sys-relation-summary span { color: var(--sys-muted); font-size: 15px; }
.sys-relation-legend { display: inline-flex; align-items: center; gap: 7px; color: var(--sys-muted); font-size: 13px; white-space: nowrap; }
.sys-relation-legend i { width: 28px; height: 14px; border: 1px dashed var(--sys-line-dark); background: transparent; }
.sys-relation-legend strong { color: var(--sys-ink-2); font-weight: 500; }
.sys-relation-filter { margin-top: 28px; }
.sys-relation-filter button { position: relative; }
.sys-relation-filter small { margin-left: auto; color: var(--sys-muted); font-size: 14px; font-weight: 400; }
.sys-relation-filter .is-active small { color: var(--sys-muted); }
.sys-relation-board { display: grid; gap: 12px; align-items: start; container-type: inline-size; }
.sys-relation-flow { min-width: 0; padding: 18px 20px; border: 1px solid var(--sys-line); background: rgba(255,255,255,.58); display: grid; grid-template-columns: 196px 64px 196px 64px 196px; grid-template-rows: auto minmax(48px, auto); column-gap: 24px; row-gap: 10px; align-items: stretch; justify-content: center; }
.sys-flow-column { display: contents; }
.sys-flow-column.is-upstream > * { grid-column: 1; }
.sys-flow-column.is-current > * { grid-column: 3; }
.sys-flow-column.is-downstream > * { grid-column: 5; }
.sys-flow-label { grid-row: 1; color: var(--sys-muted); font-size: 13px; font-weight: 600; text-align: center; }
.sys-flow-list { grid-row: 2; min-width: 0; min-height: 48px; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 8px; align-self: stretch; align-content: center; align-items: center; justify-content: center; }
.sys-flow-node { box-sizing: border-box; width: 196px; min-width: 0; min-height: 48px; padding: 9px 11px; border: 1px solid var(--sys-line-dark); color: var(--sys-ink); background: rgba(255,255,255,.82); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; align-content: center; align-items: baseline; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.sys-flow-node:hover { border-color: var(--sys-accent-deep); background: var(--sys-accent-soft); }
.sys-flow-node b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sys-flow-node span { min-width: 0; color: var(--sys-ink-2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.sys-flow-node.is-current { border-color: var(--sys-accent-deep); box-shadow: inset 3px 0 var(--sys-accent); background: var(--sys-accent-soft); }
.sys-flow-node.is-outside { border-style: dashed; color: var(--sys-muted); background: transparent; }
.sys-flow-empty { align-self: center; color: var(--sys-muted); font-size: 14px; }
.sys-flow-edge { position: relative; grid-row: 2; width: 64px; height: 1px; align-self: center; color: var(--sys-accent-deep); background: currentColor; opacity: .82; }
.sys-flow-edge.is-from-upstream { grid-column: 2; }
.sys-flow-edge.is-to-downstream { grid-column: 4; }
.sys-flow-edge::after { content: ""; position: absolute; top: 50%; right: -1px; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 7px solid currentColor; transform: translateY(-50%); }
.sys-flow-edge.is-muted { opacity: 0; }

.sys-empty { padding: 24px 18px; color: var(--sys-muted); font-size: 15px; }
.sys-state { min-height: calc(100vh - 56px); display: grid; place-content: center; gap: 14px; color: var(--sys-muted); text-align: center; }
.sys-state b { color: var(--sys-ink); font-size: 18px; }
.sys-state span { font-size: 15px; }
.sys-state button { justify-self: center; padding: 8px 16px; border: 1px solid var(--sys-line-dark); background: transparent; cursor: pointer; }
.sys-state-error b { color: var(--sys-critical); }

@media (max-width: 1180px) {
  .sys-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-l2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container (max-width: 860px) {
  .sys-relation-flow { grid-template-columns: 196px; grid-template-rows: auto; row-gap: 10px; padding: 16px; }
  .sys-flow-column { display: grid; grid-template-columns: 196px; grid-template-rows: auto auto; gap: 8px; justify-content: center; }
  .sys-flow-column > * { grid-column: 1 !important; }
  .sys-flow-label,
  .sys-flow-list { grid-row: auto; }
  .sys-flow-edge,
  .sys-flow-edge.is-from-upstream,
  .sys-flow-edge.is-to-downstream { grid-column: 1; grid-row: auto; width: 1px; height: 26px; justify-self: center; }
  .sys-flow-edge::after { top: auto; right: auto; bottom: -1px; left: 50%; border-top: 7px solid currentColor; border-right: 4px solid transparent; border-bottom: 0; border-left: 4px solid transparent; transform: translateX(-50%); }
}

@media (max-width: 1100px) {
  .sys-relation-flow { grid-template-columns: 196px; grid-template-rows: auto; row-gap: 10px; padding: 16px; }
  .sys-flow-column { display: grid; grid-template-columns: 196px; grid-template-rows: auto auto; gap: 8px; justify-content: center; }
  .sys-flow-column > * { grid-column: 1 !important; }
  .sys-flow-label,
  .sys-flow-list { grid-row: auto; }
  .sys-flow-edge,
  .sys-flow-edge.is-from-upstream,
  .sys-flow-edge.is-to-downstream { grid-column: 1; grid-row: auto; width: 1px; height: 26px; justify-self: center; }
  .sys-flow-edge::after { top: auto; right: auto; bottom: -1px; left: 50%; border-top: 7px solid currentColor; border-right: 4px solid transparent; border-bottom: 0; border-left: 4px solid transparent; transform: translateX(-50%); }
}

@media (max-width: 900px) {
  .sys-app { grid-template-columns: 1fr; }
  .sys-sidebar { min-height: auto; height: auto; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--sys-line); position: static; }
  .sys-side-title { display: none; }
  .sys-nav { display: flex; overflow-x: auto; padding: 0; }
  .sys-nav a { flex: 0 0 auto; }
  .sys-nav a i { display: none; }
  .sys-main { padding: 38px 26px 72px; }
  .sys-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .sys-main { padding: 30px 17px 58px; }
  .sys-page-head { display: block; }
  .sys-page-head h1 { font-size: 43px; }
  .sys-live { margin-top: 22px; padding: 15px 0 0; border-left: 0; border-top: 1px solid var(--sys-line); }
  .sys-structure-head { min-height: 56px; padding: 14px 19px; }
  .sys-structure-grid { grid-template-columns: 1fr; }
  .sys-structure-grid article { min-height: 118px; padding: 22px 24px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.18); }
  .sys-structure-grid article:last-child { border-bottom: 0; }
  .sys-structure-grid strong { font-size: 41px; }
  .sys-structure-grid span { margin-top: 8px; font-size: 17px; }
  .sys-metric-grid { grid-template-columns: 1fr; }
  .sys-metric-card { min-height: 174px; }
  .sys-filter { overflow-x: auto; }
  .sys-filter button { flex: 0 0 auto; }
  .sys-capability-branch-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .sys-capability-branch-meta { white-space: normal; }
  .sys-l2-directory { padding-right: 16px; padding-left: 16px; }
  .sys-l2-grid { grid-template-columns: 1fr; }
  .sys-relation-overview { align-items: flex-start; flex-direction: column; gap: 8px; }
  .sys-method-note { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 420px) {
  .sys-l2-identity { display: grid; gap: 3px; }
}

/* Personal production tasks reuse the portal typography, colors and controls. */
.main.my-work-active { max-width: none; padding: 0; }
#myWorkPage { max-width: none; }
.my-work-shell { padding: 42px 0 70px; }
.my-work-breadcrumb { color: var(--text-secondary); margin-bottom: 20px; font-size: 14px; }
.my-work-breadcrumb a { color: var(--primary); }
.my-work-heading, .my-work-summary { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; }
.my-work-heading > div { flex: 1; min-width: 0; }
.my-work-heading h1 { margin: 0 0 12px; font-size: clamp(42px, 5.2vw, 76px); font-weight: 300; line-height: 1.1; }
.my-work-heading p, .my-work-summary p, .my-work-task p { color: var(--text-secondary); margin: 6px 0 0; line-height: 1.7; }
.my-work-update { color: var(--wb2-faint); font-size: 14px; min-height: 24px; margin: 24px 0; }
.my-work-update.is-error { color: var(--danger); }
.my-work-state { padding: 30px 24px; border: 1px solid var(--wb2-line); border-radius: var(--radius); background: var(--wb2-ivory); }
.my-work-state h2 { margin: 0 0 12px; font-size: 22px; }
.my-work-state p { color: var(--text-secondary); line-height: 1.8; margin: 0; }
.my-work-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.my-work-task { display: flex; justify-content: space-between; gap: 24px; padding: 24px; border: 1px solid var(--wb2-line); border-radius: var(--radius); background: var(--wb2-paper); color: var(--wb2-ink); text-decoration: none; }
.my-work-task:hover { border-color: var(--primary); }
.my-work-task:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.my-work-task h2 { font-size: 19px; margin: 0; overflow-wrap: anywhere; }
.my-work-badge { display: inline-block; background: var(--primary-light); color: var(--primary); padding: 4px 12px; border-radius: var(--radius); font-size: 14px; flex: 0 0 auto; }
.my-work-summary { padding: 24px 0; }
.my-work-summary h2 { margin: 0; font-size: 25px; overflow-wrap: anywhere; }
.my-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.my-work-panel { background: var(--wb2-paper); border: 1px solid var(--wb2-line); border-radius: var(--radius); padding: 24px; overflow-wrap: anywhere; }
.my-work-panel h2 { font-size: 18px; margin: 0 0 16px; }
.my-work-panel p, .my-work-panel li { line-height: 1.8; }
.my-work-panel ul { padding-left: 22px; }
.my-work-panel a { color: var(--primary); }
.my-work-muted { color: var(--text-secondary); font-size: 14px; }
.my-work-prose { white-space: pre-wrap; }
.my-work-materials li + li { margin-top: 12px; }
.my-work-notice { padding: 14px 18px; border-left: 3px solid var(--primary); background: var(--primary-light); line-height: 1.8; }
.my-work-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.my-work-filters { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(130px, .7fr) minmax(160px, .8fr) minmax(200px, 1.4fr) auto; gap: 16px; align-items: end; margin-top: 30px; padding: 24px 0; border-top: 1px solid var(--wb2-line); border-bottom: 1px solid var(--wb2-line); }
.my-work-filters label { min-width: 0; display: grid; gap: 8px; font-size: 14px; color: var(--wb2-sub); }
.my-work-filters input, .my-work-filters select { width: 100%; min-width: 0; height: 44px; padding: 0 12px; line-height: 44px; box-sizing: border-box; border: 1px solid var(--wb2-line); border-radius: var(--radius); color: var(--wb2-ink); background: var(--wb2-paper); font: inherit; font-size: 15px; }
.my-work-filters .btn { min-height: 44px; }
.my-work-filters input:focus-visible, .my-work-filters select:focus-visible, .my-work-task a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.my-work-list-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 18px; }
.my-work-list-meta .my-work-update { margin: 0; }
.my-work-count { font-size: 15px; color: var(--wb2-sub); }
.my-work-task-main { min-width: 0; flex: 1; }
.my-work-task .my-work-project, .my-work-summary .my-work-project { margin: 0 0 8px; font-size: 14px; color: var(--wb2-sub); }
.my-work-task .my-work-order-no, .my-work-summary .my-work-order-no { margin: 0 0 8px; color: var(--wb2-sub); font-size: 13px; overflow-wrap: anywhere; }
.my-work-order-no span { color: var(--wb2-ink); margin-left: 5px; }
.my-work-fields .my-work-original-name { font-size: 13px; color: var(--wb2-sub); }
.my-work-task-title { color: var(--wb2-ink); text-decoration: none; }
.my-work-task-title:hover { color: var(--primary); }
.my-work-task-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.my-work-task-side p { text-align: right; font-size: 14px; }
.my-work-task-side p > span, .my-work-task-side time { display: block; }
.my-work-task-open { color: var(--primary); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; gap: 12px; }
.my-work-task .my-work-task-people { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; margin-top: 12px; font-size: 14px; color: var(--wb2-ink); }
.my-work-task-meta { display: flex; flex-wrap: wrap; gap: 5px 18px; margin-top: 10px; color: var(--wb2-sub); font-size: 13px; line-height: 1.6; }
.my-work-task-meta span { overflow-wrap: anywhere; }
.my-work-person-label { color: var(--wb2-faint); }
.my-work-person-label:not(:first-child) { margin-left: 18px; }
.my-work-unit-path { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; font-size: 14px; color: var(--wb2-sub); }
.my-work-unit-path a { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 32px; color: var(--wb2-sub); text-decoration: none; }
.my-work-unit-path a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.my-work-unit-no { color: var(--primary); }
.my-work-unit-separator { color: var(--wb2-faint); }
.my-work-detail-path { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; border-top: 1px solid var(--wb2-line); border-bottom: 1px solid var(--wb2-line); padding: 18px 0; margin-bottom: 30px; }
.my-work-detail-path .my-work-unit-path { margin-top: 0; }
.my-work-field-label { color: var(--wb2-faint); font-size: 14px; }
.my-work-fields { display: grid; gap: 18px; }
.my-work-fields > div { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 18px; }
.my-work-fields dt { color: var(--wb2-faint); font-size: 14px; }
.my-work-fields dd { margin: 0; }
.my-work-source-note { color: var(--wb2-faint); font-size: 14px; line-height: 1.8; margin: 18px 0; }
@media (max-width: 1024px) { .my-work-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.portal-resource-freshness { margin: 0; padding: 12px 24px; color: var(--text-secondary); background: var(--bg); font-size: 14px; line-height: 1.7; }
.portal-resource-freshness.is-stale { color: var(--danger); }
@media (max-width: 760px) {
  .my-work-shell { padding: 30px 0 42px; }
  .my-work-grid { grid-template-columns: 1fr; }
  .my-work-heading, .my-work-summary, .my-work-task { flex-wrap: wrap; gap: 14px; }
  .my-work-task { padding: 20px; }
  .my-work-panel { padding: 20px; }
  .my-work-filters { grid-template-columns: 1fr; gap: 12px; padding: 18px 0; }
  .my-work-task-side { width: 100%; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px; }
  .my-work-task-side p { text-align: left; }
  .my-work-unit-path a, .my-work-task-open { min-height: 44px; }
  .my-work-fields > div { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
}

/* Project management dashboard. Work-order lists retain their own renderer. */
.main.projects-active { max-width: none; padding: 0; }
#projectDashboardPage { width: 100%; max-width: none; }
.project-shell { width: min(1368px, calc(100% - 72px)); margin: 0 auto; padding: 26px 0 54px; }
.project-breadcrumb { margin-bottom: 12px; color: var(--text-secondary); font-size: 13px; }
.project-breadcrumb a, .project-card-bottom a, .project-state a { color: var(--primary); text-decoration: none; }
.project-breadcrumb a:hover, .project-card-bottom a:hover, .project-state a:hover { text-decoration: underline; }
.project-page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.project-page-heading > div { flex: 1; min-width: 0; }
.project-page-heading h1 { font-size: clamp(28px, 3.2vw, 36px); line-height: 1.2; font-weight: 600; margin-bottom: 6px; }
.project-page-heading p { color: var(--text-secondary); line-height: 1.7; font-size: 14px; }
.project-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); }
.project-overview > div { min-height: 118px; padding: 18px 22px; display: flex; flex-direction: column; align-items: stretch; }
.project-overview > div + div { border-left: 1px solid var(--border); }
.project-overview span { color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.project-overview strong { flex: 1; display: grid; place-items: center; font-size: 34px; line-height: 1; font-weight: 600; }
.project-overview-note { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.project-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 20px; }
.project-toolbar > p { font-size: 15px; color: var(--text-secondary); }
.project-toolbar label { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 13px; }
.project-toolbar input { width: 280px; max-width: 100%; height: 44px; padding: 0 12px; line-height: 44px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); background: var(--card-bg); font: inherit; font-size: 14px; }
.project-update { min-height: 22px; margin: 16px 0; font-size: 12px; color: var(--text-secondary); }
.project-update.is-error { color: var(--danger); }
.project-source-note { color: var(--text-secondary); font-size: 13px; line-height: 1.7; margin-bottom: 18px; }
.project-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); box-shadow: var(--shadow); }
.project-card:hover { border-color: #b9c9df; box-shadow: var(--shadow-hover); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-number { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.project-stage { flex-shrink: 0; padding: 3px 9px; border-radius: var(--radius); color: var(--primary); background: var(--primary-light); font-size: 12px; }
.project-name-label { margin: 0 0 4px; color: var(--text-secondary); font-size: 12px; }
.project-card h2 { font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; }
.project-card h2 a { position: relative; z-index: 1; color: var(--text); text-decoration: none; }
.project-card h2 a:hover { color: var(--primary); }
.project-card-facts { display: grid; gap: 7px; font-size: 14px; }
.project-card-facts > div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
.project-card-facts dt { color: var(--text-secondary); }
.project-card-facts dd { margin: 0; overflow-wrap: anywhere; }
.project-card-dates { display: grid; gap: 7px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--border-light); font-size: 14px; }
.project-card-dates > div { min-width: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.project-card-dates dt { color: var(--text-secondary); }
.project-card-dates dd { min-width: 0; margin: 0; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.project-card-dates time { white-space: nowrap; }
.project-card-dates .project-date-range { justify-content: flex-start; }
.project-date-panel { min-width: 0; }
.project-date-summary { display: flex; align-items: flex-start; gap: 40px; margin-bottom: 14px; }
.project-date-summary dl { min-width: 0; margin: 0; }
.project-date-summary dt { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.project-date-summary dd { margin: 4px 0 0; color: var(--text); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.4; }
.project-date-summary time { white-space: nowrap; }
.project-date-window { flex: 1; }
.project-date-range { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.project-date-separator { color: #8c9bad; font-size: 17px; line-height: 1.4; }
.project-date-unavailable { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.project-timeline { border: 1px solid #dce4ef; border-radius: var(--radius); overflow: hidden; background: var(--card-bg); }
.project-timeline-legend { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #dce4ef; background: var(--card-bg); }
.project-timeline-legend span { padding: 3px 8px; border-radius: 999px; color: #596b80; font-size: 11px; line-height: 1.4; }
.project-timeline-legend .is-project-window { background: #f2f5f9; }
.project-timeline-legend .is-deadline-window { color: #174e91; background: #e8f2ff; }
.project-calendar { display: grid; grid-template-columns: repeat(var(--day-count), minmax(64px, 1fr)); overflow-x: auto; }
.project-calendar time { position: relative; min-height: 72px; padding: 10px 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-right: 1px solid #dfe6ef; border-top: 3px solid #cbd5e1; color: var(--text-secondary); }
.project-calendar time:last-child { border-right: 0; }
.project-calendar time > span { font-size: 11px; }
.project-calendar time > strong { color: var(--text); font-size: 19px; font-weight: 600; }
.project-calendar time.is-project-window { background: #f6f8fb; }
.project-calendar time.is-deadline-window { border-top-color: var(--primary); background: #eaf3ff; }
.project-calendar time.is-weekend > span, .project-calendar time.is-holiday > span { color: #a54f43; }
.project-calendar time.is-makeup > span { color: var(--primary); }
.project-calendar time > em { position: absolute; top: 5px; right: 6px; font-style: normal; font-size: 10px; color: var(--danger); }
.project-calendar time.is-makeup > em { color: var(--primary); }
.project-card-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 88px; grid-template-rows: auto 8px; column-gap: 24px; row-gap: 8px; align-items: center; border-top: 1px solid var(--border-light); padding-top: 16px; font-size: 13px; }
.project-card-bottom a { grid-column: 2; grid-row: 2; display: inline-flex; align-items: center; justify-content: flex-end; min-height: 20px; line-height: 20px; }
.project-card-bottom a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.project-card-bottom a:focus-visible { outline: none; }
.project-card-bottom a:focus-visible::after { outline: 2px solid var(--primary); outline-offset: 3px; }
.project-progress, .project-missing { color: var(--text-secondary); }
.project-card-bottom .project-progress:not(.project-progress-unavailable) { display: contents; }
.project-card-bottom .project-progress-value { grid-column: 1; grid-row: 1; }
.project-card-bottom .project-progress-track { grid-column: 1; grid-row: 2; align-self: center; min-width: 0; margin-top: 0; }
.project-card-bottom .project-progress-unavailable { grid-column: 1; grid-row: 1 / 3; align-self: center; min-width: 0; }
.project-progress-value { color: var(--text); font-size: 16px; font-weight: 600; }
.project-progress-track { height: 8px; margin-top: 7px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.project-progress-track > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.project-progress-unavailable { overflow-wrap: anywhere; }
.project-progress-nodes { margin-top: 16px; }
.project-progress-nodes ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.project-progress-node { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-left: 3px solid var(--border); background: var(--bg); overflow-wrap: anywhere; font-size: 14px; }
.project-progress-node strong { color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.project-progress-node.is-active { border-color: var(--primary); }
.project-progress-node.is-complete { border-color: var(--success); }
.project-progress-node.is-active strong { color: var(--primary); }
.project-progress-node.is-complete strong { color: var(--success); }
.project-progress-node.is-date { background: transparent; border: 1px dashed var(--border); border-left-width: 3px; }
.project-state { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); }
.project-state h2 { font-size: 21px; margin-bottom: 10px; }
.project-state p { color: var(--text-secondary); margin-bottom: 14px; line-height: 1.7; }
.project-state a { display: inline-flex; min-height: 36px; align-items: center; }
.project-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.project-summary { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); }
.project-summary-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.project-summary-heading > div { min-width: 0; }
.project-summary-heading .project-name-label { margin-top: 8px; }
.project-summary-heading h2 { font-size: 24px; line-height: 1.4; overflow-wrap: anywhere; }
.project-summary > .project-date-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.project-summary .project-date-start { flex: 0 0 220px; }
.project-summary .project-date-start dd, .project-summary .project-date-window dd { font-size: 22px; margin-top: 6px; font-weight: 600; }
.project-summary .project-date-separator { font-size: 22px; }
.project-summary .project-date-unavailable { font-size: 16px; }
.project-detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 16px; }
.project-section { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); min-width: 0; }
.project-section h2 { margin-bottom: 14px; font-size: 19px; line-height: 1.4; }
.project-facts { display: grid; gap: 11px; font-size: 14px; }
.project-facts > div { display: grid; grid-template-columns: 106px minmax(0, 1fr); gap: 12px; }
.project-facts dt { color: var(--text-secondary); }
.project-facts dd { margin: 0; overflow-wrap: anywhere; }
.project-facts a { color: var(--primary); text-underline-offset: 3px; }
.project-field-note { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.project-files, .project-notes { margin-top: 16px; }
[data-project-support] { margin-top: 28px; }
.project-notes summary { cursor: pointer; font-size: 16px; }
.project-notes[open] summary { margin-bottom: 12px; }
.project-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.project-section-heading h2 { margin-bottom: 4px; }
.project-section-heading > span, .project-section-note { color: var(--text-secondary); font-size: 13px; }
.project-section-note { margin-bottom: 14px; }
.project-file-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.project-file-table th { color: var(--text-secondary); font-weight: 400; background: var(--bg); }
.project-file-table th, .project-file-table td { border-bottom: 1px solid var(--border-light); padding: 10px 12px; vertical-align: top; }
.project-file-table th:first-child { width: 52%; }
.project-file-table th:not(:first-child), .project-file-table td:not(:first-child) { white-space: nowrap; }
.project-file-table td:first-child { overflow-wrap: anywhere; }
.project-file-table tr:last-child td { border-bottom: 0; }
.project-file-name, .project-file-number { display: block; }
a.project-file-name { color: var(--primary); text-decoration: none; text-underline-offset: 3px; }
a.project-file-name:hover { text-decoration: underline; }
.project-file-number { color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.project-file-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 18px; border: 1px solid var(--border-light); border-radius: var(--radius); }
.project-file-summary > div { min-width: 0; padding: 13px 14px; display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 5px; }
.project-file-summary > div + div { border-left: 1px solid var(--border-light); }
.project-file-summary span { color: var(--text-secondary); font-size: 12px; }
.project-file-summary strong { font-size: 18px; font-weight: 600; }
.project-file-summary small { color: var(--text-secondary); font-size: 11px; }
.project-prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.project-empty-files { font-size: 14px; color: var(--text-secondary); padding: 10px 0; }
.project-sources { margin-top: 16px; color: var(--text-secondary); font-size: 13px; }
.project-sources summary { cursor: pointer; width: fit-content; padding: 6px 0; }
.project-sources .project-facts { margin-top: 10px; padding: 14px 18px; border-left: 2px solid var(--border); }
.project-orders { margin-top: 30px; --wb2-ivory: var(--bg); --wb2-paper: var(--card-bg); --wb2-ink: var(--text); --wb2-sub: var(--text-secondary); --wb2-faint: var(--text-secondary); --wb2-line: var(--border); }
.project-orders .my-work-shell { width: 100%; margin: 0; padding: 0; }
.project-orders .my-work-heading h2 { font-size: 22px; }
.project-orders .my-work-filters { grid-template-columns: minmax(130px, .7fr) minmax(160px, .8fr) minmax(220px, 1.4fr) auto; }
.project-orders .my-work-filters label[hidden] { display: none; }
.project-shell a:focus-visible, .project-toolbar input:focus-visible, .project-shell summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1280px) { .project-shell { width: calc(100% - 48px); } .project-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .project-shell { width: calc(100% - 34px); padding-top: 26px; }
  .project-card-grid { grid-template-columns: 1fr; gap: 14px; }
  .project-card { padding: 20px; gap: 14px; }
  .project-overview { grid-template-columns: 1fr; margin-top: 18px; }
  .project-overview > div { min-height: 88px; padding: 14px 16px; gap: 5px 10px; }
  .project-overview > div + div { border-left: 0; border-top: 1px solid var(--border-light); }
  .project-overview strong { font-size: 24px; }
  .project-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .project-toolbar label { align-items: stretch; flex-direction: column; gap: 6px; }
  .project-toolbar input { width: 100%; }
  .project-summary { padding: 20px; }
  .project-summary-heading h2 { font-size: 22px; }
  .project-date-summary { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .project-summary .project-date-start { flex-basis: auto; }
  .project-date-separator { font-size: 16px; }
  .project-summary .project-date-start dd { font-size: 15px; font-weight: 500; }
  .project-summary .project-date-window dd { font-size: clamp(14px, 4.5vw, 18px); }
  .project-summary .project-date-separator { font-size: clamp(14px, 4.5vw, 18px); }
  .project-date-range { gap: 5px; }
  .project-detail-grid { grid-template-columns: 1fr; }
  .project-section { padding: 18px; }
  .project-facts > div { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
  .project-file-table, .project-file-table tbody { display: block; }
  .project-file-table thead { display: none; }
  .project-file-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--border); }
  .project-file-table td { display: block; padding: 0; border: 0; }
  .project-file-table td:first-child { grid-column: 1 / -1; }
  .project-file-table td:not(:first-child)::before { content: attr(data-label); display: block; color: var(--text-secondary); font-size: 12px; }
  .project-file-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-file-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-light); }
  .project-file-summary > div:nth-child(4) { border-top: 1px solid var(--border-light); }
  .project-card-bottom a { min-height: 40px; }
  .project-orders .my-work-filters { grid-template-columns: 1fr; }
}

/* Project context is stated once; supporting definitions live in the portal standard. */
.project-update:empty, .my-work-update:empty, [data-work-scope]:empty { display: none; }
[data-project-reading] { margin-top: 22px; }
.project-overview span, .project-number, .project-stage, .project-date-summary dt, .project-card-dates dt,
.project-toolbar label, .project-file-number, .project-progress-node strong { font-size: 14px; }
.project-facts, .project-card-facts, .project-file-table { font-size: 15px; }
.project-detail-grid { grid-template-columns: 1fr 1fr; }
.project-detail-grid .project-facts { gap: 13px; }
.project-delivery > .project-progress .project-progress-value { font-size: 28px; }
.project-progress-nodes ol { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.project-progress-node { padding: 10px; }
.project-section-heading { justify-content: flex-start; margin-bottom: 12px; }
.project-section-heading h2 { margin: 0; }
.project-orders .my-work-task { align-items: center; padding: 18px 22px; }
.project-orders .my-work-task-side { flex-direction: row; align-items: center; gap: 24px; }
.project-orders .my-work-task h2 { font-size: 18px; }
@media (max-width: 760px) {
  .project-detail-grid { grid-template-columns: 1fr; }
  .project-detail-grid .project-facts { grid-template-columns: 1fr; gap: 10px; }
  .project-overview > div { min-height: 76px; }
  .project-orders .my-work-task { padding: 18px; }
  .project-orders .my-work-task-side { justify-content: space-between; }
}
@media (max-width: 420px) {
  .project-card-dates > div { grid-template-columns: 1fr; gap: 2px; }
  .project-card-dates .project-date-range { flex-wrap: wrap; row-gap: 0; }
  .project-card-bottom { grid-template-columns: minmax(0, 1fr) 72px; column-gap: 16px; }
}

/* 项目方案（B43.0-S02 § 5）：左列一级单元与人工审核点按执行顺序以箭头相连；右列二级单元逐个串联，相邻二级单元间距一致，一级单元箭头随右列高度伸缩 */
.project-plan, .portal-flow { --plan-sea: #1b3348; --plan-brand: #245fac; --plan-brand-deep: #173d66; --plan-paper: #fbfbf9; --plan-ink: #20282f; --plan-line: #bcc3c5; --plan-soft: #dcdeda; --plan-check: #eaf1fa; --plan-gap: 28px; }
.project-plan-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 18px; color: var(--text-secondary); font-size: 14px; }
.project-plan-legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.project-plan-legend .is-l1::before { background: var(--plan-sea); }
.project-plan-legend .is-unit::before { background: var(--plan-paper); border: 1px solid var(--plan-line); border-left: 3px solid var(--plan-brand); }
.project-plan-legend .is-check::before { background: var(--plan-check); border: 1px dashed var(--plan-brand); }
.project-plan-legend .is-review::before { background: var(--plan-paper); border: 1.5px solid var(--plan-ink); }
.project-plan-legend .is-pm::before { background: transparent; border: 1px solid var(--text-secondary); }
.project-plan-head, .project-plan-row { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); column-gap: 30px; }
.project-plan-head { padding: 0 0 8px; color: var(--text-secondary); font-size: 14px; }
.project-plan-stage { margin: 0 0 14px; padding: 16px 18px 18px; border: 1px solid var(--plan-soft); border-radius: 4px; background: var(--plan-paper); }
.project-plan-stage.is-prod { border-top: 3px solid var(--plan-brand); }
.project-plan-stage.is-pm { background: transparent; border: 1px dashed var(--plan-line); }
.project-plan-stage h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 600; color: var(--plan-ink); }
.project-plan-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--plan-brand); }
.project-plan-stage.is-pm h3 { color: var(--text-secondary); }
.project-plan-stage.is-pm .project-plan-dot { background: transparent; border: 1.5px solid var(--text-secondary); }
.project-plan-rows, .project-plan-units { list-style: none; margin: 0; padding: 0; }
.project-plan-row { align-items: stretch; }
.project-plan-lead { display: flex; flex-direction: column; }
.project-plan-l1, .project-plan-review { display: flex; align-items: baseline; gap: 12px; min-height: 48px; padding: 12px 16px; border-radius: 2px; }
.project-plan-l1 { background: var(--plan-sea); color: #fff; }
.project-plan-l1 strong { font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.project-plan-l1 span { font-weight: 400; }
.project-plan-review { background: var(--plan-paper); border: 1.5px solid var(--plan-ink); color: var(--plan-ink); }
.project-plan-review em { font-style: normal; font-size: 14px; font-weight: 600; padding: 0 6px; background: var(--plan-ink); color: var(--plan-paper); border-radius: 2px; }
.project-plan-review strong { font-weight: 600; }
.project-plan-arrow, .project-plan-link, .portal-flow-arrow { position: relative; display: block; border-left: 1px solid var(--plan-line); }
.project-plan-arrow::after, .project-plan-link::after, .portal-flow-arrow::after { content: ""; position: absolute; left: -4px; bottom: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 8px solid var(--plan-line); }
.portal-flow-arrow { flex: 0 0 auto; width: 1px; height: var(--plan-gap); margin: 6px auto; }
.project-plan { --plan-gap: 28px; }
.project-plan-arrow { flex: 1 1 auto; min-height: var(--plan-gap); margin: 6px 0 6px 28px; }
.project-plan-link { height: var(--plan-gap); margin: 6px 0 6px 22px; }
.project-plan-link.is-fill { flex: 1 1 auto; height: auto; margin-top: 0; }
.project-plan-units { display: flex; flex-direction: column; align-items: flex-start; }
.project-plan-units.is-pass { display: flex; }
.project-plan-unit, .portal-flow-unit { display: flex; align-items: baseline; gap: 12px; min-width: 260px; padding: 9px 14px; background: var(--plan-paper); border: 1px solid var(--plan-line); border-left: 3px solid var(--plan-brand); border-radius: 2px; font-size: 15px; line-height: 24px; color: var(--plan-ink); }
.project-plan-unit strong, .portal-flow-unit strong { font-weight: 600; color: var(--plan-brand-deep); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.project-plan-unit > span, .portal-flow-unit > span { min-width: 0; overflow-wrap: anywhere; font-weight: 400; }
.project-plan-unit.is-check, .portal-flow-unit.is-check { background: var(--plan-check); border: 1px dashed var(--plan-brand); }
.project-plan-unit.is-review, .portal-flow-unit.is-review { border: 1.5px solid var(--plan-ink); color: var(--plan-ink); }
.project-plan-row.is-parallel { display: block; }
.project-plan-parallel { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; padding: 22px 16px 16px; border: 1px dashed var(--plan-line); border-radius: 4px; }
.project-plan-parallel-tag { position: absolute; top: -10px; left: 14px; padding: 0 6px; background: var(--plan-paper); color: var(--text-secondary); font-size: 13px; }
.project-plan-lane { min-width: 0; }
.project-plan-lane .project-plan-unit { min-width: 0; width: 100%; }
.project-plan-join { position: relative; display: block; height: var(--plan-gap); margin: 6px 0 6px 28px; border-left: 1px solid var(--plan-line); }
.project-plan-join::after { content: ""; position: absolute; left: -4px; bottom: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 8px solid var(--plan-line); }
.project-plan-unit > em, .project-plan-unit.is-review em { font-style: normal; font-size: 14px; font-weight: 600; padding: 0 6px; background: var(--plan-ink); color: var(--plan-paper); border-radius: 2px; }
.project-plan-l1.is-pm { background: transparent; border: 1px solid var(--text-secondary); color: var(--plan-ink); }
.project-plan-unit.is-pm { background: transparent; border: 1px solid var(--plan-line); }
.project-plan-unit.is-pm strong { color: var(--text-secondary); }
@media (max-width: 760px) {
  .project-plan-head { display: none; }
  .project-plan-row { grid-template-columns: 1fr; }
  .project-plan-units { margin: 8px 0 0 18px; }
  .project-plan-unit { min-width: 0; width: 100%; }
  .project-plan-arrow { min-height: var(--plan-gap); }
}
