:root {
  --navy: #0f2744;
  --navy-2: #1a3a5c;
  --gold: #d4a843;
  --gold-dim: #b8922f;
  --bg: #0b1524;
  --panel: #132338;
  --panel-2: #1a2d45;
  --text: #e8eef6;
  --muted: #8fa3b8;
  --line: rgba(255, 255, 255, 0.08);
  --ok: #3ecf8e;
  --danger: #f07178;
  --teal: #2dd4bf;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 50%),
    radial-gradient(900px 500px at 100% 0%, #2a1f0a 0%, transparent 40%), var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

/* Mock AI 顶栏 */
.mock-banner {
  background: linear-gradient(90deg, #3a2a0a, #1a2d1a);
  color: #f0d78c;
  font-size: 0.72rem;
  text-align: center;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.25);
  letter-spacing: 0.02em;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* 统一焦点环（键盘可达） */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

.btn,
.btn-icon,
.lib-tab,
.frame-chip,
.nav-tabs button {
  min-height: 36px;
}

/* —— Top nav —— */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(11, 21, 36, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #f0d78c);
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--panel);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.nav-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}

.nav-tabs button.active {
  background: var(--navy-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35);
}

.nav-tabs button:hover {
  color: var(--text);
}

@media (max-width: 768px) {
  .app-nav {
    flex-wrap: wrap;
    padding: 0.6rem 0.75rem;
  }
  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs button {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .demo-shell {
    display: none; /* 窄屏编辑台隐藏，引导用阅读预览 */
  }
  .view[data-view="demo"].active .demo-shell {
    display: block;
  }
  .view[data-view="demo"].active::before {
    content: "窄屏建议使用「交付预览」阅读；完整编辑请在电脑上操作。";
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: var(--gold);
    background: rgba(212, 168, 67, 0.08);
    border-bottom: 1px solid var(--line);
  }
}

/* 研究员表单 */
.summary-box {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
}

.advanced-json {
  margin: 0.75rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem 0.65rem 0.65rem;
  background: rgba(0, 0, 0, 0.15);
}

.advanced-json summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.35rem 0;
}

.advanced-json[open] summary {
  color: var(--gold);
  margin-bottom: 0.35rem;
}

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

/* 交付预览（阅读模式 — 正式咨询报告纸面） */
.reader-shell {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(212, 168, 67, 0.08), transparent 55%),
    linear-gradient(180deg, #eef2f7 0%, #e4eaf2 100%);
}

.reader-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid rgba(15, 39, 68, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  color: #0f2744;
}

.reader-bar strong {
  color: #0f2744;
  font-size: 0.95rem;
}

.reader-bar .hint {
  color: #6b7c8f;
  font-size: 0.78rem;
}

.reader-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.reader-scroll {
  flex: 1;
  overflow: auto;
  overflow-x: hidden;
  padding: 1.75rem 1.25rem 3.5rem;
}

.reader-page {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 20px 50px rgba(15, 39, 68, 0.1),
    0 4px 12px rgba(15, 39, 68, 0.04);
  border: 1px solid rgba(15, 39, 68, 0.07);
}

/* 阅读默认 light：高对比正文 */
.reader-page.theme-navy {
  background: #0f2744;
  color: #e8eef6;
}

.reader-page.theme-light {
  background: #ffffff;
  color: #152536;
}

.reader-page.theme-light .pv-p,
.reader-page.theme-light .pv-card-text,
.reader-page.theme-light .pv-tl-text,
.reader-page.theme-light .pv-split-p {
  color: #2a3b4d;
  opacity: 1;
}

.reader-page.theme-light .pv-status-bar {
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  color: #152536;
  padding: 0.85rem 1.75rem;
}

.reader-page.theme-light .pv-nav {
  background: #fff;
  padding: 0.85rem 1.5rem 1rem;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(15, 39, 68, 0.07);
}

.reader-page.theme-light .pv-footer {
  color: #7a8b9c;
  opacity: 1;
  padding: 1.25rem 1.75rem 1.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

/* 阅读模式隐藏编辑用章节标签，避免与目录重复 */
.reader-page .canvas-sec-label {
  display: none;
}

.reader-page .canvas-block.is-readonly {
  margin: 0.35rem 0;
}

.reader-page.theme-teal {
  background: #0b2a28;
  color: #e6fffa;
}

.reader-empty {
  padding: 5rem 1.5rem;
  text-align: center;
  color: #6b7c8f;
  line-height: 1.75;
  background: #fff;
  font-size: 0.95rem;
}

/* 390 移动阅读：禁止横向撑破 */
@media (max-width: 600px) {
  .mock-banner {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
    font-size: 0.68rem;
    padding: 0.4rem 0.5rem;
  }

  .reader-scroll {
    padding: 0 0 2rem;
    overflow-x: hidden;
  }

  .reader-page {
    width: 100%;
    max-width: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .reader-page .pv-status-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .reader-page .pv-status-meta {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .reader-page .pv-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .reader-page .pv-nav button {
    flex: 0 0 auto;
  }

  .reader-page .pv-hero-title {
    max-width: none;
    font-size: 1.35rem;
    overflow-wrap: anywhere;
  }

  .reader-page .pv-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-page .pv-chart-row {
    grid-template-columns: 4.5rem minmax(0, 1fr) 2rem;
  }

  .reader-page .pv-cards-grid,
  .reader-page .pv-split {
    grid-template-columns: 1fr;
  }

  .reader-page .pv-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .reader-bar {
    padding: 0.65rem 0.75rem;
  }
}

/* AI 差异建议面板 */
.ai-diff-panel {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.08);
}

.ai-diff-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--gold);
}

.ai-diff-item {
  font-size: 0.75rem;
  line-height: 1.45;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.ai-diff-item strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

.ai-diff-item .diff-before {
  text-decoration: line-through;
  opacity: 0.7;
}

.ai-diff-item .diff-after {
  color: var(--ok);
}

.ai-diff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.ai-status {
  font-size: 0.72rem;
  margin: 0.35rem 0;
  min-height: 1.2em;
}

.ai-status.is-error {
  color: var(--danger);
}

.ai-status.is-busy {
  color: var(--gold);
}

.ai-status.is-ok {
  color: var(--ok);
}

.insp-block-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
}

.insp-block-tools .btn-icon {
  font-size: 0.7rem;
  padding: 0 0.5rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-left: 0.45rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--line);
}

.toolbar-group:first-child {
  border-left: 0;
  padding-left: 0;
  margin-left: 0;
}

.insert-target-hint {
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0.35rem 0 0;
}

.panel-section {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.panel-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.canvas-block.is-readonly {
  cursor: default;
  outline: none !important;
  box-shadow: none !important;
}

.canvas-block.is-readonly:hover {
  background: transparent;
  outline: none;
}

/* 去掉假缩放手柄样式占用（已不再渲染） */
.sel-handles {
  display: none !important;
}

/* ========== V3 战略报告表面 · 排版精修 ========== */
.canvas-page.theme-light {
  background: #fbfcfe;
  color: #152536;
}

.canvas-page.theme-light .pv-body,
.reader-page.theme-light .pv-body {
  padding: 0.25rem 2rem 2.75rem;
}

.reader-page.theme-light .pv-body {
  padding: 0.5rem 2.25rem 2.75rem;
}

.canvas-page.theme-light .canvas-sec-label {
  color: #8a9aab;
  border-bottom: 1px solid rgba(15, 39, 68, 0.06);
  padding-bottom: 0.4rem;
  margin: 1.85rem 0 0.85rem;
  letter-spacing: 0.1em;
}

/* 章节标题 */
.canvas-page.theme-light .pv-h2,
.reader-page.theme-light .pv-h2 {
  font-size: 1.28rem;
  font-weight: 720;
  color: #0c2138;
  margin: 1.65rem 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid rgba(15, 39, 68, 0.08);
  letter-spacing: -0.01em;
  position: relative;
}

.reader-page.theme-light .pv-h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 2.75rem;
  height: 2px;
  background: linear-gradient(90deg, #d4a843, rgba(212, 168, 67, 0.15));
  border-radius: 1px;
}

.canvas-page.theme-light .pv-p,
.reader-page.theme-light .pv-p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: #2c3e50;
}

.canvas-page.theme-light .pv-badge,
.reader-page.theme-light .pv-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.12);
  color: #9a6b2f;
  border: 1px solid rgba(212, 168, 67, 0.28);
  margin: 0.5rem 0 0.85rem;
}

