:root {
  --panel-border: rgba(15, 23, 42, 0.10);
}

.createCard {
  width: min(1560px, 100%);
}

.createCard,
.createCard * {
  box-sizing: border-box;
}

.createPageMarker {
  display: none;
}

.createPageMarker ~ .siteLegalFooter {
  padding: 0 16px 28px;
}

.createPageMarker ~ .siteLegalFooter .siteLegalFooterInner {
  width: min(1560px, 100%);
}

.miniProgramGuideCard {
  width: min(680px, 100%);
  margin: 48px auto;
  padding: clamp(22px, 5vw, 44px);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 16px;
  background:
    radial-gradient(circle at 22% 12%, rgba(34, 211, 238, 0.18), transparent 30%),
    radial-gradient(circle at 86% 20%, rgba(34, 197, 94, 0.15), transparent 28%),
    rgba(255, 255, 255, 0.92);
}

.miniProgramGuideBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  background: rgba(240, 253, 250, 0.94);
  color: rgba(13, 148, 136, 0.98);
  font-size: 13px;
  font-weight: 1000;
}

.miniProgramGuideCard h1 {
  margin: 0;
  max-width: 520px;
  color: rgba(15, 23, 42, 0.96);
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.miniProgramGuideCard p {
  margin: 0;
  max-width: 520px;
  color: rgba(71, 85, 105, 0.94);
  font-size: 16px;
  line-height: 1.72;
  font-weight: 800;
}

.miniProgramCodeBox {
  width: min(320px, 78vw);
  padding: 14px;
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.miniProgramCodeBox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  user-select: auto;
  -webkit-user-select: auto;
  -webkit-touch-callout: default;
}

.miniProgramGuideTips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.miniProgramGuideTips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(236, 253, 245, 0.96);
  color: rgba(22, 101, 52, 0.96);
  font-size: 13px;
  font-weight: 1000;
}

.miniProgramBackHome {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: rgba(15, 23, 42, 0.86);
  font-weight: 1000;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

/* create 页：大屏尽量铺宽，提升预览体验 */
.createWrap {
  place-items: start center;
}
@media (min-width: 1100px) {
  .createWrap {
    padding: 16px 16px 22px;
  }
}

.createCard > .header {
  min-width: 0;
}
.createCard > .header .homeHeaderRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.createCard > .header .homeHeaderActions {
  min-width: 0;
  flex: 0 0 auto;
}
.createCard > .header h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* create 顶部右侧“回到首页”图标按钮（复用 homeAvatarBtn 的外框） */
.createHomeIconBtn {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  color: rgba(15, 23, 42, 0.82);
}
.createHomeIconSvg {
  width: 18px;
  height: 18px;
}

.createTopBar {
  margin-top: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.createTopLeft,
.createTopRight {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  min-width: 0;
}
.createTopLeft {
  flex: 1 1 auto;
}
/* TopActions 里的菜单（与返回首页同一行） */
.createTopActions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.createBusyHint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: rgba(239, 246, 255, 0.96);
  color: rgba(3, 105, 161, 0.96);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.08);
  font-size: 12px;
  font-weight: 1000;
  white-space: nowrap;
}
.createMenu {
  position: relative;
  flex: 0 0 auto;
}
.createPrimaryActions {
  align-items: center;
}
.createTopActionBtn {
  flex: 0 0 auto;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  color: rgba(15, 23, 42, 0.88);
  font-size: 13px;
  font-weight: 1100;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.createNewActionBtn {
  color: rgba(37, 99, 235, 0.96);
  border-color: rgba(37, 99, 235, 0.20);
  background: rgba(239, 246, 255, 0.92);
}
.createPublishActionBtn {
  min-width: 82px;
  color: rgba(255, 255, 255, 0.98);
  border-color: transparent;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(14, 165, 233, 0.95));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}
