/* ============================================================
   AquaRAS 工艺设计软件 — light engineering product UI
   中性浅色画布 / 水务青绿色强调 / 清晰的工程数据层级
   ============================================================ */

:root {
  --bg: #f4f7f8;
  --bg-grad-1: #edf4f5;
  --bg-grad-2: #f8fafb;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --surface-raised: #ffffff;
  --border: #d5e1e4;
  --border-strong: #b8cbd0;
  --text: #102a35;
  --text-soft: #46616a;
  --text-faint: #536b73;
  --brand: #0d7c86;
  --brand-2: #07545d;
  --brand-strong: #07545d;
  --brand-soft: rgba(13, 124, 134, 0.12);
  --brand-gradient: linear-gradient(135deg, var(--brand), var(--brand-2));
  --accent: #26835b;
  --accent-2: #71b89c;
  --success: #26835b;
  --warning: #a96e15;
  --danger: #b54747;
  --pipe: #71898f;
  --grid: rgba(16, 42, 53, 0.08);
  --input-bg: #ffffff;
  --card-shadow: 0 12px 28px rgba(16, 42, 53, 0.08);
  --glow: 0 8px 20px rgba(13, 124, 134, 0.16);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
}

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

html, body { height: 100%; overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg) 44%, var(--bg-grad-2) 100%);
  font-size: 15px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}
/* 视图切换过渡（hash 路由跳转丝滑） */
#view-landing, #view-engine, #view-community, #view-suppliers, #view-admin, #view-share {
  animation: rasViewIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.admin-page { animation: rasViewIn 0.3s ease both; }