.canvas-page.theme-light .pv-callout,
.reader-page.theme-light .pv-callout {
  margin: 1rem 0;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.08), rgba(212, 168, 67, 0.03));
  border: 1px solid rgba(212, 168, 67, 0.22);
  border-left: 3px solid #d4a843;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #1e3348;
}

.canvas-page.theme-light .pv-split-col,
.reader-page.theme-light .pv-split-col {
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.04);
}

.rp-demo-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  color: #9a6b2f;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.28);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin-top: 0.55rem;
  letter-spacing: 0.02em;
}

.rp-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b8922f;
  margin-bottom: 0.55rem;
}

.rp-field-h {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f2744;
  margin: 0.65rem 0 0.3rem;
}

.rp-p {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #2c3e50;
}

.rp-ul {
  margin: 0.3rem 0 0.55rem;
  padding-left: 1.15rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #2c3e50;
}

.rp-ul li {
  margin: 0.28rem 0;
}

.rp-expand-btn {
  border: 1px solid rgba(15, 39, 68, 0.12);
  background: #fafbfc;
  color: #3d4f63;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  margin-top: 0.55rem;
  cursor: pointer;
  min-height: 34px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.rp-expand-btn:hover {
  border-color: rgba(212, 168, 67, 0.55);
  color: #9a6b2f;
  background: rgba(212, 168, 67, 0.08);
}

/* AI 配图合规标注 */
.rp-img-credit {
  font-size: 0.66rem;
  line-height: 1.5;
  color: #7a8b9c;
  margin-top: 0.45rem;
  padding: 0.4rem 0.6rem;
  background: #f5f7fa;
  border-radius: 8px;
  border-left: 3px solid rgba(212, 168, 67, 0.5);
}

.rp-figure-chapter {
  font-size: 0.64rem;
  color: #93a1b0;
  margin-top: 0.3rem;
}

/* visualRole 布局 */
.rp-figure {
  margin: 1rem 0 1.25rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.rp-figure.role-context .rp-figure-row,
.rp-figure.role-explanation .rp-figure-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.1rem;
  align-items: center;
  padding: 0.85rem;
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(15, 39, 68, 0.04);
}

.rp-figure.role-transition {
  margin: 0.75rem 0 1.1rem;
}

.rp-figure.role-transition .pv-figure-art {
  aspect-ratio: 21 / 7;
  max-height: 148px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 39, 68, 0.08);
}

.rp-figure.role-transition .pv-figure-img {
  max-height: 148px;
  width: 100%;
  object-fit: cover;
}

