:root {
  --bg: #ffffff;
  --page: #f7f7f8;
  --ink: #10121a;
  --muted: #8b8f9b;
  --line: #e3e5ea;
  --soft: #f0f1f5;
  --purple: #7654ff;
  --purple2: #8b62ff;
  --yellow: #f3ff38;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}
button, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.promo-bar {
  position: fixed; left: 0; right: 0; top: 0; height: 44px; z-index: 50;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 0 56px;
  background: var(--yellow);
  color: #111;
  font-size: 15px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.countdown { border: 1px solid rgba(0,0,0,.16); border-radius: 7px; padding: 5px 14px; background: rgba(255,255,255,.18); }
.promo-bar button:not(.close-promo) { border: 0; background: #10121a; color: #fff; border-radius: 999px; padding: 7px 18px; font-weight: 900; }
.close-promo { position: absolute; right: 18px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 24px; line-height: 1; }
.side-nav {
  position: fixed; top: 44px; bottom: 0; left: 0; width: 88px; z-index: 40;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 8px 16px;
  background: #fff;
  border-right: 1px solid #eef0f4;
}
.brand-dot { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 30px; }
.brand-dot span { width: 27px; height: 27px; border-radius: 50%; background: conic-gradient(#7457ff, #ff5aab, #ffb33d, #7457ff); box-shadow: inset 0 0 0 6px rgba(255,255,255,.72); }
.side-nav nav { display: grid; gap: 9px; width: 100%; }
.side-nav nav a {
  position: relative;
  min-height: 58px;
  border-radius: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #51545c; font-size: 12px;
}
.side-nav nav a i { font-style: normal; font-size: 22px; line-height: 1; }
.side-nav nav a b { font-weight: 500; }
.side-nav nav a.active, .side-nav nav a:hover { background: #eef0f6; color: #10121a; }
.side-nav nav a em {
  position: absolute; top: -7px; right: 6px;
  background: var(--purple); color: #fff; font-style: normal; font-size: 11px; border-radius: 5px; padding: 2px 5px;
}
.side-nav nav a:nth-child(5) em { background: var(--yellow); color: #10121a; }
.side-bottom { margin-top: auto; display: grid; justify-items: center; gap: 10px; color: #5c606b; font-size: 14px; }
.price-badge { border: 1px solid var(--purple); color: var(--purple); border-radius: 14px; padding: 9px 14px; text-align: center; line-height: 1.25; }
.side-bottom button { width: 64px; height: 32px; border-radius: 999px; border: 1px solid #ddd; background: #fff; }
.clean-workspace { margin-left: 0; padding: 46px 40px 80px; }
.top-tabs { max-width: 1520px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.mode-card {
  position: relative; height: 58px; border: 0; border-radius: 30px;
  background: #edeff5; color: #111; font-weight: 900; font-size: 16px; text-align: left; padding: 0 40px;
  overflow: hidden;
}
.mode-card.active { background: linear-gradient(90deg, #7353ff, #7b58ff); color: #fff; }
.replicate-card { background: linear-gradient(90deg, #eef2ff, #f4f6ff); }
.mode-card .bot { position: absolute; right: 75px; bottom: -12px; font-size: 58px; transform: rotate(-4deg); opacity: .95; }
.history-entry {
  height: 58px;
  border-radius: 30px;
  background: #11131b;
  color: #fff;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(17, 19, 27, .12);
}
.mode-card small {
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  color: inherit;
  font-size: 12px;
}
.hero-area { max-width: 1520px; margin: 34px auto 0; }
.hero-area h1 { margin: 0 0 22px; font-size: 34px; line-height: 1.45; letter-spacing: -.03em; }
.hero-area h1 span { color: var(--purple); }
.replicate-mode #createTitle { display: none; }
.composer-card {
  min-height: 212px;
  border: 1px solid #d9dce3;
  border-radius: 22px;
  background: #fff;
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: 1fr auto;
  gap: 0;
  padding: 16px;
}
.upload-zone {
  grid-row: 1 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 116px;
}
.upload-pair { display: flex; align-items: center; justify-content: center; gap: 14px; }
.upload-pair[hidden],
.frame-upload[hidden] { display: none !important; }
.frame-upload {
  position: relative;
  overflow: hidden;
  width: 86px; height: 116px; border-radius: 12px; background: #f0f1f5; color: #9296a2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.frame-upload input { display: none; }
.frame-upload span { font-size: 34px; font-weight: 200; line-height: 1; }
.frame-upload b { font-size: 12px; font-weight: 500; }
.frame-upload small { font-size: 11px; color: inherit; opacity: .72; line-height: 1; }
.multi-upload {
  width: 168px;
  border: 1px dashed #d5dbe8;
  background: linear-gradient(180deg, #f7f8fb, #eef1f7);
}
.multi-upload b { font-size: 13px; font-weight: 800; color: #626b7c; }
.replicate-upload-pair { gap: 16px; }
.replicate-mini-upload {
  width: 104px;
  border: 1px dashed #d5dbe8;
}
.replicate-mini-upload b { font-size: 13px; font-weight: 800; color: #626b7c; }
.replicate-mode .composer-card {
  grid-template-columns: 170px 1fr;
}
.replicate-mode .upload-zone {
  justify-content: flex-start;
  padding-left: 12px;
  overflow: visible;
}
.replicate-mode .replicate-upload-pair {
  width: 124px;
  justify-content: flex-start;
}
.frame-upload.has-file { background: #111; color: #fff; }
.swap-icon { color: #c2c5cc; font-size: 22px; }
#promptBox {
  grid-column: 2 / 3;
  min-height: 132px;
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  padding: 6px 8px;
  font-size: 15px;
  line-height: 1.8;
  color: #20232b;
}
#promptBox::placeholder { color: #c4c7ce; }
.composer-footer { grid-column: 1 / 3; display: flex; align-items: center; justify-content: space-between; padding-top: 14px; }
.settings-row, .create-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.settings-row button { border: 1px solid #e1e3e8; background: #fff; border-radius: 10px; padding: 10px 14px; color: #545966; }
.create-meta span { color: #1f2330; font-size: 14px; }
.create-btn { border: 0; background: #11131b; color: #fff; border-radius: 12px; padding: 12px 19px; font-weight: 900; }
.banner-grid { max-width: 1520px; margin: 32px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wide-banner { height: 150px; border-radius: 14px; overflow: hidden; position: relative; background: #111; color: #fff; }
.wide-banner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.wide-banner.light video { opacity: .9; }
.wide-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.82), rgba(0,0,0,.25), transparent); }
.wide-banner div { position: absolute; z-index: 2; left: 30px; top: 35px; }
.wide-banner small { font-weight: 900; opacity: .9; }
.wide-banner h2 { margin: 10px 0 0; font-size: 26px; line-height: 1.25; }
.discover { max-width: 1520px; margin: 24px auto 0; }
.category-tabs { display: flex; align-items: center; gap: 25px; overflow-x: auto; padding: 8px 0 16px; }
.category-tabs button { position: relative; border: 0; background: transparent; color: #6e727b; font-size: 16px; white-space: nowrap; padding: 8px 0; }
.category-tabs button.active { color: #11131b; }
.category-tabs button.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 4px; background: var(--purple); border-radius: 99px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.template-card { position: relative; min-height: 250px; border-radius: 8px; overflow: hidden; background: #eef0f4; }
.template-card.tall { min-height: 450px; }
.template-card video, .fake-cover { width: 100%; height: 100%; min-height: inherit; object-fit: cover; display: block; }
.template-card div:last-child { position: absolute; left: 0; right: 0; bottom: 0; padding: 54px 14px 13px; color: #fff; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.72)); }
.template-card h3 { margin: 0; font-size: 17px; line-height: 1.2; }
.template-card span { font-size: 14px; opacity: .85; }
.fake-cover { display: grid !important; place-items: center; padding: 28px; text-align: center; color: #fff; font-size: 26px; }
.red-cover { background: radial-gradient(circle at 70% 30%, #ffba54, transparent 28%), linear-gradient(135deg, #b70d19, #f05224); }
.cute-cover { background: radial-gradient(circle at 20% 20%, #fff4bf, transparent 28%), linear-gradient(135deg, #d23a22, #ffba55); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 130%); transition: .22s ease; z-index: 80; background: #11131b; color: #fff; border-radius: 99px; padding: 12px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.toast.show { transform: translate(-50%, 0); }
.recent-history {
  max-width: 1520px;
  margin: 26px auto 0;
  padding-bottom: 10px;
}
.recent-history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.recent-history-head small {
  color: var(--purple);
  font-weight: 900;
}
.recent-history-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -.02em;
}
.recent-history-head a {
  flex: 0 0 auto;
  border: 1px solid #e3e7f1;
  border-radius: 999px;
  padding: 9px 14px;
  color: #252a36;
  font-weight: 900;
  background: #fff;
}
.recent-history-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  padding: 2px 4px 14px;
  scrollbar-width: thin;
}
.history-tile {
  flex: 0 0 272px;
  height: 176px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #f0f2f7;
  border: 1px solid #e5e8f0;
  box-shadow: 0 12px 32px rgba(16, 18, 26, .06);
  scroll-snap-align: start;
}
.history-tile video,
.history-tile img,
.history-tile .history-thumb-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.history-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.72));
}
.history-tile div {
  position: absolute;
  z-index: 1;
  left: 14px;
  right: 14px;
  bottom: 13px;
  color: #fff;
  display: grid;
  gap: 4px;
}
.history-tile em {
  justify-self: start;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  padding: 4px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}
.history-tile b {
  font-size: 16px;
  line-height: 1.25;
}
.history-tile span {
  font-size: 12px;
  opacity: .84;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-thumb-fallback {
  display: grid !important;
  place-items: center;
  color: #7a8191;
  font-weight: 900;
  background:
    radial-gradient(circle at 30% 20%, rgba(118,84,255,.28), transparent 28%),
    linear-gradient(135deg, #f7f8fc, #e8ebf4);
}
@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(2, 1fr); } .banner-grid { grid-template-columns: 1fr; } .composer-card { grid-template-columns: 1fr; } #promptBox, .composer-footer { grid-column: 1; } }
@media (max-width: 720px) { .side-nav { display: none; } .clean-workspace { margin-left: 0; padding: 78px 16px 60px; } .top-tabs { grid-template-columns: 1fr; gap: 10px; } .promo-bar { justify-content: flex-start; overflow: hidden; font-size: 12px; padding-left: 12px; } .hero-area h1 { font-size: 29px; } .card-grid { grid-template-columns: 1fr; } }
body.promo-hidden .promo-bar { display: none; }
body.promo-hidden .side-nav { top: 0; }
body.promo-hidden .clean-workspace { padding-top: 46px; }
.mode-card:not(.active):hover { background: #e7e9f0; transform: translateY(-1px); }
.mode-card { transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.mode-card.active { box-shadow: 0 10px 24px rgba(118, 84, 255, .18); }
.mode-card .bot { pointer-events: none; }
.settings-row button.is-selected { border-color: rgba(118, 84, 255, .45); color: var(--purple); background: #f4f1ff; }
.template-card { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.template-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(16, 18, 26, .12); }
.template-card.is-hidden { display: none; }
.create-btn:disabled { opacity: .72; cursor: progress; }
.frame-upload { cursor: pointer; transition: transform .18s ease, background .18s ease, color .18s ease; }
.frame-upload:hover { transform: translateY(-2px); background: #e9ebf2; }
.frame-upload.has-file:hover { background: #111; }
.workflow-output {
  margin-top: 22px;
  border: 1px solid #dfe1e8;
  border-radius: 22px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 18px 48px rgba(16, 18, 26, .06);
}
.workflow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.workflow-head small {
  display: inline-flex;
  color: var(--purple);
  font-weight: 900;
  margin-bottom: 6px;
}
.workflow-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}
.workflow-head button,
.refine-box button {
  border: 0;
  background: #11131b;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.result-grid article,
.prompt-detail,
.video-job {
  border: 1px solid #eceef4;
  border-radius: 16px;
  background: #fafbfe;
  padding: 14px;
}
.result-grid h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.point-card {
  padding: 10px 0;
  border-top: 1px solid #e7e9f0;
}
.point-card:first-child { border-top: 0; padding-top: 0; }
.point-card b { display: block; margin-bottom: 5px; color: #151924; }
.point-card p { margin: 4px 0; color: #555b67; font-size: 13px; line-height: 1.6; }
.workflow-output pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: #303540;
  font-size: 13px;
  line-height: 1.65;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
.script-shot,
.story-shot {
  padding: 8px 0;
  border-top: 1px solid #e7e9f0;
}
.script-shot:first-child,
.story-shot:first-child { border-top: 0; padding-top: 0; }
.script-shot b,
.story-shot b { color: #151924; }
.script-shot p,
.story-shot p { margin: 5px 0; color: #555b67; font-size: 13px; line-height: 1.55; }
.story-shot img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  margin-top: 8px;
  border: 1px solid #e4e6ee;
  background: #fff;
}
.prompt-detail {
  margin-top: 12px;
}
.prompt-detail summary {
  cursor: pointer;
  font-weight: 900;
  margin-bottom: 10px;
}
.refine-box {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 8px;
  margin-top: 12px;
}
.refine-box select,
.refine-box input {
  min-height: 42px;
  border: 1px solid #dfe1e8;
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}
.refine-output {
  margin-top: 10px !important;
  border: 1px solid rgba(118, 84, 255, .22);
  border-radius: 14px;
  background: #f7f4ff;
  padding: 12px;
}
.video-job {
  margin-top: 12px;
  color: #404650;
  line-height: 1.7;
}
.chat-confirm-panel {
  margin-top: 18px;
}
.chat-stage {
  min-height: 520px;
  border: 1px solid #e1e4ec;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(118, 84, 255, .08), transparent 28%),
    linear-gradient(180deg, #ffffff, #fbfbfd);
  padding: 18px;
  box-shadow: 0 18px 48px rgba(16, 18, 26, .06);
}
.chat-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid #edf0f6;
}
.chat-stage-head small {
  color: var(--purple);
  font-weight: 900;
}
.chat-stage-head h2 {
  margin: 6px 0 6px;
  font-size: 22px;
}
.chat-stage-head p {
  margin: 0;
  color: #6a6f7a;
  line-height: 1.7;
}
.confirm-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f3ff38;
  color: #11131b;
  padding: 8px 14px;
  font-weight: 900;
}
.chat-stream {
  display: grid;
  gap: 14px;
  padding: 18px 4px 10px;
}
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
}
.chat-message.user {
  justify-self: end;
  flex-direction: row-reverse;
}
.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #11131b;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.chat-message.user .avatar {
  background: var(--purple);
}
.bubble {
  border: 1px solid #e8ebf2;
  border-radius: 18px;
  background: #fff;
  padding: 13px 15px;
  color: #303540;
  line-height: 1.7;
  box-shadow: 0 10px 28px rgba(16, 18, 26, .05);
}
.chat-message.user .bubble {
  background: #11131b;
  color: #fff;
  border-color: #11131b;
}
.bubble b {
  display: block;
  color: #151924;
  margin-bottom: 4px;
}
.chat-message.user .bubble b,
.chat-message.user .bubble p {
  color: #fff;
}
.bubble p {
  margin: 4px 0;
}
.bubble ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.bubble li {
  margin: 4px 0;
}
.ai-step-card {
  margin-top: 10px;
  border: 1px solid #edf0f6;
  border-radius: 14px;
  background: #fafbff;
  padding: 10px 12px;
}
.ai-step-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
}
.ai-step-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.65;
}
.mini-shot-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.mini-shot {
  border-top: 1px solid #e8ebf2;
  padding-top: 8px;
}
.mini-shot:first-child {
  border-top: 0;
  padding-top: 0;
}
.mini-shot img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  margin-top: 8px;
  border: 1px solid #e4e7ef;
  background: #fff;
}
.confirm-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 4px 0;
  border: 1px solid rgba(118, 84, 255, .22);
  border-radius: 18px;
  background: #f7f4ff;
  padding: 14px;
}
.confirm-action-bar div {
  display: grid;
  gap: 3px;
}
.confirm-action-bar span {
  color: #696f7c;
  font-size: 13px;
}
.primary-action,
.secondary-action {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  font-weight: 900;
}
.primary-action {
  background: #11131b;
  color: #fff;
}
.secondary-action {
  background: #fff;
  color: #303540;
  border: 1px solid #dddff0;
}
.chat-input-bar {
  position: sticky;
  bottom: 18px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 14px auto 0;
  border: 1px solid #dfe2ea;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  padding: 12px;
  box-shadow: 0 18px 54px rgba(16, 18, 26, .12);
}
.chat-upload {
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f0f1f5;
  color: #626875;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}
.chat-upload.has-file {
  background: #11131b;
  color: #fff;
}
.chat-upload input {
  display: none;
}
#chatPromptInput {
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  padding: 8px 4px;
  line-height: 1.6;
}
#chatSendBtn {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: var(--purple);
  color: #fff;
  padding: 0 18px;
  font-weight: 900;
}
#chatSendBtn:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: .65;
  cursor: progress;
}
.confirm-mode .composer-card,
.confirm-mode .workflow-output {
  display: none;
}
body.ai-director-mode {
  overflow: hidden;
}
body.ai-director-mode .banner-grid,
body.ai-director-mode .discover,
body.ai-director-mode .replicate-panel {
  display: none !important;
}
body.ai-director-mode .clean-workspace {
  min-height: 100vh;
  padding-bottom: 18px;
}
body.ai-director-mode .hero-area {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 178px);
}
body.ai-director-mode .hero-area > h1 {
  margin-bottom: 14px;
}
body.ai-director-mode .chat-confirm-panel {
  flex: 1;
  min-height: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.ai-director-mode .chat-confirm-card,
body.ai-director-mode .chat-stage {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid #e1e4ec;
  border-radius: 24px;
  background:
    radial-gradient(circle at 10% 0%, rgba(118, 84, 255, .08), transparent 28%),
    linear-gradient(180deg, #ffffff, #fbfbfd);
  padding: 18px;
  box-shadow: 0 18px 48px rgba(16, 18, 26, .06);
  overflow: hidden;
}
body.ai-director-mode .confirm-head,
body.ai-director-mode .chat-stage-head {
  flex: 0 0 auto;
}
body.ai-director-mode .chat-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}
body.ai-director-mode .confirm-action-bar {
  flex: 0 0 auto;
}
body.ai-director-mode .chat-input-row,
body.ai-director-mode .chat-input-bar {
  position: static;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  margin: 0;
  border: 1px solid #dfe2ea;
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px);
  padding: 12px;
  box-shadow: 0 18px 54px rgba(16, 18, 26, .10);
}
.replicate-mode .workflow-output { display: none; }
.replicate-panel {
  margin-top: 18px;
}
.replicate-hero-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #e0e4ef;
  border-radius: 26px;
  background:
    radial-gradient(circle at 8% 0%, rgba(118, 84, 255, .13), transparent 30%),
    linear-gradient(135deg, #fff, #f8f8ff);
  padding: 24px;
  box-shadow: 0 18px 48px rgba(16, 18, 26, .06);
}
.replicate-hero-card small,
.replicate-plan-head small {
  color: var(--purple);
  font-weight: 900;
}
.replicate-hero-card h2,
.replicate-plan-head h2 {
  margin: 7px 0 8px;
  font-size: 24px;
  line-height: 1.35;
}
.replicate-hero-card p,
.replicate-plan-head p {
  margin: 0;
  max-width: 820px;
  color: #666d7b;
  line-height: 1.75;
}
.replicate-steps {
  min-width: 300px;
  margin: 0;
  padding: 12px;
  list-style: none;
  display: grid;
  gap: 10px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #eef0f6;
}
.replicate-steps li {
  position: relative;
  border-radius: 16px;
  padding: 12px 14px 12px 38px;
  color: #626876;
  font-weight: 900;
}
.replicate-steps li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #c8ccd6;
}
.replicate-steps li.active {
  background: #f4f1ff;
  color: var(--purple);
}
.replicate-steps li.active::before { background: var(--purple); }
.replicate-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.replicate-upload-card {
  position: relative;
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px dashed #cfd5e2;
  border-radius: 22px;
  background: #fff;
  padding: 20px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.replicate-upload-card:hover {
  transform: translateY(-2px);
  border-color: rgba(118, 84, 255, .5);
  box-shadow: 0 18px 42px rgba(16, 18, 26, .08);
}
.replicate-upload-card input { display: none; }
.replicate-upload-card span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f1f3f8;
  color: #6a7283;
  font-weight: 900;
}
.replicate-upload-card b {
  font-size: 18px;
  color: #141823;
}
.replicate-upload-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.65;
  font-size: 14px;
}
.replicate-upload-card em {
  align-self: end;
  justify-self: start;
  border-radius: 999px;
  background: #f0f2f7;
  color: #606779;
  padding: 7px 10px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.replicate-upload-card.required::after {
  content: "必填";
  position: absolute;
  right: 16px;
  top: 16px;
  border-radius: 999px;
  background: #fff1f1;
  color: #d64b4b;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}
.replicate-upload-card.has-file {
  border-style: solid;
  border-color: rgba(118, 84, 255, .45);
  background: linear-gradient(180deg, #fff, #fbfaff);
}
.replicate-upload-card.has-file span,
.replicate-upload-card.has-file em {
  background: #11131b;
  color: #fff;
}
.replicate-upload-card.error {
  border-color: #ff6b6b;
  background: #fff7f7;
}
.replicate-upload-card.uploading,
.frame-upload.uploading {
  border-color: rgba(118, 84, 255, .75);
  background: linear-gradient(135deg, #fff, #f5f1ff);
}
.replicate-upload-card.uploading::before,
.frame-upload.uploading::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 0%, rgba(118, 84, 255, .10) 42%, rgba(41, 211, 162, .18) 50%, transparent 62%);
  background-size: 220% 100%;
  animation: uploadShimmer 1.1s linear infinite;
  pointer-events: none;
}
@keyframes uploadShimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}
.upload-preview {
  width: 100%;
  min-height: 112px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.frame-upload .upload-preview {
  position: absolute;
  inset: 5px;
  z-index: 0;
  grid-template-columns: 1fr;
  min-height: auto;
  margin: 0;
  opacity: .78;
}
.frame-upload.has-file > span,
.frame-upload.has-file > b,
.frame-upload.has-file > small,
.frame-upload.uploading > span,
.frame-upload.uploading > b,
.frame-upload.uploading > small {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 8px rgba(0,0,0,.42);
}
.upload-preview-item {
  position: relative;
  overflow: hidden;
  min-height: 72px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e9f2ff, #f7ecff);
  border: 1px solid rgba(118, 84, 255, .16);
}
.upload-preview-item img,
.upload-preview-item video {
  width: 100%;
  height: 100%;
  min-height: 72px;
  object-fit: cover;
  display: block;
}
.upload-preview-item em {
  position: absolute;
  left: 7px;
  bottom: 7px;
  margin: 0;
  border-radius: 999px;
  background: rgba(17, 19, 27, .72) !important;
  color: #fff !important;
  padding: 4px 7px !important;
  font-size: 11px !important;
}
.upload-spinner {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,.75);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: uploadSpin .8s linear infinite;
  background: rgba(255,255,255,.35);
}
@keyframes uploadSpin { to { transform: rotate(360deg); } }
.replicate-brief-card,
.replicate-plan-panel {
  margin-top: 14px;
  border: 1px solid #e0e4ef;
  border-radius: 24px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 18px 48px rgba(16, 18, 26, .05);
}
.brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.brief-head b {
  display: block;
  font-size: 17px;
}
.brief-head span {
  display: block;
  margin-top: 5px;
  color: #737a89;
  font-size: 13px;
}
.brief-head strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f3ff38;
  padding: 8px 13px;
  font-size: 13px;
}
#replicateBrief {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid #e0e4ef;
  border-radius: 18px;
  outline: none;
  padding: 13px 14px;
  line-height: 1.75;
  color: #242936;
}
.replicate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.replicate-actions p {
  margin: 0;
  color: #747b89;
  font-size: 13px;
}
.replicate-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f6;
}
#replicatePlanStatus {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f4f1ff;
  color: var(--purple);
  padding: 8px 13px;
  font-weight: 900;
}
.replicate-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.replicate-summary-card {
  border: 1px solid #edf0f6;
  border-radius: 16px;
  background: #fafbfe;
  padding: 14px;
}
.replicate-summary-card small {
  display: block;
  color: #8d94a3;
  font-weight: 900;
  margin-bottom: 6px;
}
.replicate-summary-card b {
  display: block;
  color: #171c28;
  line-height: 1.45;
}
.replicate-summary-card p {
  margin: 7px 0 0;
  color: #666d7b;
  line-height: 1.65;
  font-size: 13px;
}
.replicate-shot-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.replicate-contact-sheet-card {
  border: 1px solid #e2e6f0;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #f8f9ff);
  padding: 16px;
}
.replicate-contact-sheet-card small {
  display: block;
  color: var(--purple);
  font-weight: 900;
  margin-bottom: 4px;
}
.replicate-contact-sheet-card h3 {
  margin: 0 0 6px;
  color: #171c28;
}
.replicate-contact-sheet-card p {
  margin: 0 0 12px;
  color: #626978;
  line-height: 1.6;
}
.replicate-contact-sheet-card.error {
  border-color: #ffd6d6;
  background: #fff8f8;
}
.inline-task-spinner {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 4px solid #ece7ff;
  border-top-color: var(--purple);
  animation: uploadSpin 1s linear infinite;
}
.replicate-contact-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.replicate-contact-sheet-grid figure,
.dialog-contact-sheet-grid figure {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #e3e7f1;
  background: #fff;
}
.replicate-contact-sheet-grid img,
.dialog-contact-sheet-grid img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  display: block;
  background: #fff;
}
.replicate-contact-sheet-grid figcaption,
.dialog-contact-sheet-grid figcaption {
  padding: 9px 11px;
  font-size: 13px;
  color: #667085;
  font-weight: 900;
}
.replicate-final-storyboard,
.dialog-final-storyboard {
  margin: 12px 0 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #e3e7f1;
  background: #fff;
}
.replicate-final-storyboard img,
.dialog-final-storyboard img {
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}
.dialog-final-storyboard figcaption {
  padding: 10px 12px;
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}
.replicate-script-details {
  margin-top: 12px;
  border-radius: 14px;
  background: #f8f9fc;
  border: 1px solid #edf0f6;
  padding: 12px 14px;
}
.replicate-script-details summary {
  cursor: pointer;
  font-weight: 900;
  color: #171c28;
}
.replicate-script-details li,
.dialog-script-lines li {
  margin: 6px 0;
  color: #4b5563;
  line-height: 1.55;
  font-size: 13px;
}
.dialog-script-lines {
  margin: 10px 0 0;
  padding-left: 22px;
}
.replicate-shot-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 14px;
  border: 1px solid #e8ebf2;
  border-radius: 18px;
  background: #fff;
  padding: 14px;
}
.replicate-shot-meta {
  border-radius: 16px;
  background: #f7f8fb;
  padding: 13px;
}
.replicate-shot-meta strong {
  display: block;
  color: var(--purple);
  font-size: 22px;
}
.replicate-shot-meta b {
  display: block;
  margin: 6px 0;
  color: #171c28;
}
.replicate-shot-meta span {
  color: #707786;
  font-size: 13px;
}
.replicate-shot-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
}
.replicate-shot-body p {
  margin: 5px 0;
  color: #4f5665;
  line-height: 1.65;
  font-size: 13px;
}
.replicate-shot-body code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
  border-radius: 14px;
  background: #f8f7ff;
  color: #303540;
  padding: 10px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.65;
  font-size: 12px;
}
.replicate-shot-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}
.replicate-shot-images figure {
  margin: 0;
  border-radius: 14px;
  background: #f8f9fc;
  border: 1px solid #e5e8f0;
  overflow: hidden;
}
.replicate-shot-images figcaption {
  padding: 8px 10px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.replicate-shot-body img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  display: block;
  border-radius: 0;
  margin-top: 0;
  border: 0;
  background: #11131b;
}
.replicate-prompt-detail {
  margin-top: 14px;
  border: 1px solid #edf0f6;
  border-radius: 16px;
  background: #fafbfe;
  padding: 14px;
}
.replicate-prompt-detail summary {
  cursor: pointer;
  font-weight: 900;
  margin-bottom: 10px;
}
.replicate-prompt-detail pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: #303540;
  font-size: 13px;
  line-height: 1.65;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
.replicate-revise-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}
.replicate-revise-box input {
  min-height: 44px;
  border: 1px solid #dfe2ea;
  border-radius: 14px;
  padding: 0 13px;
  outline: none;
}
.replicate-confirm-bar { margin-left: 0; margin-right: 0; }
.direct-video-job,
.replicate-video-job {
  margin-top: 14px;
  border-radius: 18px;
  background: #f8f9fc;
  border: 1px solid #e6e9f1;
  padding: 14px;
  color: #303540;
  line-height: 1.65;
}
.direct-video-job b,
.replicate-video-job b { display: block; margin-bottom: 4px; color: #171c28; }
.direct-video-job a,
.replicate-video-job a { color: #6b4dff; font-weight: 800; text-decoration: none; }
.job-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e9f2;
  margin: 8px 0 6px;
}
.job-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6b4dff, #29d3a2);
  transition: width .35s ease;
}
.batch-job-item {
  padding: 8px 0;
  border-top: 1px dashed #e6e9f1;
}
.batch-job-item:first-of-type { border-top: none; }
.batch-job-item p { margin: 0 0 2px; font-size: 13px; }
.pricing-estimate-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ececf4;
}
.pricing-estimate-row span { color: #6b7180; font-size: 13px; }
.pricing-estimate-row strong { color: #6b4dff; font-size: 16px; font-weight: 800; }
.pricing-note { margin: 6px 0 0; color: #9097a6; font-size: 12px; line-height: 1.5; }
.option-card.is-disabled,
.option-card[disabled] {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(.4);
}
.option-card.is-disabled em { color: #b0431f; }
.replicate-dialog {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: 280px 1fr;
  background: #f7f8fb;
  color: #151923;
}
.replicate-dialog[hidden] { display: none; }
.replicate-dialog-sidebar {
  border-right: 1px solid #e7eaf1;
  background: rgba(255,255,255,.86);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dialog-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dialog-sidebar-head b { font-size: 18px; }
.dialog-sidebar-head button,
.dialog-main-head button,
.dialog-input-bar button {
  border: 0;
  border-radius: 12px;
  background: #11131b;
  color: #fff;
  font-weight: 900;
  padding: 10px 12px;
  cursor: pointer;
}
.replicate-dialog-sidebar small {
  color: #98a0af;
  font-weight: 900;
}
.dialog-conversation-list {
  display: grid;
  gap: 8px;
}
.dialog-conversation {
  border: 0;
  border-radius: 13px;
  background: transparent;
  padding: 12px;
  text-align: left;
  color: #333846;
  font-weight: 800;
  cursor: pointer;
}
.dialog-conversation.active {
  background: #eef0f5;
  color: #11131b;
}
.replicate-dialog-main {
  min-width: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.dialog-main-head {
  height: 74px;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7eaf1;
  background: rgba(255,255,255,.72);
}
.dialog-main-head small {
  color: var(--purple);
  font-weight: 900;
}
.dialog-main-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
}
.dialog-stream {
  overflow: auto;
  min-height: 0;
  padding: 28px clamp(20px, 8vw, 180px) 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-padding-bottom: 24px;
}
.dialog-message {
  display: grid;
  grid-template-columns: 36px minmax(0, 920px);
  gap: 12px;
  align-items: flex-start;
}
.dialog-message.user {
  justify-content: end;
  grid-template-columns: minmax(0, 760px) 36px;
}
.dialog-message.user .dialog-avatar { order: 2; background: #11131b; color: #fff; }
.dialog-message.user .dialog-bubble { order: 1; background: #fff; }
.dialog-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3ff38;
  color: #11131b;
  font-weight: 900;
}
.dialog-bubble {
  border-radius: 18px;
  background: #fff;
  border: 1px solid #edf0f6;
  padding: 14px;
  box-shadow: 0 14px 36px rgba(16,18,26,.05);
  line-height: 1.7;
}
.dialog-bubble p { margin: 6px 0 0; color: #626978; }
.dialog-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 9px;
  margin-top: 10px;
}
.dialog-asset-grid img,
.dialog-asset-grid video {
  width: 100%;
  height: 118px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e5e8f0;
  background: #edf2ff;
}
.dialog-generating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--purple);
  font-weight: 900;
}
.dialog-generating::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(118,84,255,.25);
  border-top-color: var(--purple);
  animation: uploadSpin .8s linear infinite;
}
.dialog-input-bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0 clamp(20px, 8vw, 180px) 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e3e6ee;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 54px rgba(16,18,26,.12);
}
.dialog-input-bar textarea {
  border: 0;
  outline: none;
  resize: none;
  line-height: 1.65;
  min-height: 44px;
  font-family: inherit;
}
.dialog-plan-toolbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(90deg, #f7f5ff, #eef7ff);
  border: 1px solid #e5e4ff;
  color: #475066;
  font-size: 13px;
}
.dialog-plan-toolbar[hidden] { display: none !important; }
.dialog-plan-toolbar strong {
  display: block;
  color: #171c28;
  font-size: 14px;
}
.dialog-plan-toolbar span {
  color: #6b7280;
}
.dialog-plan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.dialog-plan-actions button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  cursor: pointer;
}
.dialog-plan-actions .secondary {
  background: #fff;
  color: #11131b;
  border: 1px solid #dde2ef;
}
.dialog-plan-actions .primary {
  background: #11131b;
  color: #fff;
}
.dialog-plan-actions button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.dialog-plan-preview {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.dialog-plan-media {
  border-radius: 18px;
  overflow: hidden;
  background: #11131b;
  border: 1px solid #e5e8f0;
}
.dialog-plan-media video,
.dialog-plan-media img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  background: #11131b;
}
.dialog-plan-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.dialog-plan-meta-grid article {
  border-radius: 14px;
  background: #f8f9fc;
  border: 1px solid #edf0f6;
  padding: 12px;
}
.dialog-plan-meta-grid small {
  display: block;
  color: #8b93a3;
  font-weight: 900;
  margin-bottom: 4px;
}
.dialog-plan-meta-grid b {
  display: block;
  color: #171c28;
}
.dialog-shot-list {
  display: grid;
  gap: 10px;
}
.dialog-shot-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e8ebf2;
  border-radius: 16px;
  background: #fff;
}
.dialog-shot-card time {
  display: grid;
  place-items: center;
  min-height: 74px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #f8eaff);
  color: #6b4dff;
  font-weight: 900;
  text-align: center;
}
.dialog-shot-card h4 {
  margin: 0 0 6px;
  color: #171c28;
}
.dialog-shot-card p {
  margin: 4px 0;
  color: #596273;
  font-size: 13px;
  line-height: 1.6;
}
.dialog-shot-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}
.dialog-shot-images figure {
  margin: 0;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid #e5e8f0;
  background: #f8f9fc;
}
.dialog-shot-images figcaption {
  padding: 7px 9px;
  font-size: 12px;
  color: #667085;
  font-weight: 800;
}
.dialog-shot-images img {
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  background: #11131b;
}
.dialog-shot-card img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid #e5e8f0;
  background: #f6f8fc;
  margin-top: 8px;
}
.dialog-plan-note {
  border-radius: 14px;
  padding: 12px;
  background: #fffbea;
  color: #6f5b19;
  border: 1px solid #f3e3a4;
  font-size: 13px;
}
.dialog-contact-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.dialog-contact-sheet-grid img {
  max-height: 520px;
}
body.replicate-dialog-open {
  overflow: hidden;
}
@media (min-width: 1500px) {
  .clean-workspace { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 900px) {
  .result-grid,
  .refine-box { grid-template-columns: 1fr; }
  .workflow-head { flex-direction: column; }
  .chat-message { max-width: 100%; }
  .confirm-action-bar,
  .chat-input-bar { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .replicate-hero-card,
  .replicate-plan-head,
  .replicate-actions,
  .brief-head { flex-direction: column; align-items: stretch; }
  .replicate-upload-grid,
  .replicate-summary-grid,
  .replicate-shot-card,
  .replicate-revise-box { grid-template-columns: 1fr; }
  .replicate-steps { min-width: 0; }
  .replicate-dialog { grid-template-columns: 1fr; }
  .replicate-dialog-sidebar { display: none; }
  .dialog-input-bar { margin-left: 18px; margin-right: 18px; }
  .dialog-stream { padding-left: 18px; padding-right: 18px; }
  .dialog-plan-toolbar { flex-direction: column; align-items: stretch; }
  .dialog-plan-actions { justify-content: stretch; }
  .dialog-plan-actions button { flex: 1 1 auto; }
  .dialog-shot-card { grid-template-columns: 1fr; }
}

/* 三组生成参数下拉框：模型 / 参考模式 / 输出设置 */
.hero-area { position: relative; z-index: 6; }
.composer-card { position: relative; overflow: visible; }
.composer-footer { position: relative; z-index: 18; align-items: flex-end; gap: 14px; }
.config-selects {
  position: relative;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}
.setting-dropdown { display: flex; }
.setting-trigger {
  height: 52px;
  min-width: 254px;
  border: 1px solid #dfe4f1 !important;
  background: rgba(255,255,255,.92) !important;
  color: #172033 !important;
  border-radius: 18px !important;
  padding: 8px 12px !important;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 22px rgba(24, 38, 78, .04);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.model-trigger { min-width: 314px; }
.output-trigger { min-width: 288px; }
.setting-trigger:hover,
.setting-dropdown.open .setting-trigger {
  border-color: rgba(88, 128, 255, .45) !important;
  box-shadow: 0 14px 34px rgba(71, 102, 190, .13);
  transform: translateY(-1px);
}
.trigger-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #f4f6fb;
  color: #3155b7;
  font-weight: 900;
  border: 1px solid rgba(49,85,183,.08);
}
.lazy-badge {
  color: #11131b;
  background: radial-gradient(circle at 62% 24%, #fff 0 9px, transparent 10px), #fff;
  border: 1px dashed #11131b;
  font-size: 18px;
  font-family: "Microsoft YaHei", sans-serif;
}
.grid-badge { background: #f2f5ff; color: #3f63d8; }
.output-badge { background: #f1f4ff; color: #415eff; }
.person-badge { background: #f4f1ff; color: var(--purple); }
.trigger-copy { display: grid; gap: 2px; text-align: left; min-width: 0; }
.trigger-copy small { color: #9aa2b4; font-size: 12px; font-weight: 800; line-height: 1; }
.trigger-copy b { color: #172033; font-size: 15px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setting-trigger em {
  margin-left: auto;
  max-width: 132px;
  background: #eef3ff;
  color: #3163e6;
  border-radius: 999px;
  padding: 7px 10px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.setting-trigger i {
  color: #1d2434;
  font-style: normal;
  font-size: 18px;
  transition: transform .18s ease;
}
.setting-dropdown.open .setting-trigger i { transform: rotate(180deg); }
.person-reference-dropdown { display: none !important; }
.replicate-mode .person-reference-dropdown { display: block !important; }
.person-reference-trigger { min-width: 220px; }
.person-reference-panel {
  width: 430px !important;
  max-width: calc(100vw - 60px);
  left: auto !important;
  right: 0 !important;
  padding: 18px;
}
.optional-assets-panel {
  display: none;
  gap: 12px;
}
.setting-dropdown.open .optional-assets-panel {
  display: grid;
}
.person-reference-card {
  min-height: 158px;
  margin-top: 12px;
  padding: 16px;
  border-radius: 18px;
  box-shadow: none;
}
.optional-asset-card {
  margin-top: 10px;
}
.person-reference-card b { font-size: 16px; }
.person-reference-card p { font-size: 13px; line-height: 1.55; }
.setting-panel {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 14px);
  width: min(792px, calc(100vw - 180px));
  max-height: min(68vh, 640px);
  overflow: auto;
  z-index: 90;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(213, 221, 240, .9);
  box-shadow: 0 26px 80px rgba(40, 55, 96, .18), 0 2px 8px rgba(24, 33, 56, .06);
  backdrop-filter: blur(18px);
}
.setting-panel::before {
  content: "";
  position: absolute;
  left: 34px;
  top: -8px;
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  background: rgba(255,255,255,.98);
  border-left: 1px solid rgba(213, 221, 240, .9);
  border-top: 1px solid rgba(213, 221, 240, .9);
}
.setting-dropdown.open .setting-panel {
  display: block;
  animation: panelIn .16s ease both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-head.compact { margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 18px; color: #172033; }
.panel-head span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: 999px;
  color: #6a7896;
  background: linear-gradient(180deg, #f6f8ff, #eef3ff);
  border: 1px solid #d9e3ff;
  font-size: 13px;
  font-weight: 800;
}
.panel-head span strong { color: #2d65f0; font-size: 20px; }
.panel-label { margin: 14px 0 10px; color: #98a1b4; font-size: 14px; font-weight: 900; }
.option-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.option-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option-card {
  min-height: 104px;
  border: 1px solid #e1e6f0 !important;
  border-radius: 18px !important;
  background: #fafbfe !important;
  color: #172033 !important;
  padding: 16px !important;
  display: grid;
  align-content: start;
  gap: 8px;
  text-align: left;
  box-shadow: none !important;
}
.option-card:hover,
.option-card.active {
  border-color: #9dbdff !important;
  background: linear-gradient(180deg, #f7fbff, #f3f7ff) !important;
  box-shadow: 0 16px 34px rgba(65, 105, 255, .12) !important;
}
.option-card b { font-size: 16px; line-height: 1.18; color: #182033; }
.option-card em {
  justify-self: start;
  background: #edf3ff;
  color: #2c63ec;
  border-radius: 999px;
  padding: 5px 9px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.option-card small { color: #657089; font-size: 12px; line-height: 1.45; }
.reference-panel .option-card { min-height: 118px; }
.option-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(52px, 1fr));
  gap: 6px;
  padding: 9px;
  border-radius: 22px;
  background: #f5f6fa;
}
.ratio-card {
  min-height: 70px;
  border: 0 !important;
  background: transparent !important;
  color: #2c3447 !important;
  border-radius: 18px !important;
  padding: 8px 4px !important;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  font-weight: 900;
}
.ratio-card.active,
.ratio-card:hover { background: #edf3ff !important; color: #3568ec !important; box-shadow: inset 0 0 0 1px #bfd1ff; }
.ratio-card i { display: block; width: 26px; height: 18px; border: 2px solid currentColor; border-radius: 5px; }
.ratio-card[data-value="21:9"] i { width: 32px; height: 13px; }
.ratio-card[data-value="16:9"] i { width: 30px; height: 17px; }
.ratio-card[data-value="3:2"] i { width: 28px; height: 19px; }
.ratio-card[data-value="4:3"] i { width: 27px; height: 20px; }
.ratio-card[data-value="1:1"] i { width: 22px; height: 22px; }
.ratio-card[data-value="3:4"] i { width: 20px; height: 27px; }
.ratio-card[data-value="2:3"] i { width: 18px; height: 28px; }
.ratio-card[data-value="9:16"] i { width: 15px; height: 30px; }
.quality-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-card { min-height: 78px; text-align: center; align-content: center; justify-items: center; }
.compact-card b { font-size: 16px; }
.dual-config-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.mini-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: #f5f6fa;
}
.mini-options button {
  min-width: 66px;
  height: 38px;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #3a4357 !important;
  font-weight: 900;
  padding: 0 12px !important;
}
.mini-options button.active,
.mini-options button:hover {
  color: #2d65f0 !important;
  border-color: #b9ccff !important;
  background: #edf3ff !important;
}
.mini-options button:disabled,
.mini-options button.is-disabled {
  cursor: not-allowed;
  opacity: .45;
  color: #9aa3b4 !important;
  border-color: rgba(30, 40, 70, .08) !important;
  background: rgba(245, 247, 252, .7) !important;
}
@media (max-width: 1180px) {
  .setting-trigger { min-width: 220px; }
  .model-trigger { min-width: 270px; }
  .output-trigger { min-width: 245px; }
  .setting-trigger em { display: none; }
  .setting-panel { width: min(760px, calc(100vw - 130px)); }
}
@media (max-width: 900px) {
  .config-selects { flex-wrap: wrap; }
  .setting-trigger, .model-trigger, .output-trigger { min-width: 100%; width: 100%; }
  .setting-dropdown { width: 100%; }
  .setting-panel { width: calc(100vw - 36px); left: -2px; }
  .option-grid-3, .quality-options { grid-template-columns: 1fr; }
  .option-grid-2, .dual-config-row { grid-template-columns: 1fr; }
  .option-row { grid-template-columns: repeat(3, 1fr); }
}

/* details原生下拉兜底，保证无脚本时也能点击展开 */
.setting-trigger { list-style: none; cursor: pointer; user-select: none; }
.setting-trigger::-webkit-details-marker { display: none; }
.setting-dropdown[open] .setting-trigger {
  border-color: rgba(88, 128, 255, .45) !important;
  box-shadow: 0 14px 34px rgba(71, 102, 190, .13);
  transform: translateY(-1px);
}
.setting-dropdown[open] .setting-trigger i { transform: rotate(180deg); }
.setting-dropdown[open] .setting-panel { display: block; animation: panelIn .16s ease both; }
.setting-dropdown { display: block; }

/* 点击后获得焦点也展开，兼容演示浏览器和鼠标悬停 */
.setting-dropdown:focus-within .setting-panel,
.setting-dropdown:hover .setting-panel {
  display: block;
  animation: panelIn .16s ease both;
}
.setting-dropdown:focus-within .setting-trigger,
.setting-dropdown:hover .setting-trigger {
  border-color: rgba(88, 128, 255, .45) !important;
  box-shadow: 0 14px 34px rgba(71, 102, 190, .13);
  transform: translateY(-1px);
}
.setting-dropdown:focus-within .setting-trigger i,
.setting-dropdown:hover .setting-trigger i { transform: rotate(180deg); }

/* 下拉交互最终版：只在点击后展开，点页面其它区域关闭 */
.setting-dropdown { display: block; position: relative; }
.setting-dropdown:not(.open):hover .setting-panel,
.setting-dropdown:not(.open):focus-within .setting-panel { display: none !important; }
.setting-dropdown.open .setting-panel { display: block !important; animation: panelIn .16s ease both; }
.setting-dropdown.open .optional-assets-panel { display: grid !important; }
.setting-dropdown.open .setting-trigger {
  border-color: rgba(88, 128, 255, .45) !important;
  box-shadow: 0 14px 34px rgba(71, 102, 190, .13);
  transform: translateY(-1px);
}
.setting-dropdown.open .setting-trigger i { transform: rotate(180deg); }
