/* ===== 发布页整体视觉 =====
   控制发布页头部、字段说明开关、表单容器和左右工作台之前的页面级样式。 */
.publish-top-bar {
  width: 100%;
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
}

.publish-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.publish-breadcrumb i {
  color: #2563eb;
}

.publish-page-shell {
  width: 100%;
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.publish-page-shell .publish-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 24px 28px;
  border: 1px solid #e1e9f3;
  border-radius: 18px;
  background:
    radial-gradient(400px 150px at 100% 0%, rgba(37, 99, 235, 0.10), transparent 72%),
    #ffffff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
}

.publish-page-shell .publish-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.publish-intro-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  color: #fff;
  font-size: 19px;
  background: linear-gradient(145deg, #1769e0, #0049b7);
  box-shadow: 0 8px 18px rgba(0, 86, 210, 0.22);
}

.publish-page-shell .publish-header-left h2 {
  margin-bottom: 5px;
  font-size: 20px;
  letter-spacing: -0.2px;
}

.publish-page-shell .publish-header-left p {
  max-width: 680px;
  color: #64748b;
  font-size: 13px;
}

.publish-header-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.publish-field-toggle {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #cbd9eb;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}

.publish-field-toggle:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #f8fbff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.publish-field-toggle i {
  width: 13px;
  text-align: center;
}

.publish-header-tag {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #1d4ed8;
  background: #f4f8ff;
  font-size: 12px;
  font-weight: 700;
}

.publish-page-shell .profile-section-body {
  padding: 0;
  background: transparent;
}

.publish-page-shell .sd-form-page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

.publish-page-shell.db-mapping-hidden .db-field-name,
.publish-page-shell.db-mapping-hidden .sd-form-hint {
  display: none !important;
}

.publish-page-shell .db-sync-notice {
  margin: 0 4px 18px;
  padding: 10px 14px;
  border: 0;
  border-left: 3px solid #3b82f6;
  border-radius: 0 9px 9px 0;
  color: #475569;
  background: rgba(239, 246, 255, 0.72);
}

.publish-page-shell .ai-panel {
  margin-bottom: 18px;
  padding: 26px;
  border-color: #d7e5f7;
  border-radius: 18px;
  background:
    radial-gradient(560px 220px at 100% 0%, rgba(37, 99, 235, 0.10), transparent 68%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.055);
}

.publish-page-shell .sd-form-card {
  margin-bottom: 14px;
  padding: 24px 28px 26px;
  border-color: #e3eaf3;
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.035);
}

.publish-page-shell .sd-form-card-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f6;
  color: #172033;
  font-size: 16px;
}

.publish-page-shell .sd-form-card-header::before {
  width: 3px;
  height: 17px;
  border-radius: 3px;
}

.publish-page-shell .sd-form-actions {
  position: sticky;
  bottom: 14px;
  z-index: 20;
  margin-top: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(214, 224, 236, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(12px);
}

.publish-page-shell .sd-form-submit-btn {
  min-width: 112px;
}

/* ===== 表单 + AI 对话工作台 =====
   最常改：grid-template-columns 的 380px 是右侧助手宽度，gap 是左右间距。 */
.scene-chat-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
  gap: 18px;
}

.scene-form-column {
  min-width: 0;
}

.scene-form-column .sd-form-card {
  margin-bottom: 14px;
}

/* ===== AI 面板外壳 =====
   sticky 让助手在滚动左侧长表单时保持可见；height/min-height 决定面板高度。 */
.scene-chat-panel {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  min-height: 680px;
  max-height: 860px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe5f1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.09);
}

/* ===== AI 面板标题与表单完成度 ===== */
.scene-chat-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e8eef5;
  background:
    radial-gradient(260px 110px at 100% 0%, rgba(37, 99, 235, 0.12), transparent 72%),
    linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.scene-chat-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scene-chat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #172033;
  font-size: 15px;
  font-weight: 800;
}

.scene-chat-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #1456c4);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

.scene-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.scene-chat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.scene-progress {
  margin-top: 14px;
}

.scene-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.scene-progress-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.scene-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.25s ease;
}

/* ===== 对话消息区与气泡 =====
   flex: 1 让消息区占满剩余空间，overflow-y: auto 负责内部滚动。 */
.scene-chat-messages {
  flex: 1;
  min-height: 260px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f7f9fc;
}

.scene-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

.scene-chat-message.user {
  justify-content: flex-end;
}

.scene-chat-mini-avatar {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  border-radius: 9px;
  color: #2563eb;
  background: #e8f1ff;
  font-size: 11px;
}

.scene-chat-bubble {
  max-width: calc(100% - 34px);
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 4px 13px 13px 13px;
  color: #334155;
  background: #fff;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.scene-chat-message.user .scene-chat-bubble {
  border-color: #2563eb;
  border-radius: 13px 4px 13px 13px;
  color: #fff;
  background: #2563eb;
}

/* ===== AI 字段建议卡片 =====
   每张卡片显示字段名、建议值和回填按钮。 */
.scene-chat-suggestions {
  margin-top: 10px;
  display: grid;
  gap: 7px;
}

.scene-chat-suggestion {
  padding: 9px 10px;
  border: 1px solid #dbe7f4;
  border-radius: 10px;
  background: #f8fbff;
}

.scene-chat-suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #1e40af;
  font-size: 11px;
  font-weight: 800;
}

.scene-chat-suggestion-value {
  max-height: 72px;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.scene-chat-suggestion button {
  padding: 0;
  border: 0;
  color: #2563eb;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.scene-chat-suggestion-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ===== AI 快捷指令按钮 =====
   按钮文案和发送内容在 chat.js 的 renderSceneChatPanel() 中修改。 */
.scene-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px 0;
  overflow: hidden;
  background: #fff;
}

/* ===== “一句话生成初稿”引导条 =====
   文字和示例按钮在 chat.js 的 renderSceneChatPanel() 中修改。 */
.scene-chat-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 14px 0;
  padding: 10px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #f8fbff);
}

.scene-chat-guide div {
  display: grid;
  gap: 2px;
}

.scene-chat-guide strong {
  color: #1e40af;
  font-size: 12px;
}

.scene-chat-guide span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.45;
}

.scene-chat-guide button {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 0;
  border-radius: 8px;
  color: #1d4ed8;
  background: #dbeafe;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.scene-chat-quick button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #dbe5f1;
  border-radius: 999px;
  color: #475569;
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

.scene-chat-quick button:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

/* ===== 消息输入区、附件和发送按钮 ===== */
.scene-chat-composer {
  padding: 12px 14px 14px;
  border-top: 1px solid #edf1f6;
  background: #fff;
}

.scene-chat-input-wrap {
  padding: 9px 10px 8px;
  border: 1px solid #d7e1ed;
  border-radius: 13px;
  background: #fbfcfe;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scene-chat-input-wrap:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.scene-chat-input {
  width: 100%;
  min-height: 58px;
  max-height: 120px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #334155;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.scene-chat-composer-actions {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scene-chat-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.scene-chat-file-label input {
  display: none;
}

.scene-chat-send {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #2563eb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.scene-chat-send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.scene-chat-file-summary {
  margin-top: 7px;
  color: #94a3b8;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-chat-panel .btn.small {
  padding: 6px 10px;
  font-size: 11px;
}