.rp-figure .pv-figure-art {
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.rp-figure-body .pv-figure-cap {
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f2744;
  margin: 0 0 0.35rem;
  border: 0;
  padding: 0;
  background: transparent;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .rp-figure.role-context .rp-figure-row,
  .rp-figure.role-explanation .rp-figure-row {
    grid-template-columns: 1fr;
  }
}

/* 封面 */
.rp-cover {
  padding: 1.75rem 0 0.75rem;
}
.rp-cover-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: #b8922f;
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.rp-cover-title {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 2.6vw, 1.95rem);
  line-height: 1.28;
  color: #0a1c30;
  font-weight: 760;
  letter-spacing: -0.02em;
  max-width: 18em;
}
.rp-cover-sub {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: #3d4f63;
  line-height: 1.55;
  font-weight: 500;
}
.rp-cover-meta {
  font-size: 0.78rem;
  color: #6b7c8f;
  margin-bottom: 1rem;
  line-height: 1.55;
  padding: 0.55rem 0.75rem;
  background: #f6f8fb;
  border-radius: 8px;
  display: inline-block;
  max-width: 100%;
}
.rp-cover-img {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 39, 68, 0.12);
}

/* 执行摘要 — 首屏视觉焦点 */
.rp-exec {
  background: linear-gradient(165deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid rgba(15, 39, 68, 0.08);
  border-left: 4px solid #d4a843;
  border-radius: 14px;
  padding: 1.25rem 1.35rem 1.35rem;
  margin: 0.75rem 0 1.35rem;
  box-shadow: 0 8px 28px rgba(15, 39, 68, 0.06);
}
.rp-exec-judgment {
  font-size: 1.08rem;
  font-weight: 680;
  line-height: 1.65;
  color: #0a1c30;
  margin-bottom: 1.1rem;
  letter-spacing: -0.01em;
}
.rp-exec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.rp-exec-col {
  background: #f7f9fc;
  border: 1px solid rgba(15, 39, 68, 0.06);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  min-height: 100%;
}
.rp-exec-col.findings {
  border-top: 3px solid #60a5fa;
}
.rp-exec-col.choices {
  border-top: 3px solid #d4a843;
}
.rp-exec-col.actions {
  border-top: 3px solid #3ecf8e;
}
.rp-exec-h {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: #0f2744;
  margin-bottom: 0.5rem;
}
.rp-exec-ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #2c3e50;
}
.rp-exec-ul li {
  margin: 0.35rem 0;
}

/* 核心发现 */
.rp-finding {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 14px;
  padding: 1rem 1.15rem 1.05rem;
  margin: 0.7rem 0;
  box-shadow: 0 3px 14px rgba(15, 39, 68, 0.04);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.rp-finding:hover {
  border-color: rgba(212, 168, 67, 0.35);
  box-shadow: 0 6px 20px rgba(15, 39, 68, 0.07);
}
.rp-finding-title {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #b8922f;
  margin-bottom: 0.35rem;
}
.rp-finding-conclusion {
  font-size: 0.98rem;
  font-weight: 680;
  color: #0a1c30;
  line-height: 1.55;
}
.rp-finding-detail {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 39, 68, 0.08);
}

/* SWOT */
.rp-swot {
  margin: 1rem 0;
}
.rp-swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.rp-swot-cell {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.03);
}
.rp-swot-h {
  font-size: 0.78rem;
  font-weight: 750;
  color: #0f2744;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(15, 39, 68, 0.06);
}

/* 战略选择 */
.rp-choice {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  margin: 0.75rem 0 1rem;
  box-shadow: 0 4px 16px rgba(15, 39, 68, 0.04);
}
.rp-choice-who {
  font-weight: 720;
  font-size: 1rem;
  color: #0a1c30;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.rp-choice-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.rp-choice-col {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(15, 39, 68, 0.07);
}
.rp-choice-col.ok {
  background: linear-gradient(180deg, rgba(62, 207, 142, 0.1), rgba(62, 207, 142, 0.04));
  border-color: rgba(62, 207, 142, 0.28);
}
.rp-choice-col.warn {
  background: linear-gradient(180deg, rgba(240, 113, 120, 0.08), rgba(240, 113, 120, 0.03));
  border-color: rgba(240, 113, 120, 0.25);
}

/* 业务组合 */
.rp-portfolio {
  margin: 0.5rem 0 1rem;
}
.rp-port-card {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 12px;
  padding: 0.9rem 1.05rem;
  margin: 0.55rem 0;
  box-shadow: 0 2px 12px rgba(15, 39, 68, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rp-port-card:hover {
  box-shadow: 0 6px 18px rgba(15, 39, 68, 0.07);
}
.rp-port-name {
  font-weight: 720;
  color: #0a1c30;
  font-size: 0.98rem;
}
.rp-port-meta {
  font-size: 0.78rem;
  color: #6b7c8f;
  margin: 0.25rem 0;
}
.rp-port-score {
  font-size: 0.72rem;
  color: #b8922f;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.rp-port-card.action-收缩 {
  border-left: 4px solid #f07178;
}
.rp-port-card.action-做强,
.rp-port-card.action-做优 {
  border-left: 4px solid #3ecf8e;
}
.rp-port-card.action-培育 {
  border-left: 4px solid #d4a843;
}

/* KPI */
.rp-kpi {
  margin: 0.5rem 0 1rem;
}
.rp-kpi-row {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 12px;
  padding: 0.9rem 1.05rem;
  margin: 0.55rem 0;
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.035);
}
.rp-kpi-name {
  font-weight: 720;
  color: #0a1c30;
  font-size: 0.95rem;
}
.rp-kpi-vals {
  font-size: 0.9rem;
  color: #1e3348;
  margin: 0.35rem 0;
  font-weight: 600;
}
.rp-kpi-meta,
.rp-kpi-def {
  font-size: 0.74rem;
  color: #6b7c8f;
  line-height: 1.5;
}

/* 路线图 */
.rp-roadmap {
  margin: 0.5rem 0 1rem;
  position: relative;
}
.rp-road-phase {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  margin: 0.7rem 0;
  border-left: 4px solid #d4a843;
  box-shadow: 0 3px 14px rgba(15, 39, 68, 0.04);
}
.rp-road-when {
  font-size: 0.7rem;
  color: #b8922f;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.rp-road-title {
  font-weight: 720;
  color: #0a1c30;
  margin: 0.3rem 0 0.4rem;
  font-size: 1rem;
}

/* 风险 */
.rp-risk-row {
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0;
  border: 1px solid rgba(15, 39, 68, 0.07);
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.03);
}
.rp-risk-row.level-high {
  border-left: 4px solid #f07178;
}
.rp-risk-row.level-mid {
  border-left: 4px solid #d4a843;
}
.rp-risk-name {
  font-weight: 720;
  color: #0a1c30;
}
.rp-risk-lv {
  font-size: 0.74rem;
  color: #b8922f;
  margin: 0.2rem 0 0.35rem;
  font-weight: 700;
}

