/* create-page layout - two column: sidebar + content */
body.create-page .site-shell {
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}
body.create-page .layout {
  flex: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  min-height: 0 !important;
  padding: 0 !important;
}
body.create-page .apple-sidebar {
  display: block !important;
  flex-shrink: 0 !important;
  width: 240px !important;
}
body.create-page .main-content {
  flex: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  min-width: 0 !important;
  overflow: hidden !important;
  height: calc(100vh - 56px) !important;
}
body.create-page .chat-panel {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
}
body.create-page .chat-messages {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}
body.create-page .chat-input-wrap {
  flex-shrink: 0 !important;
  position: relative !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-form {
  max-width: min(1360px, calc(100vw - 160px)) !important;
  width: 100% !important;
  gap: 8px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-ref-bar:not(:has(img)) {
  display: none !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .prompt-draft-hint,
body.create-page .chat-input-bar:not(.is-video-compact) .create-mode-status {
  display: none !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .prompt-quick-row {
  padding: 0 !important;
  min-height: 28px !important;
  gap: 6px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .prompt-quick-chip {
  min-height: 28px !important;
  padding: 0 11px !important;
  font-size: 12px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap {
  min-height: 64px !important;
  padding: 5px 8px 5px 12px !important;
  border-radius: 12px !important;
  align-items: center !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt {
  min-height: 52px !important;
  max-height: 108px !important;
  padding: 9px 96px 9px 4px !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
}
body.create-page .chat-prompt-field {
  position: relative !important;
  flex: 1 1 auto !important;
  grid-area: prompt !important;
  min-width: 0 !important;
  align-self: stretch !important;
  display: flex !important;
}
body.create-page .chat-prompt-field .chat-prompt {
  flex: 1 1 auto !important;
  width: 100% !important;
  position: relative !important;
  z-index: 2 !important;
  background: transparent !important;
  scrollbar-width: none !important;
}
body.create-page .chat-prompt-field .chat-prompt::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}
body.create-page .chat-prompt-field .chat-prompt,
body.create-page .chat-prompt-highlight {
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif) !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  tab-size: 4 !important;
  white-space: pre-wrap !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}
body.create-page .chat-prompt-highlight {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  overflow: hidden !important;
  padding: 9px 96px 9px 4px !important;
  border: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 16px !important;
  line-height: 1.45 !important;
  pointer-events: none !important;
}
body.create-page .chat-prompt-highlight[hidden] {
  display: none !important;
}
body.create-page .chat-prompt.has-mention-highlight {
  color: transparent !important;
  caret-color: #0f172a !important;
  -webkit-text-fill-color: transparent !important;
}
body.create-page .chat-prompt.has-mention-highlight::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}
body.create-page .prompt-ref-token {
  --prompt-ref-color: #0d9488;
  --prompt-ref-soft: rgba(13, 148, 136, 0.12);
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: var(--prompt-ref-soft) !important;
  color: var(--prompt-ref-color) !important;
  font: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  box-shadow: inset 0 -2px 0 var(--prompt-ref-color) !important;
  -webkit-text-fill-color: var(--prompt-ref-color) !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
body.create-page .prompt-ref-token--1 {
  --prompt-ref-color: #2563eb;
}
body.create-page .prompt-ref-token--2 {
  --prompt-ref-color: #ea580c;
}
body.create-page .prompt-ref-token--3 {
  --prompt-ref-color: #7c3aed;
}
body.create-page .prompt-ref-token--4 {
  --prompt-ref-color: #16a34a;
}
body.create-page .prompt-field-token {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: rgba(249, 115, 22, 0.13) !important;
  color: #c2410c !important;
  font: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  box-shadow: inset 0 -2px 0 rgba(249, 115, 22, 0.78) !important;
  -webkit-text-fill-color: #c2410c !important;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

body.create-page .prompt-token-bracket {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-ref-upload {
  min-width: 36px !important;
  min-height: 36px !important;
  padding: 6px !important;
}
body.create-page .chat-ref-mention {
  flex: 0 0 auto !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(20, 184, 166, 0.24) !important;
  border-radius: 10px !important;
  background: rgba(236, 253, 245, 0.88) !important;
  color: #0f766e !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease !important;
}
body.create-page .chat-ref-mention:hover {
  background: #ccfbf1 !important;
  border-color: rgba(20, 184, 166, 0.48) !important;
}
body.create-page .chat-ref-mention:disabled {
  cursor: not-allowed !important;
  opacity: 0.42 !important;
  transform: none !important;
}
body.create-page .chat-ref-upload.is-entry-highlight {
  border-color: rgba(13, 148, 136, 0.72) !important;
  background: rgba(204, 251, 241, 0.96) !important;
  color: #0f766e !important;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16) !important;
}
body.create-page .ref-mention-menu {
  position: absolute !important;
  left: 54px !important;
  bottom: calc(100% + 8px) !important;
  z-index: 20 !important;
  width: min(300px, calc(100vw - 48px)) !important;
  max-height: 260px !important;
  overflow: auto !important;
  padding: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18) !important;
}
body.create-page .ref-mention-menu[hidden] {
  display: none !important;
}
body.create-page .ref-mention-item {
  --ref-mention-color: #0d9488;
  --ref-mention-soft: rgba(13, 148, 136, 0.10);
  --ref-mention-border: rgba(13, 148, 136, 0.36);
  width: 100% !important;
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 9px !important;
  border: 1px solid transparent !important;
  border-left: 4px solid var(--ref-mention-color) !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #334155 !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  text-align: left !important;
  cursor: pointer !important;
}
body.create-page .ref-mention-item:nth-of-type(4n + 1) {
  --ref-mention-color: #2563eb;
  --ref-mention-soft: rgba(37, 99, 235, 0.10);
  --ref-mention-border: rgba(37, 99, 235, 0.36);
}
body.create-page .ref-mention-item:nth-of-type(4n + 2) {
  --ref-mention-color: #ea580c;
  --ref-mention-soft: rgba(234, 88, 12, 0.11);
  --ref-mention-border: rgba(234, 88, 12, 0.38);
}
body.create-page .ref-mention-item:nth-of-type(4n + 3) {
  --ref-mention-color: #7c3aed;
  --ref-mention-soft: rgba(124, 58, 237, 0.11);
  --ref-mention-border: rgba(124, 58, 237, 0.38);
}
body.create-page .ref-mention-item:nth-of-type(4n + 4) {
  --ref-mention-color: #16a34a;
  --ref-mention-soft: rgba(22, 163, 74, 0.11);
  --ref-mention-border: rgba(22, 163, 74, 0.38);
}
body.create-page .ref-mention-item:hover {
  border-color: var(--ref-mention-border) !important;
  background: var(--ref-mention-soft) !important;
  color: #0f172a !important;
}
body.create-page .ref-mention-item > span:not(.ref-mention-thumb) {
  min-width: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: var(--ref-mention-color) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}
body.create-page .ref-mention-item small {
  margin-left: auto !important;
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}
body.create-page .ref-mention-thumb {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 auto !important;
  border: 2px solid var(--ref-mention-border) !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  background: var(--ref-mention-soft) !important;
}
body.create-page .ref-mention-empty {
  padding: 10px !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-send-btn {
  width: 132px !important;
  min-width: 132px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 14px !important;
  justify-content: center !important;
  border-radius: 11px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-options {
  flex-wrap: nowrap !important;
  gap: 8px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-options::-webkit-scrollbar {
  display: none !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-model-btn,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-select {
  min-height: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
}
body.create-page .chat-send-btn.is-waiting-prompt {
  opacity: 0.72 !important;
  filter: grayscale(0.22) !important;
  cursor: not-allowed !important;
}
body.create-page .chat-send-btn.is-waiting-prompt:hover {
  transform: none !important;
}
body.create-page .chat-prompt-clear {
  flex: 0 0 auto !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.14) !important;
  color: #64748b !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease, transform .15s ease !important;
}
body.create-page .chat-prompt-expand {
  position: absolute !important;
  right: 146px !important;
  top: 9px !important;
  z-index: 6 !important;
  width: 28px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(20, 184, 166, 0.22) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: #14b8a6 !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease, transform .15s ease !important;
}
body.create-page .chat-prompt-clear[hidden] {
  display: none !important;
}
body.create-page .chat-prompt-expand[hidden] {
  display: none !important;
}
body.create-page .chat-prompt-ai-expand {
  position: absolute !important;
  right: 180px !important;
  top: 9px !important;
  z-index: 6 !important;
  height: 28px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(20, 184, 166, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(236, 253, 245, 0.94) !important;
  color: #0f766e !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background .15s ease, color .15s ease, transform .15s ease !important;
}
body.create-page .chat-prompt-ai-expand:hover {
  background: #ccfbf1 !important;
  border-color: rgba(20, 184, 166, 0.5) !important;
}
body.create-page .chat-prompt-ai-expand:disabled {
  cursor: not-allowed !important;
  opacity: 0.55 !important;
}
body.create-page .chat-prompt-clear:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}
body.create-page .chat-prompt-expand:hover {
  background: rgba(20, 184, 166, 0.18) !important;
}
body.create-page .chat-prompt-expand[aria-pressed="true"] {
  background: rgba(20, 184, 166, 0.18) !important;
  color: #0f766e !important;
}
body.create-page .chat-input-wrap.is-expanded .chat-prompt {
  min-height: 180px !important;
  max-height: 280px !important;
}
body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap.is-expanded .chat-prompt {
  min-height: 156px !important;
  max-height: 240px !important;
}
body.create-page .chat-prompt-count {
  flex: 0 0 auto !important;
  min-width: 38px !important;
  padding: 0 2px !important;
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  text-align: right !important;
  white-space: nowrap !important;
}
body.create-page .chat-prompt-count[hidden] {
  display: none !important;
}
html.dark-mode body.create-page .chat-prompt-clear {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
}
html.dark-mode body.create-page .chat-prompt-expand {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, 0.28) !important;
}
html.dark-mode body.create-page .chat-ref-mention {
  background: rgba(20, 184, 166, 0.14) !important;
  border-color: rgba(94, 234, 212, 0.22) !important;
  color: #5eead4 !important;
}
html.dark-mode body.create-page .ref-mention-menu {
  background: rgba(15, 23, 42, 0.98) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32) !important;
}
html.dark-mode body.create-page .ref-mention-item {
  color: #cbd5e1 !important;
}
html.dark-mode body.create-page .ref-mention-item:hover {
  background: var(--ref-mention-soft) !important;
  color: #f8fafc !important;
}
html.dark-mode body.create-page .chat-prompt-highlight {
  color: #e2e8f0 !important;
}
html.dark-mode body.create-page .chat-prompt.has-mention-highlight {
  color: transparent !important;
  caret-color: #f8fafc !important;
  -webkit-text-fill-color: transparent !important;
}
html.dark-mode body.create-page .chat-prompt-count {
  color: #94a3b8 !important;
}
html.dark-mode body.create-page .prompt-ref-token--1 { --prompt-ref-color: #60a5fa; }
html.dark-mode body.create-page .prompt-ref-token--2 { --prompt-ref-color: #fb923c; }
html.dark-mode body.create-page .prompt-ref-token--3 { --prompt-ref-color: #c084fc; }
html.dark-mode body.create-page .prompt-ref-token--4 { --prompt-ref-color: #4ade80; }
html.dark-mode body.create-page .prompt-field-token {
  background: rgba(251, 146, 60, 0.16) !important;
  color: #fdba74 !important;
  box-shadow: inset 0 -2px 0 rgba(251, 146, 60, 0.72) !important;
  -webkit-text-fill-color: #fdba74 !important;
}
html.dark-mode body.create-page .prompt-token-bracket {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}

/* Mobile: hide sidebar, single column */
@media (max-width: 768px) {
  body.create-page .apple-sidebar {
    display: none !important;
  }
  body.create-page .layout {
    flex-direction: column !important;
  }
}
/* 视频时长滑块选择器样式 */
.chat-duration-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: var(--border, #ddd);
  outline: none;
  cursor: pointer;
  vertical-align: middle;
}
.chat-duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #4f8cff);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .15s;
}
.chat-duration-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}
.chat-duration-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #4f8cff);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  cursor: pointer;
}
.chat-duration-value {
  display: inline-block;
  min-width: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #4f8cff);
  text-align: center;
  vertical-align: middle;
}
.chat-select-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chat-select-label {
  font-size: 12px;
  color: var(--text-muted, #888);
  white-space: nowrap;
}

/* ── 底部固定区域容器 ── */
body.create-page .chat-bottom-fixed {
  flex-shrink: 0 !important;
  background: var(--bg, #ffffff) !important;
  border-top: none !important;
}

/* ── Tab栏（跟随底部输入区）：紧凑贴合 ── */
body.create-page .chat-bottom-fixed .ai-tabs {
  display: flex !important;
  gap: 6px !important;
  padding: 4px 12px 0 !important;
  flex-shrink: 0 !important;
  background: transparent !important;
  border: none !important;
  max-width: 680px !important;
  margin: 0 auto !important;
  position: static !important;
}
body.create-page .chat-bottom-fixed .ai-tab {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 5px 10px !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  background: rgba(0,0,0,0.04) !important;
  color: #64748b !important;
  transition: all 0.15s !important;
}
body.create-page .chat-bottom-fixed .ai-tab svg { width: 15px !important; height: 15px !important; }
body.create-page .chat-bottom-fixed .ai-tab.is-active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
  color: #fff !important;
}
body.create-page .chat-bottom-fixed .ai-tab.is-active svg { stroke: #fff !important; }

/* 移动端：TAB栏更紧凑贴合输入框，覆盖PC端absolute定位 */
@media (max-width: 768px) {
  body.create-page .chat-bottom-fixed .ai-tabs {
    display: flex !important;
    padding: 2px 8px 0 !important;
    gap: 4px !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }
  body.create-page .chat-bottom-fixed .ai-tab {
    padding: 5px 9px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }
}

/* ── 底部悬浮输入区（居中收紧，与生成卡片同宽）── */
.chat-form { max-width: 680px !important; }
.chat-input-bar {
  padding: 2px 16px 8px !important;
  background: transparent !important;
}
body.create-page .chat-input-bar.is-video-compact {
  padding-top: 0 !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-form {
  max-width: min(1180px, calc(100vw - 380px)) !important;
  margin: 0 auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-areas:
    "quick"
    "input"
    "options"
    "ref" !important;
  column-gap: 0 !important;
  row-gap: 5px !important;
  align-items: start !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-tip {
  grid-area: tip !important;
  width: fit-content !important;
  max-width: min(900px, calc(100vw - 380px)) !important;
  margin: 4px auto 2px !important;
  padding: 5px 12px !important;
  min-height: 28px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-tip span {
  white-space: nowrap !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-tip[hidden] {
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-ref-bar {
  grid-area: ref !important;
}
body.create-page .chat-input-bar.is-video-compact .prompt-quick-row {
  grid-area: quick !important;
}
body.create-page .chat-input-bar.is-video-compact .prompt-quick-choice,
body.create-page .chat-input-bar.is-video-compact .prompt-draft-hint {
  grid-column: 1 !important;
}
body.create-page .chat-input-bar.is-video-compact .prompt-draft-hint {
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .create-mode-status {
  grid-area: status !important;
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
  grid-area: input !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-options {
  grid-area: options !important;
}
/* 夜间模式：底部输入区背景适配 */
html.dark-mode .chat-input-bar {
  background: rgba(0,0,0,0.4) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
/* 创作页面隐藏全局页脚（底部有悬浮聊天框，不需要） */
body.create-page .site-footer {
  display: none !important;
}

/* 夜间模式：创建页面整体背景适配 */
html.dark-mode body.create-page .chat-panel {
  background: var(--bg-card) !important;
}
html.dark-mode .chat-input-wrap {
  background: var(--bg-elevated) !important;
  border-color: var(--border) !important;
}
body.create-page .chat-input-bar.is-ref-dragover .chat-input-wrap {
  border-color: rgba(20, 184, 166, 0.55) !important;
  background: rgba(20, 184, 166, 0.08) !important;
}
html.dark-mode body.create-page .chat-bottom-fixed {
  background: var(--bg-elevated) !important;
  border-top: none !important;
}
/* 历史记录聊天卡片居中，宽度与聊天框对齐 */
.chat-msg--creation {
  display: block !important;
  margin: 0 auto !important;
  text-align: center !important;
}
.chat-msg--creation .creation-history-card {
  text-align: left !important;
  display: inline-block !important;
  max-width: 680px !important;
  width: 100% !important;
}

/* 创作结果网格：历史和新生成作品以卡片流展示，提升一屏可见数量 */
body.create-page .creation-card-grid {
  counter-reset: creation-card;
  width: min(100%, 1480px) !important;
  margin: 0 auto !important;
  padding: 10px 18px 190px !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}
body.create-page .creation-history-toolbar {
  width: min(100%, 1480px) !important;
  margin: 0 auto !important;
  padding: 8px 18px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
body.create-page .creation-history-toolbar[hidden] {
  display: none !important;
}
body.create-page .creation-history-filter {
  display: flex !important;
  gap: 6px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
body.create-page .creation-history-search {
  flex: 1 1 220px !important;
  max-width: 320px !important;
  min-width: 180px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: #64748b !important;
}
body.create-page .creation-history-search input {
  width: 100% !important;
  min-width: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 12px !important;
}
body.create-page .creation-history-search input::placeholder {
  color: #94a3b8 !important;
}
body.create-page .creation-history-filter::-webkit-scrollbar {
  display: none !important;
}
body.create-page .creation-history-filter button {
  flex: 0 0 auto !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}
body.create-page .creation-history-filter button.is-active {
  border-color: rgba(20, 184, 166, 0.4) !important;
  background: rgba(20, 184, 166, 0.12) !important;
  color: #0f766e !important;
}
body.create-page .creation-history-count {
  flex: 0 0 auto !important;
  color: #64748b !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}
body.create-page .creation-history-assets-link {
  flex: 0 0 auto !important;
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(20, 184, 166, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(20, 184, 166, 0.1) !important;
  color: #0f766e !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}
body.create-page .creation-history-assets-link:hover {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #0f766e !important;
}
body.create-page .creation-history-empty {
  width: min(100%, 1480px) !important;
  margin: 8px auto 0 !important;
  padding: 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  color: #64748b !important;
  font-size: 13px !important;
}
body.create-page .creation-history-empty[hidden] {
  display: none !important;
}
body.create-page .creation-history-empty button,
body.create-page .creation-history-empty a {
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 0 12px !important;
  border: 1px solid rgba(20, 184, 166, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(20, 184, 166, 0.1) !important;
  color: #0f766e !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  cursor: pointer !important;
  text-decoration: none !important;
}
body.create-page .creation-history-empty button:hover,
body.create-page .creation-history-empty a:hover {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #0f766e !important;
}
body.create-page .creation-history-more {
  width: min(100%, 1480px) !important;
  margin: -174px auto 190px !important;
  padding: 0 18px !important;
  display: flex !important;
  justify-content: center !important;
  pointer-events: none !important;
}
body.create-page .creation-history-more[hidden] {
  display: none !important;
}
body.create-page .creation-history-more button {
  min-height: 34px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(20, 184, 166, 0.34) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: #0f766e !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  cursor: pointer !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
  pointer-events: auto !important;
}
body.create-page .creation-history-more button:hover {
  background: rgba(20, 184, 166, 0.1) !important;
}
body.create-page .creation-history-more button:disabled {
  opacity: .65 !important;
  cursor: wait !important;
}
body.create-page .creation-history-card.is-filtered-out,
body.create-page .chat-msg--creation.is-filtered-out {
  display: none !important;
}
body.create-page .creation-card-grid .chat-msg--creation {
  counter-increment: creation-card;
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  text-align: left !important;
}
body.create-page .creation-card-grid .creation-history-card {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  display: block !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}
body.create-page .creation-card-grid .creation-history-card::before {
  content: "#" counter(creation-card);
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 8 !important;
  min-width: 34px !important;
  height: 24px !important;
  padding: 0 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.78) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18) !important;
  pointer-events: none !important;
}
body.create-page .creation-card-grid .creation-prompt-bar {
  padding: 10px 12px !important;
}
body.create-page .creation-card-grid .prompt-avatar {
  display: none !important;
}
body.create-page .creation-card-grid .prompt-text {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}
body.create-page .creation-card-grid .prompt-copy-row {
  gap: 6px !important;
  align-items: flex-start !important;
}
body.create-page .creation-card-grid .prompt-meta {
  margin-top: 0 !important;
}
body.create-page .creation-card-grid .meta-tag {
  font-size: 10px !important;
  padding: 2px 6px !important;
}
body.create-page .creation-card-grid .creation-media-grid {
  display: block !important;
}
body.create-page .creation-card-grid .creation-media-unit {
  position: relative !important;
}
body.create-page .creation-card-grid .creation-media,
body.create-page .creation-card-grid .creation-media.image {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  max-height: none !important;
  background: #f8fafc !important;
}
body.create-page .creation-card-grid .creation-media.video {
  width: 100% !important;
  aspect-ratio: var(--video-aspect-ratio, 9 / 16) !important;
  max-height: min(70vh, 720px) !important;
  background: #020617 !important;
  overflow: hidden !important;
}
body.create-page .creation-card-grid .creation-video-placeholder {
  width: 100% !important;
  height: 100% !important;
  min-height: 240px !important;
  display: grid !important;
  place-items: center !important;
  background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.16), transparent 34%), #020617 !important;
  color: #fff !important;
  font-size: 42px !important;
  font-weight: 900 !important;
}
body.create-page .creation-card-grid .creation-media img,
body.create-page .creation-card-grid .creation-media video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  display: block !important;
}
body.create-page .creation-card-grid .creation-media.video,
body.create-page .chat-video-wrap {
  position: relative !important;
}
body.create-page .creation-card-grid .creation-media.video video,
body.create-page .chat-video-wrap .chat-video-player {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #020617 !important;
}
body.create-page .chat-video-wrap {
  aspect-ratio: var(--video-aspect-ratio, 9 / 16) !important;
  max-height: min(70vh, 720px) !important;
  background: #020617 !important;
  overflow: hidden !important;
}
body.create-page .creation-card-grid .creation-actions-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding: 8px !important;
}
body.create-page .creation-card-grid .creation-action {
  min-height: 28px !important;
  padding: 5px 8px !important;
  font-size: 11px !important;
  border-radius: 7px !important;
}
body.create-page .creation-card-grid .creation-more-menu {
  position: relative !important;
  display: inline-flex !important;
}
body.create-page .creation-card-grid .creation-action.more {
  min-width: 42px !important;
}
body.create-page .creation-card-grid .creation-more-list {
  position: absolute !important;
  right: 0 !important;
  bottom: calc(100% + 6px) !important;
  z-index: 30 !important;
  min-width: 116px !important;
  padding: 6px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 9px !important;
  background: #fff !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16) !important;
}
body.create-page .creation-card-grid .creation-more-list .creation-action {
  width: 100% !important;
  justify-content: flex-start !important;
  margin: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
}
body.create-page .creation-card-grid .creation-more-list .creation-action:hover {
  background: #f1f5f9 !important;
}
body.create-page .creation-card-grid .creation-action.delete {
  margin-left: auto !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  color: #dc2626 !important;
  background: #fff7f7 !important;
}
body.create-page .creation-card-grid .creation-action.delete:hover {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: #fee2e2 !important;
}
body.create-page .creation-card-grid .creation-action.delete:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}
body.create-page .creation-delete-confirm {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border-top: 1px solid rgba(239, 68, 68, 0.12) !important;
  background: #fff7f7 !important;
  color: #991b1b !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
body.create-page .creation-delete-confirm span {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  line-height: 1.45 !important;
}
body.create-page .creation-delete-confirm button {
  flex: 0 0 auto !important;
  min-height: 28px !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  border: 1px solid rgba(239, 68, 68, 0.24) !important;
  background: #fff !important;
  color: #991b1b !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}
body.create-page .creation-delete-confirm button[data-action="confirm-delete"] {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}
body.create-page .creation-delete-confirm button:disabled {
  opacity: .68 !important;
  cursor: wait !important;
}
body.create-page .creation-card-grid .creation-action.use-ref {
  border-color: rgba(20, 184, 166, 0.28) !important;
  color: #0f766e !important;
  background: rgba(20, 184, 166, 0.08) !important;
}
body.create-page .creation-card-grid .creation-action.use-ref:hover {
  border-color: rgba(20, 184, 166, 0.48) !important;
  background: rgba(20, 184, 166, 0.14) !important;
}
body.create-page .creation-card-grid .creation-action.canvas-edit {
  border-color: rgba(37, 99, 235, 0.28) !important;
  color: #1d4ed8 !important;
  background: rgba(59, 130, 246, 0.08) !important;
}
body.create-page .creation-card-grid .creation-action.canvas-edit:hover {
  border-color: rgba(37, 99, 235, 0.48) !important;
  background: rgba(59, 130, 246, 0.14) !important;
}
body.create-page .creation-card-grid .meta-tag.canvas {
  border-color: rgba(37, 99, 235, 0.22) !important;
  color: #1d4ed8 !important;
  background: rgba(59, 130, 246, 0.08) !important;
}
body.create-page .creation-card-grid .creation-media-delete {
  position: absolute !important;
  top: 9px !important;
  right: 9px !important;
  z-index: 8 !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  background: rgba(15, 23, 42, 0.72) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  opacity: 0 !important;
  transform: translateY(-2px) !important;
  transition: opacity .16s ease, transform .16s ease, background .16s ease !important;
}
body.create-page .creation-card-grid .creation-media-unit:hover .creation-media-delete,
body.create-page .creation-card-grid .creation-media-delete:focus-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
body.create-page .creation-card-grid .creation-media-delete:hover {
  background: #dc2626 !important;
  border-color: rgba(255, 255, 255, 0.9) !important;
}
body.create-page .creation-card-grid .creation-media-delete:disabled {
  opacity: .7 !important;
  transform: translateY(0) !important;
}
body.create-page .creation-media-preview,
body.create-page .chat-video-detail {
  position: absolute !important;
  right: 9px !important;
  bottom: 9px !important;
  z-index: 8 !important;
  width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  background: rgba(15, 118, 110, 0.82) !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24) !important;
  cursor: zoom-in !important;
  opacity: 0 !important;
  transform: translateY(2px) !important;
  transition: opacity .16s ease, transform .16s ease, background .16s ease !important;
}
body.create-page .creation-media.video:hover .creation-media-preview,
body.create-page .creation-media-preview:focus-visible,
body.create-page .chat-video-wrap:hover .chat-video-detail,
body.create-page .chat-video-detail:focus-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}
body.create-page .creation-media-preview:hover,
body.create-page .chat-video-detail:hover {
  background: #0f766e !important;
}
html.dark-mode body.create-page .creation-card-grid .creation-more-list {
  background: #1f2937 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}
html.dark-mode body.create-page .creation-card-grid .creation-more-list .creation-action:hover {
  background: #334155 !important;
}
html.dark-mode body.create-page .creation-delete-confirm {
  background: rgba(69, 10, 10, 0.72) !important;
  border-color: rgba(239, 68, 68, 0.22) !important;
  color: #fecaca !important;
}
html.dark-mode body.create-page .creation-delete-confirm button {
  background: rgba(15, 23, 42, 0.86) !important;
  border-color: rgba(248, 113, 113, 0.28) !important;
  color: #fecaca !important;
}
html.dark-mode body.create-page .creation-delete-confirm button[data-action="confirm-delete"] {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}
html.dark-mode body.create-page .creation-history-search,
html.dark-mode body.create-page .creation-history-filter button,
html.dark-mode body.create-page .creation-history-assets-link {
  background: rgba(15, 23, 42, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
}
html.dark-mode body.create-page .creation-history-assets-link {
  color: #5eead4 !important;
}
html.dark-mode body.create-page .creation-history-search input {
  color: #e5e7eb !important;
}
html.dark-mode body.create-page .creation-history-empty {
  color: #94a3b8 !important;
}
html.dark-mode body.create-page .creation-history-more button {
  background: rgba(15, 23, 42, 0.78) !important;
  box-shadow: none !important;
}
body.create-page .chat-ref-item--cloud img {
  border-color: rgba(20, 184, 166, 0.45) !important;
}
body.create-page .chat-ref-item {
  position: relative !important;
  cursor: grab !important;
}
body.create-page .chat-ref-item [data-ref-preview-url],
body.create-page .video-ref-upload [data-ref-preview-url],
body.create-page .video-ref-style-thumb [data-video-style-preview-url] {
  cursor: zoom-in !important;
}
body.create-page .chat-ref-item:active {
  cursor: grabbing !important;
}
body.create-page .chat-ref-item.dragging {
  opacity: 0.45 !important;
}
body.create-page .chat-ref-item.drag-over {
  outline: 2px dashed #14b8a6 !important;
  outline-offset: 3px !important;
  border-radius: 12px !important;
}
body.create-page .chat-ref-index {
  position: absolute !important;
  left: 5px !important;
  top: 5px !important;
  z-index: 4 !important;
  padding: 1px 6px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.74) !important;
  color: #fff !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
  font-weight: 800 !important;
  pointer-events: none !important;
}
body.create-page .chat-ref-add {
  flex: 0 0 auto !important;
  width: 48px !important;
  height: 48px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px dashed rgba(20, 184, 166, 0.48) !important;
  border-radius: 10px !important;
  background: rgba(240, 253, 250, 0.9) !important;
  color: #0f766e !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
body.create-page .chat-ref-add:hover {
  background: #ccfbf1 !important;
  border-color: rgba(20, 184, 166, 0.72) !important;
}
body.create-page .chat-ref-item.is-uploading::after,
body.create-page .chat-ref-item.is-uploaded::after,
body.create-page .chat-ref-item.is-upload-error::after {
  position: absolute !important;
  left: 4px !important;
  right: 4px !important;
  bottom: 4px !important;
  z-index: 3 !important;
  padding: 1px 4px !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
  text-align: center !important;
  pointer-events: none !important;
}
body.create-page .chat-ref-item.is-uploading::after {
  content: "上传中";
  background: rgba(15, 23, 42, 0.72);
}
body.create-page .chat-ref-item.is-uploaded::after {
  content: "已就绪";
  background: rgba(15, 118, 110, 0.82);
}
body.create-page .chat-ref-item.is-upload-error::after {
  content: "重试";
  background: rgba(220, 38, 38, 0.82);
}
body.create-page .chat-ref-source {
  position: absolute !important;
  left: 5px !important;
  bottom: 5px !important;
  z-index: 2 !important;
  padding: 1px 5px !important;
  border-radius: 999px !important;
  background: rgba(15, 118, 110, 0.88) !important;
  color: #fff !important;
  font-size: 10px !important;
  line-height: 1.5 !important;
  font-weight: 700 !important;
  pointer-events: none !important;
}

body.create-page .model-picker-tools {
  display: grid !important;
  grid-template-columns: minmax(220px, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
  padding: 14px 20px !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--bg-elevated) !important;
}
body.create-page .model-picker-search {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  padding: 9px 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  background: var(--bg) !important;
  color: var(--text-muted) !important;
}
body.create-page .model-picker-search input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 14px !important;
}
body.create-page .model-picker-filters {
  display: flex !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
}
body.create-page .model-picker-filters button {
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  background: var(--bg) !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  cursor: pointer !important;
}
body.create-page .model-picker-filters button.is-active {
  border-color: rgba(20, 184, 166, 0.35) !important;
  background: rgba(20, 184, 166, 0.1) !important;
  color: #0f766e !important;
}
body.create-page .model-picker-empty {
  grid-column: 1 / -1 !important;
  min-height: 120px !important;
  padding: 44px 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  gap: 10px !important;
  text-align: center !important;
  color: var(--text-muted) !important;
  font-size: 14px !important;
}
body.create-page .model-picker-clear-search {
  min-height: 30px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(20, 184, 166, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(20, 184, 166, 0.1) !important;
  color: #0f766e !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}
body.create-page .model-picker-clear-search:hover {
  background: rgba(20, 184, 166, 0.16) !important;
}
@media (max-width: 720px) {
  body.create-page .model-picker-tools {
    grid-template-columns: 1fr !important;
  }
  body.create-page .model-picker-filters {
    justify-content: flex-start !important;
  }
}
@media (max-width: 900px) {
  body.create-page .creation-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    padding: 8px 10px 180px !important;
    gap: 10px !important;
  }
  body.create-page .creation-history-toolbar {
    padding: 8px 10px 0 !important;
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px !important;
  }
  body.create-page .creation-history-search {
    width: 100% !important;
    max-width: none !important;
  }
  body.create-page .creation-history-more {
    margin: -164px auto 180px !important;
    padding: 0 10px !important;
  }
  body.create-page .creation-card-grid .creation-media-delete {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── 视频模式首帧尾帧上传区 ── */
.video-ref-area {
  display: none !important;        /* 默认隐藏，由JS控制显隐 */
  gap: 8px;                        /* 间距调近 */
  padding: 8px 12px 0;
  flex-shrink: 0;
  justify-content: flex-start !important;     /* 靠左对齐 */
}
.video-ref-tip {
  width: 100%;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.4;
}
.video-ref-area.is-visible {
  display: flex !important;        /* 只有加 is-visible 类才显示 */
}
.video-ref-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.video-ref-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}
/* ★ 容器：相对定位基准，所有子元素绝对定位叠加 */
.video-ref-upload {
  position: relative !important;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  border: 1.5px dashed var(--border);
  display: block !important; /* 不再用flex布局 */
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-subtle);
  transition: border-color 0.2s;
}
.video-ref-upload:hover { border-color: var(--brand); }
.video-ref-area.is-dragover .video-ref-upload,
.video-ref-area.is-dragover .video-ref-toggle-collapsed {
  border-color: var(--brand) !important;
  background: rgba(20, 184, 166, 0.08) !important;
}
.video-ref-upload.is-uploading::after,
.video-ref-upload.is-uploaded::after,
.video-ref-upload.is-upload-error::after {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  z-index: 5;
  padding: 1px 4px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}
.video-ref-upload.is-uploading::after {
  content: "上传中";
  background: rgba(15, 23, 42, 0.72);
}
.video-ref-upload.is-uploaded::after {
  content: "已就绪";
  background: rgba(15, 118, 110, 0.82);
}
.video-ref-upload.is-upload-error::after {
  content: "重试";
  background: rgba(220, 38, 38, 0.82);
}

/* 风格参考槽位：品牌色边框区分 */
.video-ref-style {
  border-color: var(--brand) !important;
  border-style: dashed;
  opacity: 0.85;
  pointer-events: auto !important;  /* 确保点击事件不被父级拦截 */
}
.video-ref-style:hover {
  opacity: 1;
}
.video-ref-style.has-image {
  opacity: 1;
  border-color: var(--brand) !important;
  border-style: solid;
}

/* 视频参考模式切换：首尾帧 / 风格参考 互斥显隐 */
.video-ref-area .video-ref-style-row { display: none !important; }
.video-ref-area.mode-firstlast .video-ref-first-row { display: flex !important; }
.video-ref-area.mode-firstlast .video-ref-last-row { display: flex !important; }
.video-ref-area.mode-firstlast .video-ref-style-row { display: none !important; }
.video-ref-area.mode-style .video-ref-first-row { display: none !important; }
.video-ref-area.mode-style .video-ref-last-row { display: none !important; }
.video-ref-area.mode-style .video-ref-style-row { display: flex !important; }

/* 折叠状态（必须在模式规则之后，确保优先级覆盖） */
.video-ref-area.collapsed .video-ref-slot,
.video-ref-area.collapsed .video-ref-tip { display: none !important; }
.video-ref-area.collapsed .video-ref-toggle-expanded { display: none !important; }
.video-ref-area:not(.collapsed) .video-ref-toggle-collapsed { display: none !important; }
.video-ref-toggle-collapsed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
}
.video-ref-toggle-collapsed:hover { border-color: var(--brand); color: var(--brand); }
.video-ref-toggle-collapsed svg { opacity: 0.6; }
/* Sora-2 模型：完全隐藏参考图区 */
.video-ref-area.hidden-for-model { display: none !important; }
body.create-page .chat-input-bar.is-video-compact .video-ref-area {
  grid-area: ref !important;
  align-self: start !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 4px 0 0 !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  scrollbar-width: none !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-area::-webkit-scrollbar {
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-area.collapsed {
  align-content: flex-start !important;
  justify-content: flex-start !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-toggle-collapsed {
  width: auto !important;
  min-width: 128px !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  flex-direction: row !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-tip {
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-slot {
  gap: 2px !important;
  flex: 0 0 auto !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-label {
  font-size: 10px !important;
  line-height: 1.1 !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-upload {
  width: 54px !important;
  height: 54px !important;
  border-radius: 8px !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-area.mode-style .video-ref-style-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-list {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-thumb {
  position: relative !important;
  flex: 0 0 auto !important;
  width: 54px !important;
  height: 54px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  background: rgba(15, 23, 42, 0.04) !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-thumb.dragging {
  opacity: 0.45 !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-thumb.drag-over {
  outline: 2px dashed var(--brand) !important;
  outline-offset: 2px !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-index {
  position: absolute !important;
  left: 3px !important;
  top: 3px !important;
  z-index: 3 !important;
  padding: 1px 5px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  color: #fff !important;
  font-size: 9px !important;
  line-height: 1.4 !important;
  font-weight: 800 !important;
  pointer-events: none !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-thumb button {
  position: absolute !important;
  top: 3px !important;
  right: 3px !important;
  width: 18px !important;
  height: 18px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.78) !important;
  color: #fff !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-add {
  flex: 0 0 auto !important;
  width: 54px !important;
  height: 54px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1.5px dashed rgba(20, 184, 166, 0.52) !important;
  border-radius: 8px !important;
  background: rgba(240, 253, 250, 0.9) !important;
  color: #0f766e !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-style-add:hover {
  background: #ccfbf1 !important;
  border-color: rgba(20, 184, 166, 0.72) !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-placeholder svg {
  width: 18px !important;
  height: 18px !important;
}
body.create-page .chat-input-bar.is-video-compact .video-ref-placeholder span {
  font-size: 10px !important;
}

/* ★ 所有子元素统一绝对定位——叠在一起，用display切换显隐 */
.video-ref-placeholder,
.video-ref-upload > img,
.video-ref-remove {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit !important;
}

/* 占位符：居中显示文字+图标 */
.video-ref-placeholder {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 10px;
  z-index: 1;
}
.video-ref-placeholder svg { opacity: 0.5; }

/* 预览图：铺满容器 */
.video-ref-upload > img {
  object-fit: cover !important;
  z-index: 2;
  display: none !important; /* 默认隐藏 */
}

/* 删除按钮：右上角小圆钮 */
.video-ref-remove {
  top: -6px !important;
  right: -6px !important;
  left: auto !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  border: 2px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none !important; /* 默认隐藏 */
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.video-ref-remove:hover { transform: scale(1.15); background: #dc2626; }

/* ★ has-image 切换：有图片时隐藏占位符、显示图片和删除按钮 */
.video-ref-upload.has-image .video-ref-placeholder { display: none !important; }
.video-ref-upload.has-image > img { display: block !important; }
.video-ref-upload.has-image .video-ref-remove { display: flex !important; }

html.dark-mode .video-ref-upload {
  background: var(--bg-elevated);
}

/* ── 邀请弹幕 ── */
.chat-marquee {
  position: relative;
  margin: 8px 12px 0;
  padding: 8px 36px 8px 14px;
  background: linear-gradient(90deg, var(--brand-subtle), var(--brand-light));
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--brand);
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.chat-marquee-track {
  display: inline-block;
  animation: marquee-scroll 12s linear infinite;
  padding-left: 100%;
}
.chat-marquee-track span {
  margin-right: 40px;
  white-space: nowrap;
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.marquee-close {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: #e65100;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  z-index: 2;
}
.marquee-close:hover { opacity: 1; }

/* ===== 隐藏提示词 + 自定义占位符提醒样式 (2026-05-14) ===== */
/* 隐藏内容标记：⚫ 黑色圆点 */
.prompt-hidden {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  background: linear-gradient(135deg, #374151, #1f2937);
  color: transparent !important;
  border-radius: 50%;
  font-size: 0.75em;
  vertical-align: middle;
  margin: 0 1px;
  cursor: help;
  position: relative;
  transition: all 0.2s ease;
}
.prompt-hidden:hover {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  transform: scale(1.2);
}
/* 悬停显示完整隐藏内容 */
.prompt-hidden:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17,24,39,0.95);
  color: #f9fafb;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 100;
}
/* 提交时【自定义】占位符警告气泡 */
.chat-custom-warning {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #9a3412;
  animation: customWarnPulse 0.4s ease-out;
}
@keyframes customWarnPulse {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
.custom-warn-tag {
  display: inline-block;
  background: #fff;
  border: 1.5px solid #fb923c;
  border-radius: 6px;
  padding: 2px 8px;
  margin: 2px 4px;
  font-weight: 700;
  color: #c2410c;
  font-size: 12.5px;
  animation: customTagBlink 1.5s infinite;
}
@keyframes customTagBlink {
  0%, 100% { background: #fff; }
  50% { background: #ffedd5; }
}
/* 输入框下方实时提醒条（边打字边显示） */
.custom-input-warning {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 10px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--warning-bg);
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
}

.custom-input-warning[hidden] {
  display: none !important;
}

.custom-input-warning-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.custom-input-warning button {
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 38%, transparent);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.custom-input-warning button:hover,
.custom-input-warning button:focus-visible {
  border-color: var(--warning);
  color: var(--brand-strong);
  outline: none;
}
/* 夜间模式适配 */
html.dark-mode .chat-custom-warning {
  background: linear-gradient(135deg, #451a03, #290d00);
  border-color: #9a3412;
  color: #fbbf24;
}
html.dark-mode .custom-warn-tag {
  background: #451a03;
  border-color: #f59e0b;
  color: #fbbf24;
}
html.dark-mode .custom-input-warning {
  color: var(--text-secondary);
}
html.dark-mode .custom-input-warning button {
  background: var(--bg-subtle);
  color: var(--text);
}

.prompt-quick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
body.create-page .chat-input-bar.is-video-compact .prompt-quick-row {
  padding: 0 !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
}
body.create-page .chat-input-bar.is-video-compact .prompt-quick-chip {
  min-height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.prompt-quick-row[hidden] {
  display: none !important;
}
.prompt-quick-row::-webkit-scrollbar {
  display: none;
}
.prompt-quick-chip {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #475569;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.prompt-quick-chip:hover {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
}
.prompt-quick-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 8px;
  padding: 7px 10px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
  font-size: 12px;
  line-height: 1.35;
}
.prompt-quick-choice[hidden] {
  display: none !important;
}
.prompt-quick-choice span {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prompt-quick-choice button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(20, 184, 166, 0.26);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  color: #0f766e;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.prompt-quick-choice button:hover {
  background: rgba(20, 184, 166, 0.14);
}
.prompt-draft-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 8px;
  padding: 7px 10px;
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
  font-size: 12px;
  line-height: 1.4;
}
.prompt-draft-hint[hidden] {
  display: none !important;
}
.prompt-draft-clear {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.create-mode-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 8px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.86);
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  overflow-x: auto;
  scrollbar-width: none;
}
body.create-page .chat-input-bar.is-video-compact .create-mode-status {
  margin: 0 !important;
  padding: 5px 8px !important;
  min-height: 28px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
  min-height: 60px !important;
  border-radius: 12px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-prompt-expand {
  right: 80px !important;
  top: 7px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-prompt-ai-expand {
  right: 114px !important;
  top: 7px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap .chat-prompt {
  min-height: 58px !important;
  max-height: 72px !important;
  padding-top: 12px !important;
  font-size: 14px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-prompt-highlight {
  padding-top: 12px !important;
  font-size: 14px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap.is-expanded .chat-prompt {
  min-height: 150px !important;
  max-height: 220px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-send-btn {
  width: 70px !important;
  height: 50px !important;
  border-radius: 10px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-options {
  margin-top: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 7px !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-options::-webkit-scrollbar {
  display: none !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-model-btn,
body.create-page .chat-input-bar.is-video-compact .chat-select {
  min-height: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-duration-slider {
  width: 128px !important;
}
body.create-page .chat-input-bar.is-video-compact .chat-cost {
  min-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  font-size: 12px !important;
}
@media (max-width: 1100px) {
  body.create-page .chat-input-bar.is-video-compact .chat-form {
    max-width: 680px !important;
    display: block !important;
  }
  body.create-page .chat-input-bar.is-video-compact .chat-tip {
    width: auto !important;
    max-width: none !important;
    margin: 4px 0 2px !important;
  }
  body.create-page .chat-input-bar.is-video-compact .chat-tip span {
    white-space: normal !important;
  }
  body.create-page .chat-input-bar.is-video-compact .video-ref-area {
    min-height: 0 !important;
    padding: 4px 0 2px !important;
    border: 0 !important;
    background: transparent !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
  }
  body.create-page .chat-input-bar.is-video-compact .video-ref-toggle-collapsed {
    width: auto !important;
    min-height: 30px !important;
    flex-direction: row !important;
  }
}
.create-mode-status::-webkit-scrollbar {
  display: none;
}
.create-mode-status[hidden] {
  display: none !important;
}
.create-mode-status b {
  flex: 0 0 auto;
  color: #0f766e;
  font-weight: 800;
}
.create-mode-status span {
  flex: 0 0 auto;
  white-space: nowrap;
}
html.dark-mode .prompt-quick-chip {
  background: rgba(15, 23, 42, 0.66);
  color: #cbd5e1;
}
html.dark-mode .prompt-draft-hint {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.24);
  color: #5eead4;
}
html.dark-mode .prompt-quick-choice {
  background: rgba(20, 184, 166, 0.14);
  border-color: rgba(20, 184, 166, 0.24);
  color: #5eead4;
}
html.dark-mode .prompt-quick-choice button {
  background: rgba(15, 23, 42, 0.66);
  border-color: rgba(20, 184, 166, 0.24);
  color: #5eead4;
}
html.dark-mode .prompt-quick-chip:hover {
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
}
html.dark-mode .create-mode-status {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
}
html.dark-mode .create-mode-status b {
  color: #5eead4;
}

/* ── 2026-05-15 失败卡片样式（生图失败后显示完整可交互卡片）── */
.creation-failed-card {
  background: var(--card-bg, #fff);
  border: 1px solid #fecaca !important;
  border-radius: 12px;
  overflow: hidden;
}
.chat-error-detail {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  margin: 0 16px 12px;
  border-radius: 8px;
}
.chat-error-icon {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}
.chat-error-body strong {
  display: block;
  font-size: 14px;
  color: #991b1b;
  margin-bottom: 4px;
}
.chat-error-reason {
  font-size: 13px;
  color: #b91c1c;
  margin: 0 0 6px;
  word-break: break-word;
  line-height: 1.5;
}
.chat-error-hint {
  font-size: 12px;
  color: #9a3412;
  margin: 0;
  opacity: 0.85;
}
.creation-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(220,38,38,0.08);
}
.creation-failed-card .creation-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  background: #f3f4f6;
  color: #374151;
}
.creation-failed-card .creation-action:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}
.creation-failed-card .creation-action.edit:hover { border-color: #3b82f6; background: #eff6ff; color: #2563eb; }
.creation-failed-card .creation-action.regenerate:hover { border-color: #ef4444; background: #fef2f2; color: #dc2626; }
.creation-failed-card .creation-action.delete {
  margin-left: auto;
  border-color: rgba(239, 68, 68, 0.28);
  color: #dc2626;
  background: #fff7f7;
}
.creation-failed-card .creation-action.delete:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: #fee2e2;
  color: #b91c1c;
}

/* 暗色模式 */
html.dark-mode .creation-failed-card {
  --card-bg: #1f2937;
  border-color: #7f1d1d !important;
}
html.dark-mode .chat-error-detail {
  background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
}
html.dark-mode .chat-error-body strong { color: #fca5a5; }
html.dark-mode .chat-error-reason { color: #fca5a5; }
html.dark-mode .chat-error-hint { color: #fdba74; }
html.dark-mode .creation-failed-card .creation-action {
  background: #374151;
  color: #d1d5db;
  border-color: #4b5563;
}
html.dark-mode .creation-failed-card .creation-action:hover { background: #4b5563; }
html.dark-mode .creation-failed-card .creation-action.edit:hover { border-color: #3b82f6; background: #1e3a5f; color: #93c5fd; }
html.dark-mode .creation-failed-card .creation-action.regenerate:hover { border-color: #ef4444; background: #450a0a; color: #fca5a5; }
html.dark-mode .creation-failed-card .creation-action.delete {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.24);
  color: #fca5a5;
}
html.dark-mode .creation-failed-card .creation-action.delete:hover {
  border-color: rgba(248, 113, 113, 0.56);
  background: rgba(127, 29, 29, 0.48);
  color: #fecaca;
}

/* meta-tag.failed 样式 */
.meta-tag.failed {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}
html.dark-mode .meta-tag.failed {
  background: #450a0a !important;
  color: #fca5a5 !important;
  border-color: #7f1d1d !important;
}

/* ── Mobile create page final pass: keep prompt input usable above soft keyboard ── */
@media (max-width: 768px) {
  html,
  body.create-page {
    height: 100% !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  body.create-page {
    padding-bottom: 0 !important;
    background: #f6f8fb !important;
  }

  body.create-page .site-shell {
    height: var(--aibu-mobile-vh, 100dvh) !important;
    min-height: var(--aibu-mobile-vh, 100dvh) !important;
    overflow: hidden !important;
  }

  body.create-page .site-shell__nav {
    flex: 0 0 56px !important;
    min-height: 56px !important;
    width: 100% !important;
    padding: 0 10px !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  body.create-page .site-shell__nav .nav-logo {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 168px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  body.create-page .site-shell__nav .nav-logo img {
    width: auto !important;
    max-width: 168px !important;
    height: 20px !important;
    object-fit: contain !important;
  }

  body.create-page .site-shell__nav .nav-actions {
    flex: 0 0 auto !important;
    min-width: 44px !important;
    max-width: 44px !important;
    gap: 6px !important;
    overflow: hidden !important;
  }

  body.create-page .site-shell__nav .search-container,
  body.create-page .site-shell__nav #checkin-btn,
  body.create-page .site-shell__nav .points-badge,
  body.create-page .site-shell__nav .vip-badge-nav,
  body.create-page .site-shell__nav .primary-button,
  body.create-page .site-shell__nav .user-dropdown-wrap,
  body.create-page .site-shell__nav [data-open-auth] {
    display: none !important;
  }

  body.create-page .site-shell__nav #theme-toggle {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 14px !important;
  }

  body.create-page .site-shell__nav .sidebar-drawer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1200 !important;
    width: 100vw !important;
    height: var(--aibu-mobile-vh, 100dvh) !important;
    display: flex !important;
    overflow: visible !important;
  }

  body.create-page .site-shell__nav .sidebar-drawer[hidden] {
    display: none !important;
  }

  body.create-page .site-shell__nav .drawer-overlay {
    position: absolute !important;
    inset: 0 !important;
  }

  body.create-page .site-shell__nav .drawer-content {
    position: relative !important;
    width: min(78vw, 320px) !important;
    max-width: 320px !important;
    height: var(--aibu-mobile-vh, 100dvh) !important;
    max-height: var(--aibu-mobile-vh, 100dvh) !important;
    padding: calc(env(safe-area-inset-top, 0px) + 18px) 14px 24px !important;
    overflow-y: auto !important;
    background: var(--bg, #fff) !important;
  }

  body.create-page .site-shell__nav .drawer-content .menu-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  body.create-page .layout {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    flex-direction: column !important;
  }

  body.create-page .apple-sidebar {
    display: none !important;
  }

  body.create-page .main-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f6f8fb !important;
  }

  body.create-page .chat-panel {
    height: 100% !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f6f8fb !important;
    overflow: hidden !important;
  }

  body.create-page .chat-messages {
    flex: 1 1 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px 10px 14px !important;
    scroll-padding-bottom: 16px !important;
  }

  body.create-page .chat-welcome {
    padding: 32px 14px 20px !important;
  }

  body.create-page .chat-welcome p {
    font-size: 13px !important;
    line-height: 1.55 !important;
  }

  body.create-page .chat-scroll-btn,
  body.create-page .chat-marquee,
  body.create-page .chat-float-btn,
  body.create-page #chatInviteBtn {
    display: none !important;
  }

  body.create-page .chat-bottom-fixed {
    flex: 0 0 auto !important;
    position: relative !important;
    z-index: 40 !important;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.22) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  body.create-page .chat-bottom-fixed .ai-tabs {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 0 5px !important;
    gap: 5px !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
  }

  body.create-page .chat-bottom-fixed .ai-tabs::-webkit-scrollbar {
    display: none !important;
  }

  body.create-page .chat-bottom-fixed .ai-tab {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    gap: 4px !important;
  }

  body.create-page .chat-bottom-fixed .ai-tab svg {
    width: 15px !important;
    height: 15px !important;
  }

  body.create-page .chat-input-bar,
  body.create-page .chat-input-bar.is-video-compact {
    position: relative !important;
    bottom: auto !important;
    z-index: 45 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.create-page .chat-form,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-form,
  body.create-page .chat-input-bar.is-video-compact .chat-form {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  body.create-page .chat-ref-bar {
    padding: 2px 0 0 !important;
    max-height: 64px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
  }

  body.create-page .chat-ref-grid {
    flex-wrap: nowrap !important;
  }

  body.create-page .chat-ref-grid img,
  body.create-page .chat-ref-bar .chat-ref-grid img {
    width: 48px !important;
    height: 48px !important;
  }

  body.create-page .prompt-quick-row,
  body.create-page .chat-input-bar.is-video-compact .prompt-quick-row {
    min-height: 30px !important;
    padding: 0 !important;
    gap: 6px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none !important;
  }

  body.create-page .prompt-quick-row::-webkit-scrollbar {
    display: none !important;
  }

  body.create-page .prompt-quick-chip,
  body.create-page .chat-input-bar.is-video-compact .prompt-quick-chip {
    flex: 0 0 auto !important;
    min-height: 28px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  body.create-page .prompt-quick-choice {
    margin: 0 !important;
    padding: 7px 8px !important;
    font-size: 12px !important;
    overflow-x: auto !important;
  }

  body.create-page .prompt-draft-hint,
  body.create-page .create-mode-status {
    display: none !important;
  }

  body.create-page .chat-input-wrap,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr) 70px !important;
    grid-template-areas: "upload prompt send" !important;
    align-items: end !important;
    gap: 8px !important;
    min-height: 58px !important;
    padding: 7px 7px 7px 9px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.34) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
  }

  body.create-page .chat-input-wrap:focus-within {
    border-color: rgba(20, 184, 166, 0.68) !important;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14), 0 4px 16px rgba(15, 23, 42, 0.08) !important;
  }

  body.create-page .chat-ref-upload {
    grid-area: upload !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }

  body.create-page #chat-audio-upload-label[style*="display:none"] {
    display: none !important;
  }

  body.create-page .chat-prompt,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap .chat-prompt {
    grid-area: prompt !important;
    position: relative !important;
    z-index: 2 !important;
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 44px !important;
    max-height: 118px !important;
    padding: 10px 70px 8px 0 !important;
    border: 0 !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
    color: #0f172a !important;
    background: transparent !important;
    resize: none !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  body.create-page .chat-prompt-field {
    grid-area: prompt !important;
    min-width: 0 !important;
    align-self: stretch !important;
  }

  body.create-page .chat-prompt-highlight,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt-highlight,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-highlight {
    padding: 10px 70px 8px 0 !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
  }

  body.create-page .chat-input-wrap.is-expanded,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap.is-expanded {
    grid-template-columns: 38px minmax(0, 1fr) 70px !important;
  }

  body.create-page .chat-input-wrap.is-expanded .chat-prompt,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap.is-expanded .chat-prompt,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap.is-expanded .chat-prompt {
    min-height: 132px !important;
    max-height: 42vh !important;
  }

  body.create-page .chat-prompt-expand,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-expand {
    right: 80px !important;
    top: 10px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
    z-index: 5 !important;
  }

  body.create-page .chat-prompt-ai-expand,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-ai-expand {
    right: 114px !important;
    top: 10px !important;
    width: 30px !important;
    height: 28px !important;
    padding: 0 !important;
    font-size: 0 !important;
    z-index: 5 !important;
  }

  body.create-page .chat-prompt-ai-expand::after,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-ai-expand::after {
    content: "AI";
    font-size: 11px;
    font-weight: 800;
  }

  body.create-page .chat-prompt-clear {
    display: none !important;
  }

  body.create-page .chat-prompt-count {
    display: none !important;
  }

  body.create-page .chat-send-btn,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-send-btn,
  body.create-page .chat-input-bar.is-video-compact .chat-send-btn {
    grid-area: send !important;
    width: 70px !important;
    min-width: 70px !important;
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 13px !important;
    touch-action: manipulation !important;
  }

  body.create-page .chat-send-cost {
    font-size: 13px !important;
    font-weight: 800 !important;
  }

  body.create-page .chat-options,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-options,
  body.create-page .chat-input-bar.is-video-compact .chat-options {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 1px 0 0 !important;
    margin: 0 !important;
    scrollbar-width: none !important;
  }

  body.create-page .chat-options::-webkit-scrollbar {
    display: none !important;
  }

  body.create-page .chat-model-btn,
  body.create-page .chat-select,
  body.create-page .chat-cost,
  body.create-page .chat-input-bar.is-video-compact .chat-model-btn,
  body.create-page .chat-input-bar.is-video-compact .chat-select,
  body.create-page .chat-input-bar.is-video-compact .chat-cost {
    flex: 0 0 auto !important;
    min-height: 36px !important;
    height: 36px !important;
    max-width: 170px !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }

  body.create-page .chat-model-btn {
    max-width: 210px !important;
  }

  body.create-page .chat-duration-slider {
    width: 116px !important;
  }

  body.create-page .chat-select-group {
    flex: 0 0 auto !important;
    min-height: 36px !important;
  }

  body.create-page .video-ref-area,
  body.create-page .chat-input-bar.is-video-compact .video-ref-area {
    width: 100% !important;
    min-height: 0 !important;
    max-height: 96px !important;
    padding: 2px 0 !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    border: 0 !important;
    background: transparent !important;
  }

  body.create-page .chat-input-bar.is-video-compact .video-ref-area.collapsed {
    display: flex !important;
    height: 36px !important;
    max-height: 36px !important;
    overflow: hidden !important;
    justify-content: flex-start !important;
    align-items: center !important;
  }

  body.create-page .chat-input-bar.is-video-compact .video-ref-toggle-collapsed {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    flex-direction: row !important;
    border-radius: 999px !important;
    transform: none !important;
  }

  body.create-page .video-ref-tip,
  body.create-page .chat-input-bar.is-video-compact .video-ref-tip {
    display: none !important;
  }

  body.create-page .video-ref-slot {
    flex: 0 0 auto !important;
  }

  body.create-page .model-picker-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  body.create-page .model-picker-panel {
    width: 100% !important;
    max-width: none !important;
    max-height: min(78vh, 620px) !important;
    border-radius: 18px 18px 0 0 !important;
    overflow: hidden !important;
  }

  body.create-page .model-picker-grid {
    grid-template-columns: 1fr !important;
    padding: 10px !important;
    max-height: 48vh !important;
    overflow-y: auto !important;
  }

  body.create-page .model-picker-tools {
    padding: 10px !important;
    gap: 8px !important;
  }

  body.create-page .creation-history-toolbar {
    padding: 8px 10px 0 !important;
    gap: 7px !important;
  }

  body.create-page .creation-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 8px 10px 12px !important;
  }

  body.create-page .creation-card-grid .chat-msg--creation,
  body.create-page .creation-card-grid .creation-history-card,
  body.create-page .chat-msg--creation,
  body.create-page .creation-history-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.create-page .creation-card-grid .creation-actions-bar {
    gap: 5px !important;
    padding: 7px !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
  }

  body.create-page .creation-card-grid .creation-action {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }
}

body.create-page .creation-continuation {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 6px 0;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(14, 165, 164, 0.32);
  border-radius: 7px;
  background: rgba(14, 165, 164, 0.08);
  color: #0f766e;
  font-size: 12px;
  line-height: 1.4;
}

body.create-page .creation-project-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

body.create-page .creation-project-row[hidden] {
  display: none !important;
}

body.create-page .creation-project-row > label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-weight: 600;
}

body.create-page .creation-project-row > select {
  width: min(260px, 32vw);
  min-width: 150px;
  height: 30px;
  padding: 0 28px 0 9px;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font: inherit;
}

body.create-page .creation-project-row > button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

body.create-page .creation-project-row > button:hover:not(:disabled) {
  border-color: #0f8f86;
  color: #0f766e;
}

body.create-page .creation-project-row > button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

body.create-page .creation-project-editor {
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(480px, 100%);
  min-height: 34px;
  padding: 4px;
  border: 1px solid rgba(14, 165, 164, 0.28);
  border-radius: 7px;
  background: rgba(14, 165, 164, 0.06);
}

body.create-page .creation-project-editor[hidden] {
  display: none !important;
}

body.create-page .creation-project-editor > input {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border, #dbe3ee);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font: inherit;
}

body.create-page .creation-project-editor > button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(14, 116, 110, 0.28);
  border-radius: 5px;
  background: var(--surface, #fff);
  color: #0f766e;
  font: inherit;
  cursor: pointer;
}

body.create-page .meta-tag.project {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
}

html.dark-mode body.create-page .creation-project-row > select,
html.dark-mode body.create-page .creation-project-row > button,
html.dark-mode body.create-page .creation-project-editor > input,
html.dark-mode body.create-page .creation-project-editor > button {
  border-color: var(--border, #334155);
  background: var(--bg-elevated, #171717);
  color: var(--text, #e5e7eb);
}

html.dark-mode body.create-page .creation-project-editor {
  border-color: rgba(45, 212, 191, 0.28);
  background: rgba(20, 184, 166, 0.1);
}

html.dark-mode body.create-page .meta-tag.project {
  border-color: rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
}

body.create-page .creation-continuation[hidden] {
  display: none !important;
}

body.create-page .creation-continuation > span {
  flex: 1 1 auto;
  min-width: 0;
}

body.create-page .creation-continuation > button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(14, 116, 110, 0.28);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

body.create-page .creation-continuation > button:hover {
  border-color: currentColor;
}

body.create-page .meta-tag.iteration {
  border-color: rgba(14, 165, 164, 0.28);
  background: rgba(14, 165, 164, 0.1);
  color: #0f766e;
}

html.dark-mode body.create-page .creation-continuation {
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(20, 184, 166, 0.12);
  color: #5eead4;
}

html.dark-mode body.create-page .creation-continuation > button {
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(15, 23, 42, 0.72);
}

html.dark-mode body.create-page .meta-tag.iteration {
  border-color: rgba(45, 212, 191, 0.3);
  background: rgba(20, 184, 166, 0.14);
  color: #5eead4;
}

@media (max-width: 768px) {
  body.create-page .creation-project-row > label > span {
    display: none;
  }

  body.create-page .creation-project-row > select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  body.create-page .creation-continuation {
    align-items: flex-start;
  }

  body.create-page .creation-continuation > button {
    min-height: 24px;
    padding-inline: 6px;
  }
}

@media (max-width: 768px) {
  html.dark-mode body.create-page,
  html.dark-mode body.create-page .main-content,
  html.dark-mode body.create-page .chat-panel {
    background: var(--bg) !important;
  }

  html.dark-mode body.create-page .chat-bottom-fixed {
    border-top-color: var(--border) !important;
    background: rgba(20, 20, 19, 0.96) !important;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28) !important;
  }

  html.dark-mode body.create-page .chat-input-wrap,
  html.dark-mode body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap,
  html.dark-mode body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
    border-color: var(--border-strong) !important;
    background: var(--bg-elevated) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24) !important;
  }

  html.dark-mode body.create-page .chat-ref-upload {
    border-color: var(--border-strong) !important;
    background: var(--bg-subtle) !important;
  }

  html.dark-mode body.create-page .chat-prompt,
  html.dark-mode body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt,
  html.dark-mode body.create-page .chat-input-bar.is-video-compact .chat-input-wrap .chat-prompt {
    color: var(--text) !important;
    caret-color: var(--text) !important;
  }
}

@media (max-width: 420px) {
  body.create-page .creation-card-grid {
    grid-template-columns: 1fr !important;
  }

  body.create-page .chat-bottom-fixed .ai-tab {
    padding: 6px 9px !important;
  }

  body.create-page .chat-input-wrap,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
    grid-template-columns: 36px minmax(0, 1fr) 64px !important;
    gap: 7px !important;
  }

  body.create-page .chat-send-btn,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-send-btn,
  body.create-page .chat-input-bar.is-video-compact .chat-send-btn {
    width: 64px !important;
    min-width: 64px !important;
  }

  body.create-page .chat-prompt-expand,
  body.create-page .chat-prompt-clear,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-expand {
    right: 72px !important;
  }

  body.create-page .chat-prompt-ai-expand,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-ai-expand {
    right: 106px !important;
  }
}

/* ═══ 4K / 大屏适配 ═══ */
/* 1920px+：2K/WQHD/150%缩放的4K */
@media (min-width: 1920px) {
  body.create-page .chat-form { max-width: 820px !important; }
  body.create-page .chat-bottom-fixed .ai-tabs { max-width: 820px !important; }
  body.create-page .chat-bottom-fixed .ai-tab { font-size: 14px !important; padding: 6px 13px !important; }
  body.create-page .chat-bottom-fixed .ai-tab svg { width: 16px !important; height: 16px !important; }
  .video-ref-upload { width: 66px; height: 66px; }
  .video-ref-placeholder { font-size: 11px; }
  .video-ref-placeholder svg { width: 28px; height: 28px; }
  .video-ref-label { font-size: 12px; }
  .video-ref-remove { width: 26px !important; height: 26px !important; font-size: 15px; }
  .chat-duration-slider { width: 140px; }
  .chat-duration-value { font-size: 14px; }
  .chat-marquee { font-size: 14px; padding: 10px 40px 10px 16px; }
  .chat-select-group { gap: 8px; }
  .chat-select-label { font-size: 13px; }
  .chat-ref-bar .chat-ref-grid img { width: 64px; height: 64px; }
  .chat-custom-warning { font-size: 14px; padding: 16px 20px; }
  .chat-error-detail { padding: 16px 18px; }
  .chat-error-body strong { font-size: 15px; }
  .chat-error-reason { font-size: 14px; }
  .chat-error-hint { font-size: 13px; }
  .creation-action-bar { padding: 12px 18px 16px; }
  .creation-failed-card .creation-action { font-size: 14px; padding: 8px 16px; }
  /* 侧边栏稍宽 */
  body.create-page .apple-sidebar { width: 260px !important; }
  /* 历史卡片同步放宽 */
  .chat-msg--creation .creation-history-card { max-width: 820px !important; }
}
/* 2560px+：原生4K/100%缩放 */
@media (min-width: 2560px) {
  body.create-page .chat-form { max-width: 940px !important; }
  body.create-page .chat-bottom-fixed .ai-tabs { max-width: 940px !important; }
  body.create-page .chat-bottom-fixed .ai-tab { font-size: 16px !important; padding: 7px 16px !important; }
  body.create-page .chat-bottom-fixed .ai-tab svg { width: 18px !important; height: 18px !important; }
  .video-ref-upload { width: 80px; height: 80px; }
  .video-ref-placeholder { font-size: 13px; }
  .video-ref-placeholder svg { width: 32px; height: 32px; }
  .video-ref-label { font-size: 14px; }
  .video-ref-remove { width: 30px !important; height: 30px !important; font-size: 17px; }
  .chat-duration-slider { width: 160px; }
  .chat-duration-value { font-size: 16px; }
  .chat-marquee { font-size: 15px; padding: 12px 44px 12px 18px; }
  .chat-select-group { gap: 10px; }
  .chat-select-label { font-size: 14px; }
  .chat-ref-bar .chat-ref-grid img { width: 76px; height: 76px; }
  .chat-custom-warning { font-size: 15px; padding: 18px 22px; }
  .chat-error-detail { padding: 18px 20px; }
  .chat-error-body strong { font-size: 16px; }
  .chat-error-reason { font-size: 15px; }
  .chat-error-hint { font-size: 14px; }
  .creation-action-bar { padding: 14px 20px 18px; }
  .creation-failed-card .creation-action { font-size: 15px; padding: 9px 18px; }
  body.create-page .apple-sidebar { width: 290px !important; }
  .chat-msg--creation .creation-history-card { max-width: 940px !important; }
}

/* Prompt composer v2: keep the editor full-width and move tools into its footer. */
body.create-page .chat-input-wrap,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap,
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
  display: block !important;
  min-height: 94px !important;
  padding: 8px 9px !important;
  border-radius: 12px !important;
}

body.create-page .chat-prompt-field {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 76px !important;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch !important;
}

body.create-page .chat-prompt-editor {
  position: relative !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 48px !important;
  display: flex !important;
}

body.create-page .chat-prompt-field .chat-prompt,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt,
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap .chat-prompt {
  width: 100% !important;
  min-height: 48px !important;
  max-height: 150px !important;
  padding: 7px 4px 5px !important;
}

body.create-page .chat-prompt-highlight,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt-highlight,
body.create-page .chat-input-bar.is-video-compact .chat-prompt-highlight {
  inset: 0 !important;
  padding: 7px 4px 5px !important;
}

body.create-page .chat-prompt-toolbar {
  position: relative !important;
  z-index: 4 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding-top: 4px !important;
}

body.create-page .chat-prompt-toolbar-spacer {
  flex: 1 1 auto !important;
  min-width: 6px !important;
}

body.create-page .chat-prompt-toolbar .chat-ref-upload,
body.create-page .chat-prompt-toolbar .chat-ref-mention,
body.create-page .chat-prompt-toolbar .chat-prompt-expand,
body.create-page .chat-prompt-toolbar .chat-prompt-clear {
  position: static !important;
  flex: 0 0 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 5px !important;
}

body.create-page .chat-prompt-toolbar .chat-prompt-ai-expand {
  position: static !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 52px !important;
  height: 30px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
}

body.create-page .chat-prompt-toolbar .chat-prompt-ai-expand::after {
  content: none !important;
}

body.create-page .chat-prompt-toolbar .chat-prompt-count {
  position: static !important;
  flex: 0 0 auto !important;
  min-width: auto !important;
}

body.create-page .chat-prompt-toolbar .chat-send-btn,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt-toolbar .chat-send-btn,
body.create-page .chat-input-bar.is-video-compact .chat-prompt-toolbar .chat-send-btn {
  position: static !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 92px !important;
  height: 34px !important;
  min-height: 34px !important;
  align-self: center !important;
  padding: 0 13px !important;
  border-radius: 9px !important;
}

body.create-page .chat-prompt-toolbar .ref-mention-menu {
  left: 34px !important;
  bottom: calc(100% + 8px) !important;
}

body.create-page .chat-input-wrap.is-expanded .chat-prompt-editor {
  min-height: 156px !important;
}

body.create-page .chat-input-wrap.is-expanded .chat-prompt,
body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap.is-expanded .chat-prompt,
body.create-page .chat-input-bar.is-video-compact .chat-input-wrap.is-expanded .chat-prompt {
  min-height: 156px !important;
  max-height: 42vh !important;
}

@media (max-width: 768px) {
  body.create-page .chat-input-wrap,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-input-wrap,
  body.create-page .chat-input-bar.is-video-compact .chat-input-wrap {
    display: block !important;
    min-height: 88px !important;
    padding: 7px 8px !important;
  }

  body.create-page .chat-prompt-toolbar {
    gap: 5px !important;
  }

  body.create-page .chat-prompt-toolbar .chat-prompt-count,
  body.create-page .chat-prompt-toolbar .chat-prompt-clear {
    display: none !important;
  }

  body.create-page .chat-prompt-toolbar .chat-prompt-ai-expand {
    min-width: 48px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  body.create-page .chat-prompt-toolbar .chat-send-btn,
  body.create-page .chat-input-bar:not(.is-video-compact) .chat-prompt-toolbar .chat-send-btn,
  body.create-page .chat-input-bar.is-video-compact .chat-prompt-toolbar .chat-send-btn {
    min-width: 64px !important;
    padding: 0 9px !important;
  }
}
