/* 全部规则限定在 ed 命名空间；无全局元素覆盖。 */
.ed-shell, .ed-gallery, .ed-menu, .ed-tooltip, .ed-toast-host {
  font: 400 var(--ed-font-size-body)/var(--ed-line-height-body) var(--ed-font);
  color: var(--ed-neutral-900);
  box-sizing: border-box;
}
.ed-shell *, .ed-gallery *, .ed-menu *, .ed-toast-host * { box-sizing: border-box; }
.ed-shell { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; background: var(--ed-neutral-200); }
.ed-toolbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, auto) minmax(0, 1fr); align-items: center; gap: var(--ed-space-4); min-height: 64px; padding: var(--ed-space-3) var(--ed-space-5); background: var(--ed-neutral-0); border-bottom: 1px solid var(--ed-neutral-300); }
.ed-toolbar-start, .ed-toolbar-center, .ed-toolbar-end { display: flex; align-items: center; gap: var(--ed-space-2); min-width: 0; flex-wrap: nowrap; }
.ed-toolbar-start { overflow: hidden; }
.ed-toolbar-center { padding: 4px; overflow-x: auto; scrollbar-width: thin; overscroll-behavior-x: contain; }
.ed-toolbar-center > *, .ed-toolbar-end > * { flex-shrink: 0; }
.ed-toolbar-end { justify-content: flex-end; }
.ed-filename { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ed-font-size-ui); font-weight: 600; }
.ed-file-badge { display: grid; place-items: center; flex: 0 0 28px; height: 30px; border-radius: var(--ed-radius-sm); background: var(--ed-active-bg); color: var(--ed-saving-fg); font-size: 12px; font-weight: 750; }
.ed-divider { width: 1px; height: 20px; margin-inline: var(--ed-space-1); background: var(--ed-neutral-400); }
.ed-button, .ed-icon-button, .ed-tab, .ed-toast-close { appearance: none; border: 0; font: 500 var(--ed-font-size-ui)/var(--ed-line-height-ui) var(--ed-font); cursor: pointer; text-decoration: none; color: var(--ed-neutral-700); transition: background var(--ed-duration) var(--ed-ease), color var(--ed-duration) var(--ed-ease), box-shadow var(--ed-duration) var(--ed-ease); }
.ed-button { display: inline-flex; justify-content: center; align-items: center; gap: var(--ed-space-2); min-height: 32px; padding: 5px 12px; background: var(--ed-neutral-0); border: 1px solid var(--ed-neutral-400); border-radius: var(--ed-radius-sm); white-space: nowrap; }
.ed-icon-button { display: inline-grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border-radius: var(--ed-radius-sm); background: var(--ed-neutral-0); }
.ed-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; font-size: 16px; line-height: 18px; font-weight: 650; }
.ed-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-button:hover, .ed-icon-button:hover, .ed-tab:hover, .ed-toast-close:hover { background: var(--ed-neutral-200); color: var(--ed-neutral-900); }
.ed-icon-button[aria-pressed="true"] { color: var(--ed-saving-fg); background: var(--ed-active-bg); box-shadow: inset 0 0 0 1px #1f5fe533; }
.ed-button-primary, .ed-button-primary:hover { background: var(--ed-blue); border-color: var(--ed-blue); color: var(--ed-neutral-0); }
.ed-button-primary:hover { filter: brightness(.94); }
.ed-button-danger, .ed-button-danger:hover { background: var(--ed-conflict-fg); border-color: var(--ed-conflict-fg); color: var(--ed-neutral-0); }
.ed-button:disabled, .ed-icon-button:disabled, .ed-tab:disabled, .ed-menu-item:disabled { color: var(--ed-neutral-600); background: var(--ed-neutral-200); cursor: not-allowed; }
.ed-shell :focus-visible, .ed-gallery :focus-visible, .ed-menu :focus-visible, .ed-toast-host :focus-visible { outline: 2px solid var(--ed-blue); outline-offset: 2px; }
.ed-tooltip { position: fixed; z-index: 90; display: flex; align-items: center; gap: var(--ed-space-3); max-width: calc(100vw - 16px); padding: 6px 10px; background: var(--ed-neutral-900); color: var(--ed-neutral-0); border-radius: var(--ed-radius-sm); font-size: var(--ed-font-size-caption); box-shadow: var(--ed-shadow-lg); pointer-events: none; }
.ed-tooltip kbd, .ed-menu kbd { padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; font: 11px/18px var(--ed-font-mono); }
.ed-segmented { display: inline-flex; flex-shrink: 0; gap: 2px; padding: 3px; border-radius: var(--ed-radius-md); background: var(--ed-neutral-200); }
.ed-tab { flex: 0 0 auto; min-height: 28px; padding: 3px 10px; border-radius: var(--ed-radius-sm); background: transparent; white-space: nowrap; }
.ed-segmented .ed-tab[aria-selected="true"] { color: var(--ed-neutral-900); background: var(--ed-neutral-0); box-shadow: var(--ed-shadow-sm); }
.ed-tab-strip { position: relative; display: flex; align-items: center; gap: var(--ed-space-1); min-width: 0; max-width: 100%; padding: var(--ed-space-1); border: 1px solid var(--ed-neutral-300); border-radius: var(--ed-radius-md); background: var(--ed-neutral-100); }
.ed-tab-list { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.ed-tab-list .ed-tab { border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0; }
.ed-tab-list .ed-tab[aria-selected="true"] { color: var(--ed-saving-fg); background: var(--ed-neutral-0); border-bottom-color: var(--ed-blue); }
.ed-tab-strip[data-overflow-start="true"]::before, .ed-tab-strip[data-overflow-end="true"]::after { content: ""; position: absolute; top: 3px; bottom: 3px; width: 10px; pointer-events: none; z-index: 1; }
.ed-tab-strip[data-overflow-start="true"]::before { left: 3px; box-shadow: inset 7px 0 7px -5px #0c113040; }
.ed-tab-strip[data-overflow-end="true"]::after { right: 34px; box-shadow: inset -7px 0 7px -5px #0c113040; }
.ed-dropdown { display: inline-flex; }
.ed-dropdown-trigger { border-color: transparent; gap: var(--ed-space-3); }
.ed-menu { position: fixed; z-index: 80; min-width: min(200px, calc(100vw - 16px)); max-width: calc(100vw - 16px); overflow-y: auto; padding: 5px; background: var(--ed-neutral-0); border-radius: var(--ed-radius-md); box-shadow: var(--ed-shadow-lg); }
.ed-menu-item { display: flex; align-items: center; justify-content: space-between; gap: var(--ed-space-4); width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: var(--ed-radius-sm); font: 400 var(--ed-font-size-ui)/var(--ed-line-height-ui) var(--ed-font); color: var(--ed-neutral-800); background: var(--ed-neutral-0); text-align: start; cursor: pointer; }
.ed-menu-item:hover, .ed-menu-item:focus { background: var(--ed-neutral-200); }
.ed-menu-item[aria-checked="true"] { background: var(--ed-active-bg); color: var(--ed-saving-fg); }
.ed-menu-item[aria-checked="true"]::after { content: "✓"; }
.ed-menu-divider { height: 1px; margin: 5px; background: var(--ed-neutral-300); }
.ed-pill { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; min-height: 24px; max-width: 100%; padding: 2px 8px; border-radius: 999px; background: var(--ed-readonly-bg); color: var(--ed-readonly-fg); font: 500 var(--ed-font-size-caption)/20px var(--ed-font); white-space: nowrap; }
.ed-pill[data-state="saved"] { background: var(--ed-saved-bg); color: var(--ed-saved-fg); }
.ed-pill[data-state="saving"] { background: var(--ed-saving-bg); color: var(--ed-saving-fg); }
.ed-pill[data-state="draft"] { background: var(--ed-draft-bg); color: var(--ed-draft-fg); }
.ed-pill[data-state="conflict"] { background: var(--ed-conflict-bg); color: var(--ed-conflict-fg); }
.ed-pill[data-state="candidate"] { background: var(--ed-candidate-bg); color: var(--ed-candidate-fg); }
.ed-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.ed-pill[data-state="saving"] .ed-pill-dot { width: 10px; height: 10px; background: transparent; border: 1.5px solid currentColor; border-right-color: transparent; animation: ed-saving var(--ed-duration) var(--ed-ease) 2; }
@keyframes ed-saving { to { transform: rotate(180deg); } }
.ed-workspace { display: flex; flex: 1; min-width: 0; align-items: stretch; }
.ed-sidebar { flex: 0 0 220px; width: 220px; padding: var(--ed-space-5) var(--ed-space-4); border-right: 1px solid var(--ed-neutral-300); background: var(--ed-neutral-100); }
.ed-sidebar-close { display: none; }
.ed-sidebar-content { min-width: 0; overflow-wrap: anywhere; }
.ed-outline-link { display: block; padding: 8px; margin-top: 6px; border-radius: var(--ed-radius-sm); color: var(--ed-neutral-700); font-size: var(--ed-font-size-ui); text-decoration: none; }
.ed-outline-link:hover { background: var(--ed-neutral-300); }
.ed-thumbnail { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 16px; padding: 12px; border: 1px solid var(--ed-neutral-400); border-radius: var(--ed-radius-sm); background: var(--ed-neutral-0); color: var(--ed-neutral-700); font: 12px/20px var(--ed-font); cursor: pointer; }
.ed-thumbnail[aria-pressed="true"] { border-color: var(--ed-blue); box-shadow: 0 0 0 1px var(--ed-blue); color: var(--ed-saving-fg); }
.ed-stage { flex: 1; min-width: 0; padding: var(--ed-space-6); overflow-x: auto; }
.ed-canvas-card { width: 100%; min-width: 0; margin-inline: auto; padding: clamp(24px, 5vw, 64px); border-radius: var(--ed-radius-md); background: var(--ed-neutral-0); box-shadow: var(--ed-shadow-sm); overflow-wrap: anywhere; }
.ed-canvas-card h1 { margin: 12px 0 24px; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.4; letter-spacing: -.03em; font-weight: 650; }
.ed-canvas-card h2 { margin: 32px 0 12px; font-size: 18px; line-height: 28px; font-weight: 600; }
.ed-canvas-card p { color: var(--ed-neutral-700); line-height: var(--ed-line-height-body); }
.ed-canvas-card blockquote { margin: 24px 0; padding: 12px 20px; border-left: 3px solid var(--ed-blue); background: var(--ed-neutral-100); color: var(--ed-neutral-700); }
.ed-eyebrow { font: 600 var(--ed-font-size-caption)/20px var(--ed-font); color: var(--ed-neutral-600); letter-spacing: .06em; }
[data-surface-kind="document"] .ed-canvas-card { max-width: var(--ed-canvas-document); min-height: 720px; }
[data-surface-kind="spreadsheet"] .ed-stage { padding: var(--ed-space-4); }
[data-surface-kind="spreadsheet"] .ed-canvas-card { max-width: none; padding: 0; overflow: auto; border: 1px solid var(--ed-neutral-400); box-shadow: none; }
.ed-canvas-card table { width: 100%; border-collapse: collapse; background: var(--ed-neutral-0); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-canvas-card caption { padding: 10px; text-align: start; font-weight: 600; background: var(--ed-neutral-100); }
.ed-canvas-card th, .ed-canvas-card td { min-width: 100px; padding: 8px 12px; border: 1px solid var(--ed-neutral-300); text-align: start; }
.ed-canvas-card th { background: var(--ed-neutral-200); color: var(--ed-neutral-700); font-weight: 500; }
.ed-canvas-card tr:nth-child(odd) td { background: var(--ed-neutral-100); }
[data-surface-kind="presentation"] .ed-canvas-card { aspect-ratio: 16 / 9; padding: var(--ed-space-5); display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); min-height: 0; overflow: auto; align-items: center; }
[data-surface-kind="presentation"] .ed-canvas-card > * { min-height: 0; min-width: 0; }
[data-surface-kind="presentation"] .ed-canvas-card .ed-skeleton { height: 100%; aspect-ratio: auto; }
[data-surface-kind="presentation"] .ed-sidebar { flex-basis: 180px; width: 180px; }
[data-surface-kind="code"] .ed-canvas-card { max-width: var(--ed-canvas-code); padding: var(--ed-space-5); border: 1px solid var(--ed-neutral-400); box-shadow: none; font-family: var(--ed-font-mono); }
[data-surface-kind="pdf"] .ed-canvas-card { max-width: var(--ed-canvas-document); background: transparent; padding: 0; box-shadow: none; }
.ed-pdf-page { aspect-ratio: 1 / 1.414; padding: 48px; margin-bottom: var(--ed-space-5); background: var(--ed-neutral-0); box-shadow: var(--ed-shadow-sm); }
[data-surface-kind="media"] .ed-canvas-card { min-height: 50vh; display: grid; place-items: center; background: var(--ed-neutral-100); }
[data-surface-kind="archive"] .ed-canvas-card { max-width: var(--ed-canvas-code); padding: var(--ed-space-5); }
[data-surface-kind="html"] .ed-canvas-card { padding: var(--ed-space-5); overflow: auto; }
.ed-statusbar { display: flex; align-items: center; justify-content: space-between; gap: var(--ed-space-4); min-width: 0; min-height: 36px; padding: 6px var(--ed-space-5); border-top: 1px solid var(--ed-neutral-300); background: var(--ed-neutral-0); color: var(--ed-neutral-600); font-size: var(--ed-font-size-caption); }
.ed-statusbar-start, .ed-statusbar-end { display: flex; align-items: center; gap: var(--ed-space-3); min-width: 0; }
.ed-statusbar-end { justify-content: flex-end; }
.ed-engine-label { padding: 0 6px; border: 1px solid var(--ed-neutral-300); border-radius: 4px; color: var(--ed-neutral-700); font: 11px/20px var(--ed-font-mono); white-space: nowrap; }
.ed-save-time { white-space: nowrap; }
.ed-skeleton { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--ed-neutral-300); border-radius: var(--ed-radius-md); background: var(--ed-neutral-0); min-width: 0; }
.ed-skeleton-bar { display: block; height: 10px; border-radius: 3px; background: var(--ed-neutral-300); animation: ed-skeleton var(--ed-duration) var(--ed-ease) 2 alternate; }
.ed-skeleton[data-variant="document"] .ed-skeleton-bar:first-child { width: 50%; height: 18px; margin-bottom: 6px; }
.ed-skeleton[data-variant="document"] .ed-skeleton-bar:nth-child(3n) { width: 75%; }
.ed-skeleton[data-variant="spreadsheet"] { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1px; padding: 8px; }
.ed-skeleton[data-variant="spreadsheet"] .ed-skeleton-bar { height: 24px; border-radius: 1px; }
.ed-skeleton[data-variant="slides"] { aspect-ratio: 16 / 9; align-content: center; }
.ed-skeleton[data-variant="slides"] .ed-skeleton-bar:first-child { width: 55%; height: 22px; }
.ed-skeleton[data-variant="slides"] .ed-skeleton-bar { width: 80%; }
.ed-skeleton[data-variant="code"] .ed-skeleton-bar { width: 75%; height: 12px; }
.ed-skeleton[data-variant="code"] .ed-skeleton-bar:nth-child(2n) { width: 55%; margin-left: 20px; }
@keyframes ed-skeleton { to { background: var(--ed-neutral-200); } }
.ed-empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; text-align: center; }
.ed-empty-state > .ed-icon { width: 36px; height: 36px; border: 1px solid var(--ed-neutral-300); border-radius: 10px; background: var(--ed-neutral-100); color: var(--ed-neutral-600); }
.ed-empty-state h3 { margin: 0; font-size: 14px; font-weight: 600; }
.ed-empty-state p { margin: 0; color: var(--ed-neutral-600); font-size: var(--ed-font-size-caption); }
.ed-error-banner { display: flex; align-items: center; gap: var(--ed-space-3); min-width: 0; padding: var(--ed-space-4); border: 1px solid #e6b1ac; border-radius: var(--ed-radius-md); background: var(--ed-conflict-bg); color: var(--ed-conflict-fg); }
.ed-error-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ed-error-copy strong { display: block; font-size: var(--ed-font-size-ui); }
.ed-error-copy p { margin: 3px 0 0; font-size: var(--ed-font-size-caption); line-height: 20px; }
.ed-error-banner > .ed-button { flex-shrink: 0; }
.ed-toast-host { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.ed-toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--ed-radius-md); background: var(--ed-neutral-900); color: var(--ed-neutral-0); box-shadow: var(--ed-shadow-lg); pointer-events: auto; }
.ed-toast > span:not(.ed-icon) { min-width: 0; overflow-wrap: anywhere; }
.ed-toast-close { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border-radius: var(--ed-radius-sm); background: var(--ed-neutral-900); color: var(--ed-neutral-0); font-size: 20px; }
.ed-drawer-backdrop { position: fixed; inset: 0; z-index: 39; background: #0c113044; }
/* 组件展示画廊也供后续接入方本地复核，不携带业务逻辑。 */
.ed-gallery { max-width: 1280px; margin-inline: auto; padding: 36px 32px 48px; }
.ed-gallery h1 { margin: 8px 0; font-size: 32px; line-height: 44px; font-weight: 650; letter-spacing: -.03em; }
.ed-gallery-lead { color: var(--ed-neutral-600); }
.ed-gallery-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 24px; }
.ed-gallery-panel { min-width: 0; padding: 20px; border-radius: var(--ed-radius-lg); background: var(--ed-neutral-0); box-shadow: var(--ed-shadow-sm); }
.ed-gallery-panel h2 { margin: 0 0 16px; color: var(--ed-neutral-600); font-size: 12px; line-height: 20px; font-weight: 500; }
.ed-gallery-panel > .ed-tab-strip { margin-top: 16px; }
.ed-component-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (min-width: 701px) and (max-width: 1200px) {
  .ed-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .ed-toolbar-center { grid-row: 2; grid-column: 1 / -1; }
  .ed-toolbar-end { grid-row: 1; grid-column: 2; }
}
@media (max-width: 700px) {
  .ed-toolbar { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px 12px; }
  .ed-toolbar-start { height: 44px; }
  .ed-toolbar-start .ed-pill { margin-left: auto; }
  .ed-toolbar-center { grid-row: 3; height: 52px; gap: 4px; }
  .ed-toolbar-end { grid-row: 2; justify-content: space-between; gap: 4px; }
  .ed-icon-button { flex-basis: 44px; width: 44px; height: 44px; }
  .ed-button, .ed-tab, .ed-menu-item, .ed-toast-close { min-height: 44px; }
  .ed-tab { padding-inline: 10px; }
  .ed-file-badge { flex-basis: 24px; height: 28px; }
  .ed-segmented { padding: 2px; }
  .ed-toolbar-end .ed-segmented .ed-tab { padding-inline: 8px; }
  .ed-sidebar, [data-surface-kind="presentation"] .ed-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 85vw); height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 16px; box-shadow: var(--ed-shadow-lg); }
  .ed-sidebar-close { display: grid; margin-left: auto; margin-bottom: 16px; }
  .ed-stage { padding: 16px; }
  .ed-canvas-card { padding: 24px; }
  .ed-canvas-card h1 { font-size: 26px; }
  .ed-canvas-card blockquote { padding: 10px 12px; }
  .ed-statusbar { padding: 8px 12px; gap: 8px; }
  .ed-statusbar-end { gap: 6px; flex-wrap: wrap; }
  .ed-statusbar-start { flex: 1; }
  .ed-engine-label { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  .ed-save-time { font-size: 11px; }
  .ed-gallery { padding: 24px 16px 100px; }
  .ed-gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .ed-gallery-panel { padding: 16px; }
  .ed-error-banner { flex-wrap: wrap; }
  .ed-error-banner > .ed-button { margin-left: 30px; }
  .ed-toast-close { flex-basis: 44px; width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .ed-shell *, .ed-gallery *, .ed-menu *, .ed-toast-host * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body > svg[width="0"][height="0"][aria-hidden="true"] { position: absolute; width: 0; height: 0; overflow: hidden; }
[data-public-wasm-ready] { height: clamp(520px, 78vh, 1000px); width: 100%; min-width: 0; overflow: hidden; }
[data-public-wasm-ready="false"] { visibility: hidden; }
.artifact-editor-host { display: flex; flex-direction: column; min-width: 0; width: 100%; height: 100%; overflow: hidden; }
.artifact-editor-host [hidden] { display: none !important; }
.artifact-editor-host > .artifact-editor-host-bar { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; flex: 0 0 auto; gap: 8px; min-height: 0; min-width: 0; padding: 10px 14px; font: 13px var(--ed-font, sans-serif); background: var(--ed-neutral-100, #f8f9fc); border-bottom: 1px solid var(--ed-neutral-300, #e5e8f0); }
.artifact-editor-host-surface { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.artifact-editor-host-staging { position: absolute; inset: 0; display: flex; flex-direction: column; visibility: hidden; pointer-events: none; }
.artifact-editor-host-banner { padding: 8px 16px; color: var(--ed-text, #172b3a); background: var(--ed-surface, #f6f8fa); overflow-wrap: anywhere; }
.artifact-editor-host-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 8px 12px;
  padding: 8px 16px;
  font: 13px/20px var(--ed-font, sans-serif);
  border-bottom: 1px solid var(--ed-neutral-300, #e5e8f0);
  background: var(--ed-neutral-100, #f8f9fc);
  color: var(--ed-neutral-900, #172b3a);
  z-index: 25;
}
.artifact-editor-host-top-banner[data-banner-tone="error"] {
  background: var(--ed-conflict-bg, #fff2f0);
  border-bottom-color: #e6b1ac;
  color: var(--ed-conflict-fg, #9e2a2b);
}
.artifact-editor-host-top-banner[data-banner-tone="verifying"] {
  background: var(--ed-draft-bg, #fffbe6);
  border-bottom-color: #f0d58c;
  color: var(--ed-draft-fg, #7a5200);
}
.artifact-editor-host-top-banner-text {
  flex: 1 1 260px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.artifact-editor-host-top-banner-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.artifact-editor-host-open-error { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin: 24px; padding: 16px 20px; border: 1px solid #e6b1ac; border-radius: 10px; background: var(--ed-conflict-bg, #fff2f0); color: var(--ed-conflict-fg, #9e2a2b); }
.artifact-editor-host-open-error p { margin: 0; font-size: 13px; line-height: 20px; }
.artifact-editor-host-btn { flex: 0 0 auto; align-self: flex-start; width: auto; min-height: 36px; padding: 6px 12px; font: inherit; }
.artifact-editor-host-picker { max-width: 240px; min-width: 0; }
.artifact-editor-host-preview { position: fixed; inset: 16px; z-index: 1000; display: flex; flex-direction: column; overflow: auto; background: var(--ed-surface, #fff); color: var(--ed-text, #172b3a); border: 1px solid #8c9eac; border-radius: 12px; box-shadow: 0 16px 64px #0004; }
.artifact-editor-host-candidate-row { display: flex; gap: 12px; padding: 12px; flex-wrap: wrap; }
.artifact-editor-host-preview-body { display: flex; flex-wrap: wrap; flex: 1; min-height: 300px; overflow: auto; gap: 12px; }
.artifact-editor-host-preview-pane { flex: 1 1 min(420px, 100%); width: 100%; max-width: 100%; min-width: 0; min-height: 340px; display: flex; flex-direction: column; }
.artifact-editor-host-cloud-body { flex: 1; min-height: 300px; }

/* 内层只保留操作与保存反馈；生命周期只读标记由外层宿主负责。 */
.ed-shell .ed-filename[hidden],
.ed-shell .ed-toolbar-start .ed-pill[data-state="readonly"] { display: none; }

@media (max-width: 700px) {
  .ed-shell .ed-toolbar-start:not(:has(button, .ed-pill:not([data-state="readonly"]))) { display: none; }
  .ed-shell .ed-toolbar-start:not(:has(button, .ed-pill:not([data-state="readonly"]))) ~ .ed-toolbar-center { grid-row: 2; }
  .ed-shell .ed-toolbar-start:not(:has(button, .ed-pill:not([data-state="readonly"]))) ~ .ed-toolbar-end { grid-row: 1; }
}

.artifact-editor-host-direct-content { position: relative; height: calc(100vh - 72px); }
.artifact-editor-host-direct-content > .artifact-editor-host-surface { position: relative; }
[data-public-wasm-ready].public-wasm-direct-content, .artifact-editor-host.public-wasm-direct-content { height: 100%; }
.artifact-editor-host-recovery-dialog { position: fixed; inset: 0; margin: auto; width: min(640px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; padding: 20px; border: 1px solid #8c9eac; border-radius: 12px; background: var(--ed-surface, #fff); color: var(--ed-text, #172b3a); }