/* 治理 */
.rp-gov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin: 0.5rem 0 1rem;
}
.rp-gov-card {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 12px;
  padding: 0.95rem 1.05rem;
  box-shadow: 0 2px 10px rgba(15, 39, 68, 0.035);
}
.rp-gov-h {
  font-weight: 720;
  font-size: 0.9rem;
  color: #0a1c30;
  margin-bottom: 0.35rem;
}

/* 来源 */
.rp-source {
  background: #f4f7fb;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0.55rem 0;
  font-size: 0.84rem;
  color: #3d4f63;
  line-height: 1.6;
  border: 1px solid rgba(15, 39, 68, 0.05);
}

/* 导航更像报告目录 */
.canvas-page.theme-light .pv-nav,
.reader-page.theme-light .pv-nav {
  background: #fff;
  border-bottom: 1px solid rgba(15, 39, 68, 0.07);
}
.canvas-page.theme-light .pv-nav button,
.reader-page.theme-light .pv-nav button {
  background: #f3f6fa;
  color: #1e3348;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.canvas-page.theme-light .pv-nav button:hover,
.reader-page.theme-light .pv-nav button:hover {
  background: rgba(212, 168, 67, 0.14);
  border-color: rgba(212, 168, 67, 0.35);
  color: #0f2744;
}
.reader-page.theme-light .pv-nav button[aria-current="true"] {
  background: rgba(212, 168, 67, 0.18);
  border-color: rgba(212, 168, 67, 0.45);
  color: #0a1c30;
  box-shadow: 0 1px 4px rgba(212, 168, 67, 0.2);
}

.canvas-page.theme-light .pv-status-bar {
  background: #fff;
  color: #0f2744;
  border-bottom: 1px solid rgba(15, 39, 68, 0.07);
  padding: 0.75rem 1.25rem;
}

.canvas-page.theme-light .pv-status-pill {
  font-weight: 650;
}

.canvas-page.theme-light .pv-footer {
  color: #7a8b9c;
  background: #fff;
}

/* 浅色主题下图表更干净 */
.canvas-page.theme-light .pv-chart,
.reader-page.theme-light .pv-chart {
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.07);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 12px rgba(15, 39, 68, 0.04);
}

.canvas-page.theme-light .pv-chart-track,
.reader-page.theme-light .pv-chart-track {
  background: #eef2f7;
}

@media (max-width: 600px) {
  .reader-scroll {
    padding: 0.75rem 0 2rem;
  }
  .reader-page.theme-light .pv-body {
    padding: 0.25rem 1.1rem 2rem;
  }
  .rp-exec-grid,
  .rp-choice-two,
  .rp-swot-grid,
  .rp-gov-grid {
    grid-template-columns: 1fr;
  }
  .rp-cover-title {
    font-size: 1.35rem;
    overflow-wrap: anywhere;
    max-width: none;
  }
  .rp-cover-img {
    max-height: 132px;
  }
  .rp-exec {
    padding: 1rem;
  }
  .rp-exec-judgment {
    font-size: 0.98rem;
  }
}

/* —— Views —— */
.view {
  display: none;
  min-height: calc(100vh - 64px);
}

.view.active {
  display: block;
}

/* —— Pitch —— */
.pitch {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: stretch;
  margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  background: linear-gradient(160deg, var(--panel) 0%, #0d1c2e 100%);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.hero h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.25;
  font-weight: 700;
}

.hero-lead {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0 0 1.5rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #1a1205;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-ok {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
  box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.35);
}

.btn-danger {
  background: rgba(240, 113, 120, 0.12);
  color: var(--danger);
}

.stat-stack {
  display: grid;
  gap: 0.75rem;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.stat strong {
  display: block;
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.section-title {
  margin: 2.5rem 0 1rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 800px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .flow {
    grid-template-columns: 1fr;
  }
}

.flow-step {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--line);
  position: relative;
}

.flow-step .n {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.flow-step h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.flow-step p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.ai-callout {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.12), transparent);
  border: 1px solid rgba(212, 168, 67, 0.25);
}

.ai-callout strong {
  color: var(--gold);
}

.ask-box {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--navy-2);
  border: 1px solid rgba(212, 168, 67, 0.3);
}

.ask-box ol {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.7;
}

/* —— Demo workspace —— */
.demo-shell {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  height: calc(100vh - 64px);
  min-height: 520px;
}

