.conversation-share-dialog,
.share-image-dialog {
  color: #35405a;
  font-family: inherit;
  border: 0;
  padding: 0;
}

.conversation-share-dialog {
  position: fixed;
  inset: 0 0 0 var(--share-sidebar-width, 0px);
  width: calc(100vw - var(--share-sidebar-width, 0px));
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  background: #f1f3ff;
}

.conversation-share-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.conversation-share-dialog::backdrop {
  background: linear-gradient(to right, transparent 0 var(--share-sidebar-width, 0px), #30344418 var(--share-sidebar-width, 0px) 100%);
}
.share-selection-header,
.share-selection-toolbar,
.share-selection-actions,
.share-image-dialog > header,
.share-image-dialog > footer { display: flex; align-items: center; gap: 12px; }
.share-selection-header { height: 60px; justify-content: space-between; padding: 0 28px; background: #ffffffc9; border-bottom: 1px solid #e5e6f3; }
.conversation-share-dialog button,
.share-image-dialog button,
.share-image-dialog a { font: inherit; font-size: 13px; color: #626879; background: #fff; border: 1px solid #e2e3ec; border-radius: 8px; padding: 9px 14px; cursor: pointer; text-decoration: none; }
.conversation-share-dialog button:disabled { opacity: .45; cursor: not-allowed; }
.conversation-share-dialog button:hover:not(:disabled) { border-color: #9b86e6; color: #7056ca; }
.share-selection-header button { border: 0; background: transparent; }
.share-selection-scroll { overflow: auto; padding: 28px 24px; }
.share-selection-feed { max-width: 900px; margin: auto; }
.share-selectable-message { position: relative; min-width: 0; padding: 16px 16px 16px 48px; margin-bottom: 18px; border: 1px solid transparent; border-radius: 12px; }
.share-selectable-message.is-selected { border-color: #c9c3f1; background: #8c80de0c; }
.share-selectable-message > input { position: absolute; left: 17px; top: 25px; }
.share-selectable-message .question-row, .share-selectable-message .answer-card { margin: 0; }
.share-selection-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 8px 24px;
  background: #fff;
  border-top: 1px solid #e5e6f3;
}
.share-selection-toolbar { display: contents; }
.share-selection-toolbar > label { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; color: #7660c7; cursor: pointer; }
.share-selection-toolbar > label { grid-column: 1; grid-row: 1; }
.share-selection-actions { flex-wrap: nowrap; }
.share-selection-actions { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.conversation-share-dialog input[type="checkbox"] { width: 16px; height: 16px; accent-color: #8463d9; cursor: pointer; vertical-align: middle; }
.share-primary,
.conversation-share-dialog .share-primary,
.share-image-dialog .share-primary { background: linear-gradient(110deg, #9676ee, #7254cd); color: #fff; border-color: transparent; box-shadow: 0 3px 9px #785bd52b; }
.conversation-share-dialog .share-primary:hover:not(:disabled) { color: #fff; }
.share-privacy { min-width: 0; margin: 0; color: #8b90a1; font-size: 11px; line-height: 1.4; }
.share-privacy { grid-column: 1; grid-row: 2; }
.share-status { position: absolute; top: 76px; left: 50%; z-index: 4; width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 10px 16px; border-radius: 8px; background: #30384fed; color: #fff; box-shadow: 0 4px 16px #30344426; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; text-align: center; transform: translateX(-50%); pointer-events: none; }
.share-status:empty { display: none; }
.share-more { position: relative; }
.share-more > summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 6px; }
.share-more > summary::-webkit-details-marker { display: none; }
.share-more > div { position: absolute; bottom: 40px; right: 0; min-width: 150px; padding: 5px; border: 1px solid #e5e3ef; border-radius: 8px; background: #fff; box-shadow: 0 6px 22px #30344418; z-index: 2; }
.share-more button { display: block; width: 100%; border: 0; text-align: left; white-space: nowrap; }
.share-image-dialog { width: min(800px, calc(100vw - 32px)); max-height: 90dvh; border-radius: 14px; }
.share-image-dialog[open] { display: flex; flex-direction: column; }
.share-image-dialog::backdrop { background: #27273866; }
.share-image-dialog > header { justify-content: space-between; padding: 15px 22px; border-bottom: 1px solid #ecebf4; }
.share-image-dialog h2 { margin: 0; font-size: 17px; }
.share-image-dialog > footer { justify-content: flex-end; padding: 15px 22px; }
.share-image-body { overflow: auto; min-height: 100px; padding: 20px; background: #f5f6fa; }
.share-image-body img { display: block; width: 100%; height: auto; }

/* 独立只读分享页不加载工作台逻辑，也不依赖本地会话或数据权限状态。 */
body.shared-page { display: block; height: auto; min-height: 100dvh; overflow: auto; margin: 0; background: linear-gradient(130deg, #f0f2ff, #f8f7fc 70%); color: #30384f; }
.shared-page * { box-sizing: border-box; }
.shared-return { color: #795bc9; text-decoration: none; }
.shared-article { max-width: 1000px; margin: 36px auto; padding: 36px 38px; border: 1px solid #e6e4f1; border-radius: 16px; background: #ffffffd9; box-shadow: 0 10px 36px #51467508; }
.shared-article > header { padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid #e9e7f0; }
.shared-article h1 { margin: 0 0 14px; font-size: 25px; line-height: 1.55; overflow-wrap: anywhere; }
.shared-article > header p { color: #9193a4; font-size: 12px; line-height: 1.8; margin: 0; }
.shared-content { min-width: 0; }
.shared-content > .question-row { margin-bottom: 24px; }
.shared-content .answer-card { margin-bottom: 30px; }
.shared-content .history-node-icon.is-complete::after,
.share-selection-feed .history-node-icon.is-complete::after {
  width: 4px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg) translate(-1px, -1px);
}
.shared-content .history-tool-kind::after,
.share-selection-feed .history-tool-kind::after { content: "⚙"; font-size: 19px; }
.shared-content .answer-card:not(:has(.answer-conclusion)) { padding: 20px; }
.shared-content table { max-width: 100%; }
.shared-content pre, .share-selection-feed pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.shared-content .farmland-table-section, .shared-content .ask-result-body { overflow-x: auto; }
.shared-content .answer-summary, .shared-content .question-bubble { overflow-wrap: anywhere; }
.shared-status { max-width: 680px; margin: 100px auto; padding: 36px; text-align: center; }
.shared-status h1 { font-size: 24px; }
.shared-status p { color: #8d91a0; line-height: 1.8; }
.shared-return { display: block; margin: 30px auto; text-align: center; font-size: 13px; }
.share-image-dialog a[hidden], .shared-page [hidden] { display: none !important; }

@media (max-width: 640px) {
  .conversation-share-dialog { inset: 0; width: 100vw; }
  .share-selection-header { padding: 0 16px; }
  .share-selection-scroll { padding: 16px 8px; }
  .share-selectable-message { padding: 12px 8px 12px 30px; }
  .share-selectable-message > input { left: 5px; top: 22px; }
  .share-selection-footer { padding: 8px 12px; }
  .share-selection-toolbar, .share-selection-actions { gap: 6px; }
  .share-selection-footer { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .share-selection-toolbar { display: flex; justify-content: space-between; min-width: 0; }
  .share-selection-toolbar, .share-privacy { grid-column: 1; }
  .share-selection-actions { flex-wrap: wrap; justify-content: flex-end; }
  .conversation-share-dialog button { padding: 8px 10px; font-size: 12px; }
  .share-more > summary { padding: 8px; }
  .share-selection-feed .history-answer-content, .shared-content .history-answer-content { min-width: 0; }
  .shared-article { margin: 16px 10px; padding: 22px 14px; border-radius: 12px; }
  .shared-article h1 { font-size: 20px; }
  .shared-content .answer-header, .shared-content .history-process-heading { flex-wrap: wrap; }
  .shared-content .history-tool-call > summary,
  .share-selection-feed .history-tool-call > summary { grid-template-columns: minmax(0, 1fr) auto 10px; column-gap: 5px; padding: 10px; }
  .shared-content .history-tool-kind,
  .share-selection-feed .history-tool-kind { display: none; }
  .shared-content .history-tool-row > strong,
  .share-selection-feed .history-tool-row > strong { grid-column: 1; white-space: normal; overflow: visible; text-overflow: clip; }
  .shared-content .history-tool-description,
  .share-selection-feed .history-tool-description { grid-column: 1 / -1; white-space: normal; overflow: visible; text-overflow: clip; }
  .shared-status { margin: 50px 12px; padding: 22px; }
}
