:root {
  --bg: #0c0d15;
  --bg-2: #11131f;
  --panel: #161827;
  --panel-2: #1c1f31;
  --line: #2a2d43;
  --line-soft: #22253a;
  --text: #eceeff;
  --text-2: #b7bbd4;
  --muted: #7f85a3;
  --accent: #6d5cf6;
  --accent-2: #4b9dff;
  --gold: #c9a77a;
  --danger: #e2687b;
  --ok: #57c9a1;
  --radius: 14px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* 横幅在正常文档流顶部，显示时自动把 .app 往下推，避免 fixed 覆盖遮挡 */
  display: flex;
  flex-direction: column;
}
button, input, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333751; border-radius: 8px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: #474c70; }

/* 占满横幅之外的剩余高度；横幅隐藏时即为满屏 */
.app {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ───────── Sidebar ───────── */
.sidebar {
  width: 254px; flex: 0 0 254px;
  background: linear-gradient(180deg, #121426 0%, #0e101c 100%);
  border-right: 1px solid var(--line-soft);
  padding: 26px 16px 18px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.sidebar::before {
  content: ""; position: absolute; top: -120px; left: -80px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(109, 92, 246, .18), transparent 70%); pointer-events: none;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 6px 24px; position: relative; }
.brand-mark { width: 34px; height: 34px; position: relative; flex: 0 0 34px; transform: rotate(-12deg); }
.brand-mark span {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 7px var(--accent-2);
}
.brand-mark span:nth-child(1) { left: 15px; top: 1px; }
.brand-mark span:nth-child(2) { left: 3px; top: 15px; background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.brand-mark span:nth-child(3) { right: 3px; top: 15px; background: #b18cff; box-shadow: 0 0 7px #b18cff; }
.brand-mark span:nth-child(4) { left: 15px; bottom: 1px; background: #67d9ff; box-shadow: 0 0 7px #67d9ff; }
.brand-mark::after {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(140, 130, 255, .55);
  transform: rotate(45deg); border-radius: 2px;
}
.brand-title { font-size: 12px; font-weight: 800; letter-spacing: 1.1px; color: #fff; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .4px; margin-top: 2px; }

.project-picker {
  width: 100%; text-align: left; background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; color: var(--text); display: block; position: relative;
  transition: .2s;
}
.project-picker:hover { border-color: #4b4f7d; background: rgba(255, 255, 255, .06); }
.pp-label { display: block; font-size: 10px; color: var(--muted); letter-spacing: .8px; }
.pp-name { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 14px; }
.pp-arrow { position: absolute; right: 12px; top: 22px; color: var(--muted); font-size: 18px; }

.nav-label { font-size: 10px; color: var(--muted); letter-spacing: 1.4px; margin: 26px 8px 10px; }
.steps { display: flex; flex-direction: column; gap: 5px; }
.step {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  border-radius: 11px; padding: 11px 12px; transition: .18s;
}
.step:hover { background: rgba(255, 255, 255, .035); }
.step.active { background: linear-gradient(100deg, rgba(109, 92, 246, .22), rgba(75, 157, 255, .06)); border-color: rgba(120, 105, 246, .42); color: #fff; }
.step.done .step-no { color: var(--ok); border-color: rgba(87, 201, 161, .5); }
.step-no { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; }
.step.active .step-no { border-color: rgba(150, 135, 255, .7); color: #c9c0ff; background: rgba(109, 92, 246, .2); }
.step-txt b { display: block; font-size: 13px; font-weight: 700; }
.step-txt small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.side-spacer { flex: 1; }
.side-info { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.info-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; padding: 4px 6px; }
.info-row span { color: var(--muted); }
.info-row b { font-weight: 600; color: var(--text-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-line { margin-top: 12px; font-size: 10.5px; color: var(--muted); padding: 8px 9px; background: rgba(255, 255, 255, .03); border-radius: 8px; line-height: 1.5; }

/* ───────── Main ───────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 58px; flex: 0 0 58px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; padding: 0 30px;
  background: rgba(14, 16, 27, .8); backdrop-filter: blur(8px);
  /* backdrop-filter 会创建独立堆叠上下文；提升层级，保证用户下拉卡片盖在内容区之上 */
  position: relative; z-index: 100;
}
.crumbs { font-size: 12px; color: var(--muted); }
.crumbs span { margin: 0 8px; color: #454963; }
.crumbs b { color: var(--text); font-weight: 700; }
.top-right { display: flex; gap: 10px; align-items: center; }
.chip { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; display: flex; align-items: center; gap: 6px; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.chip.saving .dot { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

.view { flex: 1; overflow-y: auto; padding: 26px 30px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: .5px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 780px; line-height: 1.75; }
.head-tag { font-size: 10.5px; letter-spacing: 1.5px; color: #6c7194; border: 1px solid var(--line); padding: 5px 11px; border-radius: 7px; white-space: nowrap; }

/* ───────── Panels & forms ───────── */
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.req { font-size: 10.5px; color: var(--muted); background: rgba(255, 255, 255, .04); border-radius: 5px; padding: 3px 8px; }
.form { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.field em { color: var(--gold); font-style: normal; }
.field input, .field textarea, .ec-input input, .idea-actions input {
  width: 100%; background: #10121e; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; outline: none; transition: .16s; resize: vertical; line-height: 1.6;
}
.field input:focus, .field textarea:focus, .ec-input input:focus, .idea-actions input:focus, .doc-editor:focus {
  border-color: #7465e8; box-shadow: 0 0 0 3px rgba(109, 92, 246, .12);
}
.field input::placeholder, .field textarea::placeholder { color: #5d6280; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.field-row .field.wide { flex: 2.2; }
.scale-hint { font-size: 11px; color: #a9b7e8; background: rgba(75, 157, 255, .08); border: 1px solid rgba(75, 157, 255, .2); border-radius: 8px; padding: 8px 10px; }
.tip { font-size: 11px; color: var(--muted); line-height: 1.65; margin: 0; }

.btn {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 9px; padding: 9px 15px; font-size: 12.5px; font-weight: 600;
  transition: .18s; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover:not(:disabled) { border-color: #5a5f8c; background: #252942; transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }
.btn.primary { background: linear-gradient(105deg, #6d5cf6, #5279f0); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(90, 80, 220, .25); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(105deg, #7d6dff, #5f88ff); box-shadow: 0 8px 22px rgba(90, 80, 220, .38); }
.btn.gold { background: rgba(201, 167, 122, .13); border-color: rgba(201, 167, 122, .45); color: #e2c79f; }
.btn.gold:hover:not(:disabled) { background: rgba(201, 167, 122, .22); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 11.5px; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.icon-btn:hover { color: #fff; }

/* ───────── Step 1 ───────── */
.idea-layout { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 16px; align-items: start; }
.idea-main { height: min(690px, calc(100vh - 260px)); min-height: 460px; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); height: 48px; flex: 0 0 48px; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 0 14px; height: 100%; font-size: 12.5px; font-weight: 600; }
.tab.active { color: #fff; border-bottom-color: #7b6bf5; }
.tab i { font-style: normal; font-size: 10px; background: rgba(255,255,255,.07); border-radius: 10px; padding: 1px 6px; margin-left: 4px; }
.tabs-right { margin-left: auto; display: flex; gap: 8px; }
.doc-scroll { flex: 1; overflow-y: auto; padding: 6px 0; }
.doc-editor { width: calc(100% - 44px); margin: 14px 22px; min-height: 400px; background: #10121e; border: 1px solid var(--line); color: var(--text); border-radius: 9px; padding: 16px; outline: none; font-size: 13px; line-height: 1.9; resize: vertical; }
.empty { text-align: center; padding: 62px 30px; color: var(--muted); }
.empty h4 { color: var(--text-2); margin: 22px 0 8px; font-size: 15px; }
.empty p { font-size: 12px; line-height: 1.9; margin: 0; }
.empty-ill { display: flex; gap: 9px; justify-content: center; align-items: flex-end; height: 42px; }
.empty-ill i { width: 5px; height: 5px; background: #5a5f95; border-radius: 50%; box-shadow: 0 0 8px rgba(109,92,246,.6); animation: twinkle 1.8s infinite ease-in-out; }
.empty-ill i:nth-child(2) { width: 8px; height: 8px; animation-delay: .2s; }
.empty-ill i:nth-child(3) { animation-delay: .4s; }
.empty-ill i:nth-child(4) { width: 11px; height: 11px; background: #7b6bf5; animation-delay: .6s; }
.empty-ill i:nth-child(5) { animation-delay: .8s; }
.empty-ill i:nth-child(6) { width: 8px; height: 8px; animation-delay: 1s; }
.empty-ill i:nth-child(7) { animation-delay: 1.2s; }
.empty-ill.big i:nth-child(8) { animation-delay: 1.4s; }
.empty-ill.big i:nth-child(9) { animation-delay: 1.6s; }
@keyframes twinkle { 0%,100% { opacity: .3; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }

.markdown { padding: 18px 30px 30px; font-size: 13px; color: #d6d9ee; line-height: 1.9; }
.markdown h1 { font-size: 21px; color: #fff; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin: 6px 0 20px; }
.markdown h2 { font-size: 16px; color: #b9aeff; margin: 26px 0 10px; padding-left: 10px; border-left: 3px solid #7b6bf5; }
.markdown h3 { font-size: 14px; color: #e4d6bb; margin: 20px 0 8px; }
.markdown h4 { font-size: 13px; color: #cfd3ef; margin: 16px 0 6px; }
.markdown p { margin: 7px 0; }
.markdown ul, .markdown ol { padding-left: 22px; margin: 8px 0; }
.markdown li { margin: 4px 0; }
.markdown strong { color: #fff; }
.markdown blockquote { border-left: 2px solid var(--gold); padding-left: 12px; color: var(--muted); margin: 10px 0; }
.markdown table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 12.5px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.markdown th { background: rgba(109,92,246,.12); color: #cfc6ff; }
.markdown code { background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; color: #cdb8ff; }
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.chat-log { flex: 1; overflow-y: auto; padding: 20px 26px; }
.msg { max-width: 88%; margin-bottom: 16px; }
.msg .who { font-size: 10.5px; color: var(--muted); margin-bottom: 5px; letter-spacing: .5px; }
.msg .bubble { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 11px; padding: 11px 14px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.8; }
.msg.user { margin-left: auto; }
.msg.user .who { text-align: right; }
.msg.user .bubble { background: rgba(109,92,246,.18); border-color: rgba(109,92,246,.35); }
.idea-actions, .ec-input { display: flex; gap: 9px; padding: 13px 16px; border-top: 1px solid var(--line-soft); flex: 0 0 auto; }
.idea-actions input, .ec-input input { flex: 1; }
.step-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 18px; padding: 14px 18px; background: rgba(255,255,255,.022); border: 1px solid var(--line-soft); border-radius: 11px;
  font-size: 11.5px; color: var(--muted);
}
.footer-right { display: flex; gap: 9px; }

/* ───────── Step 2 ───────── */
.scene-bar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin-bottom: 4px; }
.scene-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 8px 13px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line-soft); color: var(--text-2); font-size: 12px; transition: .18s;
}
.scene-tab:hover { border-color: #4b4f7d; }
.scene-tab.active { background: linear-gradient(100deg, rgba(109,92,246,.25), rgba(75,157,255,.07)); border-color: rgba(120,105,246,.55); color: #fff; }
.scene-tab .num { font-weight: 800; color: #8f95bb; font-size: 11px; }
.scene-tab.active .num { color: #c2b7ff; }
.scene-tab .thumb { width: 30px; height: 21px; border-radius: 4px; object-fit: cover; background: #0b0c14; }
.scene-tab .blank { width: 30px; height: 21px; border-radius: 4px; background: #0b0c14; border: 1px dashed #3a3e5c; }
.scene-tab.add { border-style: dashed; color: var(--muted); }
.scene-layout { display: grid; grid-template-columns: 342px minmax(0, 1fr); gap: 16px; align-items: start; }
.scene-config { padding-bottom: 16px; }
.scene-config > .field, .scene-config > .storyboard, .scene-config > .btn, .scene-config > .tip, .scene-config > .constraint-card { margin-left: 18px; margin-right: 18px; }
.scene-config > .field { margin-top: 14px; }
.scene-config > .btn.block { width: calc(100% - 36px); margin-top: 16px; }
.scene-config > .tip { margin-top: 10px; }
.idx { font-size: 11px; color: #b6a8ff; background: rgba(109,92,246,.16); border-radius: 5px; padding: 2px 7px; margin-left: 6px; }
.constraint-card { margin-top: 14px; background: linear-gradient(120deg, rgba(109,92,246,.12), rgba(75,157,255,.05)); border: 1px solid rgba(109,92,246,.28); border-radius: 10px; padding: 11px 12px; }
.constraint-card div { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 2px 0; }
.constraint-card div span { color: var(--muted); }
.constraint-card div b { color: #ded8ff; font-weight: 700; max-width: 190px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.constraint-card p { margin: 7px 0 0; font-size: 10.5px; color: #98a1c9; line-height: 1.6; border-top: 1px solid rgba(255,255,255,.06); padding-top: 7px; }

.storyboard { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 13px; }
.sb-head { font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-bottom: 8px; }
.sb-head span { color: var(--muted); font-weight: 400; }
.sb-list { max-height: 152px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.sb-empty { font-size: 11px; color: var(--muted); line-height: 1.6; }
.sb-item { text-align: left; background: #10121e; border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 10px; color: var(--text-2); font-size: 11.5px; }
.sb-item:hover { border-color: #6a5fd0; color: #fff; }
.sb-item b { color: #c4b8ff; margin-right: 6px; }
.sb-item small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.preview-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.preview-head h3 { margin: 0; font-size: 14px; }
.preview-actions { display: flex; gap: 8px; }
.image-stage {
  margin: 16px; min-height: 300px; border-radius: 10px; overflow: hidden; background: #08090f;
  border: 1px solid var(--line-soft); display: grid; place-items: center; position: relative;
}
.image-stage img { width: 100%; display: block; }
.image-stage .empty { padding: 44px 30px; }
.dot-note { margin: 0 16px 10px; padding: 8px 11px; font-size: 10.5px; line-height: 1.6; color: #d9bb85; background: rgba(226,164,74,.08); border: 1px solid rgba(226,164,74,.28); border-radius: 7px; }
.saved-flag { font-size: 10.5px; color: #7fc9a4; margin-right: 4px; }
.saved-flag.hidden { display: none; }

.versions { margin: 0 16px 14px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.ver-head { font-size: 11.5px; font-weight: 700; color: #c9cdf0; margin-bottom: 8px; }
.ver-head span { font-weight: 400; font-size: 10px; color: var(--muted); margin-left: 6px; }
.ver-empty { font-size: 10.5px; color: var(--muted); line-height: 1.6; padding: 4px 0 8px; }
.ver-list { display: flex; gap: 10px; flex-wrap: wrap; max-height: 178px; overflow-y: auto; }
.ver-card { width: 108px; flex: 0 0 108px; text-align: center; font-size: 10px; color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 5px; }
.ver-card.current { border-color: rgba(143,129,255,.6); background: rgba(143,129,255,.08); }
.ver-card.tpl { border-color: #e2a44a; background: rgba(226,164,74,.1); }
.ver-card img { display: block; width: 96px; height: 64px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; margin: 0 auto 4px; }
.ver-card:hover img { border-color: #8f81ff; }
.ver-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-ops { display: flex; gap: 3px; justify-content: center; margin-top: 4px; }
.ver-ops button { background: rgba(143,139,255,.14); border: 1px solid rgba(143,139,255,.35); color: #cdc9ff; border-radius: 5px; font-size: 9.5px; padding: 2px 5px; cursor: pointer; }
.ver-ops button:hover { background: rgba(143,139,255,.3); }
.ver-cur-tag { font-size: 9.5px; color: #8f81ff; }

.gen-progress { display: flex; align-items: center; gap: 9px; padding: 8px 18px; background: rgba(143,139,255,.09); border-bottom: 1px solid var(--line-soft); font-size: 12px; color: #cfcaff; }
.gen-progress.hidden { display: none; }
.gp-dot { width: 8px; height: 8px; border-radius: 50%; background: #8f81ff; animation: gp-pulse 1.1s ease-in-out infinite; flex: 0 0 auto; }
@keyframes gp-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.gp-count { margin-left: auto; font-family: Consolas, monospace; font-size: 11px; color: var(--muted); }
.edit-chat { border-top: 1px solid var(--line-soft); }
.ec-head { padding: 12px 16px 6px; font-size: 12px; font-weight: 700; }
.ec-head span { font-weight: 400; color: var(--muted); font-size: 10.5px; margin-left: 8px; }
.ec-log { max-height: 150px; overflow-y: auto; padding: 4px 16px 8px; }
.ec-empty { font-size: 11px; color: var(--muted); line-height: 1.7; }
.ec-msg { font-size: 11.5px; margin: 6px 0; line-height: 1.7; }
.ec-msg b { color: #b9aeff; margin-right: 6px; }
.ec-msg.ai b { color: #7fd0b0; }
.ec-msg img { display: block; width: 120px; border-radius: 6px; margin-top: 5px; border: 1px solid var(--line); }
.ec-input { border-top: 1px solid var(--line-soft); }
.caption-box { border-top: 1px solid var(--line-soft); padding: 13px 16px 16px; }
.cb-head { font-size: 12px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cb-head span { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.cb-head .btn { margin-left: auto; }
.saved-hint { font-size: 11px; color: var(--ok); margin-left: 10px; }

/* ───────── Step 3 ───────── */
.summary-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.sum-stats { display: flex; gap: 34px; }
.sum-stats div { display: flex; flex-direction: column; }
.sum-stats b { font-size: 22px; color: #fff; line-height: 1.2; }
.sum-stats span { font-size: 11px; color: var(--muted); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.sum-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.sum-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: #08090f; }
.sum-body { padding: 12px 14px 14px; }
.sum-title { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.sum-title b { font-size: 17px; color: #b9aeff; }
.sum-title span { font-size: 11px; color: var(--muted); }
.sum-title .moves { margin-left: auto; display: flex; gap: 5px; }
.sum-title .moves button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 5px; width: 24px; height: 24px; font-size: 12px; line-height: 1; }
.sum-title .moves button:hover { color: #fff; border-color: #6a5fd0; }
.sum-card input, .sum-card textarea { width: 100%; background: #10121e; border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: 7px 9px; font-size: 11.5px; outline: none; margin-bottom: 7px; }
.sum-card textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
.sum-card input:focus, .sum-card textarea:focus { border-color: #7465e8; }
.sum-card .del { font-size: 10.5px; color: var(--danger); background: transparent; border: 0; padding: 0; }
.sum-empty { grid-column: 1 / -1; text-align: center; padding: 80px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }

/* ───────── Overlays ───────── */
.overlay { position: fixed; inset: 0; background: rgba(6, 7, 14, .78); backdrop-filter: blur(5px); z-index: 50; display: grid; place-items: center; padding: 20px; }
.loading-card { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 34px 46px; box-shadow: var(--shadow); min-width: 300px; }
.loading-card h3 { margin: 20px 0 6px; font-size: 16px; }
.loading-card p { margin: 0; color: var(--muted); font-size: 12px; }
.spinner { display: flex; gap: 8px; justify-content: center; align-items: center; height: 26px; }
.spinner i { width: 8px; height: 8px; border-radius: 50%; background: #7b6bf5; animation: bounce 1.1s infinite ease-in-out; }
.spinner i:nth-child(2) { animation-delay: .12s; background: #8f7bff; }
.spinner i:nth-child(3) { animation-delay: .24s; background: #5b9bf0; }
.spinner i:nth-child(4) { animation-delay: .36s; background: #57c9a1; }
.spinner i:nth-child(5) { animation-delay: .48s; background: var(--gold); }
@keyframes bounce { 0%,100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-11px); opacity: 1; } }
.modal { width: 460px; max-width: 100%; max-height: 80vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.modal.wide { width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 14px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px 18px; border-top: 1px solid var(--line-soft); }
.proj-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 9px; margin-bottom: 8px; background: #10121e; }
.proj-item.active { border-color: rgba(120,105,246,.6); background: rgba(109,92,246,.1); }
.proj-item .pi-main { flex: 1; min-width: 0; }
.proj-item b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-item small { color: var(--muted); font-size: 10.5px; }
.proj-item .pi-del { color: var(--muted); background: transparent; border: 0; font-size: 15px; }
.proj-item .pi-del:hover { color: var(--danger); }
.help-body h4 { color: #b9aeff; margin: 14px 0 5px; font-size: 13px; }
.help-body h4:first-child { margin-top: 0; }
.help-body p { color: var(--text-2); font-size: 12px; line-height: 1.85; margin: 0; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px); background: #242842; border: 1px solid var(--line); color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; box-shadow: var(--shadow); max-width: 80vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(226,104,123,.6); background: #3a2230; }

@media (max-width: 1180px) {
  .idea-layout, .scene-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .sidebar { width: 216px; flex-basis: 216px; }
  .view { padding: 22px 20px 36px; }
}
@media (max-width: 900px) {
  .sidebar { width: 68px; flex-basis: 68px; padding: 18px 8px; }
  .brand > div:not(.brand-mark), .project-picker, .nav-label, .step-txt, .side-info, .pp-arrow { display: none; }
  .step { justify-content: center; padding: 8px; }
  .idea-layout, .scene-layout { grid-template-columns: 1fr; }
  .idea-main { height: 560px; }
  .field-row { flex-direction: column; }
}

/* ───────── 额度 / 限频 提示横幅 ───────── */
.quota-banner {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #b4541b, #d97706);
  color: #fff;
  box-shadow: 0 4px 18px rgba(185, 84, 27, 0.45);
  font-size: 14px;
  line-height: 1.5;
  /* 告警横幅不使用入场动画：避免低性能/截图场景下合成层导致文字上半截被裁 */
}
.quota-banner.kind-RATE {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
}
.quota-banner.hidden { display: none; }
.quota-banner .qb-icon { font-size: 22px; line-height: 1.2; flex: 0 0 auto; }
.quota-banner .qb-body { flex: 1 1 auto; }
.quota-banner .qb-title { font-weight: 700; margin-bottom: 2px; letter-spacing: 0.3px; }
.quota-banner .qb-msg { opacity: 0.95; }
.quota-banner .qb-close {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.quota-banner .qb-close:hover { background: rgba(255, 255, 255, 0.32); }
/* 横幅高度由前端写入 --quota-h，.app 据此下移，见上方 .app 定义 */

/* ───────── 实际提示词预览（可编辑覆盖） ───────── */
.prompt-peek { margin-top: 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.02); }
.pp-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; }
.pp-toggle { background: none; border: 0; color: #c9cdf0; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.pp-toggle:hover { color: #fff; }
.pp-state { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 20px; padding: 1px 8px; }
.pp-state.custom { color: #ffd48a; border-color: rgba(226,164,74,.5); }
.pp-body { padding: 0 12px 12px; }
.pp-hint { font-size: 10.5px; color: var(--muted); line-height: 1.6; margin: 0 0 8px; }
.pp-body textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 150px;
  background: #12142a; color: #cfd4f5; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px; font-size: 11px; line-height: 1.65;
  font-family: Consolas, "Microsoft YaHei", monospace;
}
.pp-body textarea:focus { outline: none; border-color: var(--purple, #6d5cf6); }
.pp-actions { display: flex; gap: 8px; margin-top: 8px; }
.pp-actions .btn { font-size: 11px; padding: 5px 10px; }

/* ───────── 右上角：统一登录用户资料 ───────── */
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 10px 3px 3px; color: var(--text-2);
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.user-trigger:hover { border-color: #8f81ff; color: #fff; }
.u-avatar, .up-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #6d5cf6, #9b8bff);
  color: #fff; font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.up-avatar { width: 38px; height: 38px; font-size: 16px; }
.u-name { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-caret { font-size: 9px; opacity: .65; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 9px); width: 236px;
  background: #1b1d31; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .55); padding: 13px; z-index: 500;
}
.user-pop.hidden { display: none; }
.up-head { display: flex; gap: 10px; align-items: center; padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); }
.up-head b { display: block; font-size: 13px; color: #fff; }
.up-head small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.up-stats { display: flex; gap: 8px; margin: 11px 0 9px; }
.up-stats > div { flex: 1; background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 7px 9px; }
.up-stats span { display: block; font-size: 10px; color: var(--muted); }
.up-stats b { font-size: 18px; color: #c9bfff; line-height: 1.35; }
.up-note { font-size: 10px; color: var(--muted); line-height: 1.55; margin: 0 0 10px; }
