:root {
  --bg: #f3f5f2;
  --surface: #fff;
  --line: #e2e7e0;
  --text: #172016;
  --muted: #728071;
  --green: #197629;
  --green-deep: #0d5c1b;
  --green-soft: #eaf6ea;
  --orange: #ee6f28;
  --orange-soft: #fff0e7;
  --focus: #1c8b31;
  --shadow: 0 14px 34px rgba(29, 55, 31, .08);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, .resizer:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.workspace { position: relative; display: grid; grid-template-columns: 200px 470px minmax(520px, 1fr); width: 100vw; height: 100vh; background: var(--bg); }
.panel { min-width: 0; min-height: 0; background: var(--surface); }
.navigation { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-height: 86px; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; box-shadow: 0 5px 12px rgba(25, 118, 41, .14); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand h1 { margin: 0; font-size: 16px; line-height: 22px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; }
.iteration-overview { display: grid; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: #fbfcfa; }
.iteration-field { display: grid; gap: 3px; }
.iteration-field span { color: var(--muted); font-size: 10px; }
.iteration-field b { color: #334132; font-size: 11px; line-height: 1.4; }
.iteration-field p { margin: 0; color: #4e5d4d; font-size: 11px; line-height: 1.48; }
.iteration-version { grid-template-columns: 1fr auto; align-items: center; padding-top: 7px; border-top: 1px dashed #dce3da; }
.iteration-version span { grid-column: 1; }
.iteration-version b { grid-column: 2; grid-row: 1; padding: 3px 6px; color: var(--green-deep); background: var(--green-soft); border-radius: 5px; font-size: 10px; }
.change-records { padding-top: 7px; border-top: 1px dashed #dce3da; }
.change-records[open] { max-height: min(42vh, 420px); overflow-y: auto; padding-right: 3px; scrollbar-width: thin; overscroll-behavior: contain; }
.change-records summary { display: flex; align-items: center; justify-content: space-between; color: #40533f; cursor: pointer; font-size: 11px; font-weight: 800; list-style: none; }
.change-records[open] summary { position: sticky; top: 0; z-index: 2; padding: 3px 0 6px; background: #fbfcfa; }
.change-records summary::-webkit-details-marker { display: none; }
.change-records summary::before { content: "›"; margin-right: 5px; color: var(--green); font-size: 15px; transition: transform 140ms ease; }
.change-records[open] summary::before { transform: rotate(90deg); }
.change-records summary span { margin-left: auto; color: #879286; font-size: 10px; font-weight: 500; }
.change-record { margin-top: 8px; padding: 8px; background: #fff; border: 1px solid #e7ece6; border-radius: 7px; }
.change-record b { display: block; color: #60705f; font-size: 10px; }
.change-record p { margin: 4px 0 0; color: #495849; font-size: 10px; line-height: 1.45; }
.change-record em { color: var(--green-deep); font-style: normal; font-weight: 800; }
.nav-search { position: relative; margin: 12px 12px 6px; }
.nav-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 12px 12px 0; padding: 3px; background: #edf0ed; border: 1px solid #dde3dc; border-radius: 8px; }
.nav-mode-switch button { min-height: 30px; color: #687468; background: transparent; border: 0; border-radius: 6px; font-size: 11px; cursor: pointer; }
.nav-mode-switch button[aria-pressed="true"] { color: var(--green-deep); background: #fff; box-shadow: 0 2px 7px rgba(35,53,35,.1); font-weight: 800; }
.nav-search input { width: 100%; height: 34px; padding: 0 30px 0 12px; color: var(--text); background: #f6f8f5; border: 1px solid transparent; border-radius: 9px; outline: 0; }
.nav-search input:focus { background: #fff; border-color: #a9cbaa; }
.nav-search span { position: absolute; top: 7px; right: 11px; color: #8b9689; }
.nav-scroll { flex: 1; overflow: auto; padding: 6px 10px 14px; scrollbar-width: thin; }
.nav-group { margin: 0 0 6px; }
.nav-group summary { position: sticky; top: -6px; z-index: 2; padding: 10px 7px 6px; color: #798579; background: rgba(255,255,255,.96); font-size: 12px; font-weight: 700; list-style: none; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::before { content: "⌄"; display: inline-block; width: 15px; color: #96a096; }
.nav-group:not([open]) summary::before { content: "›"; }
.nav-list { display: grid; gap: 2px; }
.nav-item { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; width: 100%; min-height: 38px; padding: 7px 9px; color: #4e5a4e; background: transparent; border: 0; border-radius: 9px; text-align: left; cursor: pointer; transition: 140ms ease; }
.nav-item:hover { color: var(--green-deep); background: #f2f7f1; }
.nav-item[aria-current="page"] { color: var(--green-deep); background: var(--green-soft); box-shadow: inset 3px 0 var(--green); font-weight: 700; }
.nav-arrow { color: #9aa49a; font-size: 18px; }
.nav-item[aria-current="page"] .nav-arrow { color: var(--green); }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.nav-role { padding: 2px 5px; color: #879286; background: #f1f3f0; border-radius: 5px; font-size: 9px; font-weight: 600; }
.nav-role.admin { color: #a94f19; background: var(--orange-soft); }
.nav-empty { padding: 24px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.nav-foot { display: grid; gap: 5px; padding: 10px 12px 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.nav-foot b { color: #4b584b; font-size: 11px; }
.non-functional-entry { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 34px; padding: 0 10px; color: #426242; background: #f3f8f2; border: 1px solid #cfe0ce; border-radius: 8px; cursor: pointer; }
.non-functional-entry:hover { color: var(--green-deep); background: #eaf6ea; border-color: #9fc89f; }
.non-functional-entry span { font-size: 10px; }
.non-functional-entry b { color: inherit; font-size: 11px; }
.prototype { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--line); background: linear-gradient(145deg, #f5f8f4, #edf2ee); }
.prototype-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 10px 14px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); }
.prototype-title { display: grid; gap: 3px; min-width: 0; }
.prototype-title b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.prototype-title span { color: var(--muted); font-size: 10px; }
.prototype-actions { display: flex; align-items: center; gap: 7px; }
.mode-switch { display: flex; padding: 2px; background: #edf0ed; border: 1px solid #dde3dc; border-radius: 8px; }
.mode-switch button, .annotation-toggle { min-height: 30px; padding: 0 9px; color: #687468; background: transparent; border: 0; border-radius: 6px; font-size: 11px; cursor: pointer; }
.mode-switch button[aria-pressed="true"] { color: var(--green-deep); background: #fff; box-shadow: 0 2px 7px rgba(35, 53, 35, .11); font-weight: 700; }
.annotation-toggle { color: var(--green-deep); background: var(--green-soft); border: 1px solid #bedcbe; }
.annotation-toggle[aria-pressed="false"] { color: #687468; background: #fff; border-color: #d8ddd7; }
.device-stage { display: grid; flex: 1; min-height: 0; place-items: start center; padding: 12px 10px; overflow: auto; }
/* DEMO 原始画布为 430px 宽。融合评审台不得用容器宽度挤压 iframe，否则会触发原型的窄屏重排。 */
.device-frame { box-sizing: border-box; flex: 0 0 auto; width: 448px; height: 862px; overflow: hidden; background: #fff; border: 9px solid #222924; border-radius: 38px; box-shadow: 0 28px 58px rgba(25, 42, 27, .18); }
.device-frame iframe { display: block; width: 100%; height: 100%; background: #fff; border: 0; }
.workspace.desktop-preview { grid-template-columns: 200px minmax(680px, .95fr) minmax(520px, 1.05fr); }
.workspace.desktop-preview .device-stage { place-items: start; }
.workspace.desktop-preview .device-frame { width: 1120px; height: 760px; border-width: 7px; border-radius: 18px; }
.workspace.desktop-preview[data-mode="demo"] { grid-template-columns: 0 minmax(0, 1fr) 0; }
.workspace.desktop-preview[data-mode="demo"] .prototype { width: 100vw; border-right: 0; }
.workspace.desktop-preview[data-mode="demo"] .device-stage { width: 100%; place-items: stretch; padding: 12px; overflow: hidden; }
.workspace.desktop-preview[data-mode="demo"] .device-frame { width: 100%; max-width: none; height: calc(100vh - 118px); margin: 0; }
.workspace.overview-preview { grid-template-columns: 200px minmax(680px, .95fr) minmax(520px, 1.05fr); }
.workspace.overview-preview .device-stage { place-items: start stretch; }
.workspace.overview-preview .device-frame { width: 100%; height: 760px; border-width: 7px; border-radius: 18px; }
.workspace.overview-preview[data-mode="demo"] .device-frame { width: min(1280px, calc(100vw - 32px)); height: calc(100vh - 118px); margin: auto; }
.prototype-hint { display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px; color: #718071; background: rgba(255,255,255,.8); border-top: 1px solid var(--line); font-size: 10px; pointer-events: none; }
.pulse-dot { width: 7px; height: 7px; background: #36a949; border-radius: 50%; box-shadow: 0 0 0 4px rgba(54,169,73,.12); }
.requirements { position: relative; overflow: auto; scroll-behavior: smooth; background: #fff; }
.doc-toolbar { position: sticky; top: 0; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 80px; padding: 14px 28px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.doc-toolbar > div { min-width: 0; }
.doc-toolbar span { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.doc-toolbar h1 { margin: 4px 0 0; overflow: hidden; font-size: 20px; line-height: 28px; text-overflow: ellipsis; white-space: nowrap; }
.doc-toolbar a { flex: 0 0 auto; padding: 8px 11px; color: #4d594d; border: 1px solid #d8ddd7; border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; }
.doc-toolbar a:hover { color: var(--green-deep); border-color: #9fc49f; background: #f4faf4; }
.doc-context { display: grid; grid-template-columns: minmax(100px, .65fr) minmax(180px, 1.35fr) auto; gap: 10px; margin: 18px 28px 0; padding: 13px 15px; background: #f6f8f5; border: 1px solid #e4e8e3; border-radius: 12px; }
.doc-context div { display: grid; gap: 3px; min-width: 0; }
.doc-context span { color: var(--muted); font-size: 10px; }
.doc-context b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.doc-context button { align-self: center; height: 30px; padding: 0 10px; color: var(--green-deep); background: #fff; border: 1px solid #cdd9cc; border-radius: 7px; font-size: 10px; font-weight: 700; cursor: pointer; }
.version-change-panel { margin: 12px 28px 0; padding: 13px 14px; background: #fff; border: 1px solid #e1e5e0; border-left: 4px solid #d92d20; border-radius: 8px; }
.version-change-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.version-change-panel header b { font-size: 12px; }
.version-change-panel > p { margin: 8px 0 0; color: #536052; font-size: 11px; line-height: 1.65; }
.change-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 800; }
.change-status.current { color: #b42318; background: #fff0ee; }
.change-status.history { color: #667068; background: #eef1ef; }
.change-status.accepted { color: #176526; background: #edf7ed; }
.change-status.normalized { color: #7a4a0a; background: #fff4df; }
.change-status.pending { color: #b42318; background: #fff0ee; }
.change-status.internal { color: #59645d; background: #eef1ef; }
.change-rows { display: grid; gap: 7px; margin-top: 9px; }
.change-rows div { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; align-items: start; }
.change-rows span { color: #879087; font-size: 10px; font-weight: 700; }
.change-rows p { margin: 0; color: #3f4b3f; font-size: 11px; line-height: 1.55; }
.annotation-index { margin: 12px 28px 0; padding: 13px 14px; background: linear-gradient(135deg, #f2faf2, #fbfdfb); border: 1px solid #d8e8d7; border-radius: 12px; }
.annotation-index header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.annotation-index header b { font-size: 12px; }
.annotation-index header span { color: var(--muted); font-size: 10px; }
.annotation-legend { display: inline-flex; align-items: center; gap: 5px; }
.annotation-legend i { width: 9px; height: 9px; border-radius: 3px; background: #8d9690; }
.annotation-legend i.current { margin-left: 5px; background: #d92d20; }
.annotation-list { display: flex; flex-wrap: wrap; gap: 7px; }
.annotation-link { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 5px 9px 5px 5px; color: #3f4e3e; background: #fff; border: 1px solid #dce4da; border-radius: 8px; cursor: pointer; }
.annotation-link:hover { color: var(--green-deep); border-color: #9fc79f; }
.annotation-link i { display: grid; width: 21px; height: 21px; place-items: center; color: #fff; background: #8d9690; border-radius: 6px; font-size: 10px; font-style: normal; font-weight: 800; }
.annotation-link.is-current { border-color: #efb2ad; background: #fff8f7; }
.annotation-link.is-current i { background: #d92d20; }
.annotation-link span { font-size: 11px; }
.annotation-link em { color: #8a948d; font-size: 9px; font-style: normal; }
.annotation-link.is-current em { color: #b42318; font-weight: 700; }
.annotation-link.is-highlighted { animation: linkedPulse 1.8s ease; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(238,111,40,.12); }
.prd-annotation-anchor { position: relative; scroll-margin-top: 110px; }
.prd-inline-marker { display: inline-flex; align-items: center; gap: 4px; height: 21px; margin: 0 7px 2px 0; padding: 0 5px; vertical-align: middle; color: #59645d; background: #f1f3f2; border: 1px solid #ccd2ce; border-radius: 6px; font-size: 9px; font-weight: 800; line-height: 1; cursor: pointer; }
.prd-inline-marker span { font-size: 8px; letter-spacing: .04em; }.prd-inline-marker b { display: grid; width: 14px; height: 14px; place-items: center; color: #fff; background: #8d9690; border-radius: 4px; font-size: 9px; }
.prd-inline-marker.is-current { color: #b42318; background: #fff5f4; border-color: #efb2ad; }
.prd-inline-marker.is-current b { background: #d92d20; }
.prd-inline-marker:hover { color: #9e4616; border-color: #eea17a; background: #fff0e7; }.prd-inline-marker:hover b { background: var(--orange); }
.prd-annotation-anchor.is-highlighted { animation: linkedPulse 1.8s ease; background: linear-gradient(90deg, rgba(238,111,40,.14), transparent 78%); border-radius: 6px; }
.doc-outline { display: flex; gap: 6px; margin: 12px 28px 0; padding-bottom: 4px; overflow-x: auto; }
.doc-outline:empty { display: none; }
.doc-outline button { flex: 0 0 auto; padding: 7px 10px; color: #687468; background: #fff; border: 1px solid #e0e4df; border-radius: 999px; font-size: 10px; cursor: pointer; }
.doc-outline button:hover { color: var(--green-deep); border-color: #a9cba9; }
.doc-loading { display: flex; align-items: center; gap: 6px; margin: 30px 28px; color: var(--muted); font-size: 12px; }
.doc-loading[hidden] { display: none; }
.doc-loading i { width: 7px; height: 7px; background: #8fb791; border-radius: 50%; animation: loading 1s infinite alternate; }
.doc-loading i:nth-child(2) { animation-delay: .15s; }.doc-loading i:nth-child(3) { animation-delay: .3s; }
.markdown-body { padding: 12px 28px 72px; color: #293229; font-size: 14px; line-height: 1.82; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: #152015; scroll-margin-top: 96px; }
.markdown-body h1 { margin: 20px 0 14px; font-size: 25px; line-height: 1.4; }
.markdown-body h2 { margin: 30px 0 12px; padding-top: 5px; font-size: 20px; line-height: 1.5; border-top: 1px solid #edf0ec; }
.markdown-body h3 { margin: 24px 0 9px; font-size: 16px; }
.markdown-body h4 { margin: 19px 0 7px; font-size: 14px; }
.markdown-body p { margin: 8px 0 13px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }
.markdown-body li { margin: 4px 0; }
.markdown-body blockquote { margin: 14px 0; padding: 9px 14px; color: #526052; background: #f5f8f4; border-left: 4px solid #8eba91; }
.markdown-body code { padding: 2px 5px; color: #a74c17; background: #fff2ea; border-radius: 4px; font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
.markdown-body pre { overflow: auto; padding: 14px; color: #e8f3e8; background: #1e2720; border-radius: 10px; line-height: 1.6; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.mermaid-visual { margin: 16px 0 22px; overflow: hidden; border: 1px solid #dce5da; border-radius: 12px; background: #fbfdfb; }
.mermaid-visual > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #e4ebe3; background: #f3f8f2; }
.mermaid-visual > header > div { display: flex; align-items: baseline; gap: 8px; }
.mermaid-visual > header b { color: #24452a; font-size: 12px; }
.mermaid-visual > header span { color: #7c897d; font-size: 10px; }
.flow-zoom { height: 28px; padding: 0 9px; color: #155f22; background: #fff; border: 1px solid #bfd3bf; border-radius: 6px; font-size: 10px; font-weight: 750; cursor: pointer; }
.flow-zoom:hover { background: #eaf5e9; }
.mermaid-canvas { width: 100%; padding: 8px; overflow-x: auto; background: radial-gradient(circle at 1px 1px, #e2e9e1 1px, transparent 1px); background-size: 16px 16px; }
.mermaid-flow-svg { display: block; width: 100%; min-width: 760px; height: auto; }
.flow-edges path { fill: none; stroke: #96a497; stroke-width: 1.7; }
.flow-edges marker path { fill: #758477; }
.flow-edges text { fill: #7a5740; paint-order: stroke; stroke: #fbfdfb; stroke-width: 5px; font-size: 12px; font-weight: 750; }
.flow-node rect { fill: #fff; stroke: #a9bbaa; stroke-width: 1.5; filter: drop-shadow(0 4px 6px rgba(40,67,43,.08)); }
.flow-node.decision rect { fill: #fff8ee; stroke: #d6a46f; }
.flow-node foreignObject div { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #263529; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; font-weight: 700; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.mermaid-visual details { border-top: 1px solid #e3e9e2; background: #fff; }
.mermaid-visual details summary { padding: 9px 12px; color: #667267; font-size: 10px; font-weight: 700; cursor: pointer; }
.mermaid-visual details pre { margin: 0 10px 10px; max-height: 320px; }
.mermaid-visual.is-expanded { position: fixed; z-index: 100; inset: 18px; margin: 0; background: #fff; box-shadow: 0 24px 80px rgba(19,39,22,.28); }
.mermaid-visual.is-expanded .mermaid-canvas { height: calc(100vh - 122px); padding: 20px; }
.mermaid-visual.is-expanded .mermaid-flow-svg { width: auto; min-width: 1180px; height: auto; margin: auto; }
.mermaid-visual.is-expanded details { display: none; }
.markdown-body table { display: block; width: 100%; margin: 14px 0 20px; overflow: auto; border-collapse: collapse; font-size: 12px; }
.markdown-body th, .markdown-body td { min-width: 100px; padding: 9px 10px; border: 1px solid #dde3dc; vertical-align: top; }
.markdown-body th { color: #354135; background: #f1f5f0; text-align: left; }
.markdown-body a { color: var(--green-deep); }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); }
.markdown-body .doc-empty { padding: 24px; color: var(--muted); background: #f7f8f6; border-radius: 12px; }
.resizer { position: absolute; z-index: 20; top: 0; bottom: 0; width: 8px; margin-left: -4px; cursor: col-resize; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 1px; background: transparent; transition: 140ms ease; }
.resizer:hover::after, .resizer.is-active::after { width: 3px; background: var(--green); }
body.is-resizing { cursor: col-resize; user-select: none; }
body.is-resizing iframe { pointer-events: none; }
.workspace[data-mode="demo"] { grid-template-columns: 0 minmax(0, 1fr) 0; }
.workspace[data-mode="demo"] .navigation, .workspace[data-mode="demo"] .requirements, .workspace[data-mode="demo"] .resizer { visibility: hidden; }
.workspace[data-mode="demo"] .device-frame { height: 920px; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: 340px; padding: 10px 14px; color: #fff; background: rgba(20,31,21,.92); border-radius: 9px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }
@keyframes loading { to { opacity: .25; transform: translateY(-3px); } }
@keyframes linkedPulse { 40% { background: var(--orange-soft); } }
@media (max-width: 1180px) { .workspace { grid-template-columns: 190px 430px minmax(460px, 1fr); } .doc-toolbar, .markdown-body { padding-left: 20px; padding-right: 20px; } .doc-context, .version-change-panel, .annotation-index, .doc-outline { margin-left: 20px; margin-right: 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