.createPublishActionBtn.isDirty {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.98), rgba(249, 115, 22, 0.95));
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.16);
}
.createPublishActionBtn:disabled,
.createBento .createPublishActionBtn:disabled {
  color: rgba(100, 116, 139, 0.82);
  border-color: rgba(203, 213, 225, 0.88);
  background: rgba(226, 232, 240, 0.82);
  box-shadow: none;
}
@media (hover: hover) {
  .createTopActionBtn:hover {
    filter: brightness(1.02);
    border-color: rgba(15, 23, 42, 0.18);
  }
}
.createTopActionBtn:active {
  transform: scale(0.99);
}
.createTopActionBtn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.1);
  transform: none;
  box-shadow: none;
}
.createMenuBtn {
  list-style: none;
  cursor: pointer;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  font-size: 13px;
  font-weight: 1000;
  user-select: none;
  transition: filter 120ms ease, transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.createMenuBtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22), 0 10px 22px rgba(2, 6, 23, 0.06);
}
@media (hover: hover) {
  .createMenuBtn:hover {
    filter: brightness(1.03);
    border-color: rgba(15, 23, 42, 0.18);
  }
}
.createMenuBtn:active {
  transform: scale(0.99);
}
.createMenuBtn::-webkit-details-marker {
  display: none;
}
.createMenuPanel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 160px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.12);
  padding: 6px;
  display: grid;
  gap: 6px;
  z-index: 50;
}
.createMenuItem {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  font-weight: 1000;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.88);
  transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
@media (hover: hover) {
  .createMenuItem:hover {
    filter: brightness(1.02);
    border-color: rgba(15, 23, 42, 0.16);
  }
}
.createMenuItem:active {
  transform: scale(0.995);
}
/* 不要出现“默认选中态/焦点高亮” */
.createMenuItem:focus,
.createMenuItem:focus-visible {
  outline: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.70);
}
.createMenuItem:disabled {
  opacity: 0.6;
}
.createTopInline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(260px, 100%);
  flex: 1 1 260px;
}
.createTopInline .restInput {
  min-width: 0;
  width: 100%;
  height: 38px;
}
.createTopLabel {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(100, 116, 139, 0.92);
  white-space: nowrap;
}

.gameActionRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.createGrid {
  margin-top: 10px;
  display: grid;
  /* 优先保证聊天与预览可用空间；右侧信息栏在 previewSplit 内收窄。 */
  grid-template-columns: minmax(360px, 540px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-width: 0;
}

.createPanel {
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* 关键：给 grid 一个确定高度，1fr 才会变成“可滚动的中间区” */
  height: min(780px, 82vh);
  min-height: 620px;
  min-width: 0;
}

/* 工作流面板：收敛成偏中性的“执行台”视觉 */
.createPanel.isChat {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.createPanelHeader {
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.createPanelName {
  font-size: 12px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chatList {
  padding: 10px 12px;
  overflow: auto;
  display: grid;
  gap: 2px;
  /* 关键：允许在 grid 中收缩，否则会被内容撑高 */
  min-height: 0;
  background: rgba(248, 250, 252, 0.52);
  position: relative;
  min-width: 0;
}

.chatList::before {
  display: none;
}

/* 旧的“停止任务”行已移除：按钮现在在 AI 气泡右上角 */

.chatStopLink {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: rgba(241, 245, 249, 0.92);
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  cursor: pointer;
  font-size: 11px;
  font-weight: 1000;
  color: rgba(30, 41, 59, 0.95);
  text-decoration: none;
}
.chatStopLink:hover {
  filter: brightness(0.98);
}

.chatModelRow {
  padding: 10px 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chatModelLabel {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(100, 116, 139, 0.92);
}
.chatModelSelect {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.75);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.86);
}

.chatMsg {
  display: grid;
  gap: 4px;
  padding: 7px 0;
  border-radius: 0;
  position: relative;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid rgba(203, 213, 225, 0.48);
  background: transparent;
  box-shadow: none;
  margin-left: 0;
  min-width: 0;
}

/* AI 流式输出：唯一允许气泡内滚动的场景 */
.chatMsg.isThinking {
  overflow: visible;
  padding-right: 92px;
}

.chatMsg.isAi {
  background: transparent;
}
.chatMsg.isUser {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  background: transparent;
  border-bottom: 0;
  padding: 10px 0;
  max-height: none !important;
  overflow: visible !important;
  min-width: 0;
}
.chatMsg.isUser .chatText {
  display: block;
  width: auto;
  max-width: min(88%, 560px);
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: flex-start;
  overflow: visible;
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid rgba(147, 197, 253, 0.58);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.98));
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.10);
  min-width: 0;
}
.chatText {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.86);
  min-width: 0;
}

