/* 斑雁生图页 */
.ai-img-page {
  min-height: 100vh;
  background: #f4f6fb;
  color: #1a1d26;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ai-img-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #e8ebf2;
  position: sticky;
  top: 0;
  z-index: 20;
}
.ai-img-top a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 14px;
}
.ai-img-top h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}
.ai-img-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .ai-img-wrap { grid-template-columns: 1fr; }
}
.ai-img-card {
  background: #fff;
  border: 1px solid #e8ebf2;
  border-radius: 16px;
  padding: 16px 16px 18px;
  box-shadow: 0 8px 24px rgba(20, 30, 60, 0.04);
}
.ai-img-card h2 {
  margin: 0 0 12px;
  font-size: 15px;
}
.ai-img-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ai-img-tab {
  border: 1px solid #e5e8ef;
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.ai-img-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
.ai-img-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ai-img-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 6px;
}
.ai-img-input,
.ai-img-select,
.ai-img-area {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e8ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
.ai-img-area {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
.ai-img-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ai-img-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
  line-height: 1.5;
}
.ai-img-alert {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.ai-img-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.ai-img-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ai-img-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  background: #111827;
  color: #fff;
}
.ai-img-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ai-img-btn.ghost {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e8ef;
}
.ai-img-preview {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed #dbe1ea;
  overflow: hidden;
}
.ai-img-preview img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
.ai-img-placeholder {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  padding: 24px;
}
.ai-img-status {
  margin-top: 10px;
  font-size: 13px;
  color: #4b5563;
}
.ai-img-upload-box {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  background: #fafbfc;
}
.ai-img-upload-box img {
  max-width: 100%;
  max-height: 180px;
  margin-top: 8px;
  border-radius: 8px;
}
.ai-img-face-note {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

/* 斑雁生图：与大模型页同款顶栏 + 记录 */
.ai-img-page {
  margin: 0;
  background: #f3f5f9;
}
.ai-img-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px 32px;
  min-height: 100vh;
  box-sizing: border-box;
}
.ai-img-ds-top {
  padding: 14px 0 10px;
  background: transparent;
}
.ai-img-workspace {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.ai-img-hist {
  display: none;
  width: 300px;
  flex: 0 0 300px;
  background: #fff;
  border: 1px solid #e8ebf2;
  border-radius: 16px;
  overflow: hidden;
  max-height: calc(100vh - 90px);
  position: sticky;
  top: 12px;
}
.ai-img-app.hist-open .ai-img-hist {
  display: flex;
  flex-direction: column;
}
.ai-img-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid #eef1f6;
  font-weight: 650;
  font-size: 14px;
}
.ai-img-hist-body {
  overflow: auto;
  padding: 8px;
  flex: 1;
}
.ai-img-hist-empty {
  color: #9ca3af;
  font-size: 13px;
  padding: 18px 10px;
  text-align: center;
  line-height: 1.7;
}
.ai-img-hist-empty a { color: #3b82f6; }
.ai-img-hist-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ai-img-hist-item:hover {
  background: #f8fafc;
  border-color: #e8ebf2;
}
.ai-img-hist-item .thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  flex: 0 0 56px;
}
.ai-img-hist-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-img-hist-item .meta { min-width: 0; flex: 1; }
.ai-img-hist-item .t {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-img-hist-item .m {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.ai-img-hist-item .u {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-img-wrap {
  flex: 1;
  min-width: 0;
}
.ai-img-url-box { margin-top: 10px; }
.ai-img-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ai-img-url-row .ai-img-input { flex: 1; }
.ai-img-url-row .ai-img-btn { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 900px) {
  .ai-img-workspace { flex-direction: column; }
  .ai-img-hist {
    width: 100%;
    flex-basis: auto;
    max-height: 42vh;
    position: static;
  }
  .ds-user span { display: none; }
}

.ai-img-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}
.ai-img-presets .ai-img-tab {
  padding: 4px 10px;
  font-size: 12px;
}

/* ===== 斑雁生图页：解除 ai-chat.css 的 body overflow:hidden（否则整页不能滚、生成按钮被裁掉） ===== */
html.ai-img-html,
body.ai-img-page {
  height: auto !important;
  min-height: 100% !important;
  overflow: auto !important;
  overflow-x: hidden !important;
}
.ai-img-app {
  height: auto !important;
  min-height: 100vh !important;
  overflow: visible !important;
  max-width: 1280px !important;
}
.ai-img-workspace {
  overflow: visible !important;
}
.ai-img-wrap {
  display: grid !important;
  grid-template-columns: 1.05fr 0.95fr !important;
  gap: 16px !important;
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding: 18px 16px 48px !important;
  flex: 1;
  min-width: 0;
}
.ai-img-wrap-stack { display: grid !important; }
.ai-img-result-card {
  position: sticky;
  top: 12px;
  align-self: start;
  border: 1px solid #e8ebf2;
}
.ai-img-actions-main {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0.92));
  padding: 12px 0 4px;
  margin-top: 8px;
  border-top: 1px solid #eef1f6;
}
.ai-img-actions-main .ai-img-btn {
  min-width: 140px;
  font-size: 15px;
  padding: 12px 22px;
}
.ai-img-preview {
  min-height: 360px !important;
  background: #f8fafc !important;
  overflow: auto !important;
}
.ai-img-preview img {
  max-width: 100% !important;
  max-height: 70vh !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
}
@media (max-width: 860px) {
  .ai-img-wrap { grid-template-columns: 1fr !important; }
  .ai-img-result-card { position: static; }
}
