/* 斑雁生图页 */
.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;
  cursor: zoom-in;
}
.ai-img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.88);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.ai-img-lightbox.open { display: flex; }
.ai-img-lightbox img,
.ai-img-lightbox video {
  max-width: min(96vw, 1600px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
  cursor: zoom-out;
}
.ai-img-lightbox .lb-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.ai-img-lightbox .lb-bar a,
.ai-img-lightbox .lb-bar button {
  background: rgba(255,255,255,.92);
  color: #111;
  border: 0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.ai-img-preview .ai-img-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 11px;
  color: #64748b;
  background: rgba(255,255,255,.85);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}
.ai-img-preview { position: relative; }
@media (max-width: 860px) {
  .ai-img-wrap { grid-template-columns: 1fr !important; }
  .ai-img-result-card { position: static; }
}

/* 生图/视频页 — 个人中心同款底色与字体（结构不变） */
.ai-img-page.ds-pc-skin,
.ai-img-html .ai-img-page.ds-pc-skin {
  color: #e8eef6;
  font-family: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(20, 120, 130, 0.35), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(196, 163, 90, 0.16), transparent 50%),
    linear-gradient(160deg, #07111f 0%, #0c2238 48%, #0a2a32 100%);
  background-attachment: fixed;
}
.ai-img-page.ds-pc-skin .ai-img-app { position: relative; z-index: 1; }
.ai-img-page.ds-pc-skin .ds-top,
.ai-img-page.ds-pc-skin .ai-img-ds-top {
  background: linear-gradient(to bottom, rgba(7,17,31,0.9), rgba(7,17,31,0.4));
}
.ai-img-page.ds-pc-skin .ds-brand-name { color: #f4f7fb; }
.ai-img-page.ds-pc-skin .ds-brand-sub { color: #9db0c4; }
.ai-img-page.ds-pc-skin .ds-mark {
  background: linear-gradient(145deg, #14b8a6, #0a5c60);
  box-shadow: 0 8px 20px rgba(13, 115, 119, 0.35);
}
.ai-img-page.ds-pc-skin .ds-icon-btn,
.ai-img-page.ds-pc-skin .ai-img-card,
.ai-img-page.ds-pc-skin .ai-img-hist,
.ai-img-page.ds-pc-skin .ai-img-panel,
.ai-img-page.ds-pc-skin .ai-img-result-card,
.ai-img-page.ds-pc-skin .ai-img-upload-box,
.ai-img-page.ds-pc-skin .ai-img-preview {
  background: rgba(12, 28, 44, 0.72) !important;
  border-color: rgba(255,255,255,0.10) !important;
  color: #e8eef6 !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}
.ai-img-page.ds-pc-skin .ai-img-label,
.ai-img-page.ds-pc-skin .ai-img-hint,
.ai-img-page.ds-pc-skin .ai-img-status,
.ai-img-page.ds-pc-skin .mc-v2-meta,
.ai-img-page.ds-pc-skin .ai-img-placeholder {
  color: #9db0c4 !important;
}
.ai-img-page.ds-pc-skin .ai-img-input,
.ai-img-page.ds-pc-skin .ai-img-select,
.ai-img-page.ds-pc-skin .ai-img-area,
.ai-img-page.ds-pc-skin input,
.ai-img-page.ds-pc-skin textarea,
.ai-img-page.ds-pc-skin select {
  background: rgba(7, 17, 31, 0.5) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #e8eef6 !important;
}
.ai-img-page.ds-pc-skin .ai-img-tab,
.ai-img-page.ds-pc-skin .ai-img-btn.ghost,
.ai-img-page.ds-pc-skin .js-quality,
.ai-img-page.ds-pc-skin .js-wh-preset {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #d7e6f2 !important;
}
.ai-img-page.ds-pc-skin .ai-img-tab.active,
.ai-img-page.ds-pc-skin .js-quality.active,
.ai-img-page.ds-pc-skin .ai-img-btn {
  background: linear-gradient(145deg, #14b8a6, #0d7377) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.ai-img-page.ds-pc-skin .ai-img-btn.line,
.ai-img-page.ds-pc-skin .ai-img-btn.ghost {
  background: transparent !important;
  border-color: rgba(20,184,166,0.45) !important;
  color: #5eead4 !important;
}
.ai-img-page.ds-pc-skin .ds-user span { color: #d7e6f2; }
.ai-img-page.ds-pc-skin h2,
.ai-img-page.ds-pc-skin h3 { color: #f4f7fb; }
.ai-img-page.ds-pc-skin .ai-img-preview .ai-img-zoom-hint {
  background: rgba(7,17,31,0.75);
  color: #9db0c4;
}