.chatInlineActions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
}
.chatInlineRetry {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(248, 250, 252, 1);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}
@media (hover: hover) {
  .chatInlineRetry:hover {
    filter: brightness(1.02);
  }
}

.sendCol {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.sendCol .btn {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 1100;
  min-width: 0;
}
.btnGray.isActive {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}
.voiceBtn {
  display: grid;
  place-items: center;
  width: 58px;
  padding: 12px 0 !important;
}
.sendBtn {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.96), rgba(14, 116, 144, 0.92)) !important;
  color: rgba(255, 255, 255, 0.96) !important;
}
.sendBtnDisabled {
  background: rgba(241, 245, 249, 1) !important;
  color: rgba(100, 116, 139, 0.96) !important;
  border-color: rgba(203, 213, 225, 0.95) !important;
  box-shadow: none;
  cursor: not-allowed;
}
.createNeo .sendBtn {
  border-color: rgba(17, 24, 39, 0.95);
}

.thinkBox {
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}
.thinkSummary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.86);
  user-select: none;
  list-style: none;
}
.thinkSummaryText {
  min-width: 0;
  flex: 1 1 auto;
}
.thinkSummaryMeta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex: 0 0 auto;
}
.thinkChevron {
  display: inline-flex;
  align-items: center;
  color: rgba(100, 116, 139, 0.92);
  transition: transform 160ms ease, color 160ms ease;
}
.thinkBox[open] .thinkChevron {
  transform: rotate(90deg);
  color: rgba(37, 99, 235, 0.9);
}
.thinkSummary::-webkit-details-marker {
  display: none;
}
.thinkBody {
  margin: 8px 0 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(15, 23, 42, 0.82);
  max-height: min(44vh, 360px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(241, 245, 249, 0.82);
  border: 1px solid rgba(203, 213, 225, 0.55);
  border-radius: 10px;
  padding: 8px;
  min-width: 0;
}

.chatComposer {
  padding: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: grid;
  gap: 10px;
  min-width: 0;
}
.starterPromptRow {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.starterPromptLabel {
  color: rgba(71, 85, 105, 0.96);
  font-size: 12px;
  font-weight: 1000;
}
.starterPromptChips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.starterPromptChip {
  flex: 0 0 auto;
  max-width: min(360px, 78vw);
  border: 1px solid rgba(125, 211, 252, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.98), rgba(240, 253, 244, 0.92));
  color: rgba(15, 23, 42, 0.86);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.08);
  cursor: pointer;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (hover: hover) {
  .starterPromptChip:hover {
    filter: brightness(1.02);
    border-color: rgba(56, 189, 248, 0.62);
  }
}
.starterPromptChip:active {
  transform: scale(0.99);
}
.starterPromptChip:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}
.chatRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}
.chatActions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== 彩蛋：模型选择（默认折叠） ===== */
.modelEgg {
  margin-top: 2px;
}
.modelEgg > summary::-webkit-details-marker {
  display: none;
}
.modelEggBtn {
  list-style: none;
  cursor: pointer;
  width: fit-content;
  max-width: min(560px, 92vw);
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
  font-size: 12px;
  font-weight: 1000;
  color: rgba(15, 23, 42, 0.82);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.modelEggPanel {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.modelEggRow {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.modelEggLabel {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(100, 116, 139, 0.92);
  white-space: nowrap;
}
.modelEggSelect {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 900;
}

.previewPanel {
  min-height: 620px;
  /* 预览区不需要顶部“浏览器栏”，让内容直接占满 */
  grid-template-rows: 1fr;
  min-width: 0;
}

.previewSplit {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.previewGame {
  min-height: 0;
  /* 让模拟器填满预览面板高度（否则 iframe 会按默认高度渲染，导致预览不完整） */
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.previewGame .simShell {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  min-width: 0;
}
.previewGame .simScreen {
  min-height: 0;
  min-width: 0;
}
.metaPanel {
  margin: 12px 12px 12px 0;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  padding: 12px;
  overflow: auto;
  min-height: 0;
}
.metaTitle {
  font-weight: 1100;
  font-size: 14px;
  color: rgba(15, 23, 42, 0.86);
  margin-bottom: 8px;
}
.metaBlock {
  padding: 8px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}
.metaBlock:first-of-type {
  border-top: none;
}
.metaLabel {
  font-size: 12px;
  font-weight: 500;
  color: rgba(100, 116, 139, 0.92);
  margin-bottom: 4px;
}
.metaValue {
  font-size: 13px;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.86);
  line-height: 1.55;
}
.metaPre {
  white-space: pre-wrap;
}

@media (max-width: 1360px) {
  .createGrid {
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    gap: 14px;
  }

  .previewSplit {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 220px);
    gap: 8px;
  }

  .metaPanel {
    padding: 10px;
  }
}

.previewFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

/* 预览区“模拟器外壳” */
.simShell {
  margin: 12px;
  border-radius: 18px;
  border: 2px solid rgba(17, 24, 39, 0.95);
  background: rgba(17, 24, 39, 0.10);
  box-shadow: 8px 8px 0 rgba(17, 24, 39, 0.95);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}
.simBar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(17, 24, 39, 0.95);
  background: rgba(255, 255, 255, 0.92);
}
.simDots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.simDot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(17, 24, 39, 0.95);
}
.simDot.red { background: rgba(239, 68, 68, 0.95); }
.simDot.yellow { background: rgba(250, 204, 21, 0.95); }
.simDot.green { background: rgba(34, 197, 94, 0.95); }
.simTitle {
  font-size: 12px;
  font-weight: 1100;
  color: rgba(17, 24, 39, 0.78);
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.simActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.simOpenBtn {
  text-decoration: none;
}
.simScreen {
  background: rgba(255, 255, 255, 0.96);
  min-height: 0;
}
.simScreen .previewFrame {
  background: white;
}

.previewProcess {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  padding: clamp(16px, 2.2vw, 26px);
  background:
    radial-gradient(540px 260px at 12% 8%, rgba(56, 189, 248, 0.20), transparent 66%),
    radial-gradient(520px 280px at 88% 12%, rgba(34, 197, 94, 0.16), transparent 68%),
    linear-gradient(145deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.92));
  color: rgba(15, 23, 42, 0.90);
}
.previewProcessHero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.previewProcessKicker {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(37, 99, 235, 0.92);
  letter-spacing: 0.08em;
}
.previewProcessTitle {
  margin-top: 4px;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 1100;
  line-height: 1.18;
}
.previewProcessTime {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(37, 99, 235, 0.95);
  font-size: 13px;
  font-weight: 1000;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}
.previewProcessSteps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.previewProcessStep {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.68);
  color: rgba(71, 85, 105, 0.96);
  font-size: 12px;
  font-weight: 1000;
}
.previewProcessStepDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.72);
}
.previewProcessStep.is-running {
  border-color: rgba(37, 99, 235, 0.26);
  background: rgba(219, 234, 254, 0.82);
  color: rgba(30, 64, 175, 0.98);
}
.previewProcessStep.is-running .previewProcessStepDot {
  background: rgba(37, 99, 235, 0.96);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.14);
  animation: previewPulse 1.25s ease-in-out infinite;
}
.previewProcessStep.is-done {
  border-color: rgba(34, 197, 94, 0.24);
  background: rgba(220, 252, 231, 0.74);
  color: rgba(22, 101, 52, 0.98);
}
.previewProcessStep.is-done .previewProcessStepDot {
  background: rgba(34, 197, 94, 0.95);
}
.previewProcessStep.is-failed {
  border-color: rgba(239, 68, 68, 0.24);
  background: rgba(254, 226, 226, 0.78);
  color: rgba(153, 27, 27, 0.96);
}
.previewProcessStep.is-failed .previewProcessStepDot {
  background: rgba(239, 68, 68, 0.94);
}
.previewProcessContract {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.previewProcessContract span {
  padding: 7px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: rgba(51, 65, 85, 0.96);
  font-size: 12px;
  font-weight: 900;
}
.previewProcessStream {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(15, 23, 42, 0.88);
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}
.previewProcessStreamHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(226, 232, 240, 0.92);
  font-size: 12px;
  font-weight: 1000;
}
.previewProcessStreamHead span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(147, 197, 253, 0.96);
}
.previewProcessStream pre {
  min-height: 260px;
  max-height: min(520px, 52dvh);
  margin: 0;
  padding: 14px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(226, 232, 240, 0.96);
  font-size: 12px;
  line-height: 1.58;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@keyframes previewPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
  }
}

