/* 报告模板在输入框上方展开，正文由浏览器内置 PDF 阅读器预览。 */
/* 报告与看板共用句式输入：文字、选项和主题嵌在同一段中，按可用宽度自然换行。 */
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) .chat-generation-prompt {
  --generation-prompt-height: 96px;
  gap: 8px 7px;
  height: var(--generation-prompt-height);
  min-height: var(--generation-prompt-height);
  flex-shrink: 0;
  align-content: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  margin-bottom: 0;
  padding: 8px 0;
  color: #4b526b;
  font-size: 16px;
  line-height: 2;
}
:is(#welcomeComposerForm, #composerForm)[data-generation="report"]:not([data-generation=""]) .chat-generation-prompt { font-size: 14px; }
@container (max-width: 650px) {
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) .chat-generation-prompt { --generation-prompt-height: 192px; }
}
@container (max-width: 350px) {
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) .chat-generation-prompt { --generation-prompt-height: 268px; }
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-box > span {
  flex: none;
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-option {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt .chat-generation-option select {
  field-sizing: content;
  width: auto;
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) textarea {
  box-sizing: border-box;
  field-sizing: content;
  flex: 0 1 auto;
  width: auto;
  min-width: min(12em, 100%);
  max-width: min(24em, 100%);
  height: 36px;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: #eeebfc;
  color: #7156c8;
  font: inherit;
  font-weight: 600;
  line-height: 28px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: hidden;
  box-shadow: none;
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) textarea::placeholder { color: #989db3; font-weight: 400; }
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]):not([data-generation=""]) textarea:focus {
  background: #eeebfc;
  box-shadow: none;
}
.report-generation-settings { display: contents; }
.report-generation-settings label { display: flex; align-items: center; order: 2; gap: 7px; min-width: 0; max-width: 100%; color: inherit; font: inherit; }
.report-generation-settings input { box-sizing: border-box; width: 108px; min-width: 0; height: 36px; padding: 4px 10px; border: 0; border-radius: 9px; outline: none; background: #f2f3fb; color: #4b526b; font: inherit; line-height: 28px; }
.report-generation-settings input::placeholder { color: #989db3; }
.report-generation-settings input:focus { background: #eeedfb; box-shadow: 0 0 0 2px #c5bcf4; }
.report-generation-settings [data-report-setting="year"] { width: 76px; }
.report-generation-settings .report-detail-field { white-space: nowrap; }
.report-generation-settings [data-report-setting="detail"] { field-sizing: content; flex: 0 1 auto; width: auto; min-width: min(12em, 100%); max-width: min(24em, 100%); background: #eeebfc; color: #7156c8; font-weight: 600; box-shadow: none; }
.report-generation-settings [data-report-setting="detail"]:focus { background: #eeebfc; box-shadow: none; }
.report-generation-settings [data-report-setting="detail"]::placeholder { font-weight: 400; }
/* 保留原生下拉与键盘操作，使用系统蓝紫色的轻量胶囊。 */
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt :is(.chat-generation-option, .report-generation-settings) select {
  appearance: none;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  padding: 4px 30px 4px 10px;
  border: 0;
  border-radius: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m4 5.5 3 3 3-3' fill='none' stroke='%238d7bbe' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center, #eeebfc;
  color: #7156c8;
  font: inherit;
  font-weight: 500;
  line-height: 28px;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .16s, box-shadow .16s;
}
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt :is(.chat-generation-option, .report-generation-settings) select:hover { background-color: #e6e0fa; }
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt :is(.chat-generation-option, .report-generation-settings) select:focus-visible { outline: 2px solid #b9b5f0; outline-offset: 2px; }
:is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt select option { background: #fff; color: #514b68; }
/* 可定制下拉与回退样式使用同一圆角箭头，避免旋转边框偏离文字中线。 */
@supports (appearance: base-select) {
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt select {
    align-items: center;
    gap: 8px;
  }
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt select::picker-icon {
    align-self: center;
    width: 14px;
    height: 14px;
    border: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m4 5.5 3 3 3-3' fill='none' stroke='%238d7bbe' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
    transform: none;
  }
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt select:open::picker-icon { transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  :is(#welcomeComposerForm, #composerForm):is([data-generation="report"], [data-generation="dashboard"]) .chat-generation-prompt :is(.chat-generation-option, .report-generation-settings) select { transition: none; }
}
.report-template-gallery { position: absolute; z-index: 18; bottom: calc(100% + 12px); left: 0; display: flex; flex-direction: column; box-sizing: border-box; width: 100%; overflow: hidden; border: 1px solid #e9e5ef; border-radius: 18px; background: #fff; color: #454154; box-shadow: 0 10px 40px #53426c18; text-align: left; container: report-templates / inline-size; }
.report-template-gallery[hidden] { display: none; }
body .workspace .welcome-composer[data-report-gallery-dock] { position: fixed; z-index: 17; left: var(--report-dock-left); bottom: 22px; width: var(--report-dock-width); max-width: calc(100vw - 32px); margin: 0; transform: none; }
.conversation.report-gallery-open:not(.has-conversation) :is(.page-heading, .prompt-title, .prompt-grid, .question-recommendation-status, #homeQuestionTabs, #homeQuestionCarousel, #homeQuestionPagination) { visibility: hidden; }
.conversation.report-gallery-open .report-generation-settings { display: none; }
.report-template-gallery-heading { display: flex; align-items: center; flex: none; gap: 12px; padding: 14px 16px 10px; }
.report-template-gallery-heading strong { flex: 1; white-space: nowrap; font-size: 14px; font-weight: 600; }
.report-template-gallery-heading label { display: flex; align-items: center; gap: 6px; width: 160px; padding: 6px 9px; border-radius: 7px; background: #f6f5f9; }
.report-template-gallery-heading input { width: 100%; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: #575063; font: inherit; font-size: 12px; }
.report-template-gallery svg, .report-pdf-dialog svg { width: 16px; height: 16px; }
.report-template-gallery button { font: inherit; cursor: pointer; }
.report-template-gallery-heading > button { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 50%; background: #f6f5f9; color: #9c95a8; }
.report-template-gallery-tabs { display: flex; flex: none; gap: 5px; padding: 0 14px 12px; overflow-x: auto; }
.report-template-gallery-tabs button { flex: none; padding: 5px 10px; border: 0; border-radius: 7px; background: transparent; color: #9a93a4; font-size: 12px; }
.report-template-gallery-tabs button[aria-pressed="true"] { background: #f0eafb; color: #7855bc; }
.report-template-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 14px; min-height: 0; padding: 0 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
.report-pdf-card { min-width: 0; overflow: hidden; border: 1px solid #ebe8ef; border-radius: 12px; background: #fff; }
.report-pdf-card.selected { border-color: #9d83dc; box-shadow: 0 0 0 1px #9d83dc; }
.report-pdf-cover { position: relative; height: 190px; overflow: hidden; background: #f4f3f7; }
.report-pdf-cover > button:first-child { display: block; width: 100%; height: 100%; padding: 9px; border: 0; background: transparent; }
.report-pdf-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.report-pdf-selected { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #8a67d0; color: #fff; pointer-events: none; }
.report-template-gallery .report-pdf-use { position: absolute; right: 50%; bottom: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; border: 0; border-radius: 999px; background: #fff; color: #554a65; box-shadow: 0 3px 18px #3427412b; font-size: 12px; white-space: nowrap; opacity: 0; transform: translateX(50%); transition: opacity .15s; }
.report-pdf-card:hover .report-pdf-use, .report-pdf-card:focus-within .report-pdf-use { opacity: 1; }
.report-pdf-card-caption { display: flex; align-items: center; gap: 7px; padding: 11px 12px; }
.report-pdf-card-caption > div { flex: 1; min-width: 0; }
.report-pdf-card-caption h3 { display: -webkit-box; margin: 0; overflow: hidden; color: #575062; font-size: 12px; font-weight: 500; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.report-pdf-card-caption p { margin: 4px 0 0; color: #b1aabb; font-size: 10px; }
.report-pdf-card-caption button { display: grid; place-items: center; flex: none; width: 29px; height: 29px; padding: 6px; border: 0; border-radius: 50%; background: #f3eff9; color: #9b89b7; }
.report-template-empty { grid-column: 1 / -1; padding: 22px 0; color: #a49bad; text-align: center; font-size: 12px; }
.report-pdf-dialog { width: min(1080px, calc(100vw - 40px)); max-width: none; height: min(900px, calc(100dvh - 40px)); max-height: none; padding: 0; overflow: hidden; border: 1px solid #e4dfed; border-radius: 18px; background: #fff; color: #51485e; box-shadow: 0 20px 90px #2e233b38; }
.report-pdf-dialog[open] { display: flex; flex-direction: column; }
.report-pdf-dialog::backdrop { background: #2d263e55; backdrop-filter: blur(2px); }
.report-pdf-header { display: flex; align-items: center; flex: none; justify-content: space-between; gap: 15px; padding: 16px 20px; border-bottom: 1px solid #eeeaf4; }
.report-pdf-header > div:first-child { min-width: 0; }
.report-pdf-header h2 { margin: 0; color: #53465f; font-size: 16px; font-weight: 600; }
.report-pdf-header > div:last-child { display: flex; flex: none; gap: 8px; }
.report-pdf-header button { display: grid; place-items: center; width: 30px; height: 30px; padding: 5px; border: 0; border-radius: 50%; background: #f5f3f9; color: #9b8eaa; }
.report-pdf-reader { display: block; flex: 1; width: 100%; min-height: 0; border: 0; background: #525659; }
.report-pdf-footer { display: flex; align-items: center; flex: none; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid #eae5f1; }
.report-pdf-footer a { color: #89729f; font-size: 12px; }
.report-pdf-footer button { padding: 8px 13px; border: 1px solid #e7e0ef; border-radius: 8px; background: #fff; color: #9b8aaa; font: inherit; font-size: 12px; cursor: pointer; }
.report-pdf-footer .report-pdf-apply { border-color: #8a67ce; background: #8a67ce; color: #fff; }
.report-template-gallery button:focus-visible, .report-pdf-dialog :is(button, a, input):focus-visible { outline: 2px solid #b293e6; outline-offset: 2px; }
.report-artifact-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.report-artifact-meta span { padding: 4px 9px; border-radius: 6px; background: #f3f0fa; color: #8a75aa; font-size: 11px; }
.quick-report-preview section p, .quick-report-paper textarea { white-space: pre-wrap; }
@container report-templates (max-width: 600px) {
  .report-template-gallery-heading { gap: 7px; padding: 12px; }
  .report-template-gallery-heading strong { font-size: 12px; }
  .report-template-gallery-heading label { width: 100px; }
  .report-template-gallery-tabs { padding: 0 10px 10px; }
  .report-template-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 12px 12px; }
  .report-template-gallery .report-pdf-use { bottom: 8px; padding: 6px 10px; opacity: 1; font-size: 11px; }
  .report-pdf-card-caption { padding: 8px; }
  .report-pdf-cover { height: 175px; }
}
@media (max-width: 600px) {
  body .workspace .welcome-composer[data-report-gallery-dock] { bottom: 14px; }
  .report-pdf-dialog { width: calc(100vw - 20px); height: calc(100dvh - 24px); border-radius: 12px; }
  .report-pdf-header { gap: 8px; padding: 12px; }
  .report-pdf-header h2 { font-size: 14px; }
  .report-pdf-footer { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .report-pdf-footer button { padding: 8px 9px; font-size: 11px; }
}
