/* Generator Module — 即梦风格完整实现 */

.generator-module {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  position: relative;
  overflow: visible;
}

/* ── 主内容区 ── */
.generator-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 0;
  overflow-y: auto;
  gap: 0;
  justify-content: flex-start;
}

/* 空态 */
.generator-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: auto;
  padding: 60px 0 36px;
}
.generator-mascot {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #bfdbfe 0%, #ddd6fe 50%, #fce7f3 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  box-shadow: 0 6px 24px rgba(139,92,246,.18);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.generator-empty-hint { font-size: 14px; color: var(--color-text-muted); }

/* ── 底部整体容器 ── */
.generator-bottom {
  flex-shrink: 0;
  padding: 0 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  background: #fff;
}

/* ── 输入卡片 ── */
.generator-card {
  width: 100%;
  max-width: 780px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  overflow: visible;
  position: relative;
}

.generator-input-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 14px 10px;
}

.gen-upload-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #9ca3af;
  transition: all .15s;
}
.gen-upload-btn:hover { border-color: var(--color-primary); color: var(--color-primary); background: #e0f2fe; }

.gen-prompt {
  flex: 1; border: none; outline: none;
  font-size: 14px; color: #111827;
  background: transparent; resize: none;
  min-height: 56px; max-height: 180px;
  font-family: var(--font-family); line-height: 1.65;
  padding-top: 2px;
}
.gen-prompt::placeholder { color: #9ca3af; }

/* ── 底部工具栏 ── */
.generator-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 14px 12px;
  gap: 6px;
  border-top: 1px solid #f3f4f6;
}

/* 生成类型主选择器 */
.gen-type-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border: none; border-radius: 8px;
  background: none; cursor: pointer;
  font-size: 13px; color: var(--color-primary);
  font-weight: 500; font-family: var(--font-family);
  transition: background .15s;
}
.gen-type-btn:hover { background: #e0f2fe; }
.gen-type-btn svg { flex-shrink: 0; }

.toolbar-divider { width: 1px; height: 18px; background: #e5e7eb; margin: 0 2px; }

/* 工具芯片（模型、比例等）*/
.gen-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border: none; border-radius: 20px;
  background: #f3f4f6; cursor: pointer;
  font-size: 12px; color: #374151; font-weight: 500;
  font-family: var(--font-family);
  transition: all .15s; white-space: nowrap;
}
.gen-chip:hover { background: #e5e7eb; }
.gen-chip.active { background: #e0f2fe; color: var(--color-primary); }
.gen-chip svg { flex-shrink: 0; }

/* 数量 + 发送 */
.toolbar-spacer { flex: 1; }

.gen-count {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #6b7280; font-weight: 500;
}
.gen-count-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid #e5e7eb; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #374151; line-height: 1;
  transition: all .15s;
}
.gen-count-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.gen-count-num { min-width: 18px; text-align: center; }
.gen-count-label { color: #9ca3af; font-weight: 400; }

.gen-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--color-primary); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  box-shadow: 0 3px 10px rgba(14,165,233,.4);
  transition: all .15s;
}
.gen-send-btn:hover { background: #0284c7; transform: scale(1.05); }
.gen-send-btn:disabled { background: #e5e7eb; box-shadow: none; cursor: not-allowed; }

/* ═══════════════════════════════
   弹出层通用样式
═══════════════════════════════ */
.gen-popup {
  position: absolute;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 999;
  display: none;
  animation: popIn .15s ease;
}
.gen-popup.open { display: block; }
@keyframes popIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

.gen-popup-title {
  font-size: 12px; color: #9ca3af; font-weight: 500;
  padding: 14px 16px 8px; border-bottom: 1px solid #f3f4f6;
}

/* ── 类型下拉 ── */
.gen-type-popup {
  bottom: calc(100% + 8px);
  left: 0;
  width: 220px;
}

.type-option {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  cursor: pointer; font-size: 14px; color: #111827;
  transition: background .12s;
  position: relative;
}
.type-option:hover { background: #f9fafb; }
.type-option.active { color: var(--color-primary); }
.type-option-icon { font-size: 16px; width: 22px; text-align: center; }
.type-option-check { margin-left: auto; color: var(--color-primary); }

/* ── 模型选择弹层 ── */
.gen-model-popup {
  bottom: calc(100% + 8px);
  left: 60px;
  width: 360px;
}

.model-list { padding: 8px; }

.model-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: 10px;
  cursor: pointer; transition: background .12s; position: relative;
}
.model-item:hover { background: #f9fafb; }
.model-item.active { background: #f0f9ff; }

.model-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(145deg, #42c5f5, #1a8fd8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
  opacity: 1;
}
.model-item[style*="not-allowed"] .model-icon { filter: grayscale(.6); }

.model-info { flex: 1; }
.model-name { font-size: 14px; font-weight: 600; color: #111827; display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.model-badge { font-size: 10px; padding: 1px 6px; border-radius: 20px; background: #fef3c7; color: #d97706; font-weight: 500; }
.model-badge.new-badge { background: #d1fae5; color: #059669; }
.model-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }
.model-check { color: var(--color-primary); margin-top: 2px; flex-shrink: 0; }

/* ── 比例/分辨率弹层 ── */
.gen-ratio-popup {
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  padding: 16px 16px 18px;
  overflow: visible;
}
.gen-ratio-popup.open { display: block; }

.ratio-section-title {
  font-size: 12px; color: #6b7280; font-weight: 500; margin-bottom: 10px;
}

/* 比例图标网格 */
.ratio-grid {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}

/* 视频比例：固定 5 列 */
#vidRatioGrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 0;
}

.ratio-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; padding: 8px 4px;
  border-radius: 8px; transition: background .12s;
}
.ratio-item:hover { background: #f0f9ff; }
.ratio-item.active .ratio-icon-box {
  border-color: var(--color-primary);
  background: rgba(99,102,241,.08);
}
.ratio-item.active .ratio-label { color: var(--color-primary); font-weight: 600; }

.ratio-icon-box {
  border: 1.5px solid #d1d5db; border-radius: 5px;
  background: #f9fafb;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  font-size: 12px; color: #6b7280;
}

.ratio-label { font-size: 11px; color: #6b7280; text-align: center; white-space: nowrap; }

/* 分辨率选择 */
.resolution-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; margin-bottom: 14px;
}
.res-tab {
  padding: 10px; text-align: center;
  cursor: pointer; font-size: 13px; color: #6b7280; font-weight: 500;
  background: none; border: none; font-family: var(--font-family);
  transition: all .12s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.res-tab:hover { background: #f9fafb; }
.res-tab.active { background: #f0f9ff; color: var(--color-primary); }
.res-plus { font-size: 10px; padding: 1px 5px; background: var(--color-primary); color: #fff; border-radius: 20px; }

/* 尺寸输入 */
.size-row {
  display: flex; align-items: center; gap: 8px;
}
.size-input-wrap {
  display: flex; align-items: center; gap: 6px;
  flex: 1 1 0; min-width: 0; padding: 8px 10px;
  border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb;
}
.size-label { font-size: 12px; color: #9ca3af; font-weight: 500; flex-shrink: 0; }
.size-input {
  flex: 1; min-width: 0; width: 100%;
  border: none; background: none; outline: none;
  font-size: 14px; font-weight: 600; color: #374151; text-align: center;
  font-family: var(--font-family);
}
.size-sep { font-size: 16px; color: #d1d5db; }
.size-unit { font-size: 12px; color: #9ca3af; }

/* tooltip */
.gen-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1f2937; color: #fff; font-size: 12px; padding: 5px 10px;
  border-radius: 6px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.gen-tooltip.show { opacity: 1; }
.gen-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1f2937;
}

/* ── 数字人 / 动作 上传槽 ── */
.avatar-upload-slot {
  width: 56px; height: 56px;
  border: 1.5px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.avatar-upload-slot:hover { border-color: var(--color-primary); background: #e0f2fe; }

/* 动作提示卡 */
.motion-hint-card {
  width: 100%; max-width: 780px;
  display: flex; gap: 16px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.motion-hint-img {
  width: 140px; height: 100px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  background: linear-gradient(135deg,#fce7f3,#ddd6fe);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; overflow: hidden;
}
.motion-hint-text h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.motion-hint-text p  { font-size: 12px; color: #6b7280; margin: 0; }

/* 配音声色 slot */
.voice-upload-slot {
  width: 56px; height: 56px;
  border: 1.5px dashed #d1d5db; border-radius: 10px;
  background: #f9fafb; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.voice-upload-slot:hover { border-color: var(--color-primary); background: #e0f2fe; }

/* ── 类型图标圆角背景 ── */
.type-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* 类型弹层图标列表 */
.type-option .type-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
}

.gen-type-popup .type-option {
  padding: 9px 14px;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════
   Generator — Result Area + Reference Upload + Loading
   ═══════════════════════════════════════════════════════ */

/* ── Result area ── */
.gen-result-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 8px;
}
.gen-result-area::-webkit-scrollbar { width: 4px; }
.gen-result-area::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.gen-result-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.gen-result-meta { font-size: 12px; color: #94a3b8; font-weight: 500; }

.gen-result-actions { display: flex; gap: 8px; }

.gen-result-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 12px;
  border: 1px solid #e2e8f0; border-radius: 7px;
  background: #fff; color: #64748b;
  font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.gen-result-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Image grid */
.gen-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.gen-image-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: pointer;
}

.gen-image-card img {
  width: 100%; height: auto; display: block;
  transition: transform 0.2s;
}

.gen-image-card:hover img { transform: scale(1.03); }

/* Footer below image grid */
.gen-result-footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
}
.gen-result-footer-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 14px;
  border: 1px solid #e2e8f0; border-radius: 20px;
  background: #fff; color: #374151;
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.12s; font-family: inherit;
}
.gen-result-footer-btn:hover { background: #f3f4f6; border-color: #d1d5db; }

.gen-image-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  display: none; align-items: center; justify-content: center; gap: 8px;
  backdrop-filter: blur(2px);
}

.gen-image-card:hover .gen-image-overlay { display: flex; }

.gen-img-btn {
  width: 32px; height: 32px;
  border-radius: 8px; border: none;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; transition: background 0.12s;
}
.gen-img-btn:hover { background: rgba(255,255,255,.3); }

/* Video result */
.gen-video-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}

.gen-video-player {
  width: 100%; max-height: 420px;
  display: block; border-radius: 12px;
}

/* 即梦风格视频等待卡片 */
.gen-video-queue-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e8edf3;
}

.gen-video-queue-visual {
  position: relative;
  height: 240px;
  background: linear-gradient(160deg, #dbeafe 0%, #e0f2fe 40%, #f0f9ff 70%, #fff 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}

.gen-video-queue-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(99,102,241,.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin-queue .9s linear infinite;
}
@keyframes spin-queue { to { transform: rotate(360deg); } }

.gen-video-queue-label {
  font-size: 14px; color: #374151; font-weight: 500;
}

.gen-video-queue-sub {
  font-size: 12px; color: #9ca3af;
}

.gen-video-queue-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  background: #fafafa; border-top: 1px solid #f0f0f0;
  font-size: 12px; color: #6b7280;
}

.gen-video-queue-bar-info {
  flex: 1; display: flex; align-items: center; gap: 6px;
}

.gen-video-queue-model {
  font-weight: 600; color: #374151;
}

/* 浮动进度 chip */
.gen-progress-chip {
  position: fixed; bottom: 100px; right: 24px;
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  background: #111827; color: #fff;
  border-radius: 20px; font-size: 12px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 9999; cursor: pointer;
  transition: opacity .3s;
}
.gen-progress-chip svg { animation: spin-queue .9s linear infinite; }

.gen-video-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; height: 260px;
  color: #94a3b8; font-size: 13px;
}

/* Placeholder */
.gen-result-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 48px 24px;
  color: #94a3b8; font-size: 13px;
}

/* Error */
.gen-error {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 32px 24px;
  font-size: 13px; color: #ef4444;
}

/* ── Loading skeletons ── */
.gen-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 20px 0;
}

.gen-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; width: 100%;
}

.gen-skeleton {
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 400px 100%;
  animation: gen-shimmer 1.2s ease-in-out infinite;
}

.gen-skeleton-video {
  width: 100%; aspect-ratio: 16/9;
  border-radius: 12px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 400px 100%;
  animation: gen-shimmer 1.2s ease-in-out infinite;
}

@keyframes gen-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.gen-loading-text {
  font-size: 12px; color: #94a3b8; font-weight: 500;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── Reference image strip ── */
.gen-ref-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 0;
  flex-wrap: wrap;
}

.gen-ref-thumbs {
  display: flex; gap: 6px; flex-wrap: wrap;
}

.gen-ref-thumb {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 8px; overflow: hidden;
  border: 1.5px solid #e2e8f0; flex-shrink: 0;
}

.gen-ref-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}

.gen-ref-remove {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%; border: none;
  background: rgba(0,0,0,.5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.12s;
}
.gen-ref-remove:hover { background: rgba(239,68,68,.8); }

.gen-ref-clear {
  width: 28px; height: 28px;
  border-radius: 7px; border: 1px solid #e2e8f0;
  background: #fff; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.12s; flex-shrink: 0;
}
.gen-ref-clear:hover { border-color: #f87171; color: #ef4444; }

/* ── Drag-over state ── */
.drag-over { border: 2px dashed var(--color-primary) !important; background: var(--color-primary-light) !important; }

/* ═══════════════════════════════════════════════════════
   Top bar (即梦风格)
   ═══════════════════════════════════════════════════════ */
.gen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.gen-topbar-left { display: flex; align-items: center; gap: 14px; }
.gen-topbar-right { display: flex; align-items: center; gap: 6px; }

.gen-new-chat-btn {
  display: flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; color: #374151;
  font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .12s; font-family: inherit;
}
.gen-new-chat-btn:hover { background: #f9fafb; border-color: #d1d5db; }

.gen-topbar-date {
  font-size: 18px; font-weight: 700; color: #111827; letter-spacing: -0.03em;
}

.gen-topbar-icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #6b7280; transition: background .12s;
}
.gen-topbar-icon-btn:hover { background: #f3f4f6; }

.gen-topbar-filter-btn {
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px;
  border: none; background: none;
  font-size: 12px; color: #6b7280; font-weight: 500;
  cursor: pointer; border-radius: 6px; transition: background .12s;
  font-family: inherit;
}
.gen-topbar-filter-btn:hover { background: #f3f4f6; }
.gen-topbar-filter-btn.active { background: #e0f2fe; color: var(--color-primary); }
.gen-new-chat-btn.active { background: #e0f2fe; border-color: #93c5fd; color: var(--color-primary); }

/* ── Topbar dropdown menus ── */
.gen-tb-dropdown { position: relative; }

.gen-tb-menu {
  position: absolute;
  top: calc(100% + 6px); left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  z-index: 2000;
  padding: 6px;
  display: none;
}
.gen-tb-menu.gen-tb-menu-right { left: auto; right: 0; }
.gen-tb-menu.open { display: block; animation: popIn .15s ease; }

.gen-tb-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; color: #374151;
  cursor: pointer; transition: background .1s;
  justify-content: space-between;
}
.gen-tb-menu-item:hover { background: #f9fafb; }
.gen-tb-menu-item.active { color: var(--color-primary); }
.gen-tb-menu-item.gen-tb-menu-danger { color: #ef4444; }
.gen-tb-menu-item.gen-tb-menu-danger:hover { background: #fef2f2; }
.gen-tb-check { color: var(--color-primary); flex-shrink: 0; }
.gen-tb-divider { height: 1px; background: #f3f4f6; margin: 4px 8px; }

/* 时间 — 日期行 */
.gen-tb-date-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 4px;
}
.gen-tb-date-label { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.gen-tb-date-input {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 12px; color: #6b7280; flex: 1; cursor: pointer;
}
.gen-tb-date-input.active { border-color: var(--color-primary); color: #374151; }

/* ═══════════════════════════════════════════════════════
   Feed (即梦风格对话流)
   ═══════════════════════════════════════════════════════ */
.gen-feed {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px 40px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Feed entry */
.gen-feed-entry {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gen-entry-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.gen-entry-thumb-stack {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.gen-entry-thumb {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.gen-entry-meta { flex: 1; padding-top: 2px; }

.gen-entry-prompt {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 3px;
  line-height: 1.4;
}

.gen-entry-params {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.gen-entry-content { width: 100%; }

.gen-entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* ═══════════════════════════════════════════════════════
   Session sidebar（与 chat-v2 抽屉行为一致：260px 常驻 + 折叠保留宽度）
   ═══════════════════════════════════════════════════════ */
.gen-root {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100%;
  min-height: 600px;
  background: #f8fafc;
}
/* 折叠时：保留 260px 列宽，仅隐藏内容；右侧布局完全不变 */
.gen-root.gen-collapsed .gen-left { visibility: hidden; pointer-events: none; }

.gen-left {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gen-left-head {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gen-conv-newbtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.gen-conv-newbtn:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,23,42,.15);
}

.gen-conv-collapse-btn,
.gen-conv-expand-btn {
  width: 34px; height: 34px; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}
.gen-conv-collapse-btn:hover,
.gen-conv-expand-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
/* 默认隐藏 expand，折叠态才显示在右侧顶栏内 */
.gen-conv-expand-btn { display: none; }
.gen-root.gen-collapsed .gen-conv-expand-btn { display: flex; }

.gen-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px 16px;
}
.gen-conv-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

.gen-conv-group { margin-bottom: 14px; }
.gen-conv-group-label {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: .05em;
}

.gen-conv-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: background .12s;
}
.gen-conv-item:hover { background: #f1f5f9; }
.gen-conv-item.active { background: #e0e7ff; }
.gen-conv-item-title {
  flex: 1;
  font-size: 13px;
  color: #0f172a;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gen-conv-item.active .gen-conv-item-title { color: #3730a3; font-weight: 600; }

.gen-conv-item-more {
  width: 22px; height: 22px; padding: 0;
  border: none; background: transparent;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.gen-conv-item:hover .gen-conv-item-more { opacity: 1; }
.gen-conv-item-more:hover { background: #e2e8f0; color: #475569; }

.gen-conv-item-menu {
  position: absolute;
  top: 100%; right: 6px;
  z-index: 30;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  padding: 4px;
  min-width: 140px;
}
.gen-conv-item-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: 5px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.gen-conv-item-menu button:hover { background: #f1f5f9; color: #0f172a; }
.gen-conv-item-menu button.gen-conv-danger { color: #dc2626; }
.gen-conv-item-menu button.gen-conv-danger:hover { background: #fef2f2; }

/* 右侧主区不强加布局，让内嵌 .generator-module (height:100%) 自己撑满 */
.gen-right {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* 移动端：与 chat-v2 同口径，<768px 隐藏抽屉 */
@media (max-width: 768px) {
  .gen-root { grid-template-columns: 1fr; }
  .gen-left { display: none; }
  .gen-conv-expand-btn { display: none !important; }
}