.miniBtn {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 1000;
}

.iconBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 1100;
  line-height: 1;
}

.previewUrl {
  font-size: 12px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.95);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 44vw;
}

@media (max-width: 1180px) {
  .createTopBar {
    align-items: stretch;
  }
  .createTopInline {
    min-width: min(360px, 100%);
    flex: 1 1 auto;
  }
  .createGrid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .createPanel {
    height: min(720px, 72vh);
    min-height: 520px;
  }
  .previewPanel {
    height: min(760px, 76dvh);
    min-height: 520px;
  }
  /* 小屏：信息模块放到预览下方 */
  .previewSplit {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .metaPanel {
    margin: 0 12px 12px 12px;
    max-height: 240px;
  }
}

@media (max-width: 520px) {
  .createCard {
    width: 100%;
  }
  /* 手机端：不要出现横向滚动 */
  .createBento {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .createTopBar,
  .createGrid {
    width: 100%;
    max-width: 100%;
  }
  .createTopLeft,
  .createTopRight,
  .createTopInline {
    min-width: 0;
    max-width: 100%;
  }

  .createTopBar {
    gap: 10px;
  }
  .createTopActions {
    gap: 8px;
  }
  .createMenuBtn {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* 手机端：让“操作”按钮紧贴在“我的游戏”下拉右侧，不要被挤到下一行 */
  .createTopLeft {
    flex-wrap: nowrap;
    align-items: center;
  }
  .createTopLeft .createTopInline {
    flex: 1 1 auto;
  }
  .createTopLeft .restInput {
    min-width: 0;
    width: 100%;
  }
  .createMenu {
    flex: 0 0 auto;
  }
  .createMenuBtn {
    white-space: nowrap;
  }

  .createPanelHeader {
    padding: 10px 10px;
  }

  .createPanel {
    /* 手机上高度更紧凑一点，避免被浏览器地址栏挤压 */
    height: min(680px, 74vh);
    min-height: 480px;
  }

  .chatRow {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .sendCol {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: column;
  }

  .previewToolbar {
    gap: 8px;
  }
  .previewUrl {
    max-width: 44vw;
  }
}

/* =========================
   Bento Grid（便当盒布局）
   仅作用于 create 页面：.createBento
   ========================= */
.createBento {
  --b-bg: rgba(248, 250, 252, 1); /* 极浅灰 */
  --b-card: rgba(255, 255, 255, 1);
  --b-border: rgba(226, 232, 240, 1); /* gray-200 */
  --b-border2: rgba(241, 245, 249, 1); /* gray-100 */
  --b-text: rgba(15, 23, 42, 0.92);
  --b-muted: rgba(100, 116, 139, 0.95);
  --b-shadow: 0 1px 2px rgba(2, 6, 23, 0.06);

  border: 1px solid var(--b-border2);
  background: var(--b-bg);
  box-shadow: var(--b-shadow);
}
.createBento .header h1 {
  color: var(--b-text);
}
.createBento .header .desc {
  color: var(--b-muted);
  font-weight: 900;
}

.createBento .createTopActions .homeCreateBtn,
.createBento .createTopActionBtn,
.createBento .createMenuBtn {
  border: 1px solid var(--b-border);
  box-shadow: var(--b-shadow);
  border-radius: 16px;
  background: rgba(255, 255, 255, 1);
  font-weight: 1000;
}
.createBento .createNewActionBtn {
  color: rgba(37, 99, 235, 0.96);
  background: rgba(239, 246, 255, 1);
  border-color: rgba(191, 219, 254, 1);
}
.createBento .createPublishActionBtn {
  color: rgba(255, 255, 255, 0.98);
  border-color: transparent;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(14, 165, 233, 0.95));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.14);
}
.createBento .createPublishActionBtn.isDirty {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.98), rgba(249, 115, 22, 0.95));
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.14);
}
@media (hover: hover) {
  .createBento .createTopActionBtn:hover,
  .createBento .createMenuBtn:hover {
    filter: brightness(1.02);
    border-color: rgba(148, 163, 184, 0.55);
  }
}
.createBento .createMenuPanel {
  border: 1px solid var(--b-border);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.08);
  border-radius: 18px;
}
.createBento .createMenuItem {
  border: 1px solid var(--b-border2);
  box-shadow: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, 1);
}
@media (hover: hover) {
  .createBento .createMenuItem:hover {
    filter: brightness(1.01);
    border-color: rgba(148, 163, 184, 0.55);
  }
}