@keyframes rasViewIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
/* 轻量工程网格：只提供尺度感，不与内容争夺层级 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--grid) 1.2px, transparent 1.8px);
  background-size: 28px 28px;
  opacity: .42;
  -webkit-mask-image: radial-gradient(ellipse 78% 60% at 50% -4%, #000 28%, transparent 82%);
  mask-image: radial-gradient(ellipse 78% 60% at 50% -4%, #000 28%, transparent 82%);
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 30px 22px 64px; }
.panel[id] { scroll-margin-top: 92px; }

/* ---------- Site shell / global navigation ---------- */
.global-nav {
  position: fixed; inset: 0 0 auto; z-index: 1000;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(16, 42, 53, .06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.gn-wrap {
  position: relative; max-width: 1200px; min-height: 64px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap;
}
.global-nav .brand { gap: 11px; min-width: 0; flex: 0 0 auto; }
.global-nav .brand-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.global-nav .brand-name b { font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
.global-nav .brand-name b::after { content: "·"; color: var(--brand); margin-left: 10px; font-size: 15px; }
.global-nav .brand-name span { color: var(--text-soft); font-size: 13px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.global-nav .site-nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.global-nav .site-nav a {
  color: var(--text-soft); font-size: 13px; font-weight: 650; text-decoration: none;
  padding: 8px 11px; border: 1px solid transparent; border-radius: 999px; white-space: nowrap;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.global-nav .site-nav a:hover { color: var(--text); background: var(--brand-soft); border-color: var(--border); transform: translateY(-1px); }
.global-nav .site-nav a.active { color: #fff; background: var(--brand-gradient); box-shadow: 0 6px 16px var(--brand-soft); }
.global-nav .site-nav .nav-admin,
.global-nav .site-nav .nav-console,
.global-nav .site-nav .nav-user {
  color: var(--text-soft); background: var(--surface-raised); border-color: var(--border); margin-left: 4px;
}
.global-nav .site-nav .nav-admin.on,
.global-nav .site-nav .nav-console.active,
.global-nav .site-nav .nav-user.on { color: #fff; background: var(--brand-gradient); border-color: transparent; }
.global-nav .site-nav .nav-admin:hover,
.global-nav .site-nav .nav-console:hover,
.global-nav .site-nav .nav-user:hover { border-color: var(--brand); }
.global-nav .nav-toggle { display: none; }

@media (max-width: 900px) {
  .gn-wrap { gap: 10px; padding-inline: 16px; }
  .global-nav .brand-name span { display: none; }
  .global-nav .site-nav a { padding-inline: 8px; font-size: 12.5px; }
}

@media (max-width: 768px) {
  .gn-wrap { min-height: 64px; }
  .global-nav .nav-toggle { display: inline-flex; }
  .global-nav #siteNav {
    display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 12px;
    background: var(--surface-raised); border: 1px solid var(--border); border-top: 0;
    box-shadow: 0 14px 30px rgba(16, 42, 53, .12);
  }
  .global-nav .gn-wrap.nav-open #siteNav { display: flex; }
  .global-nav #siteNav a { width: 100%; padding: 11px 12px; border-radius: 10px; }
}

/* ---------- Header ---------- */

.brand { display: flex; align-items: center; gap: 14px; }
.brand .logo {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.brand .logo img { width: 36px; height: 36px; display: block; }
.brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; }
.brand p { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; letter-spacing: 0.005em; text-align: justify; }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* ---------- Tabs ---------- */
.tabs-toolbar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.tabs { display: flex; flex: 1 1 auto; min-width: 0; gap: 8px; flex-wrap: wrap; margin-bottom: 0; }
.tabs-actions { flex: 0 0 auto; display: flex; align-items: center; min-height: 42px; }
.tabs-actions .export-btn { white-space: nowrap; min-height: 42px; padding-inline: 16px; }

.tab {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); padding: 10px 18px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: all 0.25s ease;
  backdrop-filter: blur(10px); display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); transform: translateY(-1px); border-color: var(--border-strong); background: var(--brand-soft); }
.tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 22px var(--brand-soft);
}

/* ---------- Panels ---------- */
.panel { display: none; animation: fade 0.45s ease; }
.panel.active { display: block; }
/* Workspace forms are content panels, not route panels. Keep them visible
   even though the engine's global .panel class is hidden until .active. */
.workspace-shell .ws-panel { display: block; animation: fade 0.45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Workspace：项目管理视觉层（D-122） ----------
   与引擎共用冷蓝灰底色、青色强调和统一圆角；信息密度保持克制，
   让“下一步动作”始终比元数据更醒目。 */
#view-workspace.active { background: var(--bg); }
.workspace-shell { color: var(--text); }
.workspace-shell button,
.workspace-shell input,
.workspace-shell select,
.workspace-shell textarea { font-family: var(--font); }
.workspace-shell .ws-head {
  position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 4px 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border);
}
.workspace-shell .ws-head > div { min-width: 0; }
.workspace-shell .ws-head > div::before {
  content: none;
  color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .18em;
}
.workspace-shell .ws-head h2 {
  color: var(--text); font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12;
  letter-spacing: -.045em; font-weight: 850;
}
.workspace-shell .ws-head p { margin-top: 8px; color: var(--text-soft); font-size: 14px; line-height: 1.65; }
.workspace-shell .ws-head > .btn-primary,
.workspace-shell .ws-head > .toggle-btn { flex: 0 0 auto; white-space: nowrap; }
.workspace-shell .btn-primary { padding: 12px 22px; font-size: 14px; box-shadow: var(--card-shadow); }
.workspace-shell .btn-primary:hover { box-shadow: 0 14px 30px rgba(16,42,53,.12); }
.workspace-shell .toggle-btn { padding: 9px 14px; font-size: 13px; background: var(--surface-2); }
.workspace-shell .toggle-btn:focus-visible,
.workspace-shell .btn-primary:focus-visible,
.workspace-shell .ws-card:focus-visible,
.workspace-shell .text-input:focus-visible { outline: 3px solid rgba(2,132,199,.28); outline-offset: 2px; }

.workspace-shell .ws-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.workspace-shell .ws-stat {
  position: relative; min-height: 92px; display: flex; flex-direction: column; justify-content: center;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: none;
  color: var(--text-soft); font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.workspace-shell .ws-stat::after { content: ""; position: absolute; left: 18px; bottom: 0; width: 34px; height: 3px; border-radius: 99px; background: var(--accent); }
.workspace-shell .ws-stat b { color: var(--text); font-family: var(--font-num); font-size: 29px; line-height: 1; letter-spacing: -.04em; margin-bottom: 8px; }
.workspace-shell .ws-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.workspace-shell .ws-card {
  position: relative; min-height: 156px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 22px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); box-shadow: none;
  cursor: pointer; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.workspace-shell .ws-card::after { content: none; }
.workspace-shell .ws-card-next { align-self: flex-end; margin-top: 14px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .04em; opacity: .86; }
.workspace-shell .ws-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.workspace-shell .ws-card-actions .ws-card-next { margin-top: 0; }
.workspace-shell .ws-project-delete, .workspace-shell .ws-project-delete-detail { color: #be123c; border-color: rgba(190,18,60,.24); background: rgba(255,241,242,.78); }
.workspace-shell .ws-project-delete:hover, .workspace-shell .ws-project-delete-detail:hover { color: #9f1239; border-color: rgba(190,18,60,.44); background: rgba(255,228,230,.9); }
.workspace-shell .ws-card:hover { transform: translateY(-3px); border-color: var(--brand); background: var(--surface); box-shadow: var(--card-shadow); }
.workspace-shell .ws-card-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.workspace-shell .ws-card-head b { flex: 1 1 100%; min-width: 0; color: var(--text); font-size: 18px; line-height: 1.35; letter-spacing: -.02em; overflow-wrap: anywhere; }
.workspace-shell .ws-card-meta { color: var(--text-soft); font-size: 13px; line-height: 1.8; }
.workspace-shell .ws-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 9px; border-radius: 999px; font-size: 11px; line-height: 1; font-weight: 750; letter-spacing: .02em; }
.workspace-shell .ws-badge.stage-IDEA { color: #075985; background: rgba(56,189,248,.17); }
.workspace-shell .ws-badge.stage-ARCHIVED { color: var(--text-soft); background: var(--surface-2); }
.workspace-shell .ws-badge.vis-private { color: #115e59; background: rgba(45,212,191,.16); }
.workspace-shell .ws-badge.vis-shared, .workspace-shell .ws-badge.vis-public { color: var(--brand-strong); background: var(--brand-soft); }

.workspace-shell .ws-empty,
.workspace-shell .ws-loading,
.workspace-shell .ws-err {
  min-height: 150px; display: grid; place-items: center; padding: 30px 24px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: 18px; background: var(--surface);
  color: var(--text-soft); font-size: 14px; line-height: 1.8;
}
.workspace-shell .ws-err { color: #9f1239; border-color: rgba(225,29,72,.25); background: rgba(255,228,230,.58); }
.workspace-shell .ws-loading { color: var(--brand); }
.workspace-shell .ws-login { max-width: 640px; margin: 22px auto 0; padding: 42px 38px; text-align: center; }
.workspace-shell .ws-login-ico { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 18px; background: linear-gradient(135deg, var(--brand-soft), rgba(45,212,191,.18)); color: var(--brand); font-size: 26px; }
.workspace-shell .ws-login h2 { font-size: 28px; letter-spacing: -.035em; }
.workspace-shell .ws-login p { max-width: 40ch; margin: 9px auto 22px; color: var(--text-soft); line-height: 1.8; }
.workspace-shell .ws-login .ws-note { margin: 22px 0 0; text-align: left; }

.workspace-shell .ws-form { max-width: 820px; margin: 0 auto 24px; padding: 26px; }
.workspace-shell .ws-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.workspace-shell .ws-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.workspace-shell .ws-field label { color: var(--text); font-size: 13px; font-weight: 800; }
.workspace-shell .ws-field .text-input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); color: var(--text); font-size: 14px; box-sizing: border-box; }
.workspace-shell .ws-field textarea.text-input { min-height: 92px; height: auto; resize: vertical; }
.workspace-shell .ws-field .text-input::placeholder { color: var(--text-faint); }
.workspace-shell .ws-form-err { display: none; margin: 2px 0 14px; color: #be123c; font-size: 13px; font-weight: 650; }
.workspace-shell .ws-form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }

.workspace-shell .ws-project-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.workspace-shell .ws-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workspace-shell .ws-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -7px 0 20px; color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-detail-time { margin-left: 4px; }
.workspace-shell .ws-section { margin-top: 20px; }
.workspace-shell .ws-section-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; color: var(--text); font-size: 18px; font-weight: 850; letter-spacing: -.025em; }
.workspace-shell .ws-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.workspace-shell .ws-scheme { padding: 20px; margin-bottom: 14px; background: var(--surface); }
.workspace-shell .ws-scheme-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.workspace-shell .ws-scheme-head b { color: var(--text); font-size: 17px; letter-spacing: -.02em; }
.workspace-shell .ws-scheme-time, .workspace-shell .ws-scheme-desc { color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-scheme-desc { margin-top: 5px; }
.workspace-shell .ws-scheme-binding { display: inline-flex; margin-top: 14px; padding: 6px 10px; border-radius: 8px; color: var(--accent); background: var(--surface-2); font-size: 12px; font-weight: 750; }
.workspace-shell .ws-scheme-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.workspace-shell .ws-scheme-actions .toggle-btn { min-height: 38px; }
.workspace-shell .ws-scheme-delete { color: #be123c; border-color: rgba(190,18,60,.24); background: rgba(255,241,242,.78); }
.workspace-shell .ws-scheme-delete:hover { color: #9f1239; border-color: rgba(190,18,60,.44); background: rgba(255,228,230,.9); }
.workspace-shell .ws-inline-edit { margin: 16px 0 0; max-width: none; padding: 18px; background: var(--surface-2); }
.workspace-shell .ws-calc-box { margin-top: 16px; }
.workspace-shell .ws-calc-list { display: grid; gap: 8px; }
.workspace-shell .ws-calc { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.workspace-shell .ws-calc-id { color: var(--brand); font-family: var(--font-num); font-weight: 800; }
.workspace-shell .ws-calc-v, .workspace-shell .ws-calc-time { color: var(--text-soft); font-size: 12px; }
.workspace-shell .ws-calc-time { color: var(--text-faint); }
.workspace-shell .ws-calc-detail { grid-column: 1 / -1; min-width: 0; }
.workspace-shell .ws-calc-head { padding: 14px 0 10px; color: var(--text-soft); font-size: 12px; font-weight: 750; border-bottom: 1px solid var(--border); }
.workspace-shell .ws-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; padding: 14px 0; }
.workspace-shell .ws-metric { padding: 10px 11px; border-radius: 10px; background: var(--surface); }
.workspace-shell .ws-metric span { display: block; color: var(--text-faint); font-size: 11px; }
.workspace-shell .ws-metric b { display: block; margin-top: 4px; color: var(--text); font-family: var(--font-num); font-size: 14px; }
.workspace-shell .ws-calc-artifacts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.workspace-shell .ws-artifact-status { color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-note { margin: 0; padding: 12px 14px; border-radius: 11px; background: var(--brand-soft); border: 1px solid var(--border); color: var(--text-soft); font-size: 12.5px; }
.workspace-shell .ws-archived-note { margin-bottom: 18px; color: #854d0e; background: rgba(251,191,36,.13); border-color: rgba(245,158,11,.25); }

/* Persisted calculation Report: existing workspace reading surface. */
.workspace-shell .ws-report-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); min-width: 0; }
.workspace-shell .ws-report-status { margin: 0 0 12px; color: var(--text-soft); font-size: 12.5px; }
.workspace-shell .ws-report-content { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.workspace-shell .ws-report-content h4 { margin: 20px 0 10px; font-size: 14px; }
.workspace-shell .ws-report-source, .workspace-shell .ws-report-summary { margin: 0; }
.workspace-shell .ws-report-source > div, .workspace-shell .ws-report-summary > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.workspace-shell .ws-report-content dt { color: var(--text-soft); }
.workspace-shell .ws-report-content dd { margin: 0; min-width: 0; }
.workspace-shell .ws-report-conditions { padding-left: 20px; }
.workspace-shell .ws-report-conditions li { margin: 10px 0; }
.workspace-shell .ws-report-conditions p { margin: 3px 0; color: var(--text-soft); }

/* ---- 实际数据 Actual Data（AD-014~AD-019）---- */
.workspace-shell .ws-ad-box { margin-top: 12px; }
.workspace-shell .ws-ad-intro { margin: 4px 0 14px; padding: 12px 14px; border-radius: 11px; border: 1px dashed var(--border); background: var(--surface); color: var(--text-soft); font-size: 12.5px; line-height: 1.7; }
.workspace-shell .ws-ad-create { margin-bottom: 16px; }
.workspace-shell .ws-ad-list { display: grid; gap: 10px; }
.workspace-shell .ws-ad-session-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.workspace-shell .ws-ad-session-head b { min-width: 0; overflow-wrap: anywhere; }
.workspace-shell .ws-ad-session-meta { margin: 8px 0 10px; color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-ad-session-detail { margin-top: 12px; }
.workspace-shell .ws-badge.stage-ad-PROCUREMENT { color: #1e40af; background: rgba(59,130,246,.12); }
.workspace-shell .ws-badge.stage-ad-COMMISSIONING { color: #854d0e; background: rgba(251,191,36,.16); }
.workspace-shell .ws-badge.stage-ad-OPERATION { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-badge.ad-status-active { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-badge.ad-status-closed, .workspace-shell .ws-badge.ad-status-voided, .workspace-shell .ws-badge.ad-status-archived { color: #7c2d12; background: rgba(148,163,184,.18); }
.workspace-shell .ws-badge.ad-src { color: var(--text-soft); background: var(--surface-2); }
.workspace-shell .ws-badge.ad-evidence { color: #0f766e; background: rgba(20,184,166,.12); }
.workspace-shell .ws-badge.ws-badge-provenance { color: var(--text-soft); background: var(--surface-2); font-size: 10.5px; padding: 2px 7px; margin-left: 2px; }
.workspace-shell .ws-badge.ws-badge-frozen { color: #475569; background: rgba(148,163,184,.2); border: 1px solid rgba(148,163,184,.35); }
.workspace-shell .ws-badge.ad-vf-verified { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-badge.ad-vf-reviewed { color: #1e3a8a; background: rgba(59,130,246,.12); }
.workspace-shell .ws-badge.ad-vf-declared { color: #854d0e; background: rgba(251,191,36,.16); }
.workspace-shell .ws-badge.ad-vf-unverified { color: var(--text-soft); background: var(--surface-2); }
.workspace-shell .ws-badge.ad-cmp-COMPARABLE { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-badge.ad-cmp-MISSING_ACTUAL_VALUE { color: var(--text-soft); background: var(--surface-2); }
.workspace-shell .ws-badge.ad-cmp-MISSING_DESIGN_VALUE, .workspace-shell .ws-badge.ad-cmp-NOT_COMPARABLE, .workspace-shell .ws-badge.ad-cmp-ZERO_BASELINE { color: #854d0e; background: rgba(251,191,36,.16); }
.workspace-shell .ws-badge.ad-audit { color: var(--text-soft); background: var(--surface-2); font-family: var(--font-num); }
.workspace-shell .ws-ad-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.workspace-shell .ws-ad-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.workspace-shell .ws-ad-table th { padding: 9px 10px; text-align: left; color: var(--text-faint); font-size: 11.5px; font-weight: 750; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.workspace-shell .ws-ad-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-family: var(--font-num); white-space: nowrap; }
.workspace-shell .ws-ad-table td:first-child { font-family: inherit; }
.workspace-shell .ws-ad-table tr:last-child td { border-bottom: none; }
.workspace-shell .ws-ad-note { margin: 10px 0 16px; }
.workspace-shell .ws-ad-obs-list, .workspace-shell .ws-ad-obs { display: grid; gap: 8px; }
.workspace-shell .ws-ad-obs { padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.workspace-shell .ws-ad-obs.ad-voided { opacity: .62; }
.workspace-shell .ws-ad-obs-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-num); }
.workspace-shell .ws-ad-obs-main b { font-family: inherit; }
.workspace-shell .ws-ad-obs-meta { margin-top: 4px; color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-ad-obs-notes { margin-top: 6px; color: var(--text-soft); font-size: 12.5px; overflow-wrap: anywhere; }
.workspace-shell .ws-ad-obs-edit-box { margin-top: 8px; }
.workspace-shell .ws-ad-audit { display: grid; gap: 6px; margin-bottom: 14px; }
.workspace-shell .ws-ad-audit-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-ad-history-entry { margin-top: 14px; }
.workspace-shell .ws-ad-history-head { margin-bottom: 12px; }
.workspace-shell .ws-ad-filters { margin-bottom: 12px; }

@media (max-width: 760px) {
  .workspace-shell { padding: 26px 16px 56px; }
  .workspace-shell .ws-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .workspace-shell .ws-head > .btn-primary, .workspace-shell .ws-head > .toggle-btn { width: 100%; justify-content: center; }
  .workspace-shell .ws-stats, .workspace-shell .ws-list, .workspace-shell .ws-grid2 { grid-template-columns: 1fr; }
  .workspace-shell .ws-card { min-height: 140px; }
  .workspace-shell .ws-login { padding: 32px 22px; }
  .workspace-shell .ws-form { padding: 20px 16px; }
  .workspace-shell .ws-scheme-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .workspace-shell .ws-calc { grid-template-columns: auto minmax(0,1fr); }
  .workspace-shell .ws-calc-time { grid-column: 2; }
  .workspace-shell .ws-calc .ws-calc-open { grid-column: 1 / -1; justify-self: start; }
  .workspace-shell .ws-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace-shell .ws-ad-table th, .workspace-shell .ws-ad-table td { padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-shell .ws-panel, .workspace-shell .ws-card, .workspace-shell .btn-primary, .workspace-shell .toggle-btn { animation: none; transition: none; }
}

/* ---------- Engine context: keep the next action visible ---------- */
.engine-context {
  max-width: 1240px; margin: 18px auto 0; padding: 11px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid rgba(2,132,199,.18); border-radius: 13px;
  background: linear-gradient(110deg, rgba(239,246,255,.9), rgba(240,253,250,.72));
  color: var(--text-soft); font-size: 12px;
}
.engine-context-stage { color: var(--brand); font-size: 10px; font-weight: 850; letter-spacing: .16em; }
.engine-context strong { color: var(--text); font-size: 13px; letter-spacing: -.01em; }
.engine-context #engineContextMeta { color: var(--text-faint); }
.engine-context.is-bound { border-color: rgba(13,148,136,.28); background: linear-gradient(110deg, rgba(236,253,245,.94), rgba(239,246,255,.9)); }
.tabs-stage { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.tabs-stage::before { content: attr(data-stage-label); align-self: stretch; display: inline-grid; place-items: center; padding: 0 7px; color: var(--text-faint); font-size: 10px; font-weight: 850; letter-spacing: .12em; writing-mode: vertical-rl; }
@media (max-width: 760px) {
  .engine-context { margin: 12px 14px 0; padding: 10px 13px; gap: 7px 10px; }
  .engine-context #engineContextMeta { flex-basis: 100%; }
  .tabs-stage { width: 100%; overflow-x: auto; }
  .tabs-stage::before { writing-mode: horizontal-tb; flex: 0 0 auto; }
  .tabs-toolbar { flex-direction: column; gap: 8px; }
  .tabs-actions { width: 100%; justify-content: flex-end; min-height: 0; }
}

/* Global keyboard and motion affordances (P2) */
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid rgba(13, 124, 134, .34); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@supports not ((backdrop-filter: blur(1px))) {
  .global-nav, .admin-side, .glass { background: rgba(255,255,255,.97); }
}

/* ---------- Input form ---------- */
.example-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 26px 0; }
.example-label { font-size: 13px; font-weight: 700; color: var(--text-soft); }
.example-note { font-size: 12.5px; color: var(--text-faint); }
.example-bar .toggle-btn { padding: 7px 14px; font-size: 13px; }
.form-guide {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.form-guide > div { min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.form-guide strong { color: var(--text); font-size: 14px; }
.form-guide span { color: var(--text-faint); font-size: 12px; }
.form-guide .toggle-btn { flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px; }
.advanced-collapsed .advanced-only { display: none !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 26px; }
.form-section-label { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 9px; margin: 4px 0 -3px; padding: 14px 0 5px; border-bottom: 1px solid var(--border); }
.form-section-label span { color: var(--brand); font: 800 11px/1 var(--font-num); letter-spacing: .08em; }
.form-section-label b { color: var(--text); font-size: 15px; letter-spacing: -.01em; }
.form-section-label small { color: var(--text-faint); font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; color: var(--text-soft); letter-spacing: 0.01em; }
.field .hint { font-size: 11.5px; color: var(--text-faint); }
.field input, .field select {
  width: 100%; height: 46px; min-height: 46px; box-sizing: border-box; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-size: 15px; font-family: inherit; transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft), inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.field .unit { color: var(--text-faint); font-size: 12px; }
.unit-affixed { display: none; }
.field-range { font-size: 11px; font-weight: 500; color: var(--text-faint); margin-left: 5px; letter-spacing: 0.02em; }
.input-unit-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  height: 46px;
  min-height: 46px;
  box-sizing: border-box;
}
.input-unit-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft), inset 0 1px 2px rgba(15, 23, 42, 0.04);
  background: var(--surface);
}
.input-unit-wrap input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 10px 12px !important;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.input-unit-wrap input:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}
.input-unit-wrap:has(input:disabled) {
  background: var(--surface);
  opacity: 0.72;
  border-color: var(--border);
}
.input-unit-wrap .input-unit {
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-left: 1px solid var(--border);
  background: rgba(16, 42, 53, 0.025);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

/* 方案库：结果目录与项目主仓库的层级说明 */
.lib-lead { padding: 24px 26px 4px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lib-kicker { color: var(--brand); font: 800 11px/1 var(--font-num); letter-spacing: .08em; text-transform: uppercase; }
.lib-lead h2 { margin-top: 8px; font-size: 22px; color: var(--text); }
.lib-lead p { max-width: 780px; margin-top: 6px; color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.lib-lead p strong { color: var(--brand-strong); }

/* 地区全年平均气温下拉选择器 */
.temp-select {
  width: 100%; height: 46px; max-width: 380px; padding: 11px 14px; box-sizing: border-box; font-size: 14px; font-family: inherit;
  font-weight: 600; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.temp-select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.temp-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.temp-row .temp-select { flex: 1 1 240px; max-width: none; }
.temp-input {
  flex: 1 1 140px; min-width: 120px; height: 46px; padding: 11px 14px; box-sizing: border-box; font-size: 14px; font-family: inherit;
  font-weight: 600; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.temp-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.temp-input::placeholder { color: var(--text-faint); font-weight: 500; }

.btn-primary {
  grid-column: 1 / -1; justify-self: start; margin-top: 4px;
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.01em;
  padding: 14px 30px; border-radius: 999px;
  box-shadow: 0 10px 28px var(--brand-soft);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 34px rgba(13, 124, 134, 0.30); }
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-price-sn {
  border: 1px solid rgba(2, 132, 199, 0.32); cursor: pointer; font-family: inherit;
  background: rgba(2, 132, 199, 0.08); color: var(--text);
  font-weight: 700; font-size: 13px; letter-spacing: 0.01em;
  padding: 8px 16px; border-radius: 999px;
  transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-price-sn:hover { transform: translateY(-1px); background: rgba(2, 132, 199, 0.18); box-shadow: 0 8px 20px rgba(2, 132, 199, 0.22); }
.btn-price-sn:active { transform: translateY(0) scale(0.98); }
.btn-price-sn.active { background: rgba(2, 132, 199, 0.26); border-color: rgba(2, 132, 199, 0.7); box-shadow: 0 8px 22px rgba(2, 132, 199, 0.32); }
.price-sn tr.up td { color: #34d399; }
.price-sn tr.down td { color: #f87171; }
.price-sn tr.ps-base td { font-weight: 700; color: var(--text); }
.price-sn tr.focus td { background: rgba(2, 132, 199, 0.14); }
.price-sn tr .d { font-size: 11.5px; opacity: 0.92; }

/* ---------- Result metric cards ---------- */
.section-title { position: relative; font-size: 17px; font-weight: 700; margin: 28px 0 14px; padding: 0 26px 0 36px; display: flex; align-items: center; gap: 10px; letter-spacing: 0.02em; }
.section-title::before {
  content: ""; position: absolute; left: 26px; top: 0; width: 5px; height: 20px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-2));
  box-shadow: 0 0 12px var(--brand-soft);
}
.section-title .badge {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; letter-spacing: 0.03em;
}

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; padding: 0 26px; }
.metric {
  position: relative; padding: 18px 18px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.metric::before {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity: 0.55;
}
.metric:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--brand-soft); border-color: var(--border-strong); }
.metric .k { font-size: 13px; color: var(--text-soft); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.metric .v {
  font-family: var(--font-num); font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.15;
}
.metric .v.v-nowrap { white-space: nowrap; word-break: keep-all; }
.metric .v.v-wrap { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
.metric .v small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-faint); margin-left: 5px; }
.metric .sub { font-size: 12px; color: var(--text-faint); margin-top: 5px; line-height: 1.45; }
.metric.accent .v { color: var(--accent); }
.metric.brand .v { color: var(--brand); }

/* ---------- PFD / P&ID 通用：SVG 文字清晰 + 字体统一 ---------- */
.pfd-svg text, .pid-svg text { font-family: var(--font); text-rendering: optimizeLegibility; }
.pfd-wrap { padding: 18px; overflow-x: auto; }
.pfd-svg { width: 100%; height: auto; min-width: 720px; }
.pfd-header { font-size: 17px; font-weight: 800; fill: var(--text); letter-spacing: -0.01em; }
.pfd-caption { font-size: 12.5px; fill: var(--text-soft); }
.pfd-title { font-size: 14px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.pfd-sub { font-size: 11.5px; fill: var(--text-soft); text-anchor: middle; }
.pfd-box { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.6; transition: stroke-width .18s ease, stroke .18s ease; }
.pfd-node, .pid-node { transition: filter 0.22s ease; }
.pfd-node:hover { filter: drop-shadow(0 0 10px rgba(2, 132, 199, 0.5)); }
.pfd-node:hover .pfd-box { stroke-width: 2.8; }
.pfd-node:hover .pfd-title { fill: var(--brand); }
.pfd-line { stroke: var(--pipe); stroke-width: 2.2; fill: none; }
.pfd-head { fill: var(--pipe); }
.pfd-return { stroke: var(--brand); stroke-dasharray: 6 5; }
.pfd-return.pfd-head { fill: var(--brand); }
.pfd-flow-label { font-size: 11px; fill: var(--text-faint); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3.4px; stroke-linejoin: round; }
.pfd-flow-label.side { text-anchor: start; fill: var(--text-soft); font-weight: 600; }
/* 协调的类别色（冷调青→靛→翠，污泥用琥珀语义色） */
.pfd-node.c1 .pfd-box { stroke: #38bdf8; }
.pfd-node.c2 .pfd-box { stroke: #22d3ee; }
.pfd-node.c3 .pfd-box { stroke: #34d399; }
.pfd-node.c4 .pfd-box { stroke: #818cf8; }
.pfd-node.c5 .pfd-box { stroke: #a78bfa; }
.pfd-node.c6 .pfd-box { stroke: #2dd4bf; }
.pfd-node.c7 .pfd-box { stroke: #fb923c; }
.pfd-node.c8 .pfd-box { stroke: #60a5fa; }
.pfd-node.c9 .pfd-box { stroke: #f472b6; }
.pfd-node.c10 .pfd-box, .pfd-aux.c10 .pfd-box { stroke: #fbbf24; }
.pfd-node.c11 .pfd-box, .pfd-aux.c11 .pfd-box { stroke: #fb923c; }
.pfd-arrow.pfd-denit .pfd-line { stroke: #f472b6; fill: none; }
.pfd-skimmer .pfd-line { stroke: #c99520; fill: none; }
.pfd-skimmer .pfd-head { fill: #c99520; }
.pfd-ozone .pfd-line, .pfd-ozone-line { stroke: #9f51ad; stroke-dasharray: 4 3; fill: none; }
.pfd-ozone .pfd-head { fill: #9f51ad; }

.pfd-arrow.pfd-denit .pfd-head { stroke: #f472b6; fill: #f472b6; }
.pfd-legend .pfd-sub { fill: var(--text-soft); text-anchor: start; }
.pfd-arrow.pfd-makeup .pfd-line { stroke: #2dd4bf; fill: none; }
.pfd-arrow.pfd-makeup .pfd-head { stroke: #2dd4bf; fill: #2dd4bf; }
.pfd-arrow.pfd-sludge .pfd-line { stroke: #fb923c; fill: none; }
.pfd-arrow.pfd-sludge .pfd-head { stroke: #fb923c; fill: #fb923c; }
/* 比水耗胶囊 */
.pfd-swu { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1; }
.pfd-swu-dot { fill: var(--brand); }
.pfd-swu-txt { font-size: 12px; font-weight: 700; fill: var(--brand); text-anchor: start; }

/* ---------- PFD ↔ P&ID 联动高亮 ---------- */
[data-key] { cursor: pointer; }
[data-key].linked .pid-box,
[data-key].linked .pfd-box { stroke: var(--brand); stroke-width: 3.6; }
[data-key].linked .pid-bubble { stroke: #ffffff; stroke-width: 2.6; }
[data-key].linked .pid-title,
[data-key].linked .pfd-title { fill: var(--brand); }
@keyframes linkFlash {
  0%   { filter: drop-shadow(0 0 0 rgba(2, 132, 199, 0)); }
  30%  { filter: drop-shadow(0 0 14px rgba(2, 132, 199, 0.95)); }
  60%  { filter: drop-shadow(0 0 5px rgba(2, 132, 199, 0.45)); }
  100% { filter: drop-shadow(0 0 9px rgba(2, 132, 199, 0.7)); }
}
[data-key].link-flash { animation: linkFlash 0.6s ease-in-out 3; }
.link-hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-soft);
  padding: 10px 4px 0;
}
.link-hint .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 8px var(--brand); }

/* ---------- 3D ---------- */
.model-toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 18px; flex-wrap: wrap; }
.model-toolbar .spacer { flex: 1; }
.model-view-select { border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--text-soft); padding: 8px 12px; font: inherit; font-size: 13px; min-height: 36px; }
@media (max-width: 600px) {
  #model3d .model-legend { max-width: 180px; font-size: 11px; padding: 8px 10px; }
  #model3d .ml-title, #model3d .ml-note { display: none; }
  #model3d .ml-item { display: inline-flex; margin-right: 6px; }
}
#model3d { position: relative; width: 100%; height: 540px; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; display: block; }

/* 3D 模型加载失败占位（WebGL 不可用 / 引擎脚本加载失败时的友好提示） */
.model-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; height: 100%; min-height: 260px; padding: 24px; text-align: center;
  color: var(--text-soft); background: var(--brand-soft);
}
.model-error-ic { font-size: 40px; line-height: 1; opacity: .85; }
.model-error-msg { max-width: 460px; font-size: 13.5px; line-height: 1.7; color: var(--text-soft); }
.model-error-retry {
  cursor: pointer; border: 1px solid var(--brand); background: transparent; color: var(--brand);
  font-size: 13.5px; padding: 8px 26px; border-radius: 999px; transition: all .2s;
}
.model-error-retry:hover { background: var(--brand); color: #fff; }
.model-disclaim { font-size: 12px; color: var(--text-soft); text-align: center; padding: 8px 10px 12px; }
.toggle-btn {
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-soft);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: all 0.2s ease;
}
.toggle-btn:hover { color: var(--text); transform: translateY(-1px); background: var(--brand-soft); }
.toggle-btn.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px var(--brand-soft); }

/* 管线图层开关 */
.layer-toggles { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.layer-toggles label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-soft); cursor: pointer; user-select: none; }
.layer-toggles input { accent-color: var(--brand); width: 15px; height: 15px; }

/* 表单选项列表：每项卡片式横向排列，主标签下带小字体说明 */
.option-list { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0 2px; }
.option-row { flex: 1 1 180px; display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; user-select: none; transition: border-color 0.2s ease, background 0.2s ease; }
.option-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.option-row input { accent-color: var(--brand); width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; }
.option-body { display: flex; flex-direction: column; gap: 2px; }
.option-main { font-size: 13px; font-weight: 600; color: var(--text); }
.option-desc { font-size: 11.5px; color: var(--text-faint); line-height: 1.45; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px rgba(0, 0, 0, .25); }
.dot-water { background: #38bdf8; } .dot-makeup { background: #2dd4bf; }
.dot-gas { background: #34d399; } .dot-co2 { background: #94a3b8; }
.dot-sludge { background: #c2723a; } .dot-elec { background: #fbbf24; }

/* 3D 图例 */
.model-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 5; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  font-size: 12px; max-width: 210px; line-height: 1.5;
  box-shadow: var(--card-shadow);
}
.model-legend .ml-title { font-weight: 700; margin-bottom: 6px; font-size: 12.5px; color: var(--brand); }
.model-legend .ml-item { display: flex; align-items: center; gap: 7px; }
.model-legend .ml-sw { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: 0 0 5px rgba(0, 0, 0, .3); }
.model-legend .ml-note { margin-top: 6px; font-size: 11px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 5px; }

/* ---------- Scheme Library: data source / cloud sync ---------- */
.lib-source { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-source > label { font-size: 13px; color: var(--text-soft); font-weight: 600; }
.lib-source .seg { display: inline-flex; gap: 6px; }
.lib-source .text-input {
  flex: 1; min-width: 220px; height: 46px; min-height: 46px; box-sizing: border-box; padding: 11px 12px; border-radius: 10px; font-size: 13px;
  background: var(--input-bg); color: var(--text); border: 1px solid var(--border);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.lib-source .text-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lib-source .text-input:disabled { opacity: .5; cursor: not-allowed; }
.lib-status { font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lib-status.muted { background: rgba(100, 116, 139, .14); color: var(--text-soft); }
.lib-status.ok { background: rgba(34, 197, 94, .16); color: #15803d; }
.lib-status.warn { background: rgba(234, 179, 8, .18); color: #a16207; }
.src-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.src-tag.cloud { background: rgba(2, 132, 199, .12); color: #0369a1; }
.src-tag.local { background: rgba(100, 116, 139, .16); color: #334155; }
.lib-project-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: middle; background: rgba(16, 185, 129, .12); color: #047857; }
.lib-project-tag.legacy { background: rgba(100, 116, 139, .12); color: #475569; }

/* ---------- Table (BOM / economics) ---------- */
.table-wrap { padding: 8px 0; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; font-weight: 400; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { color: var(--text-soft); font-weight: 600; font-size: 12.5px; letter-spacing: 0.02em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: var(--brand-soft); }
table.data tfoot td { font-weight: 800; border-top: 2px solid var(--border-strong); }

/* ---------- Notes / callout ---------- */
.note {
  display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--brand-soft); border: 1px solid var(--brand-soft);
  font-size: 13.5px; color: var(--text-soft); line-height: 1.65;
  margin: 6px 26px 14px; text-align: justify;
}
.note b { color: var(--text); }
.note .ic { font-size: 18px; flex: 0 0 auto; }
/* 水质区下方元信息卡片：紧凑键值布局 */
.note.wq-meta { margin: 6px 26px 14px; padding: 14px 18px; align-items: flex-start; }
@media (max-width: 720px) {
  .note, .note.wq-meta { margin-left: 14px; margin-right: 14px; }
  .form-guide { align-items: flex-start; flex-direction: column; }
  .form-guide .toggle-btn { width: 100%; }
}
.note.wq-meta .note-body { flex: 1; min-width: 0; }
.note.wq-meta .note-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note.wq-meta .note-kvs { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.note.wq-meta .note-kv { display: flex; flex-direction: column; gap: 2px; min-width: 86px; }
.note.wq-meta .note-kv span { font-size: 12px; color: var(--text-faint); }
.note.wq-meta .note-kv b { font-size: 14px; color: var(--text); font-weight: 700; }
.note.wq-meta .note-kv small { font-size: 11.5px; color: var(--text-soft); }
.note.wq-meta .note-foot { margin-top: 10px; font-size: 12.5px; color: var(--text-soft); line-height: 1.55; }
@media (max-width: 720px) {
  .note.wq-meta .note-kv { min-width: 78px; }
}
/* 养殖池水力结构等说明的多行排版 */
.tk-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.tk-line { margin: 7px 0; line-height: 1.65; overflow-wrap: anywhere; }
.tk-line:first-of-type { margin-top: 5px; }
/* 兜底：长文本/长数字不溢出容器 */
.note, .wq-note { overflow-wrap: anywhere; }
.note-warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); color: var(--text); }
.note-warn b { color: #f59e0b; }
/* ---------- Footer ---------- */
.footer { margin-top: 40px; text-align: center; color: var(--text-faint); font-size: 12.5px; line-height: 1.9; }
.footer a { color: var(--brand); text-decoration: none; }

/* ---------- Magnetic ---------- */
.magnetic { transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1); will-change: transform; }

/* ---------- Focus visibility (a11y) ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

/* ============================================================
   响应式 — 桌面 / 平板 / 手机 三端适配
   ============================================================ */

/* 平板及以下：表单转单列，避免窄屏两列拥挤 */
@media (max-width: 980px) {
  .form-grid,
  .panel.glass .form-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
}

/* 手机 */
@media (max-width: 720px) {
  .wrap { padding: 22px 14px 48px; }

  .header-actions { width: 100%; justify-content: space-between; }
  .brand h1 { font-size: 17px; }
  .brand p { font-size: 11.5px; }

  /* 标签页：单行横向滑动 + scroll-snap（像原生 App） */
  .tabs {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 -14px 18px; padding: 2px 14px 6px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; scroll-snap-align: start; white-space: nowrap; padding: 9px 14px; font-size: 13px; }

  /* 表单更紧凑；输入 16px 防 iOS 聚焦自动缩放 */
  .form-grid { padding: 18px; gap: 14px; }
  .field input, .field select { height: 46px; min-height: 46px; font-size: 16px; padding: 11px 14px; }
  .btn-primary { width: 100%; justify-self: stretch; text-align: center; padding: 15px; }

  /* 指标 / 标题左右留白收窄 */
  .metrics { padding: 0 14px; }
  .section-title { padding: 0 14px 0 24px; margin: 22px 0 12px; font-size: 16px; }
  .section-title::before { left: 14px; }
  #libCompare .metrics { padding: 14px !important; }

  /* 3D 高度按视口自适应 */
  #model3d { height: 60vh; max-height: 420px; min-height: 300px; }

  /* PFD/P&ID 横向滑动更顺 */
  .pfd-wrap { -webkit-overflow-scrolling: touch; touch-action: pan-x; padding: 14px; }

  /* 方案库控件更顺手 */
  .lib-source { gap: 10px; }
  .lib-source .text-input { min-width: 150px; }

  /* Hero（字号本身已 clamp 自适应，此处调布局） */
  .hero { min-height: auto; padding-block: 48px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-scroll { display: none !important; } /* 需 !important 压过下方基础规则 .hero-scroll{display:grid}（基础规则在媒体查询之后，同权重后写胜出）——修复移动端滚动指示器误显示（D-064） */
  /* 手机：管道铺满为背景(slice)，降透明度 + 隐藏角标，文字居中不重叠 */
  .hero .hero-circuit { opacity: 0.30; }
  .hero .hc-label, .hero .hc-node { display: none; }
  .hero-inner { gap: 14px; max-width: 100%; }
  .hero-sub { font-size: 14px; line-height: 1.62; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .wrap { padding: 16px 12px 40px; }
  .tabs { margin: 0 -12px 16px; padding: 2px 12px 6px; }
  .brand p { display: none; }                       /* 隐藏副标题省空间 */
  .header-actions .toggle-btn { flex: 1; justify-content: center; }  /* 导出按钮占满整行 */
  .hero-cta-row { gap: 10px; }
  .hero-cta { flex: 1; justify-content: center; padding: 13px 12px; font-size: 14px; }
  /* Hero 更小屏：管道更弱、指标更紧凑 */
  .hero .hero-circuit { opacity: 0.30; }
  .hero-stats { gap: 8px; grid-template-columns: repeat(2, 1fr); }
  .hero-stat { padding: 10px 8px; min-height: 88px; }
  .hero-stat .hs-v { font-size: 19px; height: 32px; min-height: 32px; }
  #model3d { height: 52vh; min-height: 260px; }
  .pfd-wrap { padding: 12px; }
  .section-title { font-size: 15px; }
}

/* —— 敏感度分析 · 龙卷风图 —— */
.sn-wrap { margin-top: 4px; }
.sn-wrap .note { margin-left: 0; margin-right: 0; }
.sn-ctrl { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sn-ctrl label { font-size: 13px; color: var(--text-soft); }
.tornado { display: flex; flex-direction: column; gap: 10px; }
.tornado-row { display: grid; grid-template-columns: 120px 1fr 150px; gap: 10px; align-items: center; }
.tornado-label { font-size: 13px; color: var(--text-soft); text-align: right; }
.tornado-track { position: relative; height: 22px; background: var(--surface); border-radius: 6px; }
.sn-bar { position: absolute; top: 0; height: 100%; border-radius: 5px; overflow: hidden; display: flex; }
.sn-seg { height: 100%; }
.sn-good { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.sn-bad { background: linear-gradient(90deg, #fb7185, #ef4444); }
.tornado-base { position: absolute; top: -4px; width: 2px; height: 30px; background: var(--text); opacity: .55; }
.tornado-val { font-size: 11.5px; color: var(--text-faint); line-height: 1.35; }
.tornado-axis { padding: 6px 0 0 130px; font-size: 12px; color: var(--text-soft); }

@media (max-width: 720px) {
  .tornado-row { grid-template-columns: 90px 1fr 96px; }
  .tornado-val { font-size: 10.5px; }
}

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

/* —— CAPEX 子项分解（默认折叠，点击展开一级） —— */
.cap-top > td { vertical-align: top; padding: 0 !important; }
.cap-det { border-radius: 10px; overflow: hidden; }
.cap-det > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 14px; font-weight: 600;
}
.cap-det > summary::-webkit-details-marker { display: none; }
.cap-det > summary::before {
  content: "▸"; color: var(--brand); font-size: 12px; margin-right: 6px;
  display: inline-block; transition: transform 0.2s ease;
}
.cap-det[open] > summary::before { transform: rotate(90deg); }
.cap-det > summary:hover { background: var(--surface-2); }
.cap-name { font-weight: 600; }
.cap-qty { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.cap-amt { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); white-space: nowrap; }
.cap-indirect > td > .cap-det > summary .cap-name { color: var(--brand); }
.cap-indirect > td > .cap-det { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.cap-tag { font-size: 10.5px; font-weight: 700; color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
  border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.cap-subtotal { border-top: 2px solid var(--border); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cap-subtotal .cap-name { font-weight: 800; color: var(--accent); }
.cap-subtable { width: 100%; border-collapse: collapse; margin: 0 0 4px; }
.cap-subtable td { padding: 7px 14px 7px 34px; color: var(--text-soft); font-size: 13px;
  border-top: 1px dashed var(--border); }
.cap-subtable td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.cap-subtable tr:last-child td { border-bottom: 1px dashed var(--border); }

/* 表单分组标题 */
.subhead {
  grid-column: 1 / -1; margin-top: 6px; padding: 12px 0 6px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em; color: var(--brand);
  border-top: 1px solid var(--border);
}

/* 融资假设标题与表单对齐，并在窄屏完整换行。 */
#panel-econ .section-title { overflow-wrap: anywhere; }
#panel-econ .finance-assumptions { min-width: 0; }
#panel-econ .finance-assumptions > .subhead { padding-inline: 26px; overflow-wrap: anywhere; }
#panel-econ .finance-assumptions .field { min-width: 0; }
@media (max-width: 640px) {
  #panel-econ .finance-assumptions > .subhead { padding-inline: 18px; }
  #panel-econ .finance-assumptions .form-grid { padding-inline: 18px !important; grid-template-columns: minmax(0, 1fr); }
}

/* 文本按钮（展开全部/折叠全部等） */
.link-btn {
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  transition: all 0.2s ease; white-space: nowrap;
}
.link-btn:hover { background: var(--brand-soft); border-color: var(--brand); }

/* —— 设计计算书 —— */
.doc-hero { padding: 20px 22px 8px; }
.doc-title { font-size: 20px; margin: 0 0 8px; letter-spacing: .2px; }
.doc-lead { margin: 0; font-size: 14px; color: var(--text-soft); line-height: 1.65; max-width: 880px; text-align: justify; }
.doc-section { padding: 14px 22px 0; }
.doc-section h3 { font-size: 16px; margin: 0 0 8px; color: var(--brand-2); letter-spacing: .2px; }
.doc-p { font-size: 14px; color: var(--text-soft); line-height: 1.7; max-width: 900px; margin: 0 0 10px; text-align: justify; }
.doc-list { margin: 0 0 4px; padding-left: 20px; max-width: 900px; color: var(--text-soft); line-height: 1.7; font-size: 14px; }
.doc-list li { margin: 0 0 7px; text-align: justify; }
.doc-list li b { color: var(--text); }

.doc-table { margin: 0; }
.doc-table th, .doc-table td { padding: 6px 10px; font-size: 13px; }

/* 条件结论状态栏：状态文案只保留一个视觉出口，避免徽章与摘要重复 */
.doc-cond { padding: 14px 16px 12px; border: 1px solid var(--border); border-radius: 14px;
  background: linear-gradient(135deg, var(--surface-2), rgba(255,255,255,.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68), 0 8px 24px rgba(15,23,42,.05); }

.doc-cond .cond-list { margin-top: 0; }

/* 响应式：设计计算书双列在窄屏堆叠 */

/* ============================================================
   水质可行性校核 — 状态徽章
   ============================================================ */
.wq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 0 26px; }
.wq-item { position: relative; padding: 16px 16px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,0.12); }
.wq-item::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--accent); opacity: 0.7; }
.wq-item.wq-ok::before { background: linear-gradient(90deg, #22c55e, #34d399); }
.wq-item.wq-warn::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.wq-item.wq-fail::before { background: linear-gradient(90deg, #f43f5e, #fb7185); }
.wq-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wq-name { font-size: 12.5px; font-weight: 700; color: var(--text-soft); }
.wq-pill { font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.wq-pill.wq-ok { background: rgba(34,197,94,.18); color: #22c55e; }
.wq-pill.wq-warn { background: rgba(245,158,11,.20); color: #f59e0b; }
.wq-pill.wq-fail { background: rgba(244,63,94,.20); color: #f43f5e; }
.wq-val { font-family: var(--font-num); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.wq-val small { font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--text-faint); margin-left: 5px; }
.wq-lim { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.wq-note { font-size: 11.5px; color: var(--text-soft); margin-top: 6px; }
.badge.wq-ok { color: #22c55e; background: rgba(34,197,94,.16); }
.badge.wq-warn { color: #f59e0b; background: rgba(245,158,11,.18); }
.badge.wq-fail { color: #f43f5e; background: rgba(244,63,94,.18); }
@media (max-width: 720px) { .wq-grid { padding: 0 14px; } }

/* ============================================================
   Hero 首屏 — 高级科技感头图
   ============================================================ */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 72vh; margin-bottom: 26px; padding: clamp(40px, 5.5vw, 72px) clamp(22px, 5vw, 64px);
  display: flex; align-items: center; justify-content: center; text-align: center;
  background:
    radial-gradient(120% 120% at 50% -10%, rgba(2, 132, 199, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(238, 242, 249, 0.46));
}

/* 视觉系统固定为浅色工程画布；不再保留暗色主题基础分支。 */

/* 背景层 */
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; }
.hero-aurora {
  position: absolute; border-radius: 50%; filter: blur(58px); opacity: 0.32;
  mix-blend-mode: multiply; will-change: transform;
}
.hero-aurora.a1 { width: 460px; height: 460px; top: -120px; left: -80px;
  background: radial-gradient(circle, var(--brand), transparent 68%); animation: floatA 14s ease-in-out infinite; }
.hero-aurora.a2 { width: 520px; height: 520px; top: -60px; right: -120px;
  background: radial-gradient(circle, var(--brand-2), transparent 68%); animation: floatB 17s ease-in-out infinite; }
.hero-aurora.a3 { width: 420px; height: 420px; bottom: -160px; left: 38%;
  background: radial-gradient(circle, var(--accent), transparent 70%); animation: floatA 19s ease-in-out infinite reverse; }
@keyframes floatA { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.08); } }
@keyframes floatB { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-46px, 26px) scale(1.06); } }

/* 正交 RAS 回路 SVG（矩形环线） */
.hero-circuit { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.52; }
/* 液态玻璃空心管道：极透管壁 + 柔光晕 + 高光内线，水滴贴壁穿行 */
.hc-pipe-outer {
  fill: none; stroke: url(#hcFlow); stroke-opacity: 0.18; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; filter: blur(1.6px) drop-shadow(0 0 9px rgba(150,210,255,0.5));
}
.hc-pipe-core {
  fill: none; stroke: rgba(148,163,184,0.10); stroke-width: 10.4; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* 玻璃高光内线（液态玻璃的边缘反射） */
.hc-pipe-rim {
  fill: none; stroke: rgba(205,238,255,0.55); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(150,210,255,0.7));
}
/* 角部装饰短线 */
.hc-spur { fill: none; stroke: var(--brand); stroke-width: 2; opacity: 0.4; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* 巡游水滴：液态蓝玻璃珠 + 蓝白双层辉光；贴满管腔；随管道转向(尖端朝运动方向)；速度 16s */
.hc-drop { stroke: rgba(225,245,255,0.55); stroke-width: 0.8; }
.hc-photon { filter: drop-shadow(0 0 10px #6fd0ff) drop-shadow(0 0 20px rgba(31,143,224,0.9)); }
.hc-spec { pointer-events: none; }
.hc-node { fill: var(--brand); stroke: var(--surface-2); stroke-width: 2.5; filter: drop-shadow(0 0 6px var(--brand-soft)); }
.hc-label { fill: var(--text-soft); font-size: 13px; font-weight: 700; text-anchor: middle; font-family: var(--font); letter-spacing: 0.02em; }

/* 柔和暗角，仅极淡压暗四角，保证中心文字清晰且角部标签可见 */
.hero-scrim { position: absolute; inset: 0;
  background: radial-gradient(ellipse 82% 86% at 50% 46%, transparent 62%, rgba(255, 255, 255, 0.22) 100%);
  opacity: 0.5; }

/* 前景内容 */
.hero-inner { position: relative; z-index: 2; max-width: 860px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-soft);
  padding: 7px 16px; border-radius: 999px; backdrop-filter: blur(8px);
}
.hero-title {
  font-size: clamp(34px, 6vw, 62px); font-weight: 900; line-height: 1.08;
  letter-spacing: -0.03em; margin: 0; color: var(--text);
}
.hero-title .grad {
  background: linear-gradient(115deg, var(--brand), var(--brand-2) 52%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px var(--brand-soft));
}
.hero-sub {
  font-size: clamp(14px, 1.7vw, 17px); line-height: 1.7; color: var(--text-soft);
  max-width: 680px; margin: 0; font-weight: 500; text-align: justify;
}

.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.hero-cta {
  border: none; cursor: pointer; font-family: inherit; font-size: 15.5px; font-weight: 700;
  letter-spacing: 0.01em; padding: 14px 30px; border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease;
}
.hero-cta.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 12px 30px var(--brand-soft);
}
.hero-cta.primary:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 40px rgba(2, 132, 199, 0.36); }
.hero-cta.ghost {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
}
.hero-cta.ghost:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); box-shadow: 0 12px 30px var(--brand-soft); }

/* 首屏指标条（4 列竖卡，数字行固定高度垂直居中，避免压底边框） */
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  width: 100%; max-width: 720px; margin-top: 10px;
}
.hero-stat {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 108px; padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 30px rgba(15, 23, 42, 0.10);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.hero-stat::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity: 0.6; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.hero-stat:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16), 0 0 0 1px var(--brand-soft); }
.hs-v {
  font-family: var(--font-num); font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; letter-spacing: -0.02em;
  height: 40px; min-height: 40px; line-height: 1.2; color: var(--brand); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; overflow: visible;
}
.hs-v small { font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--text-faint); white-space: nowrap; }
.hs-k { font-size: 12px; color: var(--text-soft); font-weight: 600; margin-top: 6px; letter-spacing: 0.01em; white-space: nowrap; }
.hero-guide { margin: 12px 0 0; font-size: 13px; color: var(--text-soft); text-align: center; }

/* 滚动指示器 */
.hero-scroll { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 16px; display: grid; place-items: start center; }
.hero-scroll span { width: 4px; height: 9px; border-radius: 4px; background: var(--brand); margin-top: 7px; animation: heroScroll 1.7s ease-in-out infinite; }
@keyframes heroScroll { 0% { opacity: 0; transform: translateY(0); } 35% { opacity: 1; } 70%,100% { opacity: 0; transform: translateY(14px); } }

/* ---------- P&ID ---------- */
.pid-svg { width: 100%; height: auto; min-width: 760px; }
.pid-header { font-size: 17px; font-weight: 800; fill: var(--text); letter-spacing: -0.01em; }
.pid-caption { font-size: 12.5px; fill: var(--text-soft); }
.pid-tag { font-size: 11px; font-weight: 800; fill: var(--brand); text-anchor: middle; }
.pid-title { font-size: 14px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.pid-sub { font-size: 11.5px; fill: var(--text-soft); text-anchor: middle; }
/* P&ID 背景面板与栅格 */
.pid-bg { fill: rgba(127, 140, 170, 0.05); stroke: var(--border); stroke-width: 1; }
.pid-box { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.6; transition: stroke-width .18s ease, stroke .18s ease; }
.pid-node:hover { filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.5)); }
.pid-node:hover .pid-box { stroke-width: 2.8; }
.pid-node:hover .pid-title { fill: var(--brand-2); }
.pid-line { stroke: var(--pipe); stroke-width: 2.2; fill: none; }
.pid-head { fill: var(--pipe); }
.pid-return { stroke: var(--brand); stroke-dasharray: 6 5; }
.pid-flow-label { font-size: 11px; fill: var(--text-faint); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 3.4px; stroke-linejoin: round; }
.pid-line.pid-sludge { stroke: #fb923c; fill: none; }
.pid-head.pid-sludge { stroke: #fb923c; fill: #fb923c; }
.pid-node.c1 .pid-box { stroke: #38bdf8; }
.pid-node.c2 .pid-box { stroke: #22d3ee; }
.pid-node.c3 .pid-box { stroke: #34d399; }
.pid-node.c4 .pid-box { stroke: #818cf8; }
.pid-node.c5 .pid-box { stroke: #a78bfa; }
.pid-node.c6 .pid-box { stroke: #2dd4bf; }
.pid-node.c7 .pid-box { stroke: #fb923c; }
.pid-node.c8 .pid-box { stroke: #60a5fa; }
.pid-node.c9 .pid-box { stroke: #f472b6; }
.pid-node.c10 .pid-box, .pid-aux.c10 .pid-box { stroke: #fbbf24; }
.pid-node.c11 .pid-box, .pid-aux.c11 .pid-box { stroke: #fb923c; }
.pid-denit .pid-line { stroke: #f472b6; fill: none; }
.pid-denit .pid-head { fill: #f472b6; }
.pid-skimmer .pid-line { stroke: #c99520; fill: none; }
.pid-skimmer .pid-head { fill: #c99520; }
.pid-ozone .pid-line, .pid-ozone-line { stroke: #9f51ad; stroke-dasharray: 4 3; fill: none; }
.pid-ozone .pid-head { fill: #9f51ad; }
.pid-return.pid-head { fill: #0ea5e9; }
.pid-flow-label.denit-txt { fill: #f472b6; }
/* 仪表轨 */
.pid-rail { fill: rgba(79, 70, 229, 0.07); stroke: var(--brand-2); stroke-width: 1.2; stroke-dasharray: 5 4; }
.pid-inst .pid-bubble { fill: var(--brand-2); stroke: #ffffff; stroke-width: 1.4; transition: stroke .15s ease, stroke-width .15s ease; }
.pid-inst:hover .pid-bubble { stroke: var(--brand); stroke-width: 2.4; }
.pid-bubble-txt { font-size: 10.5px; font-weight: 800; fill: #ffffff; text-anchor: middle; }
.pid-inst-label { font-size: 10.5px; fill: var(--text-faint); text-anchor: middle; }
.pid-inst-label.side { text-anchor: start; fill: var(--text); font-weight: 600; font-size: 11px; }
.pid-signal { stroke: var(--brand-2); stroke-width: 1.6; stroke-dasharray: 4 4; fill: none; }
.pid-bus { stroke: var(--brand-2); stroke-width: 2.4; stroke-dasharray: 8 4; fill: none; opacity: 0.85; }
.pid-control { stroke: #f59e0b; stroke-width: 2.2; stroke-dasharray: 2 3; fill: none; }
.pid-valve .pid-valve-box { fill: #f59e0b; stroke: #d97706; stroke-width: 1.5; }
.pid-dcs .pid-box { stroke: var(--brand); }
.pid-sub.left { text-anchor: start; }
.pid-title.left { text-anchor: start; }
.pid-legend .pid-sub { fill: var(--text-soft); text-anchor: start; }
.pid-legend .pid-bubble { fill: var(--brand-2); stroke: #ffffff; stroke-width: 1.2; }
.pid-legend .pid-valve-box { fill: #f59e0b; stroke: #d97706; }
/* 比水耗胶囊 */
.pid-swu { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1; }
.pid-swu-dot { fill: var(--brand); }
.pid-swu-txt { font-size: 12px; font-weight: 700; fill: var(--brand); text-anchor: start; }

/* ---------- Optimizer / Library ---------- */
.panel.glass .form-grid { grid-template-columns: repeat(2, 1fr); }

#libList table.data th:nth-child(5), #libList table.data td:nth-child(5) { text-align: right; }
#libList .toggle-btn { padding: 6px 12px; font-size: 12px; margin-left: 4px; }
#libCompare .metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 14px 26px; }

/* ======== 供应商库 ======== */
#panel-suppliers { padding: 22px 26px; }
.supplier-toolbar { display:flex; flex-wrap:wrap; gap:.65rem; align-items:center; margin-bottom:1rem; }
.supplier-toolbar-btns { display:flex; gap:.55rem; align-items:center; margin-left:auto; }
.supplier-submit-btn { background:transparent; border:1px solid var(--brand); color:var(--brand); border-radius:10px; padding:.5rem .9rem; cursor:pointer; font-size:.82rem; transition:all .15s; white-space:nowrap; }
.supplier-submit-btn:hover { background:var(--brand); color:#fff; }
.supplier-region { max-width:150px; }
.submit-tip { font-size:.78rem; color:var(--text-faint); margin:0 0 .8rem; text-align:left; }
.submit-field { margin-bottom:.7rem; text-align:left; }
.submit-field label { display:block; font-size:.76rem; color:var(--text-soft); margin-bottom:.3rem; }
.submit-field .req { color:#ef4444; margin-left:2px; }
.submit-field input, .submit-field select, .submit-field textarea { width:100%; box-sizing:border-box; }
.submit-err { color:#ef4444; font-size:.78rem; margin:.5rem 0; text-align:left; }
.supplier-submit-ok { position:fixed; top:22px; left:50%; transform:translateX(-50%); background:#059669; color:#fff; padding:.7rem 1.3rem; border-radius:10px; z-index:999; font-size:.88rem; box-shadow:0 4px 16px rgba(0,0,0,.25); animation:toastIn .25s; }
.admin-submissions { margin-bottom:1.5rem; }
.admin-submissions h3 { margin-bottom:.5rem; font-size:1rem; }
.submission-count { background:var(--brand); color:#fff; border-radius:10px; padding:1px 10px; font-size:.78rem; margin-left:6px; }
.submission-card { border:1px solid var(--border); border-radius:12px; padding:.85rem 1rem; margin-bottom:.8rem; text-align:left; background:var(--surface-2); }
.submission-head { display:flex; gap:.6rem; align-items:center; font-size:.88rem; margin-bottom:.35rem; flex-wrap:wrap; }
.submission-cat { font-size:.72rem; color:var(--brand); border:1px solid var(--brand); border-radius:8px; padding:1px 8px; }
.submission-line { font-size:.8rem; color:var(--text-soft); margin-top:.15rem; }
.submission-desc { font-size:.8rem; color:var(--text-soft); margin-top:.4rem; line-height:1.6; }
.submission-acts { display:flex; gap:.6rem; margin-top:.7rem; }
.submission-none, .submission-loading { color:var(--text-faint); font-size:.8rem; padding:.5rem 0; text-align:left; }
.admin-act-btn.approve { border-color:#059669; color:#059669; }
.admin-act-btn.approve:hover { background:rgba(5,150,105,.15); }
.admin-act-btn.reject { border-color:#ef4444; color:#ef4444; }
.admin-act-btn.reject:hover { background:rgba(239,68,68,.15); }
.supplier-categories { display:flex; gap:.4rem; flex-wrap:wrap; flex:1; }
.supplier-categories .chip { border:1px solid rgba(2,132,199,.32); background:rgba(255,255,255,.72); color:#0f172a; padding:.35rem .85rem; border-radius:99px; cursor:pointer; font-size:.75rem; transition:all .18s; user-select:none; box-shadow:0 2px 8px rgba(15,23,42,.05); }
.supplier-categories .chip:hover { background:rgba(2,132,199,.10); border-color:rgba(2,132,199,.5); }
.supplier-categories .chip.on { background:var(--brand-gradient); border-color:transparent; color:#fff; box-shadow:0 6px 16px var(--brand-soft); }
.supplier-categories .chip .count { opacity:.6; margin-left:.3rem; font-size:.68rem; }
.supplier-search { width:220px; }
.supplier-search .text-input { padding:.35rem .7rem; font-size:.78rem; width:100%; }

.supplier-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(290px, 1fr)); gap:.75rem; }
.supplier-loading, .supplier-none { color:var(--text-faint); padding:2rem 0; text-align:center; grid-column:1/-1; }

.supplier-card { background:rgba(255,255,255,.72); border:1px solid rgba(15,23,42,.10); border-radius:12px; padding:1rem 1.05rem; transition:border-color .18s, background .18s; cursor:pointer; display:flex; flex-direction:column; gap:.45rem; box-shadow:0 8px 28px rgba(15,23,42,.08); }
.supplier-card:hover { background:rgba(255,255,255,.92); border-color:rgba(2,132,199,.45); box-shadow:0 12px 34px rgba(15,23,42,.12); }
.supplier-card .sup-header { display:flex; align-items:baseline; justify-content:space-between; gap:.5rem; }
.supplier-card .sup-name { font-weight:600; font-size:.88rem; color:#0f172a; flex:1; }
.supplier-card .sup-brand { font-size:.7rem; color:#0369a1; background:rgba(2,132,199,.12); border:1px solid rgba(2,132,199,.18); padding:.12rem .5rem; border-radius:99px; white-space:nowrap; }
.supplier-card .sup-product { font-size:.73rem; color:#334155; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.supplier-card .sup-meta { font-size:.7rem; color:var(--text-faint); display:flex; flex-wrap:wrap; gap:.6rem; }
.supplier-card .sup-meta span { white-space:nowrap; }
.supplier-card .sup-capabilities { font-size:.68rem; color:#0369a1; line-height:1.4; }
.supplier-card .sup-tags { display:flex; flex-wrap:wrap; gap:.3rem; margin-top:.1rem; }
.supplier-card .sup-tag { font-size:.65rem; background:var(--surface-2); color:var(--text-soft); padding:.12rem .5rem; border-radius:99px; border:1px solid var(--border); }
.supplier-card .sup-desc { font-size:.7rem; color:var(--text-faint); line-height:1.4; margin-top:.1rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }

/* 数据看板统计卡片 */
.dash-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:.75rem; margin-top:.75rem; }
.dash-card { background:rgba(255,255,255,.72); border:1px solid rgba(15,23,42,.10); border-radius:14px; padding:1rem; display:flex; flex-direction:column; align-items:center; gap:.3rem; text-align:center; box-shadow:0 8px 28px rgba(15,23,42,.08); }
.dash-card-icon { font-size:1.5rem; }
.dash-card-num { font-size:1.6rem; font-weight:700; color:#0f172a; line-height:1.1; font-variant-numeric:tabular-nums; }
.dash-card-label { font-size:.72rem; color:var(--text-faint); }

/* 供应商详情弹窗 */
.supplier-modal-overlay { position:fixed; inset:0; background:hsla(0,0%,0%,.55); z-index:200; display:flex; align-items:center; justify-content:center; animation:fadeIn .18s; }
.supplier-modal { background:rgba(255,255,255,.96); border:1px solid rgba(15,23,42,.12); box-shadow:0 24px 60px rgba(15,23,42,.18); border-radius:16px; padding:1.5rem; max-width:480px; width:calc(100% - 2rem); max-height:85vh; overflow-y:auto; animation:toastIn .25s; }
.supplier-modal .modal-close { float:right; background:none; border:none; color:var(--text-faint); font-size:1.2rem; cursor:pointer; padding:0 .3rem; }
.supplier-modal .modal-close:hover { color:#0f172a; }
.supplier-modal .modal-name { font-size:1rem; font-weight:600; color:#0f172a; margin-bottom:.3rem; padding-right:1.5rem; }
.supplier-modal .modal-brand { font-size:.75rem; color:#0369a1; margin-bottom:.8rem; }
.supplier-modal .modal-section { margin-bottom:.8rem; }
.supplier-modal .modal-label { font-size:.68rem; color:var(--text-faint); margin-bottom:.2rem; text-transform:uppercase; letter-spacing:.5px; }
.supplier-modal .modal-value { font-size:.78rem; color:#334155; line-height:1.5; }
.supplier-modal .modal-value a { color:#0284c7; text-decoration:none; }
.supplier-modal .modal-value a:hover { text-decoration:underline; }
.supplier-modal .modal-tags { display:flex; flex-wrap:wrap; gap:.3rem; }
.supplier-modal .modal-tag { font-size:.7rem; background:rgba(2,132,199,.10); color:#0369a1; border:1px solid rgba(2,132,199,.16); padding:.15rem .6rem; border-radius:99px; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes toastIn { from{opacity:0; transform:translateY(12px) scale(.96)} to{opacity:1; transform:none} }

@media (max-width: 720px) {
  .supplier-toolbar { flex-direction:column; }
  .supplier-search { width:100%; }
  .supplier-grid { grid-template-columns:1fr; }
  #panel-suppliers { padding: 16px 14px; }
}

/* ======== 供应商管理端 ======== */
.admin-lock-btn { background:var(--surface); border:1px solid var(--border); color:var(--text-soft); font-size:.9rem; padding:.35rem .6rem; border-radius:8px; cursor:pointer; transition:all .18s; line-height:1; }
.admin-lock-btn:hover { background:rgba(2,132,199,.10); border-color:rgba(2,132,199,.4); color:#0f172a; }
.admin-lock-btn.on { background:rgba(16,185,129,.14); border-color:rgba(16,185,129,.4); color:#047857; }

/* ======== 统一导航入口（管理登录 / 控制台） ======== */
.site-nav .nav-admin, .site-nav .nav-console { text-decoration:none; color:var(--text-soft); font-size:13px; font-weight:600; padding:7px 12px; border-radius:999px; border:1px solid var(--border); transition:all .25s ease; margin-left:4px; flex-shrink:0; white-space:nowrap; }
.site-nav .nav-admin:hover, .site-nav .nav-console:hover { color:var(--text); border-color:var(--brand); background:var(--brand-soft); }
.site-nav .nav-admin.on, .site-nav .nav-console.active { color:#fff; background:linear-gradient(135deg, var(--brand), var(--brand-2)); border-color:transparent; }
.nav-admin.hidden { display:none; }

.admin-add-btn { background:rgba(2,132,199,.14); border:1px solid rgba(2,132,199,.4); color:#0369a1; font-size:.78rem; padding:.35rem 1rem; border-radius:8px; cursor:pointer; transition:all .18s; white-space:nowrap; }
.admin-add-btn:hover { background:rgba(2,132,199,.22); border-color:rgba(2,132,199,.5); }

/* 卡片上的管理按钮 */
.supplier-card.admin-mode { position:relative; }
.card-admin-actions { position:absolute; top:.5rem; right:.5rem; display:flex; gap:.3rem; z-index:5; }
.admin-act-btn { background:var(--surface); color:var(--text-soft); border:1px solid var(--border); border-radius:6px; padding:.25rem .45rem; font-size:.75rem; cursor:pointer; transition:all .15s; line-height:1; }
.admin-act-btn.edit:hover { background:rgba(2,132,199,.10); border-color:rgba(2,132,199,.45); color:#075985; }
.admin-act-btn.del:hover { background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.45); color:#b91c1c; }
.admin-act-btn.hide-btn:hover { background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.45); color:#a16207; }

/* 供应商卡片隐藏状态 */
.supplier-card.is-hidden { opacity:.5; }
.supplier-card.is-hidden::before { content:""; position:absolute; inset:0; background:rgba(100,116,139,.18); border-radius:14px; z-index:1; pointer-events:none; }
.supplier-card.is-hidden .card-admin-actions { z-index:6; }
.sup-hidden-badge { display:inline-block; font-size:.68rem; background:rgba(245,158,11,.14); border:1px solid rgba(245,158,11,.35); color:#a16207; border-radius:4px; padding:.1rem .4rem; margin-left:.4rem; vertical-align:middle; }
.sup-status-badge { display:inline-block; font-size:.62rem; background:rgba(239,68,68,.10); border:1px solid rgba(239,68,68,.30); color:#b91c1c; border-radius:4px; padding:.1rem .35rem; margin-left:.3rem; vertical-align:middle; }

/* 管理登录弹窗 */
.admin-login-modal { max-width:360px; }

/* 编辑表单 */
.supplier-editor-modal { max-width:520px; }
.supplier-form { display:flex; flex-direction:column; gap:.75rem; }
.supplier-form .form-row { display:flex; flex-direction:column; gap:.25rem; }
.supplier-form .form-row label { font-size:.7rem; color:var(--text-faint); text-transform:uppercase; letter-spacing:.4px; }
.supplier-form .form-row .req { color:#f66; }
.supplier-form .form-row .text-input { padding:.45rem .7rem; font-size:.78rem; width:100%; background:#fff; border:1px solid rgba(15,23,42,.14); border-radius:8px; color:#0f172a; }
.supplier-form .form-row .text-input:focus { outline:none; border-color:rgba(2,132,199,.5); }
.supplier-form .form-row textarea.text-input { resize:vertical; min-height:60px; font-family:inherit; }
.supplier-form .form-row-inline { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
.supplier-form .form-row-inline > div { display:flex; flex-direction:column; gap:.25rem; }
.supplier-form .form-row select.text-input { appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' opacity='.4' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right .6rem center; padding-right:2rem; }
.supplier-form .form-actions { display:flex; gap:.5rem; justify-content:flex-end; margin-top:.3rem; }
.supplier-form .form-actions .toggle-btn { padding:.4rem 1.2rem; font-size:.78rem; }
.supplier-form .form-actions .toggle-btn.on { background:rgba(2,132,199,.14); border-color:rgba(2,132,199,.5); color:#075985; }

/* 详情弹窗中的管理按钮 */
.modal-admin-footer { display:flex; gap:.5rem; margin-top:1rem; padding-top:.8rem; border-top:1px solid var(--border); }
.modal-admin-footer .admin-act-btn { font-size:.78rem; padding:.35rem .8rem; border-radius:8px; }

/* ======== 知识库管理面板 ======== */
#panel-knowledge { padding:18px 22px; }
.kb-header { display:flex; align-items:center; gap:.75rem; margin-bottom:1rem; flex-wrap:wrap; }
.kb-cat-select { background:#fff; border:1px solid rgba(15,23,42,.14); border-radius:8px; color:#0f172a; font-size:.82rem; padding:.45rem 2rem .45rem .75rem; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' opacity='.6' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right .55rem center; cursor:pointer; min-width:220px; }
.kb-cat-select:focus { outline:none; border-color:rgba(2,132,199,.5); }
.kb-header-actions { display:flex; align-items:center; gap:.5rem; margin-left:auto; }
.kb-save-btn { background:var(--brand); border:1px solid var(--brand); color:#fff; font-size:.78rem; padding:.4rem 1rem; border-radius:8px; cursor:pointer; transition:all .18s; }
.kb-save-btn:hover { background:var(--brand-strong, #075985); }
.kb-reset-btn { background:rgba(239,68,68,.08); border:1px solid rgba(239,68,68,.3); color:#b91c1c; font-size:.75rem; padding:.35rem .8rem; border-radius:8px; cursor:pointer; transition:all .18s; }
.kb-reset-btn:hover { background:rgba(239,68,68,.14); color:#991b1b; border-color:rgba(239,68,68,.5); }
.kb-badge { background:rgba(16,185,129,.12); border:1px solid rgba(16,185,129,.35); color:#047857; font-size:.7rem; padding:.2rem .6rem; border-radius:12px; }
.kb-hint { color:var(--text-faint); font-size:.78rem; text-align:center; padding:2rem 0; }

.kb-table-wrap { overflow-x:auto; }
.kb-table { width:100%; border-collapse:collapse; font-size:.75rem; }
.kb-table th { text-align:left; color:var(--text-faint); font-weight:500; padding:.5rem .6rem; border-bottom:1px solid var(--border); text-transform:uppercase; letter-spacing:.4px; font-size:.68rem; }
.kb-table td { padding:.45rem .6rem; border-bottom:1px solid var(--border); vertical-align:middle; }
.kb-table tr:hover td { background:var(--brand-soft); }
.kb-table tr.overridden td { background:rgba(16,185,129,.08); }
.kb-table tr.overridden:hover td { background:rgba(16,185,129,.14); }
.kb-table .kb-path { color:var(--text-soft); font-family:var(--font-num); font-size:.7rem; max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.kb-table .kb-default { color:var(--text-faint); font-family:var(--font-num); font-size:.7rem; }
.kb-table .kb-input { background:#fff; border:1px solid rgba(15,23,42,.14); border-radius:6px; color:#0f172a; font-size:.73rem; padding:.3rem .5rem; width:100%; max-width:160px; font-family:var(--font-num); }
.kb-table .kb-input:focus { outline:none; border-color:var(--brand); }
.kb-table .kb-input.changed { border-color:#ca8a04; background:rgba(245,158,11,.10); }
.kb-table .kb-notes-input { background:var(--surface); border:1px solid var(--border); border-radius:6px; color:var(--text-soft); font-size:.7rem; padding:.3rem .5rem; width:100%; max-width:140px; }
.kb-table .kb-notes-input:focus { outline:none; border-color:var(--brand); color:#0f172a; }
.kb-table .kb-reset-cell { cursor:pointer; color:#94a3b8; font-size:.7rem; transition:all .15s; padding:.3rem .5rem; }
.kb-table .kb-reset-cell:hover { color:#dc2626; }
.kb-table tr.overridden .kb-reset-cell { color:#b91c1c; }

/* 表格移动端横向滚动 + 首列吸顶（sticky） */
@media (max-width: 720px) {
  #userManageList { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kb-table th:first-child, .kb-table td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--surface-2);
  }
  .kb-table tr:hover td:first-child,
  .kb-table tr.overridden td:first-child,
  .kb-table tr.overridden:hover td:first-child { background: var(--surface-2); }
}

/* 审计日志 */
.kb-audit-section { margin-top:1.2rem; border-top:1px solid var(--border); padding-top:.8rem; }
.kb-audit-title { font-size:.78rem; color:var(--text-faint); cursor:pointer; margin:0 0 .5rem; }
.kb-audit-title:hover { color:var(--text); }
.kb-audit-list { display:none; max-height:200px; overflow-y:auto; font-size:.7rem; }
.kb-audit-list.open { display:block; }
.kb-audit-item { padding:.35rem 0; border-bottom:1px solid var(--border); color:var(--text-soft); display:flex; gap:.5rem; align-items:baseline; }
.kb-audit-item .audit-action { color:#0369a1; font-weight:600; min-width:3rem; }
.kb-audit-item .audit-action.del { color:#dc2626; }
.kb-audit-item .audit-action.reset { color:#a16207; }
.kb-audit-item .audit-key { font-family:var(--font-num); color:var(--text-faint); }
.kb-audit-item .audit-time { color:#94a3b8; margin-left:auto; white-space:nowrap; }

/* ======== 面板间顺序导航按钮 ======== */
.panel-nav {
  display: flex; justify-content: center; padding: 22px 26px 26px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.panel-nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; font-family: inherit; font-size: 14px; font-weight: 700;
  border: 1px solid var(--brand);
  border-radius: 999px; cursor: pointer;
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 2px 12px var(--brand-soft);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.panel-nav-btn:hover {
  transform: translateY(-2px) scale(1.03);
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 8px 28px var(--brand-soft);
}
.panel-nav-btn:active { transform: translateY(0) scale(0.98); }
.panel-nav-btn .arrow { font-size: 16px; transition: transform 0.2s ease; }
.panel-nav-btn:hover .arrow { transform: translateX(3px); }

/* ===== 分享页 ===== */
.share-loading { text-align: center; padding: 60px 20px; font-size: 16px; color: var(--text-soft); }
.share-error { text-align: center; padding: 60px 20px; }
.share-card { max-width: 640px; margin: 0 auto; }
.share-head { text-align: center; margin-bottom: 20px; }
.share-head h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.share-sub { font-size: 14px; color: var(--text-soft); }
.share-date { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.share-params { margin-top: 18px; }
.share-params h3, .share-compare h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.share-kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.share-meta { text-align: center; font-size: 12px; color: var(--text-faint); padding: 12px 0; }
.share-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.share-compare { margin-top: 22px; padding-top: 16px; border-top: 2px solid var(--brand); }
.share-cols { display: grid; grid-template-columns: 1fr; gap: 0; }

/* —— 统一登录弹窗：用户 / 管理员页签 —— */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 1rem; }
.auth-tab {
  flex: 1; padding: 8px 0; border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, .16); background: rgba(15, 23, 42, .04);
  color: #000; font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .2s ease; white-space: nowrap;
}
.auth-tab:hover { color: #000; border-color: var(--brand); background: rgba(13, 124, 134, .08); }
.auth-tab.on {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #000; border-color: transparent; box-shadow: 0 6px 18px var(--brand-soft);
}

/* ======== 移动端汉堡菜单（P3-d：375px 窄屏导航折叠） ======== */
/* 默认桌面隐藏；≤640px 显示按钮并把 #siteNav 收进下拉面板，点击切换 .gn-wrap.nav-open */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fff);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px auto;
  background: var(--text-soft, #364c66);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle:hover { border-color: var(--brand); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  #siteNav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 12px;
    background: var(--surface, #fff);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--card-shadow);
  }
  .gn-wrap.nav-open #siteNav { display: flex; }
}

/* UI-05：移动端汉堡菜单打开时锁定背景滚动 */
body.nav-lock { overflow: hidden; }

/* ---------- D-131：控件高度与引擎阶段导航视觉收口 ----------
   单行控件统一 46px；复合导航桌面优先单行，中等宽度按“设计/输出 + 校核”分层，
   手机按阶段分组堆叠，避免按钮被挤压成难以点击的窄条。 */
:where(
  #view-landing .cm input:not([type="hidden"]),
  #view-landing .cm select,
  #view-landing .modal .field input,
  #view-community .com-form input,
  #view-community .com-reply-form input,
  #view-suppliers .supplier-search .text-input,
  #view-admin #designAdminName,
  #view-admin #designAdminVis,
  #view-admin .kb-cat-select,
  .submit-field input,
  .submit-field select,
  .supplier-form .form-row .text-input,
  #view-engine #libName
) {
  height: 46px;
  min-height: 46px;
  box-sizing: border-box;
  line-height: 1.2;
}
:where(
  #view-landing .modal .field textarea,
  #view-community .com-form textarea,
  #view-community .com-reply-form textarea,
  .submit-field textarea,
  .supplier-form .form-row textarea.text-input
) {
  height: auto;
  min-height: 92px;
  box-sizing: border-box;
  line-height: 1.55;
}

.tabs-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin: 18px auto 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.tabs-toolbar .tabs {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
}
.tabs-toolbar .tabs-stage {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.tabs-toolbar .tabs-stage::before {
  content: attr(data-stage-label);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 30px;
  padding: 0 7px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
  writing-mode: horizontal-tb;
}
.tabs-toolbar .tabs-stage:has(.tab.active) {
  border-color: rgba(2, 132, 199, .28);
  background: linear-gradient(135deg, rgba(239,246,255,.92), rgba(240,253,250,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.86);
}
.tabs-toolbar .tabs-stage:has(.tab.active)::before { color: var(--brand); }
.tabs-toolbar .tab {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  justify-content: center;
  backdrop-filter: none;
}
.tabs-toolbar .tab:hover { transform: translateY(-1px); }
.tabs-toolbar .tab.active { box-shadow: 0 7px 18px rgba(2, 132, 199, .2); }
.tabs-toolbar .tabs-actions { min-height: 40px; }
.tabs-toolbar .tabs-actions .export-btn {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 11px;
  border-color: rgba(2, 132, 199, .32);
  background: linear-gradient(135deg, var(--brand-soft), rgba(7,84,93,.08));
  color: var(--brand);
  box-shadow: 0 6px 16px rgba(2,132,199,.08);
  font-weight: 800;
}
.tabs-toolbar .tabs-actions .export-btn:hover {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 9px 20px rgba(2,132,199,.22);
}

@media (max-width: 1120px) and (min-width: 761px) {
  .tabs-toolbar { align-items: start; }
  .tabs-toolbar .tabs { flex-wrap: wrap; align-content: start; }
  .tabs-toolbar .tabs-stage { flex: 1 1 auto; }
  .tabs-toolbar .tabs-stage:nth-child(2) { flex-basis: 100%; order: 3; }
  .tabs-toolbar .tabs-stage:nth-child(2) .tab { flex: 1 1 auto; }
}

@media (max-width: 760px) {
  .tabs-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    margin: 12px 0 16px;
    border-radius: 16px;
  }
  .tabs-toolbar .tabs {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .tabs-toolbar .tabs-stage {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    box-sizing: border-box;
  }
  .tabs-toolbar .tabs-stage::before { min-width: 42px; padding-inline: 4px; }
  .tabs-toolbar .tabs-stage .tab { flex: 1 1 auto; min-width: 0; padding-inline: 9px; }
  .tabs-toolbar .tabs-actions { width: 100%; justify-content: stretch; }
  .tabs-toolbar .tabs-actions .export-btn { width: 100%; }
}

/* ============================================================
   D-134 全站视觉重构收口：工程引擎、Workspace 与业务页面
   ============================================================ */
#view-engine.wrap {
  max-width: 1320px;
  padding: 22px 24px 72px;
}
#view-engine .hero {
  min-height: clamp(420px, 56vh, 600px);
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  text-align: left;
  justify-content: stretch;
  background: linear-gradient(145deg, var(--surface), var(--bg-grad-1));
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
#view-engine .hero-bg { opacity: .32; }
#view-engine .hero-aurora { opacity: .05; filter: none; animation: none; }
#view-engine .hero-circuit { opacity: .14; }
#view-engine .hero-scrim { opacity: .12; }
#view-engine .hero-inner { max-width: none; align-items: flex-start; gap: 16px; padding-left: clamp(4px, 3vw, 34px); }
#view-engine .hero-title { max-width: 620px; }
#view-engine .hero-sub { max-width: 610px; text-align: left; }
#view-engine .hero-cta-row { justify-content: flex-start; }
#view-engine .hero-stats { max-width: 620px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
#view-engine .hero-stat { min-height: 88px; box-shadow: none; backdrop-filter: none; background: rgba(255,255,255,.88); }
#view-engine .hero-scroll { display: none; }
#view-engine .engine-context,
#view-engine .tabs-toolbar { background: var(--surface); border-color: var(--border); }
#view-engine .panel.glass { backdrop-filter: none; box-shadow: 0 10px 26px rgba(16,42,53,.06); }
#view-engine .model-legend { background: var(--surface); color: var(--text); border-color: var(--border); backdrop-filter: none; box-shadow: var(--card-shadow); }
#view-engine .pid-rail { fill: var(--brand-soft); stroke: var(--brand); }
#view-engine .pid-signal,
#view-engine .pid-bus { stroke: var(--brand); }

#view-workspace.active { background: var(--bg); }
#view-workspace .workspace-shell { max-width: 1240px; padding: 42px 24px 80px; }
#view-workspace .ws-head { border-bottom-color: var(--border); padding-bottom: 20px; }
#view-workspace .ws-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#view-workspace .ws-stat { background: var(--surface); border-color: var(--border); box-shadow: none; border-radius: var(--radius-sm); }
#view-workspace .ws-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#view-workspace .ws-card { background: var(--surface); border-color: var(--border); border-left: 3px solid var(--brand); box-shadow: none; }
#view-workspace .ws-card:hover { border-color: var(--brand); box-shadow: var(--card-shadow); transform: translateY(-2px); }
#view-workspace .ws-badge.vis-shared,
#view-workspace .ws-badge.vis-public { color: var(--brand-strong); background: var(--brand-soft); }
#view-workspace .ws-empty,
#view-workspace .ws-login { background: var(--surface); border-color: var(--border-strong); box-shadow: none; }
#view-workspace .ws-login-ico { font-size: 0; background: var(--brand-soft); border-color: var(--border); }
#view-workspace .ws-login-ico::before { content: none; }
#view-workspace .ws-login-ico svg { color: var(--brand-strong); }
#view-workspace .ws-field .text-input,
#view-workspace .ws-field textarea { background: var(--surface); border-color: var(--border-strong); }
#view-workspace .ws-scheme { background: var(--surface); border-color: var(--border); box-shadow: none; }
#view-workspace .ws-scheme-binding { color: var(--accent); background: var(--surface-2); border-color: var(--border); }
#view-workspace .ws-calc { background: var(--surface-2); border-color: var(--border); }
#view-workspace .ws-metric { background: var(--surface); border-color: var(--border); }
#view-workspace .ws-inline-edit { background: var(--surface-2); border-color: var(--border); }

/* ---- P1 Commissioning Intelligence（Project Workspace / Slice C2）---- */
.workspace-shell .ws-commissioning { margin-top: 28px; }
.workspace-shell .ws-commissioning-head,
.workspace-shell .ws-comm-toolbar,
.workspace-shell .ws-comm-card-head,
.workspace-shell .ws-comm-test-head,
.workspace-shell .ws-comm-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.workspace-shell .ws-commissioning-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.workspace-shell .ws-commissioning-head .ws-section-title { margin-bottom: 5px; }
.workspace-shell .ws-commissioning-subtitle { margin: 0; color: var(--text-faint); font-size: 12px; line-height: 1.7; }
.workspace-shell .ws-comm-scope,
.workspace-shell .ws-comm-role { color: var(--brand-strong); background: var(--brand-soft); }
.workspace-shell .ws-comm-toolbar { align-items: center; margin: 14px 0; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.workspace-shell .ws-comm-role { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.workspace-shell .ws-comm-role-muted { margin-left: 7px; color: #854d0e; background: rgba(251,191,36,.14); }
.workspace-shell .ws-comm-baseline-picker { display: flex; align-items: center; gap: 8px; }
.workspace-shell .ws-comm-select-label { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.workspace-shell .ws-comm-baseline-select { min-width: 210px; min-height: 38px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.workspace-shell .ws-comm-empty-note { margin-bottom: 14px; }
.workspace-shell .ws-comm-form-title { margin-bottom: 5px; color: var(--text); font-size: 16px; font-weight: 850; letter-spacing: -.02em; }
.workspace-shell .ws-comm-form-note { margin: 0 0 14px; color: var(--text-soft); font-size: 12.5px; line-height: 1.7; }
.workspace-shell .ws-comm-baseline-form,
.workspace-shell .ws-comm-test-form { max-width: none; margin: 0 0 16px; padding: 18px; background: var(--surface-2); }
.workspace-shell .ws-comm-blocker { min-height: 0; margin: 0 0 14px; padding: 14px; text-align: left; }
.workspace-shell .ws-comm-baseline-card { margin-bottom: 16px; padding: 18px; background: var(--surface); }
.workspace-shell .ws-comm-baseline-card.is-historical { border-color: rgba(2,132,199,.28); }
.workspace-shell .ws-comm-kicker { margin-bottom: 5px; color: var(--text-faint); font: 800 10px/1.2 var(--font-mono); letter-spacing: .14em; }
.workspace-shell .ws-comm-card-head h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: var(--text); font-size: 18px; }
.workspace-shell .ws-comm-card-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.workspace-shell .ws-comm-status { vertical-align: middle; color: var(--text-soft); background: var(--surface-2); }
.workspace-shell .ws-comm-status-IN_PROGRESS { color: #854d0e; background: rgba(251,191,36,.16); }
.workspace-shell .ws-comm-status-REVIEW { color: #1e40af; background: rgba(59,130,246,.12); }
.workspace-shell .ws-comm-status-FROZEN { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-comm-status-CANCELLED { color: #7c2d12; background: rgba(148,163,184,.18); }
.workspace-shell .ws-comm-history-note { margin: 10px 0 14px; color: #075985; background: rgba(56,189,248,.10); border-color: rgba(2,132,199,.22); }
.workspace-shell .ws-comm-live-note { margin: 10px 0 14px; }
.workspace-shell .ws-comm-facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.workspace-shell .ws-comm-facts > div { min-width: 0; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.workspace-shell .ws-comm-facts span { display: block; margin-bottom: 4px; color: var(--text-faint); font-size: 11px; }
.workspace-shell .ws-comm-facts b,
.workspace-shell .ws-comm-facts code { display: block; min-width: 0; overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.workspace-shell .ws-comm-facts code { font-family: var(--font-mono); }
.workspace-shell .ws-comm-fact-wide { grid-column: span 2; }
.workspace-shell .ws-comm-completeness { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); color: var(--text-soft); font-size: 12px; }
.workspace-shell .ws-comm-completeness b { color: var(--text); }
.workspace-shell .ws-comm-completeness small { flex-basis: 100%; color: var(--text-faint); line-height: 1.6; }
.workspace-shell .ws-comm-warn { color: #92400e; font-weight: 750; }
.workspace-shell .ws-comm-tests { margin-top: 18px; }
.workspace-shell .ws-comm-section-head { align-items: center; margin-bottom: 12px; }
.workspace-shell .ws-comm-section-head h3 { margin: 0; color: var(--text); font-size: 18px; }
.workspace-shell .ws-comm-section-head p { margin: 5px 0 0; color: var(--text-faint); font-size: 12px; }
.workspace-shell .ws-comm-test { margin-bottom: 12px; padding: 16px; background: var(--surface); }
.workspace-shell .ws-comm-test-head h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 13px; }
.workspace-shell .ws-comm-test-outcome { display: inline-flex; }
.workspace-shell .ws-comm-outcome-PASS { color: #065f46; background: rgba(16,185,129,.14); }
.workspace-shell .ws-comm-outcome-FAIL { color: #9f1239; background: rgba(225,29,72,.12); }
.workspace-shell .ws-comm-outcome-NOT_COMPARABLE { color: #92400e; background: rgba(251,191,36,.16); }
.workspace-shell .ws-comm-test-definition { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.workspace-shell .ws-comm-test-definition > div { min-width: 0; padding: 9px 10px; border-radius: 9px; background: var(--surface-2); }
.workspace-shell .ws-comm-test-definition span { display: block; margin-bottom: 4px; color: var(--text-faint); font-size: 11px; }
.workspace-shell .ws-comm-test-definition b { display: block; color: var(--text-soft); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.workspace-shell .ws-comm-immutable-note { margin-top: 10px; color: var(--text-faint); background: transparent; border-style: dashed; }
.workspace-shell .ws-comm-result-box { margin-top: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.workspace-shell .ws-comm-result-title { margin-bottom: 8px; color: var(--text); font-size: 13px; font-weight: 850; }
.workspace-shell .ws-comm-result-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; color: var(--text-soft); font-size: 12px; }
.workspace-shell .ws-comm-result-facts b { color: var(--text); font-family: var(--font-num); }
.workspace-shell .ws-comm-deviation { margin-top: 12px; padding: 13px; border: 1px solid rgba(225,29,72,.24); border-radius: 11px; background: rgba(255,241,242,.58); }
.workspace-shell .ws-comm-deviation-CONFIRMED { border-color: rgba(16,185,129,.28); background: rgba(236,253,245,.68); }
.workspace-shell .ws-comm-deviation-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); font-size: 13px; }
.workspace-shell .ws-comm-deviation-status { color: #9f1239; background: rgba(225,29,72,.10); }
.workspace-shell .ws-comm-deviation-CONFIRMED .ws-comm-deviation-status { color: #065f46; background: rgba(16,185,129,.12); }
.workspace-shell .ws-comm-deviation-grid { display: grid; grid-template-columns: auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); gap: 7px 10px; align-items: baseline; margin: 12px 0; color: var(--text-faint); font-size: 11px; }
.workspace-shell .ws-comm-deviation-grid b { color: var(--text); font-family: var(--font-num); font-size: 13px; }
.workspace-shell .ws-comm-audit { margin-top: 16px; border-top: 1px solid var(--border); }
.workspace-shell .ws-comm-audit summary { cursor: pointer; padding: 13px 0 8px; color: var(--brand-strong); font-size: 12px; font-weight: 800; }
.workspace-shell .ws-comm-audit-row { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(120px, .8fr) minmax(130px, 1fr) minmax(150px, 1.2fr); gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-faint); font-size: 11px; }
.workspace-shell .ws-comm-audit-row + .ws-comm-audit-row { margin-top: 5px; }
.workspace-shell .ws-comm-audit-row b { color: var(--text-soft); }
.workspace-shell .ws-comm-audit-row time { text-align: right; }

@media (max-width: 760px) {
  .workspace-shell .ws-commissioning-head,
  .workspace-shell .ws-comm-toolbar,
  .workspace-shell .ws-comm-card-head,
  .workspace-shell .ws-comm-test-head,
  .workspace-shell .ws-comm-section-head { flex-direction: column; align-items: stretch; }
  .workspace-shell .ws-comm-scope { align-self: flex-start; }
  .workspace-shell .ws-comm-baseline-picker { align-items: stretch; flex-direction: column; }
  .workspace-shell .ws-comm-baseline-select { min-width: 0; width: 100%; }
  .workspace-shell .ws-comm-card-actions { justify-content: flex-start; }
  .workspace-shell .ws-comm-facts,
  .workspace-shell .ws-comm-test-definition { grid-template-columns: 1fr; }
  .workspace-shell .ws-comm-fact-wide { grid-column: auto; }
  .workspace-shell .ws-comm-deviation-grid { grid-template-columns: 1fr 1fr; }
  .workspace-shell .ws-comm-audit-row { grid-template-columns: 1fr; gap: 4px; }
  .workspace-shell .ws-comm-audit-row time { text-align: left; }
}

#view-community .com-wrap { max-width: 900px; padding: 42px 24px 72px; }
#view-community .community-card { max-width: none; background: var(--surface); border-color: var(--border); box-shadow: var(--card-shadow); }
#view-community .com-form input,
#view-community .com-form textarea { background: var(--surface-2); border-color: var(--border-strong); }
#view-community .com-reply,
#view-community .com-reply-form { background: var(--surface-2); border-color: var(--border); }

#view-suppliers .suppliers-page { max-width: 1240px; padding: 42px 24px 72px; }
#view-suppliers .suppliers-head { border-bottom-color: var(--border); padding-bottom: 20px; }
#view-suppliers #panel-suppliers { background: var(--surface); border-color: var(--border); box-shadow: none; backdrop-filter: none; }
#view-suppliers .supplier-toolbar { background: var(--surface-2); border-color: var(--border); }
#view-suppliers .supplier-card { background: var(--surface); border-color: var(--border); box-shadow: none; }
#view-suppliers .supplier-card:hover { border-color: var(--brand); box-shadow: var(--card-shadow); }

#view-admin .admin-shell { max-width: 1240px; padding: 42px 24px 80px; gap: 18px; }
#view-admin .admin-side,
#view-admin .admin-main { background: var(--surface); border-color: var(--border); box-shadow: none; backdrop-filter: none; }
#view-admin .admin-main { box-shadow: var(--card-shadow); }

.content-page main.wrap { max-width: 900px; padding: 48px 24px 72px; }
.content-page .a-head { text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; align-items: end; border-bottom: 1px solid var(--border); padding-bottom: 22px; margin-bottom: 28px; }
.content-page .a-head .lab { grid-column: 1 / -1; margin-bottom: 0; }
.content-page .a-head h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.045em; }
.content-page .card { background: var(--surface); border: 1px solid var(--border); box-shadow: none; border-radius: var(--radius); padding: 26px 30px; margin-bottom: 14px; }
.content-page .card h2 { font-size: 19px; color: var(--text); }
.content-page .card h2::before { color: var(--brand); }
.content-page .card p,
.content-page .card li { line-height: 1.8; }
.content-page footer { max-width: 900px; margin: 0 auto; border-top-color: var(--border); }

@media (max-width: 1020px) {
  #view-workspace .ws-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  #view-engine .hero { grid-template-columns: 1fr; min-height: auto; }
  #view-engine .hero-inner { padding: 44px 28px; }
  #view-engine .hero-stats { max-width: none; }
}
@media (max-width: 760px) {
  #view-engine.wrap,
  #view-workspace .workspace-shell,
  #view-community .com-wrap,
  #view-suppliers .suppliers-page,
  #view-admin .admin-shell { padding-left: 16px; padding-right: 16px; }
  #view-workspace .ws-stats,
  #view-workspace .ws-list { grid-template-columns: 1fr; }
  #view-engine .hero-inner { padding: 34px 20px; }
  .content-page main.wrap { padding-left: 16px; padding-right: 16px; }
  .content-page .card { padding: 22px 20px; }
  .content-page .a-head { grid-template-columns: 1fr; }
}

/* ============================================================
   D-138 恢复原始 Hero：居中主视觉、流线水珠、四角标签、四列参数
   ============================================================ */
#view-engine .hero {
  min-height: 72vh;
  margin-bottom: 26px;
  padding: clamp(40px, 5.5vw, 72px) clamp(22px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(120% 120% at 50% -10%, rgba(2, 132, 199, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(238, 242, 249, 0.46));
  box-shadow: var(--card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
#view-engine .hero-bg { opacity: 1; }
#view-engine .hero-aurora { opacity: .32; filter: blur(58px); }
#view-engine .hero-aurora.a1 { animation: floatA 14s ease-in-out infinite; }
#view-engine .hero-aurora.a2 { animation: floatB 17s ease-in-out infinite; }
#view-engine .hero-aurora.a3 { animation: floatA 19s ease-in-out infinite reverse; }
#view-engine .hero-circuit { opacity: .52; }
#view-engine .hero-scrim { opacity: .5; }
#view-engine .hero-inner {
  position: relative;
  z-index: 2;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-left: 0;
}
#view-engine .hero-title {
  max-width: none;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: -.03em;
  margin: 0;
  color: var(--text);
}
#view-engine .hero-title .grad {
  background: linear-gradient(115deg, var(--brand), var(--brand-2) 52%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 4px 24px var(--brand-soft));
}
#view-engine .hero-sub {
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 680px;
  margin: 0;
  font-weight: 500;
  text-align: justify;
}
#view-engine .hero-cta-row { justify-content: center; }
#view-engine .hero-guide {
  max-width: none;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}
#view-engine .hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
#view-engine .hero-stat {
  min-height: 108px;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 30px rgba(15, 23, 42, 0.10);
}
#view-engine .hero-stat .hs-v { color: var(--brand); font-size: clamp(20px, 2.4vw, 26px); }
#view-engine .hero-stat .hs-k { color: var(--text-soft); }
#view-engine .hero-scroll { display: grid; }

@media (max-width: 760px) {
  #view-engine .hero { min-height: auto; padding-block: 48px; }
  #view-engine .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  #view-engine .hero-scroll { display: none !important; }
  #view-engine .hero .hero-circuit { opacity: .30; }
  #view-engine .hero .hc-label,
  #view-engine .hero .hc-node { display: none; }
  #view-engine .hero-inner { gap: 14px; max-width: 100%; }
  #view-engine .hero-sub { font-size: 14px; line-height: 1.62; }
}
@media (max-width: 480px) {
  #view-engine .hero .hero-circuit { opacity: .30; }
  #view-engine .hero-stats { gap: 8px; grid-template-columns: repeat(2, 1fr); }
  #view-engine .hero-stat { padding: 10px 8px; min-height: 88px; }
  #view-engine .hero-stat .hs-v { font-size: 19px; height: 32px; min-height: 32px; }
}

/* D3-P1 工程选型与技术匹配面板 */
.ws-bom-match-panel { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm, 6px); background: rgba(15, 23, 42, 0.03); border: 1px solid var(--border, #cbd5e1); font-size: 13px; }
.ws-bom-match-summary { font-weight: 500; margin-bottom: 8px; color: var(--text-soft, #64748b); }
.ws-bom-selection-card { padding: 10px; margin-bottom: 10px; border-radius: 6px; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.3); }
.ws-bom-selection-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ws-bom-selection-meta { font-size: 12px; color: var(--text-soft, #64748b); margin-bottom: 6px; }
.ws-bom-selection-none { padding: 8px; margin-bottom: 8px; border-radius: 4px; background: rgba(0,0,0,0.03); color: var(--text-soft, #64748b); font-style: italic; }
.ws-bom-match-candidate-card { padding: 10px; margin-bottom: 8px; border-radius: 6px; border: 1px solid var(--border, #e2e8f0); background: #fff; }
.ws-bom-match-candidate-card.ws-candidate-selected { border-color: #10b981; box-shadow: 0 0 0 1px #10b981; }
.ws-bom-candidate-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ws-bom-candidate-fit { font-size: 12px; color: var(--text-soft, #334155); margin-bottom: 4px; }
.ws-bom-candidate-supplier { font-size: 12px; color: #64748b; margin-bottom: 6px; }
.ws-bom-candidate-action { text-align: right; }
.ws-selection-current-tag { font-size: 12px; font-weight: bold; color: #10b981; }
.ws-bom-comparison-details { margin-block: 10px; border: 1px solid var(--border, #cbd5e1); border-radius: 6px; padding: 6px 10px; background: #fff; }
.ws-bom-comparison-table-wrap { overflow-x: auto; margin-top: 8px; }
.ws-bom-comparison-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ws-bom-comparison-table th, .ws-bom-comparison-table td { padding: 6px 8px; border: 1px solid #e2e8f0; text-align: left; }
.ws-bom-comparison-table th { background: #f8fafc; }
.ws-bom-selection-disclaimer { margin-top: 8px; color: #94a3b8; }
.ws-match-status-matched { background: #10b981; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.ws-match-status-not_matched { background: #ef4444; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.ws-match-status-insufficient_data { background: #f59e0b; color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.ws-ozone-match-meaning { margin: 5px 0; padding: 6px 8px; border-left: 3px solid #10b981; background: rgba(16,185,129,.08); color: #065f46; font-size: 12px; }
.ws-ozone-warning-list { margin: 6px 0 8px 18px; padding: 0; color: #92400e; font-size: 12px; }
.ws-ozone-warning-list li { margin: 3px 0; }
.ws-ozone-decision-controls { display: grid; gap: 7px; text-align: left; }
.ws-ozone-decision-controls textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }
.ws-ozone-confirm { display: flex; align-items: flex-start; gap: 6px; color: #78350f; font-size: 12px; }
.ws-ozone-confirm input { margin-top: 2px; }
.ws-ozone-decision-replay { margin: 7px 0; padding: 8px; border-radius: 5px; background: rgba(15,23,42,.04); font-size: 12px; color: #334155; }
.ws-ozone-decision-replay > div { margin-bottom: 4px; }
.ws-ozone-decision-replay ul { margin: 4px 0 0 18px; padding: 0; }

/* Equipment advice uses the existing workspace visual system. */
.ws-equipment-recommendations { margin-block: 18px; }
.ws-equipment-recommendations h4 { margin: 0 0 8px; }
.ws-suggested-spec, .ws-recommendation-reason { color: var(--text, #0f172a); overflow-wrap: anywhere; }
.ws-copy-spec-status { margin-inline-start: 8px; }
.ws-candidate-evidence, .ws-other-candidates, .ws-requirement-basis { margin-block: 10px; }
.ws-candidate-evidence summary, .ws-other-candidates summary, .ws-requirement-basis summary { cursor: pointer; }
.ws-equipment-recommendations .ws-match-status-matched { background: #047857; }
.ws-other-candidates .ws-match-status-not_matched { background: #b91c1c; }
.ws-other-candidates .ws-match-status-insufficient_data { background: #fef3c7; color: #78350f; }
.ws-bom-candidate-head { flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.ws-bom-match-result { min-width: 0; }

/* D3-P2 竣工事实与调试关联 */
.ws-bom-as-built-box { font-size: 12px; margin-top: 6px; margin-bottom: 6px; padding: 6px 8px; border-radius: 4px; background: rgba(14, 165, 233, 0.08); border: 1px solid rgba(14, 165, 233, 0.25); color: #0369a1; }
.ws-bom-as-built-action { margin-top: 6px; margin-bottom: 6px; }
.ws-bom-as-built-record-btn { font-size: 12px; padding: 4px 10px; background: #0284c7; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.ws-bom-as-built-record-btn:hover { background: #0369a1; }
.ws-comm-as-built-box { font-size: 12px; margin-top: 6px; padding: 6px 8px; border-radius: 4px; background: rgba(14, 165, 233, 0.06); border-left: 3px solid #0284c7; color: #1e293b; }
.ws-as-built-badge { background: #0284c7; color: #fff; }

/* D3-P3 工程闭环结果追溯 (Engineering Outcome Traceability) */
.ws-bom-outcome-box { font-size: 12px; margin-top: 6px; margin-bottom: 6px; padding: 6px 8px; border-radius: 4px; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); color: #065f46; }
.ws-bom-outcome-box.ws-bom-outcome-pending { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.25); color: #92400e; }
.ws-bom-outcome-head { margin-bottom: 4px; font-size: 12px; }
.ws-bom-outcome-grid { font-size: 11px; color: #334155; }
.ws-outcome-badge-pass { background: #10b981; color: #fff; }
.ws-outcome-badge-fail { background: #ef4444; color: #fff; }
.ws-outcome-badge-pending { background: #f59e0b; color: #fff; }
.ws-outcome-badge-other { background: #64748b; color: #fff; }

/* Compact decision-support results; evidence remains available on demand. */
.result-caption { margin: 0 26px 16px; color: var(--text-soft); font-size: 13px; }
.result-details { margin: 12px 26px; color: var(--text-soft); font-size: 13px; line-height: 1.65; }
.result-details > summary { cursor: pointer; color: var(--brand); font-weight: 600; padding: 6px 0; }
.result-details > div { padding: 8px 0; overflow-wrap: anywhere; }
.result-details p { margin: 6px 0; }
table .result-details { margin: 6px 0 0; }
.result-details .note, .result-details .table-wrap { margin-left: 0; margin-right: 0; }
.wq-val, table.data .num { font-variant-numeric: tabular-nums; }
@media print { .result-details > div { display: block; } }

.metrics > .metric.brand { display: block; }
table.data td.num { white-space: nowrap; }

/* Consistent dialog actions and readable account information. */
.user-menu-actions { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.user-menu-actions > .toggle-btn { display: flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; min-height: 44px; margin: 0; text-decoration: none; }
.user-menu-actions > div { overflow-wrap: anywhere; }
.ws-bom-table-wrap { overflow-x: auto; margin-top: .75rem; }
.ws-bom-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ws-bom-table th, .ws-bom-table td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.ws-bom-table th { color: var(--text-soft); background: var(--surface-raised); white-space: nowrap; }
.ws-bom-table .ws-bom-match-result:not(:empty) { display: block; margin-top: .75rem; }
.ws-bom-table .ws-bom-match-open { margin-top: .5rem; }
.ws-bom-table td:nth-child(2), .ws-bom-table td:nth-child(3) { white-space: nowrap; }
.ws-bom-recovery { margin-top: .75rem; }
@media (max-width: 600px) { .ws-bom-table th, .ws-bom-table td { padding: .6rem .45rem; } .ws-bom-table td:first-child { min-width: 5rem; } .ws-bom-table td:last-child { min-width: 12rem; } }

.result-details .water-notes > div { margin: .75rem 0; }
.result-details .water-notes dt { font-weight: 650; color: var(--text); }
.result-details .water-notes dd { margin: .25rem 0 0; color: var(--text-soft); line-height: 1.7; }

/* Task-focused workspace refinement; engine introduction and stat layout remain intact. */
#view-workspace .ws-head h2 { letter-spacing: -.03em; }
#view-workspace .workspace-shell { font-size: 15px; line-height: 1.65; }
#view-workspace .ws-panel.glass { backdrop-filter: none; }
#view-workspace .btn-primary { min-height: 44px; border-radius: 9px; background: var(--brand); box-shadow: none; }
#view-workspace .toggle-btn { min-height: 44px; border-radius: 9px; background: var(--surface); font-size: 14px; box-shadow: none; }
#view-workspace .toggle-btn:hover { transform: none; background: var(--surface-2); }
#view-workspace .ws-section { margin-top: 28px; }
#view-workspace .ws-project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.ws-project-save-hint, .ws-overview-caption { color: var(--text-soft); font-size: 14px; }
.ws-project-overview { padding-block: 8px 24px; border-bottom: 1px solid var(--border); }
.ws-overview-caption { margin: 0 0 16px; overflow-wrap: anywhere; }
.ws-overview-actions, .ws-settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ws-project-secondary { border-top: 1px solid var(--border); padding-block: 18px; }
.ws-project-secondary > summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; font-weight: 700; color: var(--text); }
.ws-project-secondary > summary:focus-visible, .ws-result-details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.ws-project-secondary .ws-section { margin-top: 16px; }
#view-workspace .ws-decision-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
#view-workspace .ws-decision-metrics .ws-metric { padding: 16px 0; border: 0; border-radius: 0; border-bottom: 1px solid var(--border); background: transparent; }
#view-workspace .ws-decision-metrics .ws-metric span { font-size: 14px; color: var(--text-soft); }
#view-workspace .ws-decision-metrics .ws-metric b { display: block; margin-top: 6px; font-size: clamp(22px, 2.5vw, 30px); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ws-decision-metrics .ws-metric small { font-size: 13px; color: var(--text-soft); font-weight: 500; white-space: nowrap; }
.ws-result-title { margin: 0 0 12px; font-size: 18px; }
.ws-result-details { margin-block: 14px; font-size: 14px; }
.ws-result-details > summary { cursor: pointer; padding-block: 10px; color: var(--brand-strong); }
#view-workspace .ws-calc-v { display: none; }
#view-workspace .ws-calc-head, #view-workspace .ws-calc-time, #view-workspace .ws-note { font-size: 14px; }
#view-workspace .ws-report-box[data-state="unread"] { display: none; }
#view-workspace .ws-report-source { overflow-wrap: anywhere; }
#view-workspace .ws-bom-table, #view-workspace .ws-report-summary { font-size: 14px; }
#view-workspace .ws-bom-table td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
#view-workspace .ws-bom-table th:nth-child(2) { text-align: right; }
#view-workspace .ws-scheme-head, #view-workspace .ws-head-actions { flex-wrap: wrap; gap: 10px; }
#view-engine .tabs-toolbar { border-radius: 10px; box-shadow: none; padding: 8px 12px; }
#view-engine .tabs-toolbar .tabs-stage { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0; }
#view-engine .tabs-toolbar .tabs-stage:has(.tab.active) { background: transparent; box-shadow: none; }
#view-engine .tabs-toolbar .tab { min-height: 44px; border-radius: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-soft); box-shadow: none; }
#view-engine .tabs-toolbar .tab.active { border-bottom-color: var(--brand); color: var(--brand-strong); font-weight: 750; background: var(--brand-soft); box-shadow: none; }
#view-engine .tabs-toolbar .tab:hover { transform: none; color: var(--brand-strong); }
#view-engine .tabs-toolbar .export-btn { min-height: 44px; border-radius: 9px; background: var(--brand); color: #fff; box-shadow: none; }
#view-engine .engine-context { font-size: 14px; border-radius: 10px; }
#view-engine .panel { font-size: 15px; }
#view-engine .panel .hint, #view-engine .panel .note { font-size: 14px; }
#view-engine .panel table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.engine-mobile-nav { display: none; }
@media (max-width: 760px) {
  #view-workspace .workspace-shell { padding: 24px 16px 48px; }
  #view-workspace .ws-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #view-workspace .ws-stat { min-height: 88px; padding: 12px; }
  #view-workspace .ws-stat b { font-size: 24px; }
  #view-workspace .ws-decision-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #view-workspace .ws-head-actions { width: 100%; }
  #view-workspace .ws-overview-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #view-workspace .ws-overview-actions button { min-width: 0; }
  #view-engine .tabs-toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
  #view-engine .tabs-toolbar #tabs { display: none; }
  .engine-mobile-nav { display: grid; gap: 5px; min-width: 0; }
  .engine-mobile-nav label { color: var(--text-soft); font-size: 13px; }
  .engine-mobile-nav select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); padding: 8px 10px; font: inherit; }
  #navToggle { min-width: 44px; min-height: 44px; }
  #view-engine .hero-cta-row .cta-btn { white-space: nowrap; }
}