@media (max-width: 1100px) {
  .demo-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* 左右栏可滚动，中间画布占满高度 */
.demo-shell > .pane {
  overflow: auto;
  min-height: 0;
}

.pane {
  border-right: 1px solid var(--line);
  min-height: 100%;
}

.pane:last-child {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.pane-hd {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.pane-hd h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.pane-body {
  padding: 1rem;
}

.source-box {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}

.tool-col {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0.5rem 0 0;
}

/* —— Infinite canvas (live preview + edit) —— */
.canvas-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #070d16;
  overflow: hidden;
}

/* —— 资料 / 素材 / 模块 库 —— */
.library-dock {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.96);
  max-height: 20vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.library-dock.is-collapsed {
  max-height: none;
}

.library-dock.is-collapsed .library-hint,
.library-dock.is-collapsed .library-panel {
  display: none !important;
}

.library-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.library-tabs .lib-collapse-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 8px;
  font-size: 0.72rem;
  font-family: inherit;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  min-height: 32px;
}

.library-tabs .lib-collapse-btn:hover {
  color: var(--text);
  border-color: rgba(212, 168, 67, 0.4);
}

.lib-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

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

.lib-tab.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.library-hint {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.3rem 0.75rem 0;
  line-height: 1.4;
}

.library-panel {
  display: none;
  flex: 1;
  overflow: auto;
  padding: 0.5rem 0.65rem 0.65rem;
  gap: 0.45rem;
  align-content: start;
}

.library-panel.active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.library-panel[data-lib-panel="docs"].active {
  grid-template-columns: 1fr;
}

.lib-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  cursor: grab;
  user-select: none;
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
}

.lib-card:hover {
  border-color: rgba(212, 168, 67, 0.45);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.lib-card:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.lib-card.is-dragging {
  opacity: 0.45;
}

.lib-card-icon {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 700;
}

.lib-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.lib-card-desc {
  font-size: 0.65rem;
  color: var(--muted);
  line-height: 1.35;
}

.lib-card-thumb {
  width: 100%;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #0a1018;
  margin-bottom: 0.2rem;
}

.lib-card-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.lib-add-btn {
  border: 0;
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  font-size: 0.65rem;
  font-family: inherit;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
}

.lib-add-btn:hover {
  background: rgba(212, 168, 67, 0.28);
}

.lib-doc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.lib-doc-row .lib-card-name {
  font-size: 0.8rem;
}

.lib-doc-kind {
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  white-space: nowrap;
}

/* 画布投放目标高亮 */
.pv-section.is-drop-target {
  outline: 2px dashed rgba(212, 168, 67, 0.75);
  outline-offset: 4px;
  background: rgba(212, 168, 67, 0.06);
  border-radius: 8px;
}

.canvas-page.is-drop-hover {
  box-shadow:
    0 0 0 2px rgba(212, 168, 67, 0.55),
    0 28px 90px rgba(0, 0, 0, 0.55);
}

/* 画布内模块拖拽重排 */
.canvas-block[draggable="true"] {
  cursor: grab;
}

.canvas-block[draggable="true"]:active {
  cursor: grabbing;
}

.canvas-block.is-dragging-block {
  opacity: 0.45;
  outline: 1.5px dashed rgba(212, 168, 67, 0.7);
}

.canvas-block.drop-before {
  box-shadow: 0 -3px 0 0 #d4a843;
}

.canvas-block.drop-after {
  box-shadow: 0 3px 0 0 #d4a843;
}

.canvas-block .blk-type {
  cursor: grab;
}

.canvas-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.canvas-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
}

.canvas-toolbar-left strong {
  font-size: 0.9rem;
}

.canvas-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  min-width: 2rem;
  height: 1.85rem;
  padding: 0 0.55rem;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  line-height: 1;
}

.btn-icon:hover {
  border-color: rgba(212, 168, 67, 0.45);
  color: var(--gold);
}

.zoom-label {
  min-width: 3.2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 章节快捷条（非侧栏帧列表） */
.canvas-frames {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  max-height: 4.5rem;
  overflow: auto;
}

.frame-chip {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  white-space: nowrap;
}

.frame-chip.active,
.frame-chip:hover {
  border-color: rgba(212, 168, 67, 0.5);
  color: var(--text);
}

/* 无限视口：点阵背景 + 可拖拽平移 */
.canvas-viewport {
  position: relative;
  flex: 1;
  min-height: 420px;
  overflow: hidden;
  cursor: grab;
  /* 无限感：点阵网格，平移时由 world 带动感更弱，视口固定点阵即可 */
  background-color: #0a1018;
  background-image: radial-gradient(
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  background-position: 0 0;
  user-select: none;
}

.canvas-viewport.is-panning {
  cursor: grabbing;
}

.canvas-viewport.is-space {
  cursor: grab;
}

/*
 * 世界层：left/top 平移 + CSS zoom 缩放（见 app.js applyCanvasTransform）。
 * 禁止 transform:scale 做主缩放 —— 会把文字栅格成位图再拉伸，放大必糊。
 * 禁止 will-change:transform。
 */
.canvas-world {
  position: absolute;
  left: 0;
  top: 0;
  padding: 48px;
  transform: none;
  will-change: auto;
  /* 亚像素抗锯齿：在 zoom=1 时最清晰；放大时由 zoom 重绘 */
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
}

.artboard {
  width: 880px;
  position: relative;
  transform-origin: 0 0;
}

/* 报告正文：避免被父级合成层影响时出现发虚 */
.canvas-page,
.reader-page {
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: auto;
}

.canvas-page.theme-light,
.reader-page.theme-light {
  /* 浅色报告页用默认灰度抗锯齿，对比度更高 */
  -webkit-font-smoothing: auto;
}

.artboard-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  padding: 0 0.15rem;
  user-select: none;
}

.artboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.artboard-dot:nth-child(1) {
  background: #ff5f57;
}
.artboard-dot:nth-child(2) {
  background: #febc2e;
}
.artboard-dot:nth-child(3) {
  background: #28c840;
}

.artboard-title {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  color: rgba(232, 238, 246, 0.72);
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artboard-size {
  margin-left: auto;
  font-size: 0.68rem;
  color: rgba(143, 163, 184, 0.75);
  font-variant-numeric: tabular-nums;
}

/* 交付页画板：在线设计式图文页 */
.canvas-page {
  width: 880px;
  min-height: 960px;
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(212, 168, 67, 0.15);
  overflow: hidden;
  margin: 0;
  cursor: default;
  user-select: text;
  position: relative;
}

.canvas-page.is-loaded::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 5;
  border-radius: inherit;
}

.canvas-page.theme-navy {
  background: #0f2744;
  color: #e8eef6;
}

.canvas-page.theme-light {
  background: #fafbfc;
  color: #1a2332;
}

.canvas-page.theme-teal {
  background: #0b2a28;
  color: #e6fffa;
}

.canvas-empty {
  color: var(--muted);
  text-align: center;
  padding: 6rem 1.5rem;
  line-height: 1.7;
  background:
    radial-gradient(500px 200px at 50% 30%, rgba(212, 168, 67, 0.08), transparent 60%),
    #121c2a;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.canvas-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.35);
  color: var(--gold);
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.canvas-empty strong {
  color: var(--text);
  font-size: 1rem;
}

.canvas-empty span {
  font-size: 0.85rem;
  max-width: 22rem;
}

/* 页内状态条 */
.pv-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1.15rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.15);
  background: rgba(0, 0, 0, 0.12);
  font-size: 0.72rem;
}