.createBento .createPanel {
  border-radius: 24px;
  border: 1px solid var(--b-border);
  background: var(--b-card);
  box-shadow: var(--b-shadow);
}
.createBento .createPanelHeader {
  border-bottom: 1px solid var(--b-border2);
  background: rgba(248, 250, 252, 1);
}
.createBento .createPanelName {
  color: var(--b-text);
  font-weight: 1100;
}

/* 工作流消息流：统一成执行日志卡片 */
.createBento .chatMsg {
  border: 0;
  border-bottom: 1px solid var(--b-border);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  max-width: none;
  margin-left: 0;
  width: 100%;
}
.createBento .chatMsg.isAi {
  background: transparent;
}
.createBento .chatMsg.isUser {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  background: transparent;
  border-color: transparent;
  border-bottom: 0;
  max-height: none !important;
  overflow: visible !important;
}
.createBento .chatMsg.isUser .chatText {
  display: block;
  width: auto;
  max-width: min(82%, 560px);
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: flex-start;
  overflow: visible;
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid rgba(147, 197, 253, 0.52);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.98));
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.08);
}

/* 手机端滚动更顺滑（避免看起来像“内容展示不全”） */
@media (max-width: 520px) {
  .chatList {
    -webkit-overflow-scrolling: touch;
  }
}
.createBento .chatMsg:not(.isUser) {
  background: transparent;
  border-color: transparent;
  align-self: stretch;
}
.createBento .chatText {
  color: var(--b-text);
  font-weight: 500;
}

