:root {
  --bg: #f3f5f2;
  --panel: #ffffff;
  --ink: #17231d;
  --muted: #6b756f;
  --line: #dfe5e0;
  --green: #215f46;
  --green-soft: #e7f1eb;
  --amber: #a25d06;
  --danger: #a2372a;
  --nav: #10271e;
}
.diagnosis-workspace { min-width: 0; overflow-wrap: anywhere; }
.diagnosis-workspace .muted { color: #536158; }
.diagnosis-workspace .page-header { flex-wrap: wrap; gap: 16px; }
.diagnosis-workspace h1 { font-size: 26px; margin-top: 8px; }
.diagnosis-workspace h2 { font-size: 18px; margin: 0 0 14px; }
.diagnosis-workspace h3 { font-size: 16px; }
.diagnosis-workspace section { padding: 24px 0; border-top: 1px solid var(--line); }
.diagnosis-workspace a { text-decoration: underline; text-underline-offset: 3px; }
.diagnosis-workspace form { max-width: 720px; }
.diagnosis-workspace input, .diagnosis-workspace select, .diagnosis-workspace textarea { max-width: 100%; min-width: 0; }
.diagnosis-workspace fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); }
.diagnosis-workspace .diagnosis-choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.diagnosis-workspace input[type=radio], .diagnosis-workspace input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.diagnosis-workspace button { min-height: 44px; white-space: normal; }
.diagnosis-workspace :focus-visible { outline: 3px solid #215f46; outline-offset: 3px; }
.diagnosis-workspace .diagnosis-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.diagnosis-workspace .diagnosis-row p { margin: 4px 0 0; }
.diagnosis-frames { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 16px; }
.diagnosis-workspace figure { margin: 0; min-width: 0; }
.diagnosis-frames img { display: block; width: 100%; height: 260px; object-fit: contain; background: #fff; }
.diagnosis-workspace figcaption { padding: 8px 0; color: #536158; }
.diagnosis-finding { border-top: 1px solid var(--line); padding: 24px 0; }
.diagnosis-region { max-width: 420px; }
.diagnosis-region-image { position: relative; }
.diagnosis-region img { display: block; width: 100%; height: auto; }
.diagnosis-box { position: absolute; border: 3px solid #b22e23; pointer-events: none; }
.diagnosis-finding dl { margin: 12px 0; }
.diagnosis-finding dt { font-weight: 700; margin-top: 12px; }
.diagnosis-finding dd { margin: 4px 0 0; }
.diagnosis-workspace .actions { flex-wrap: wrap; }
.experiment-workspace .experiment-arms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.experiment-workspace .experiment-arms > div { min-width: 0; border-top: 2px solid #587b91; }
.experiment-workspace .experiment-arms > div + div { border-color: #96622e; }
.experiment-workspace .experiment-facts { display: grid; grid-template-columns: minmax(100px, 180px) minmax(0, 1fr); gap: 10px 16px; }
.experiment-workspace dd { margin: 0; white-space: pre-wrap; font-variant-numeric: tabular-nums; }
.experiment-workspace dt { font-weight: 650; }
.experiment-workspace .experiment-issue { color: #7c2c23; }
.experiment-workspace summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.experiment-workspace input, .experiment-workspace textarea, .experiment-workspace select, .experiment-workspace .alert { border-radius: 8px; }
@media (max-width: 650px) {
  .experiment-workspace .experiment-arms, .experiment-workspace .experiment-facts { grid-template-columns: minmax(0, 1fr); }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.55 Inter, "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 18px; background: var(--nav); color: #edf6f1; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #d5f2df; color: #15482f; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { color: #9eb4a9; margin-top: 2px; }
nav { display: grid; gap: 6px; margin-top: 34px; }
nav a { padding: 11px 12px; border-radius: 9px; color: #bfd0c7; }
nav a:hover { background: #1a382c; color: white; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid #29483b; display: flex; justify-content: space-between; align-items: center; }
.link-button { border: 0; background: none; color: #a9c2b6; cursor: pointer; }
.main { min-width: 0; padding: 34px 40px 64px; max-width: 1500px; width: auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.creation-trail { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 16px; font-size: 14px; }
.creation-trail a { color: var(--green); }
.creation-trail a[aria-current="page"], .creation-trail span[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }
.creation-trail .trail-sep { color: var(--muted); }
h1 { margin: 0; font-size: 29px; line-height: 1.2; letter-spacing: 0; }
h2 { margin: 0; font-size: 17px; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-weight: 750; font-size: 12px; letter-spacing: 0; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0; }
.badge.mock { background: #fff0d8; color: var(--amber); }
.alert { border-radius: 10px; padding: 13px 15px; margin: 16px 0; border: 1px solid; }
.alert.danger { color: #7c2c23; background: #fff0ed; border-color: #f0c5bd; }
.alert.warning { color: #754604; background: #fff7e8; border-color: #ecd5aa; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.stat, .panel, .empty { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 18px rgba(22, 48, 36, .04); }
.stat { padding: 19px; }
.stat span { color: var(--muted); }
.stat strong { display: block; margin-top: 8px; font-size: 28px; }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.align-start { align-items: start; }
.panel { padding: 21px; }
.panel.compact { padding: 16px 18px; }
.panel-title { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 16px; }
.panel-title span { color: var(--muted); font-size: 12px; }
.timeline { margin: 18px 0 0; padding-left: 21px; }
.timeline li { padding: 0 0 16px 8px; }
.timeline strong, .timeline span { display: block; }
.timeline span { color: var(--muted); margin-top: 2px; }
.budget strong { font-size: 42px; }
.budget small { margin-left: 8px; color: var(--muted); }
.muted { color: var(--muted); }
.stack { display: grid; gap: 13px; }
.asset-upload { width: min(760px, 100%); }
label { display: grid; gap: 6px; color: #3e4b44; font-weight: 650; }
.checkbox-label { display: flex; align-items: center; gap: 8px; }
.checkbox-label input[type="checkbox"] { width: auto; }
.adaptation-attestation { align-items: flex-start; min-height: 44px; }
.adaptation-attestation input[type="checkbox"] { flex: 0 0 18px; height: 18px; margin-top: 3px; padding: 0; }
.adaptation-attestation span { min-width: 0; overflow-wrap: anywhere; }
.image-slot-picker { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 4px; }
.image-slot-picker legend { margin-bottom: 8px; font-weight: 650; }
.image-slot-picker .checkbox-label { min-height: 32px; font-size: 13px; }
.image-slot-picker input { flex-shrink: 0; }
.image-slot-picker span { overflow-wrap: anywhere; }
.slot-presets { display: grid; gap: 8px; margin: 0 0 10px; }
.slot-presets .checkbox-label { min-height: 44px; font-size: 14px; }
.slot-advanced { margin-top: 4px; }
.slot-advanced summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid #cfd8d2; border-radius: 9px; padding: 10px 11px; color: var(--ink); background: white; }
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55; }
button { border: 1px solid #cbd5cf; background: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--ink); }
button.primary { color: white; background: var(--green); border-color: var(--green); }
button.danger, .button.danger { color: #7c2c23; background: #fff0ed; border-color: #f0c5bd; }
.facts { display: grid; gap: 8px; margin: 0; }
.facts div { display: grid; grid-template-columns: 75px 1fr; gap: 10px; }
.facts dt { color: var(--muted); }.facts dd { margin: 0; }
.product-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.fact-review { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.fact-review summary { color: var(--green); cursor: pointer; font-weight: 700; }
.fact-details { margin-top: 12px; }
.fact-details div { grid-template-columns: 100px minmax(0, 1fr); }
.fact-details dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-list { margin: 0; padding-left: 18px; }
.actions { display: flex; gap: 8px; margin-top: 15px; }
.actions.compact { margin-top: 0; flex-wrap: wrap; }
/* 只设列数，本身不建立网格：必须与 .grid-two 等设了 display:grid 的类同用。 */
.compact-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.details-body { margin-top: 12px; }
button:disabled { cursor: not-allowed; opacity: .52; }
.section-gap { margin-top: 18px; }
.planning-page { --muted: #536158; max-width: 1000px; overflow-wrap: anywhere; }
.planning-page .page-header { gap: 16px; flex-wrap: wrap; }
.planning-section { padding: 24px 0; border-top: 1px solid var(--line); }
.planning-section h2 { margin-bottom: 18px; }
.planning-section h3 { font-size: 15px; margin: 22px 0 10px; }
.planning-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.planning-page input, .planning-page select { min-width: 0; }
.planning-page :focus-visible { outline: 3px solid #215f46; outline-offset: 3px; }
.planning-page .checkbox-label { min-height: 44px; }
.planning-page .actions { flex-wrap: wrap; }
.planning-text { white-space: pre-wrap; }
.feedback-page input, .feedback-page select, .feedback-page textarea { min-width: 0; border-radius: 8px; }
.feedback-page .actions { flex-wrap: wrap; }
.feedback-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.feedback-row dd { margin: 4px 0 12px; white-space: pre-wrap; }
.feedback-row dt { font-weight: 650; }
.feedback-summary { padding: 12px 0; }
.brief-summary { padding: 12px 0; }
.creative-brief-page textarea { min-width: 0; border-radius: 8px; }
.planning-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.planning-row p { margin: 5px 0 0; }
.planning-assets { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.planning-assets img { object-fit: contain; background: #fff; max-width: 100%; }
@media (max-width: 650px) { .planning-grid, .planning-row { grid-template-columns: minmax(0, 1fr); } }
.candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.candidate-card { display: grid; align-content: start; gap: 12px; }
.candidate-card p { margin: 0; }
.candidate-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.mini-code { max-height: 220px; overflow: auto; padding: 10px; border-radius: 8px; background: #eef3ef; white-space: pre-wrap; font-size: 11px; }
.artifact-list { display: flex; flex-wrap: wrap; gap: 8px; }
.artifact-list a, .text-link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 32px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; font-weight: 750; }
.task-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
code { font-size: 11px; color: #355a48; }
.model-table { min-width: 1050px; table-layout: fixed; }
.model-table code, .model-table .muted { overflow-wrap: anywhere; }
.model-col-type { width: 70px; }
.model-col-profile { width: 180px; }
.model-col-id { width: 230px; }
.model-col-cost { width: 100px; }
.model-col-readiness { width: 270px; }
.model-col-current { width: 100px; }
.model-col-action { width: 100px; }
.code-block { min-height: 260px; max-height: 520px; overflow: auto; padding: 14px; border-radius: 9px; background: #14251e; color: #dcebe3; white-space: pre-wrap; }
.code-block.compact { min-height: 0; max-height: 360px; margin-bottom: 0; }
.mapping-editor { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.mapping-editor[hidden] { display: none; }
.mapping-editor-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.mapping-editor h3 { margin: 0; font-size: 15px; }
.mapping-editor h3:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.mapping-editor p { margin: 4px 0 0; }
.mapping-table { min-width: 640px; table-layout: fixed; }
.mapping-table th:nth-child(1) { width: 31%; }
.mapping-table th:nth-child(2) { width: 49%; }
.mapping-table th:nth-child(3) { width: 20%; }
.mapping-table select { min-width: 230px; }
.mapping-source { overflow-wrap: anywhere; font-weight: 650; }
.mapping-state { color: var(--muted); font-size: 12px; }
.mapping-state.conflict { color: var(--danger); font-weight: 750; }
.import-result { min-height: 120px; margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf8; }
.import-result strong { display: block; margin-bottom: 6px; }
.import-result p { margin: 0; }
.import-result.pending { background: #f4f7f5; }
.import-result.warning { color: #754604; background: #fff7e8; border-color: #ecd5aa; }
.import-result.danger { color: #7c2c23; background: #fff0ed; border-color: #f0c5bd; }
.import-result.success { color: #1f6841; background: #eaf5ed; border-color: #bddbc6; }
.import-raw { margin-top: 12px; }
.import-raw summary { color: var(--green); cursor: pointer; font-weight: 700; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #e8f2ec, var(--bg) 46%); }
.login-card { width: min(430px, calc(100vw - 32px)); padding: 30px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 22px 60px rgba(21, 50, 37, .12); }
.login-brand { margin-bottom: 28px; }.login-card h1 { margin-bottom: 6px; }
.status-approved, .status-needs_review { background: #e5f4e9; color: #1f6841; }
.status-pending_approval, .status-script_pending_approval { background: #fff0d8; color: #8a520c; }
.status-render_failed, .status-blocked_compliance { background: #fee9e5; color: #97372b; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }.sidebar { position: static; height: auto; }.sidebar nav { grid-template-columns: repeat(3, 1fr); }.main { padding: 24px 18px 50px; }.stat-grid, .grid-two, .candidate-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .stat-grid, .grid-two, .candidate-grid, .product-fact-grid { grid-template-columns: 1fr; }.sidebar nav { grid-template-columns: 1fr 1fr; } }

/* 今日建议首页与折叠式导航 */
/* <details> 的内容被浏览器包进一个 UA 内容槽，网格化 details 本身不会让里面的
   链接变成网格项 —— 必须让链接自己成为块级，否则它们会 inline 挤在一行。 */
.nav-advanced { margin-top: 10px; }
.nav-advanced > a { display: block; margin-top: 6px; }
.nav-advanced > summary {
  cursor: pointer; list-style: none; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13px;
}
.nav-advanced > summary::-webkit-details-marker { display: none; }
.nav-advanced > summary::before { content: "▸ "; }
.nav-advanced[open] > summary::before { content: "▾ "; }
.nav-advanced > summary:hover { color: inherit; }
.stat-link { display: block; text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--accent, #1f7a4d); }
.stat small { display: block; margin-top: 6px; font-size: 12px; line-height: 1.5; }
.candidate-card details summary { cursor: pointer; }

/* 导入页：整份文件的口径声明 */
.context-declaration {
  margin: 6px 0 4px; padding: 14px 16px 16px;
  border: 1px solid var(--line); border-radius: 12px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px;
}
.context-declaration legend { padding: 0 6px; font-weight: 650; }
.context-declaration > p { grid-column: 1 / -1; margin: 0 0 2px; font-size: 12px; line-height: 1.6; }
.context-declaration label { display: block; }

/* 首页建议卡片。注意不要复用 .diagnosis-box —— 那是诊断图上的绝对定位标注框。 */
.insight-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; background: var(--panel);
}
.insight-card > p { margin: 0 0 8px; }
.insight-card > p:last-child { margin-bottom: 0; }
.insight-card .actions { display: flex; flex-wrap: wrap; gap: 14px; }
.import-picker { max-width: 520px; }

/* 工作台与做图页。以产品为单位的卡片，每张只给一个下一步。 */
.lede { max-width: 60ch; margin-top: 8px; line-height: 1.7; }
.product-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--panel); }
.product-card.ready { border-color: #1f7a4d; }
.product-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.product-name { font-size: 16px; }
.product-code { margin-left: 8px; font-size: 12px; }
.product-card > p { margin: 8px 0 0; }
.primary-action {
  display: inline-block; padding: 9px 16px; border-radius: 9px; border: 0;
  background: #1f7a4d; color: white; font-weight: 650; font-size: 14px;
  text-decoration: none; cursor: pointer;
}
.primary-action:hover { background: #18613d; }
.secondary-action {
  display: inline-block; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 14px;
}
.secondary-action:hover { border-color: #1f7a4d; }
/* 三步进度条。已完成的一步给对勾，剩下的保持灰色，不假装已经走到。 */
.step-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.step { padding: 4px 10px; border-radius: 999px; background: #eef1ef; color: var(--muted); font-size: 12px; }
.step.done { background: #e5f4e9; color: #1f6841; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.slot-chip {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); font-size: 13px;
}
.slot-chip small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.blocker-box { border: 1px solid #e3c9a0; background: #fdf6e9; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.blocker-box ul { margin: 8px 0; padding-left: 20px; }
.blocker-box li { margin: 4px 0; }

/* Product workspaces keep decisions and results together without nesting panels. */
.workspace-section { padding: 28px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.workspace-section h2 { font-size: 21px; margin-bottom: 18px; }
.workspace-section h3 { margin: 0 0 8px; font-size: 17px; }
.workspace-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.workspace-tabs a { color: var(--green); background: var(--green-soft); }
.product-workspace-row, .creation-row, .recommendation-row { display: flex; align-items: center; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.product-row-copy, .creation-row > div, .recommendation-row > div { flex: 1; min-width: 0; }
.product-workspace-row img { width: 104px; height: 104px; object-fit: contain; background: white; }
.product-thumb-empty { width: 104px; height: 104px; display: grid; place-content: center; background: var(--green-soft); color: var(--green); flex-shrink: 0; }
.creation-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .55fr); gap: 40px; margin-top: 28px; }
.creation-main, .creation-context { min-width: 0; }
.creation-context { border-left: 1px solid var(--line); padding-left: 28px; }
.creation-context h3 { margin-top: 26px; }
.creation-picker { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 18px 0; }
.creation-picker label { flex: 1; min-width: min(240px, 100%); }
.creation-picker button { min-height: 44px; }
.product-intro { display: flex; gap: 24px; align-items: center; margin-bottom: 24px; }
.product-intro img { object-fit: contain; background: white; }
.photo-empty { padding: 30px 20px; background: var(--green-soft); color: var(--green); flex-shrink: 0; }
.product-photos { display: flex; flex-wrap: wrap; gap: 16px; }
.product-photos figure { margin: 0; }
.product-photos img { object-fit: contain; background: white; max-width: 100%; }
.product-photo-upload { margin: 12px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.product-photo-upload button.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.plan-row { padding: 22px 0; border-bottom: 1px solid var(--line); }
.action-bar { padding: 20px; background: var(--green-soft); display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.creation-main textarea { font: inherit; }
.main { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.sidebar :focus-visible { outline-color: #d5f2df; }
summary { cursor: pointer; padding: 10px 0; }
.actions { flex-wrap: wrap; }
@media (max-width: 800px) {
 .creation-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
 .creation-context { border-left: 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
 .product-workspace-row, .creation-row, .recommendation-row, .product-intro { flex-wrap: wrap; gap: 16px; }
 .product-workspace-row .actions { width: 100%; }
 .workspace-tabs { gap: 4px; }
}
.result-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.result-gallery figure { margin: 0; min-width: 0; }
.result-gallery img, .result-gallery video { width: 100%; max-height: 560px; object-fit: contain; background: white; }
.result-gallery figcaption { padding: 8px 0; color: var(--muted); }
.manager-layout{display:grid;grid-template-columns:minmax(220px,300px) minmax(0,1fr);gap:1rem;align-items:start}.manager-context,.manager-chat{min-width:0}.manager-scope{display:grid;gap:.25rem;padding:1rem;margin-top:1rem;border:1px solid var(--border,#d9dee7);border-radius:12px;background:var(--surface-muted,#f6f7f9)}.manager-scope span{font-size:1.1rem;font-weight:700}.manager-messages{display:grid;gap:1rem;min-height:360px;max-height:62vh;overflow:auto;padding:1rem;background:var(--surface-muted,#f6f7f9);border-radius:12px}.manager-message{max-width:90%;padding:1rem;border-radius:14px;background:#fff;border:1px solid var(--border,#d9dee7);white-space:pre-wrap}.manager-message.user{justify-self:end;background:#e8f1ff}.manager-message.assistant{justify-self:start}.manager-message.tool{justify-self:start;background:#f3f1ea}.message-label{font-size:.8rem;font-weight:700;color:var(--text-muted,#667085);margin-bottom:.45rem}.message-body{line-height:1.65}.manager-composer,.manager-upload{display:grid;gap:.65rem;margin-top:1rem}.composer-footer{display:flex;justify-content:space-between;gap:1rem;align-items:center}.manager-chat details{margin-top:.75rem;font-size:.85rem}.manager-files{display:grid;gap:.75rem;margin-top:1rem}.file-card{display:grid;gap:.35rem;padding:.85rem;border:1px solid var(--line,#dfe5e0);border-radius:12px;background:#fff;white-space:normal}.file-card-head{display:flex;gap:.4rem;flex-wrap:wrap}.file-card.status-FAILED{border-color:#d8b4ae;background:#fbf3f1}.file-card.status-AWAITING_SCOPE{border-color:#e0c48a;background:#fff9ef}.manager-preview{max-width:100%;max-height:240px;object-fit:contain;background:#f6f7f9;border-radius:8px}.memory-confirm{display:grid;gap:.6rem;margin-top:.75rem;white-space:normal}@media(max-width:760px){.manager-layout{grid-template-columns:1fr}.manager-messages{max-height:none}.composer-footer{align-items:flex-start;flex-direction:column}}
.task-progress { margin: 0 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task-progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.progress-track { height: 10px; border-radius: 999px; background: #e7ece8; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--green); }
.progress-steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; padding: 0; }
.progress-steps li { font-size: 12px; color: var(--muted); }
.progress-steps li[data-state="done"] { color: var(--green); font-weight: 700; }
.progress-steps li[data-state="current"] { color: var(--ink); font-weight: 800; }
.progress-steps li[data-state="failed"] { color: var(--danger); font-weight: 800; }
.task-progress-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.task-progress-confirm { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.task-progress-confirm h2 { margin: 0; font-size: 16px; }
.task-progress-confirm .stack { gap: 12px; }
.task-progress-confirm fieldset { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.task-progress-secondary { margin: 8px 0 0; }

/* ───────── 产品资料网格 ─────────
   每行 4–5 个产品，卡片只承担「这是哪个产品、状态如何、从这里进去」三件事。
   资料正文、证据、历史版本都在产品空间里看，不在网格里摊开。 */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.product-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.product-search { display: flex; align-items: center; gap: 8px; }
.product-search input { width: min(260px, 52vw); }
.product-search button { min-height: 40px; white-space: nowrap; }
.product-toolbar > button.primary { min-height: 40px; padding: 9px 16px; font-weight: 650; }
.result-count { margin: 0 0 16px; }

/* ───────── 验收指标横幅 ─────────
   只在有事要办时出现。每条都是「是什么 / 为什么 / 怎么办」三行，
   少一行就会变成又一个没人看的数字。 */
.gate-banner {
  margin: 0 0 22px; padding: 16px 18px;
  border: 1px solid #e3c9a0; border-radius: 12px; background: #fdf8ee;
}
.gate-banner-head {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: baseline; gap: 10px; margin-bottom: 10px;
}
.gate-banner-head strong { font-size: 15px; color: #754604; }
.gate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gate-item { padding-left: 12px; border-left: 3px solid #e0b26a; }
.gate-item.gate-breach { border-left-color: var(--danger); }
.gate-item p { margin: 0; line-height: 1.65; }
.gate-head { font-weight: 650; }
.gate-tag {
  display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px;
  background: #f3e2c4; color: #754604; font-size: 11px; font-weight: 800;
}
.gate-item.gate-breach .gate-tag { background: #fee9e5; color: #97372b; }
.gate-why, .gate-how { font-size: 13px; color: #5c5346; margin-top: 4px; }
.product-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
}
.product-grid-empty { grid-column: 1 / -1; }
.product-tile {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 5px 18px rgba(22, 48, 36, .04); overflow: hidden;
}
.product-tile-cover {
  display: block; aspect-ratio: 1 / 1; background: #f7f9f7;
  border-bottom: 1px solid var(--line);
}
.product-tile-cover img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-tile-cover-empty {
  display: grid; place-content: center; width: 100%; height: 100%;
  color: var(--muted); font-size: 13px;
}
.product-tile-body { padding: 14px 16px 6px; flex: 1; min-width: 0; }
.product-tile-name { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.product-tile-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.product-tile-code {
  margin: 4px 0 0; color: var(--muted); font-size: 12px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.product-tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 12px; }
.product-tile-note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; }
/* 卡片上的「下一步」。挡路的那种给个左边框，不挡路的（可以做图了）保持安静。 */
.tile-next {
  margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line);
  font-size: 12px; line-height: 1.6;
}
.tile-next.blocking { border-top-color: #e0b26a; }
.tile-next a { font-weight: 650; }
.tile-next span { display: block; margin-top: 2px; }
.product-tile-foot { padding: 12px 16px 14px; }
.product-tile-foot .primary-action { display: block; text-align: center; }
.product-tile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.product-tile-actions form { flex: 1; min-width: 0; }
.product-tile-actions button, .product-tile-actions .secondary-action {
  width: 100%; min-height: 36px; font-size: 13px; text-align: center;
}
.product-tile-more > summary { font-size: 13px; color: var(--muted); padding: 8px 0 0; }
.product-tile-more-body { display: grid; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; }
.product-tile-more-body .actions { margin-top: 0; }
.product-tile-more-body button, .product-tile-more-body .secondary-action { font-size: 13px; }
.product-tile-more-body button.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }

/* ───────── 弹出框 ─────────
   用原生 <dialog>：焦点陷阱、Esc 关闭、背景惰性全部由浏览器负责，
   自己拿 div 拼一个模态框迟早在键盘操作上出问题。 */
.app-dialog {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  padding: 0 26px 24px; border: 1px solid var(--line); border-radius: 16px;
  color: var(--ink); background: var(--panel);
  box-shadow: 0 30px 80px rgba(16, 39, 30, .28);
}
.app-dialog::backdrop { background: rgba(14, 32, 24, .45); }
.app-dialog h2 { font-size: 21px; }
.app-dialog > p { margin: 8px 0 0; }
.app-dialog-close-row {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end;
  padding: 12px 0 4px; margin: 0 -26px; padding-right: 26px; background: var(--panel);
}
.app-dialog-close {
  border: 0; background: none; font-size: 24px; line-height: 1;
  padding: 2px 6px; color: var(--muted); cursor: pointer;
}
.app-dialog-close:hover { color: var(--ink); }
.app-dialog-body { margin-top: 18px; }
.dialog-uploads {
  border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 14px; margin: 0; min-width: 0;
}
.dialog-uploads legend { padding: 0 6px; font-weight: 650; }
.dialog-uploads p { margin: 10px 0 0; font-size: 12px; line-height: 1.6; }
.app-dialog-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; padding: 14px 0 4px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.app-dialog-actions button { min-height: 42px; padding: 9px 18px; }
@media (max-width: 700px) {
  .app-dialog { padding: 0 16px 18px; }
  .app-dialog-close-row { margin: 0 -16px; padding-right: 16px; }
}
/* ───────── 产品空间：把平铺的信息分块 ─────────
   原来「数据依据」「建议」「说明」三类内容一路平铺，没有边界，读者分不清哪句管哪句。 */
.workspace-block {
  margin: 20px 0 8px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 12px; background: #fafcfa;
}
.workspace-block-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 4px;
}
.workspace-block-head h3 { margin: 0; font-size: 15px; }
.workspace-block-head span { font-size: 12px; }
.workspace-block .creation-picker { margin: 12px 0; }
.workspace-block > details > summary { font-size: 13px; color: var(--muted); }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 4px 0 12px; }
.metric-row div { display: grid; gap: 2px; }
.metric-row dt { color: var(--muted); font-size: 12px; }
.metric-row dd { margin: 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-row dd.metric-source { font-size: 13px; font-weight: 400; color: var(--muted); }
.data-link-details > summary { font-size: 13px; color: var(--muted); }
.workspace-subhead { margin: 28px 0 4px; font-size: 15px; }
/* 人工补充建议。给它自己的底色，一眼能和模型写的东西分开。 */
.advice-block {
  margin: 22px 0 8px; padding: 18px 20px;
  border: 1px solid #cfe2d6; border-radius: 12px; background: #f4faf6;
}
.advice-note { padding: 14px 0; border-bottom: 1px solid #dcebe2; }
.advice-note:last-of-type { border-bottom: 0; }
.advice-note textarea { font: inherit; background: #fff; }
.advice-note-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 10px; font-size: 12px;
}
.advice-note-foot .actions { margin: 0; }
.advice-note-foot button { font-size: 13px; }
.advice-add { margin-top: 12px; }
.advice-add > summary { font-weight: 650; color: var(--green); }
.advice-add textarea { font: inherit; background: #fff; }
.workspace-section h4 { margin: 0 0 6px; font-size: 15px; }
.intro-facts { display: grid; gap: 8px; margin: 10px 0; }
.intro-facts div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.intro-facts dt { color: var(--muted); }
.intro-facts dd { margin: 0; }
.footnote { margin-top: 20px; font-size: 12px; }

/* ───────── 提交需求页：先让操作者看见要填的三样，说明文字一律收起 ───────── */
.make-advanced, .make-notes { border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; }
.make-advanced > summary, .make-notes > summary { font-weight: 650; color: var(--green); }
.make-notes > summary { font-weight: 400; color: var(--muted); font-size: 13px; }
.make-advanced .details-body, .make-notes .details-body { padding-bottom: 14px; }
.make-notes p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.make-notes p:last-child { margin-bottom: 0; }
.scope-picker { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.scope-picker legend { margin-bottom: 8px; font-weight: 650; }
.scope-option {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  cursor: pointer; font-weight: 400;
}
.scope-option:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.scope-option input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.scope-option > span { display: grid; gap: 3px; min-width: 0; }
.scope-option strong { font-size: 15px; }
.scope-option small { font-size: 12px; line-height: 1.55; }
.scope-recommend {
  margin: 2px 0 0; padding: 10px 12px; border-radius: 9px;
  background: #fff7e8; color: #754604; font-size: 13px; line-height: 1.6;
}
.option-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; }
.make-options[hidden] { display: none; }
.make-options { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 14px; margin: 0; min-width: 0; }
.make-options legend { padding: 0 6px; font-weight: 650; }
.make-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.need-field { display: grid; gap: 6px; }
.need-field-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.need-field-label { color: #3e4b44; font-weight: 650; }
.need-field textarea { font: inherit; }
.link-action {
  border: 1px solid var(--green); background: #fff; color: var(--green);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 650; cursor: pointer;
}
.link-action:hover:not(:disabled) { background: var(--green-soft); }
.refine-note { margin: 2px 0 0; font-size: 12px; line-height: 1.6; }
@media (max-width: 650px) { .make-options-grid { grid-template-columns: minmax(0, 1fr); } }

/* 创作中心：筛选和待审批并排，审批入口不再需要单独一个侧边栏页面。 */
.tasks-filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 18px 0; }
.tasks-filter-bar .creation-picker { flex: 1; margin: 0; min-width: min(320px, 100%); }
.pending-button {
  min-height: 44px; padding: 9px 16px; font-weight: 650;
  border: 1px solid var(--green); color: var(--green); background: #fff;
}
.pending-button:hover { background: var(--green-soft); }
.pending-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pending-actions button { font-size: 13px; white-space: nowrap; }
.nav-count {
  display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px;
  border-radius: 999px; background: #d5f2df; color: #15482f;
  font-size: 11px; font-weight: 800; text-align: center;
}
.optional-extras { margin: 16px 0; padding: 8px 0; border-top: 1px solid var(--line); }
.optional-extras > summary { color: var(--muted); font-weight: 650; }
@media (max-width: 700px) { .progress-steps { grid-template-columns: minmax(0, 1fr); } }