.canvas-page.theme-light .pv-status-bar {
  background: rgba(15, 39, 68, 0.04);
}

.pv-status-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
  font-weight: 600;
}

.pv-status-pill.ok {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
}

.pv-status-meta {
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pv-footer {
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid rgba(128, 128, 128, 0.12);
  font-size: 0.7rem;
  opacity: 0.55;
  text-align: center;
}

.pv-section {
  position: relative;
}

/* 页内导航（与交付预览一致） */
.pv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  background: inherit;
}

.pv-nav button {
  border: 0;
  background: rgba(128, 128, 128, 0.12);
  color: inherit;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
}

.pv-nav button:hover {
  background: rgba(212, 168, 67, 0.22);
}

.pv-body {
  padding: 0 0 2.75rem;
}

.canvas-page section[data-sec] {
  padding: 0.35rem 1.5rem 0.65rem;
}

/* 封面章节：Hero 通栏，其余块仍有左右边距 */
.canvas-page section[data-sec]:first-of-type {
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

.canvas-page section[data-sec]:first-of-type .canvas-sec-label {
  padding: 0.75rem 1.5rem 0.25rem;
}

.canvas-page section[data-sec]:first-of-type .canvas-block {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.canvas-page section[data-sec]:first-of-type .canvas-block:has(.pv-hero) {
  padding-left: 0;
  padding-right: 0;
}

/* —— Hero 封面 —— */
.pv-hero {
  margin: 0 0 1rem;
  padding: 2rem 1.75rem 1.7rem;
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(212, 168, 67, 0.22), transparent 55%),
    linear-gradient(145deg, #0c1f38 0%, #132f4f 45%, #0a1628 100%);
  border-bottom: 1px solid rgba(212, 168, 67, 0.25);
  position: relative;
  overflow: hidden;
}

.pv-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 180px;
  height: 180px;
  border-radius: 40% 60% 50% 50%;
  background: rgba(45, 212, 191, 0.08);
  pointer-events: none;
}

.pv-hero.kind-qianhai {
  background:
    radial-gradient(500px 180px at 85% 20%, rgba(240, 215, 140, 0.18), transparent 50%),
    linear-gradient(160deg, #0a192f 0%, #123a5c 40%, #0c2a3a 100%);
}

.canvas-page.theme-light .pv-hero {
  background:
    radial-gradient(500px 180px at 90% 0%, rgba(212, 168, 67, 0.2), transparent 55%),
    linear-gradient(145deg, #f8fafc 0%, #e8eef6 100%);
  border-bottom-color: rgba(15, 39, 68, 0.1);
  color: #0f2744;
}

.canvas-page.theme-teal .pv-hero {
  background:
    radial-gradient(500px 180px at 90% 0%, rgba(45, 212, 191, 0.25), transparent 55%),
    linear-gradient(145deg, #042f2e 0%, #0b3d3a 100%);
}

.pv-hero-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.canvas-page.theme-light .pv-hero-kicker {
  color: #9a7b2f;
}

.pv-hero-title {
  margin: 0 0 0.65rem;
  font-size: 1.65rem;
  line-height: 1.28;
  font-weight: 750;
  max-width: 18em;
}

.pv-hero-sub {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1.55;
}

.pv-hero-meta {
  font-size: 0.78rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* —— 插图 figure：AI 实景配图 —— */
.pv-figure {
  margin: 0.75rem 0 1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a1018;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.canvas-page.theme-light .pv-figure {
  border-color: rgba(15, 39, 68, 0.1);
  background: #eef2f7;
}

.pv-figure-art {
  line-height: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #0f2744, #1a3a5c);
}

.pv-figure-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pv-figure-art.is-missing .pv-figure-img {
  display: none;
}

.pv-figure-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(232, 238, 246, 0.7);
  font-size: 0.85rem;
  padding: 1rem;
  text-align: center;
}

.pv-figure-cap {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.75rem;
  opacity: 0.8;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.45;
  background: rgba(0, 0, 0, 0.2);
}

.canvas-page.theme-light .pv-figure-cap {
  background: rgba(15, 39, 68, 0.04);
}

/* —— 指标卡 stats —— */
.pv-stats {
  margin: 0.75rem 0 1rem;
}

.pv-stats-title,
.pv-cards-title,
.pv-chart-title,
.pv-timeline-title {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212, 168, 67, 0.9);
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.canvas-page.theme-light .pv-stats-title,
.canvas-page.theme-light .pv-cards-title,
.canvas-page.theme-light .pv-chart-title,
.canvas-page.theme-light .pv-timeline-title {
  color: #9a7b2f;
}

.pv-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

@media (max-width: 600px) {
  .pv-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pv-stat {
  border-radius: 12px;
  padding: 0.75rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 88px;
}

.canvas-page.theme-light .pv-stat {
  background: #fff;
  border-color: rgba(15, 39, 68, 0.08);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.06);
}

.pv-stat.tone-ok {
  border-color: rgba(62, 207, 142, 0.35);
}

.pv-stat.tone-warn {
  border-color: rgba(240, 113, 120, 0.35);
}

.pv-stat.tone-info {
  border-color: rgba(96, 165, 250, 0.35);
}

.pv-stat-value {
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1.1;
  color: var(--gold);
}

.canvas-page.theme-light .pv-stat-value {
  color: #b8922f;
}

.pv-stat-unit {
  font-size: 0.72rem;
  opacity: 0.75;
  margin: 0.15rem 0 0.35rem;
}

.pv-stat-label {
  font-size: 0.72rem;
  opacity: 0.8;
  line-height: 1.35;
}

/* —— 卡片网格 —— */
.pv-cards {
  margin: 0.75rem 0 1rem;
}

.pv-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.pv-card {
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s, transform 0.15s;
}

.pv-card:hover {
  border-color: rgba(212, 168, 67, 0.4);
}

.canvas-page.theme-light .pv-card {
  background: #fff;
  border-color: rgba(15, 39, 68, 0.08);
  box-shadow: 0 4px 14px rgba(15, 39, 68, 0.05);
}

.pv-card-icon {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.pv-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.pv-card-text {
  font-size: 0.82rem;
  line-height: 1.55;
  opacity: 0.85;
}

/* —— 条形图 —— */
.pv-chart {
  margin: 0.75rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.canvas-page.theme-light .pv-chart {
  background: #fff;
  border-color: rgba(15, 39, 68, 0.08);
}

.pv-chart-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.2rem;
  gap: 0.5rem;
  align-items: center;
  margin: 0.4rem 0;
}

.pv-chart-label {
  font-size: 0.75rem;
  opacity: 0.85;
  text-align: right;
}

.pv-chart-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.canvas-page.theme-light .pv-chart-track {
  background: rgba(15, 39, 68, 0.08);
}

.pv-chart-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a3a5c, #d4a843);
  min-width: 4px;
  transition: width 0.35s ease;
}

.canvas-page.theme-teal .pv-chart-bar {
  background: linear-gradient(90deg, #134e4a, #2dd4bf);
}

.pv-chart-val {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

/* —— 时间线 —— */
.pv-timeline {
  margin: 0.75rem 0 1rem;
  padding-left: 0.25rem;
}

.pv-tl-step {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  position: relative;
}

.pv-tl-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 1.7rem;
  bottom: -0.85rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(212, 168, 67, 0.55), transparent);
}

.pv-tl-dot {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #d4a843, #b8922f);
  color: #0b1524;
  font-size: 0.75rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.pv-tl-when {
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.canvas-page.theme-light .pv-tl-when {
  color: #9a7b2f;
}

.pv-tl-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.pv-tl-text {
  font-size: 0.84rem;
  line-height: 1.55;
  opacity: 0.88;
}

/* —— 左右分栏 split —— */
.pv-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}

.pv-split-col {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.pv-split-col.ok {
  border-color: rgba(62, 207, 142, 0.35);
  background: rgba(62, 207, 142, 0.06);
}

.pv-split-col.warn {
  border-color: rgba(240, 113, 120, 0.35);
  background: rgba(240, 113, 120, 0.06);
}

.canvas-page.theme-light .pv-split-col {
  background: #fff;
}

.pv-split-h {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.pv-split-p {
  font-size: 0.84rem;
  line-height: 1.55;
  opacity: 0.9;
}

/* —— 引用 —— */
.pv-quote {
  margin: 0.85rem 0;
  padding: 1rem 1.15rem;
  border-radius: 0 12px 12px 0;
  border-left: 4px solid var(--gold);
  background: rgba(212, 168, 67, 0.1);
  font-size: 0.95rem;
  line-height: 1.65;
  font-style: italic;
  opacity: 0.95;
}

.pv-h1 {
  font-size: 1.45rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

.pv-h2 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(212, 168, 67, 0.2);
  line-height: 1.35;
}

.pv-p {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.65;
  opacity: 0.92;
}

.pv-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.2);
  color: #b8922f;
  margin: 0.35rem 0 0.75rem;
}

.theme-navy .pv-badge,
.canvas-page.theme-navy .pv-badge {
  color: var(--gold);
}

.pv-callout {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(212, 168, 67, 0.12);
  border-left: 3px solid #d4a843;
  font-size: 0.85rem;
  line-height: 1.55;
}

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

.pv-ul li {
  margin: 0.35rem 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.pv-action {
  margin: 0.45rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(46, 117, 182, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.2);
  font-size: 0.88rem;
  line-height: 1.5;
}

.pv-action-arrow {
  color: var(--gold);
  font-weight: 700;
  user-select: none;
  pointer-events: none;
}

.pv-action.em {
  background: rgba(212, 168, 67, 0.16);
  border-color: rgba(212, 168, 67, 0.45);
  font-weight: 600;
}



/* 可编辑块：生产级选中 chrome（描边 + 四角手柄） */
.canvas-block {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  outline: 1.5px solid transparent;
  outline-offset: 3px;
  transition: outline-color 0.12s, box-shadow 0.12s, background 0.12s;
  margin: 0.15rem 0;
}

.canvas-block:hover {
  outline-color: rgba(212, 168, 67, 0.4);
  background: rgba(212, 168, 67, 0.03);
}

.canvas-block.selected {
  outline-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.22);
  z-index: 2;
  background: rgba(212, 168, 67, 0.04);
}

.canvas-block .blk-type {
  position: absolute;
  top: -0.65rem;
  left: 0.4rem;
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #0b1524;
  background: linear-gradient(135deg, #f0d78c, #d4a843);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.canvas-block:hover .blk-type,
.canvas-block.selected .blk-type {
  opacity: 1;
}

/* 四角选择手柄（设计工具感） */
.sel-handles {
  display: none;
  pointer-events: none;
}

.canvas-block.selected .sel-handles {
  display: block;
}

.sel-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 1.5px solid var(--gold);
  border-radius: 1px;
  z-index: 5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sel-handle.nw {
  top: -5px;
  left: -5px;
}
.sel-handle.ne {
  top: -5px;
  right: -5px;
}
.sel-handle.sw {
  bottom: -5px;
  left: -5px;
}
.sel-handle.se {
  bottom: -5px;
  right: -5px;
}

/* 就地编辑态 */
.is-inline-editing {
  outline: 1px dashed rgba(212, 168, 67, 0.85) !important;
  outline-offset: 3px;
  cursor: text !important;
  background: rgba(212, 168, 67, 0.08);
  border-radius: 4px;
}

.canvas-block.emphasis {
  background: rgba(212, 168, 67, 0.07);
}

.canvas-sec-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 168, 67, 0.85);
  margin: 1.35rem 0 0.65rem;
  opacity: 0.95;
  font-weight: 600;
}

.canvas-sec-label .sec-idx {
  display: inline-grid;
  place-items: center;
  min-width: 1.6rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 4px;
  background: rgba(212, 168, 67, 0.15);
  font-variant-numeric: tabular-nums;
  font-size: 0.62rem;
}

.canvas-page.theme-light .canvas-sec-label {
  color: #9a7b2f;
}

.insp-sel-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.28);
}

.insp-sel-type {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.insp-sel-hint {
  font-size: 0.7rem;
  color: var(--ok);
}

/* 兼容旧类名（若其它脚本引用） */
.preview-frame {
  display: none;
}

/* Inspector */
.field label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.85rem;
  margin-bottom: 0.65rem;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.nl-box {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.nl-box h4 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}

.nl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.nl-chips button {
  border: 0;
  background: var(--panel-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: inherit;
}

.nl-chips button:hover {
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.status-pill.ok {
  color: var(--ok);
  background: rgba(62, 207, 142, 0.12);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  background: var(--panel);
  border: 1px solid rgba(212, 168, 67, 0.4);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 100;
  font-size: 0.85rem;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 1rem;
  opacity: 0.8;
}

/* ========== V4 consulting-agent chrome ========== */
.v4-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: rgba(15, 39, 68, 0.92);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.v4-stage-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.v4-stage-chip {
  font-size: 0.68rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.v4-stage-chip.done {
  color: var(--ok);
  border-color: rgba(62, 207, 142, 0.35);
}

.v4-stage-chip.current {
  color: var(--gold);
  border-color: rgba(212, 168, 67, 0.45);
}

.v4-stage-right {
  display: flex;
  gap: 0.25rem;
}

.v4-ws-btn.active {
  color: var(--gold);
  border-color: rgba(212, 168, 67, 0.5);
}

.v4-panel {
  margin-top: 0.85rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.v4-panel h4 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.v4-panel-body {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
}

.v4-panel-body .v4-row {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.v4-panel-body .v4-row:last-child {
  border-bottom: 0;
}

.v4-panel-body button.linkish {
  background: none;
  border: 0;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-align: left;
  text-decoration: underline;
}

.v4-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  margin-right: 0.25rem;
}

.v4-badge.ok {
  background: rgba(62, 207, 142, 0.15);
  color: var(--ok);
}

.v4-badge.warn {
  background: rgba(212, 168, 67, 0.15);
  color: var(--gold);
}

.v4-badge.bad {
  background: rgba(240, 113, 120, 0.15);
  color: var(--danger);
}

.v4-evidence-drawer {
  position: absolute;
  right: 0.5rem;
  bottom: 4.5rem;
  width: min(360px, calc(100% - 1rem));
  max-height: min(52vh, 420px);
  z-index: 40;
  background: #0f2138;
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-wrap {
  position: relative;
}

.v4-drawer-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
}

.v4-drawer-body {
  padding: 0.65rem 0.75rem;
  overflow: auto;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.v4-drawer-body .ev-card {
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.v4-drawer-body .ev-card strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

.reader-shell {
  position: relative;
}

.v4-evidence-drawer.reader-mode {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: #fff;
  border-color: rgba(15, 39, 68, 0.15);
  color: #1a2d45;
  box-shadow: 0 12px 40px rgba(15, 39, 68, 0.18);
  z-index: 60;
}

.v4-evidence-drawer.reader-mode .v4-drawer-hd {
  color: #0f2744;
  border-bottom-color: rgba(15, 39, 68, 0.08);
}

.v4-evidence-drawer.reader-mode .v4-drawer-body {
  color: #3a4f66;
}

.v4-evidence-drawer.reader-mode .ev-card strong {
  color: #0f2744;
}

.reader-scenario-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: 0.35rem;
}

.reader-scenario-select {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  max-width: 140px;
}

.view[data-view="reader"] .reader-scenario-select {
  background: #fff;
  color: #0f2744;
  border-color: rgba(15, 39, 68, 0.15);
}

.view[data-view="reader"] .reader-scenario-label {
  color: #5a6f86;
}

@media (max-width: 600px) {
  .v4-evidence-drawer,
  .v4-evidence-drawer.reader-mode {
    width: calc(100% - 1rem);
    right: 0.5rem;
    left: 0.5rem;
    max-height: 45vh;
  }
  .reader-bar-actions {
    flex-wrap: wrap;
  }
}