.createBento .metaPanel {
  border: 1px solid var(--b-border);
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--b-shadow);
}
.createBento .metaTitle {
  color: var(--b-text);
}
.createBento .metaLabel {
  color: var(--b-muted);
  font-weight: 500;
}
.createBento .metaValue {
  color: var(--b-text);
  font-weight: 500;
}

.createBento .restInput,
.createBento .restTextarea {
  border: 1px solid var(--b-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--b-shadow);
  font-weight: 900;
}

.createBento .btn {
  border: 1px solid var(--b-border);
  border-radius: 18px;
  box-shadow: var(--b-shadow);
  font-weight: 1100;
  /* 默认按钮为高可读性主按钮（浅色背景时避免白字看不见） */
  background: rgba(56, 189, 248, 0.95); /* 天蓝 */
  color: rgba(255, 255, 255, 0.96);
}
.createBento .btnGray {
  background: rgba(248, 250, 252, 1);
  color: var(--b-text);
}
.createBento .sendBtn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(34, 197, 94, 0.95)) !important;
  color: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(56, 189, 248, 0.40);
}
.createBento .sendBtnDisabled {
  background: rgba(248, 250, 252, 1) !important;
  color: rgba(100, 116, 139, 0.96) !important;
  border-color: rgba(203, 213, 225, 0.92) !important;
  box-shadow: var(--b-shadow);
}

