/* 会话内成果画布（0.6.3）：方案切换、文档画布、轻量工具栏、底部附件条。
 * 复用工作台设计令牌，保持微信式会话主体布局。 */
.frame .delivery-canvas {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

/* 方案切换 */
.frame .delivery-canvas .canvas-schemes {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.frame .delivery-canvas .canvas-scheme {
  padding: 3px 12px;
  border: 1px solid var(--line, #dcdfe3);
  border-radius: 999px;
  background: var(--panel-surface, #fff);
  color: var(--muted, #6b7280);
  font-size: 12px;
  line-height: 20px;
  cursor: pointer;
}
.frame .delivery-canvas .canvas-scheme.active {
  background: var(--accent, #2f7cf6);
  border-color: var(--accent, #2f7cf6);
  color: #fff;
}
.frame .delivery-canvas .canvas-scheme:focus-visible {
  outline: 2px solid var(--focus-ring, #2f7cf6);
  outline-offset: 1px;
}

/* 文档画布主体 */
.frame .delivery-canvas .canvas-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: var(--panel-surface, #fff);
  overflow: hidden;
}
.frame .delivery-canvas .file-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #eef0f2);
  min-width: 0;
}
.frame .delivery-canvas .canvas-file-icon { flex: 0 0 auto; }
.frame .delivery-canvas .canvas-file-name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.frame .delivery-canvas .canvas-file-name strong {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: var(--ink, #1f2329);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.frame .delivery-canvas .canvas-file-name small {
  font-size: 11px;
  line-height: 16px;
  color: var(--muted, #8a9199);
}
.frame .delivery-canvas .file-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.frame .delivery-canvas .canvas-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line, #e2e5e9);
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary, #4e5560);
  font-size: 12px;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.frame .delivery-canvas .canvas-tool:hover { background: var(--badge-surface, #f2f4f6); }

/* 预览内容区 */
.frame .delivery-canvas .canvas-content {
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(280px, 46dvh, 520px);
  background: #f6f7f8;
  display: flex;
  flex-direction: column;
}
.frame .delivery-canvas .canvas-content-large { height: min(72dvh, 760px); border-radius: 8px; overflow: hidden; }
.frame .delivery-canvas .canvas-image-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  min-height: 0;
}
.frame .delivery-canvas .canvas-image-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.frame .delivery-canvas .canvas-video {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #000;
  object-fit: contain;
}
.frame .delivery-canvas .canvas-audio {
  margin: auto;
  width: min(90%, 520px);
}
.frame .delivery-canvas .canvas-frame {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
.frame .delivery-canvas .canvas-no-preview {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted, #6b7280);
}
.frame .delivery-canvas .canvas-no-preview h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #1f2329);
}
.frame .delivery-canvas .canvas-no-preview p { margin: 0; font-size: 12px; line-height: 18px; max-width: 320px; }
.frame .canvas-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 7px;
  background: var(--accent, #2f7cf6);
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

/* 底部附件条 */
.frame .delivery-canvas .canvas-strip {
  display: flex;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 2px;
}
.frame .delivery-canvas .canvas-attach {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 6px 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 9px;
  background: var(--panel-surface, #fff);
  cursor: pointer;
  text-align: left;
}
.frame .delivery-canvas .canvas-attach:hover { border-color: var(--accent, #2f7cf6); }
.frame .delivery-canvas .canvas-attach-text { display: flex; flex-direction: column; min-width: 0; }
.frame .delivery-canvas .canvas-attach-text strong {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink, #1f2329);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}
.frame .delivery-canvas .canvas-attach-text small {
  font-size: 11px;
  line-height: 15px;
  color: var(--muted, #8a9199);
}
.frame .delivery-canvas .canvas-attach-all {
  color: var(--accent, #2f7cf6);
  font-size: 12px;
  align-self: center;
  background: transparent;
}
.frame .delivery-canvas .canvas-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  background: #eef0f2;
}
.frame .delivery-canvas .canvas-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame .delivery-canvas .canvas-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  background: rgba(0, 0, 0, .32);
}

/* 模态：文件抽屉 / 展开预览 */
.canvas-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 22, .45);
}
.canvas-modal {
  display: flex;
  flex-direction: column;
  width: min(92vw, 560px);
  max-height: min(86dvh, 720px);
  border-radius: 12px;
  background: var(--panel-surface, #fff);
  box-shadow: 0 18px 50px rgba(15, 18, 22, .28);
  overflow: hidden;
  outline: none;
}
.canvas-modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #eef0f2);
}
.canvas-modal-head strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #1f2329);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-modal-head span { font-size: 12px; color: var(--muted, #8a9199); }
.canvas-modal-head .canvas-tool { border: 0; font-size: 18px; line-height: 22px; padding: 2px 8px; }
.canvas-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.canvas-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.canvas-file-list { display: flex; flex-direction: column; gap: 6px; }
.canvas-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 9px;
  background: var(--panel-surface, #fff);
  cursor: pointer;
  text-align: left;
}
.canvas-file-row:hover, .canvas-file-row.current { border-color: var(--accent, #2f7cf6); }
.canvas-file-row.current { background: color-mix(in srgb, var(--accent, #2f7cf6) 7%, #fff); }
.canvas-file-row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.canvas-file-row-text strong {
  font-size: 13px;
  color: var(--ink, #1f2329);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-file-row-text small { font-size: 11px; color: var(--muted, #8a9199); }
.canvas-file-row-go { flex: 0 0 auto; color: var(--muted, #8a9199); }

@media (max-width: 720px) {
  .canvas-overlay { padding: 12px; }
  .frame .delivery-canvas .canvas-content { height: clamp(220px, 38dvh, 420px); }
  .frame .delivery-canvas .canvas-attach-text { display: none; }
  .frame .delivery-canvas .canvas-attach { max-width: none; }
}