/* 预览“模拟器外壳”也改成 bento：柔和边框 + 阴影 */
.createBento .simShell {
  border: 1px solid var(--b-border);
  box-shadow: var(--b-shadow);
  background: rgba(255, 255, 255, 1);
  border-radius: 24px;
}
.createBento .simBar {
  border-bottom: 1px solid var(--b-border2);
  background: rgba(248, 250, 252, 1);
}
.createBento .simDot {
  border: 1px solid rgba(148, 163, 184, 0.75);
}
.createBento .simScreen {
  background: rgba(255, 255, 255, 1);
}

/* =========================
   Create Responsive Hardening
   大屏双栏、平板上下堆叠、手机优先保证聊天/输入/预览可用
   ========================= */
.chatComposer .restTextarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.modelEgg,
.modelEggPanel,
.modelEggRow {
  min-width: 0;
}
.previewFrame {
  display: block;
  min-width: 0;
}
.createBento .chatMsg.isUser .chatText {
  max-width: min(88%, 560px);
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .createWrap {
    padding: 10px 10px calc(14px + env(safe-area-inset-bottom));
  }
  .createCard {
    padding: 14px 12px;
    border-radius: 18px;
  }
  .createCard > .header {
    margin-bottom: 8px;
  }
  .createCard > .header .homeHeaderRow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .createCard > .header h1 {
    display: block;
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }
  .createHomeIconBtn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .createTopBar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .createTopLeft {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    width: 100%;
  }
  .createBusyHint {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }
  .createTopInline {
    min-width: 0;
    width: 100%;
  }
  .createTopLabel {
    display: none;
  }
  .createMenuPanel {
    right: 0;
    width: min(220px, calc(100vw - 28px));
  }

  .createGrid {
    gap: 12px;
  }
  .createBento .createPanel {
    border-radius: 18px;
  }
  .createPanel.isChat {
    height: min(620px, 64dvh);
    min-height: 430px;
  }
  .previewPanel {
    height: min(720px, 74dvh);
    min-height: 500px;
  }
  .previewSplit {
    gap: 0;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .metaPanel {
    max-height: 180px;
    margin: 0 8px 8px;
    padding: 10px;
    border-radius: 14px;
  }
  .simShell {
    margin: 8px;
    border-width: 1px;
    border-radius: 16px;
    box-shadow: none;
  }
  .simBar {
    padding: 8px 10px;
    gap: 8px;
  }

  .chatList {
    padding: 7px 10px;
  }
  .chatMsg.isThinking {
    padding-right: 0;
  }
  .chatStopLink {
    top: 7px;
    right: 0;
  }
  .chatMsg.isUser .chatText,
  .createBento .chatMsg.isUser .chatText {
    max-width: min(94%, 640px);
    padding: 9px 12px;
  }
  .thinkSummary {
    align-items: flex-start;
  }
  .thinkBody {
    max-height: min(36dvh, 300px);
  }

  .chatComposer {
    padding: 12px;
    border-top-color: rgba(59, 130, 246, 0.16);
    background:
      radial-gradient(360px 120px at 10% 0%, rgba(56, 189, 248, 0.12), transparent 65%),
      rgba(255, 255, 255, 0.96);
  }
  .starterPromptLabel {
    font-size: 11px;
  }
  .starterPromptChip {
    max-width: min(320px, 84vw);
  }
  .chatRow {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .chatComposer .restTextarea,
  .createBento .chatComposer .restTextarea {
    min-height: 92px;
    padding: 14px 15px;
    border: 2px solid rgba(56, 189, 248, 0.38);
    border-radius: 20px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.88);
    font-size: 15px;
    line-height: 1.5;
  }
  .chatComposer .restTextarea::placeholder {
    color: rgba(71, 85, 105, 0.62);
  }
  .chatComposer .restTextarea:focus,
  .createBento .chatComposer .restTextarea:focus {
    outline: none;
    border-color: rgba(14, 165, 233, 0.74);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16), 0 12px 28px rgba(14, 165, 233, 0.16);
  }
  .sendCol {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-auto-flow: initial;
  }
  .voiceBtn {
    width: 100%;
  }
  .sendCol .btn {
    min-height: 50px;
    padding: 11px 12px;
    white-space: nowrap;
  }
  .modelEggBtn {
    width: 100%;
    max-width: 100%;
  }
  .modelEggRow {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }
  .modelEggSelect {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .createWrap {
    padding-left: 6px;
    padding-right: 6px;
  }
  .createCard {
    padding: 10px 8px;
  }
  .createCard > .header h1 {
    font-size: 18px;
  }
  .createTopLeft {
    gap: 8px;
  }
  .createMenuBtn {
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .createPanel.isChat {
    height: min(560px, 60dvh);
    min-height: 390px;
  }
  .previewPanel {
    height: min(700px, 76dvh);
    min-height: 460px;
  }
  .metaPanel {
    max-height: 150px;
  }
  .simDots {
    gap: 5px;
  }
  .simDot {
    width: 8px;
    height: 8px;
  }
  .iconBtn {
    width: 34px;
    height: 34px;
  }
  .chatMsg.isUser .chatText,
  .createBento .chatMsg.isUser .chatText {
    max-width: 100%;
    font-size: 13px;
  }
  .sendCol .btn {
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .card.createCard > .header h1,
  .createCard > .header h1 {
    display: block;
    font-size: 17px;
  }
  .createHomeIconBtn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .createTopLeft {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .createPanel.isChat {
    height: min(520px, 58dvh);
    min-height: 360px;
  }
  .previewPanel {
    min-height: 430px;
  }
  .chatComposer .restTextarea {
    min-height: 86px;
  }
}

/* 预览高度策略：预览区自然撑开页面，不在卡片内部滚动 */
.previewPanel {
  height: auto;
  min-height: 0;
  overflow: visible;
}
.previewSplit {
  height: auto;
  min-height: 0;
}
.previewGame {
  min-height: clamp(720px, calc(100dvh - 210px), 980px);
}
.previewGame .simShell {
  min-height: inherit;
}
.previewGame .simScreen {
  min-height: 0;
}
.metaPanel {
  max-height: none;
  overflow: visible;
}

@media (max-width: 1180px) {
  .previewGame {
    min-height: clamp(640px, 72dvh, 860px);
  }
}

@media (max-width: 720px) {
  .previewGame {
    min-height: max(600px, 70dvh);
  }
  .metaPanel {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .previewGame {
    min-height: max(560px, 68dvh);
  }
}

@media (max-width: 420px) {
  .previewGame {
    min-height: max(520px, 66dvh);
  }
}

@media (max-width: 720px) {
  .createPrimaryActions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
  }

  .createPrimaryActions .createMenu {
    min-width: 0;
  }

  .createTopActionBtn,
  .createMenuBtn {
    width: 100%;
    height: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .createTopBar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }

  .createTopLeft {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .createTopInline {
    width: 100%;
  }

  .createTopRight.createPrimaryActions {
    width: auto;
    display: block;
  }

  .createTopRight .createMenu {
    display: none;
  }

  .createTopRight .createPublishActionBtn {
    width: auto;
    min-width: 82px;
    height: 38px;
    min-height: 38px;
    padding-inline: 14px;
  }
}

@media (max-width: 420px) {
  .createTopRight .createPublishActionBtn {
    min-width: 72px;
    padding-inline: 12px;
  }
}
