:root {
  color-scheme: dark;
  --canvas: #08090a;
  --surface-1: #0f1011;
  --surface-2: #151617;
  --surface-3: #191a1b;
  --text: #f7f8f8;
  --muted: #85878a;
  --secondary: #b4b6b8;
  --line: #ffffff14;
  --line-soft: #ffffff0d;
  --blue: #1d9bf0;
  --green: #00ba7c;
  --red: #f4212e;
  --yellow: #ffd400;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--canvas); color: var(--text); font-family: var(--font); font-size: 16px; overflow: hidden; }
button, select, textarea, input { font: inherit; color: inherit; }
select, option { background: #151617; color: #f7f8f8; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }

.fx-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #050506; }
/* 大块渐变容易被 8bit 色深切出条纹（看着像马赛克），多铺两层、加大模糊、放慢色相漂移，
   再配合下面极细的颗粒抖动，把色阶打散。 */
.fx-aurora {
  position: absolute; inset: -40%;
  background:
    radial-gradient(46% 38% at 70% 16%, rgba(110, 196, 255, 0.20), transparent 68%),
    radial-gradient(42% 34% at 20% 78%, rgba(139, 92, 246, 0.16), transparent 70%),
    radial-gradient(36% 30% at 84% 68%, rgba(29, 155, 240, 0.12), transparent 74%),
    radial-gradient(32% 26% at 32% 10%, rgba(110, 255, 236, 0.075), transparent 76%);
  animation: aurora 26s ease-in-out infinite alternate, auroraHue 46s linear infinite;
  filter: blur(42px);
  transform: translateZ(0);
  will-change: transform, filter;
}
/* 会缓慢转的一束扫光。锥形渐变用大模糊化开，避免硬边变成色带 */
.fx-layer::after {
  content: ""; position: absolute; left: 50%; top: 32%;
  width: 130vmax; height: 130vmax; margin: -65vmax 0 0 -65vmax;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(122, 190, 255, 0.05) 40deg,
    transparent 110deg,
    transparent 180deg,
    rgba(160, 122, 255, 0.045) 220deg,
    transparent 290deg
  );
  filter: blur(60px);
  animation: sweep 60s linear infinite;
  transform: translateZ(0);
  will-change: transform;
}
@keyframes sweep { to { transform: translateZ(0) rotate(360deg); } }
@keyframes auroraHue {
  from { filter: blur(42px) hue-rotate(0deg); }
  to { filter: blur(42px) hue-rotate(12deg); }
}
/* 颗粒只留一点点，作用是打散渐变色阶（去带纹），所以要做细、要淡 */
.fx-grain {
  position: absolute; inset: 0; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@keyframes aurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.06); }
}

body { display: flex; }
.sidebar, .main { position: relative; z-index: 1; }

.sidebar {
  width: 260px; flex-shrink: 0; overflow-x: hidden;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent);
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; padding: 16px 12px;
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, #6ec4ff, #1d9bf0 55%, #8b5cf6);
}
.brand-title { font-weight: 700; letter-spacing: .04em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.new-btn {
  margin: 0 8px 16px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.new-btn:hover { background: var(--surface-3); }
.nav { display: grid; gap: 4px; padding: 0 4px; }
.nav-item {
  text-align: left; padding: 10px 12px; border-radius: 10px; color: var(--secondary);
}
.nav-item:hover, .nav-item.active { background: #ffffff10; color: var(--text); }
.history {
  flex: 1; overflow-x: hidden; overflow-y: auto;
  margin-top: 16px; display: grid; align-content: start; gap: 4px; min-width: 0;
}
.history-row { position: relative; display: flex; align-items: center; gap: 2px; min-width: 0; }
.history-title {
  flex: 1 1 auto; min-width: 0; text-align: left; padding: 8px 10px; border-radius: 8px;
  color: var(--secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px;
}
.history-title.active, .history-title:hover { background: #ffffff0d; color: var(--text); }
/* 行内操作：贴右、垂直居中，只占 22px，别把标题挤没 */
.history-act {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11px; line-height: 1; color: var(--muted); background: transparent;
  opacity: 0; transition: opacity .12s ease;
}
.history-row:hover .history-act { opacity: 1; }
.history-act:hover { background: #1d9bf0; color: #fff; }
.history-act.danger:hover { background: #f4212e; color: #fff; }
.sidebar-foot { font-size: 11px; color: var(--muted); padding: 12px 8px 8px; display: grid; gap: 6px; }
.sidebar-foot .foot-item {
  text-align: left; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--secondary);
}
.sidebar-foot .foot-item:hover, .sidebar-foot .foot-item.active { background: #ffffff0d; color: var(--text); }
.sidebar-foot .foot-note { margin-top: 6px; }
/* 轻提示：导出这类「点了没界面变化」的动作给个回声 */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 12px);
  z-index: 120; padding: 9px 16px; border-radius: 999px; font-size: 13px;
  background: #1a1d22; border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 12px 34px #0008; opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 页面开着不刷新时，改了前端也不会生效——给一条能点的刷新提示 */
.reload-hint {
  position: fixed; right: 18px; bottom: 18px; z-index: 130;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 999px; font-size: 13px;
  background: #1a1d22; border: 1px solid #1d9bf066; color: var(--text);
  box-shadow: 0 12px 34px #000a;
}
.reload-hint span { color: #8ec8ff; }
.reload-hint button {
  padding: 4px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: #1d9bf0; color: #fff; font-size: 13px;
}
.reload-hint button:hover { background: #1a8ad8; }
.reload-hint[hidden] { display: none; }
.sidebar-foot .logout-btn {
  justify-self: start; padding: 4px 10px; border-radius: 8px; font-size: 11px;
  background: #ffffff10; border: 1px solid var(--line); color: var(--secondary); cursor: pointer;
}
.sidebar-foot .logout-btn:hover { background: #ffffff1c; color: var(--text); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* .page 是 overflow:hidden 的 flex 容器，滚动要按页单独开。
   这里踩过四次同一个坑（视频页、后台页、更新日志页…），所以改成「除了聊天页，其余一律可滚」——
   新加页面不用再记得往白名单里补名字。 */
.page:not(#pageChat) { overflow-y: auto; overflow-x: hidden; }
#pageChat:not(.has-thread) { justify-content: center; }
#pageChat:not(.has-thread) .chat { flex: 0; max-height: 0; padding: 0; }

.hero { position: relative; text-align: center; padding: 7vh 32px 32px; isolation: isolate; }
/* 标题后面的光斑：不新增 DOM，用伪元素铺一层会呼吸的辉光 */
.hero::before {
  content: ""; position: absolute; left: 50%; top: 38%; z-index: -1;
  width: min(780px, 84vw); height: 300px; transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(29, 155, 240, 0.26), rgba(29, 155, 240, 0.06) 58%, transparent 80%),
    radial-gradient(closest-side, rgba(139, 92, 246, 0.18), transparent 72%);
  filter: blur(20px);
  animation: heroPulse 7.5s ease-in-out infinite;
}
@keyframes heroPulse {
  0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.09); }
}
.hero h1 {
  font-size: clamp(40px, 5.6vw, 64px); font-weight: 650; letter-spacing: -.03em;
  background: linear-gradient(100deg, #ffffff 6%, #8ecbff 34%, #c9b8ff 56%, #ffffff 86%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: heroSheen 9s ease-in-out infinite;
}
@keyframes heroSheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero p { margin-top: 16px; color: var(--secondary); font-size: 18px; }

.chat {
  flex: 1; overflow-x: hidden; overflow-y: auto; padding: 0 32px 16px;
  width: min(1080px, 100%); margin: 0 auto; min-width: 0;
}
.chat.has-msgs + .composer, .page.has-thread .hero { display: none; }
.page.has-thread .chat { padding-top: 24px; }

.message { display: flex; gap: 12px; margin: 18px 0; align-items: flex-start; max-width: 100%; min-width: 0; }
.message.user { flex-direction: row-reverse; }
.msg-col { display: grid; gap: 8px; max-width: min(720px, calc(100% - 44px)); min-width: 0; overflow: hidden; }
.message.user .msg-col {
  justify-items: end; width: min(560px, calc(100% - 44px)); max-width: min(560px, calc(100% - 44px));
}
.message.user .thumbs { justify-content: flex-end; }
.think-bubble { background: transparent; border: 0; padding: 2px 0; color: var(--text); max-width: none; font-size: 16px; }
.summary-bubble { background: transparent; border: 0; padding: 2px 0; max-width: none; }
.summary-bubble p { margin: 8px 0; color: var(--secondary); }
/* 摘要块是排版容器，不是正文：pre-wrap 会把模板缩进渲染成空行。文本气泡在 .bubble 里，不受影响。 */
.summary-bubble { white-space: normal; }
.summary-stats {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px;
}
.summary-stats button {
  font-size: 13px; color: #d4d7db; background: #ffffff10;
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 10px;
}
.summary-stats button:hover, .summary-stats button.on {
  color: #fff; border-color: #1d9bf066; background: #1d9bf024;
}
.best-shot { margin: 4px 0 10px; text-align: left; }
.best-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: #c9ced4; margin: 0 0 8px; line-height: 1.4;
}
.best-label em {
  margin-left: 8px; font-style: normal;
  font-size: 12px; font-weight: 500; color: #8b8e93;
}
.best-shot img {
  display: block; margin: 0;
  width: min(360px, 100%); height: auto; max-height: 480px; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--line); cursor: zoom-in; background: #000;
}
.prompt-label {
  margin: 12px 0 0; font-size: 12px; font-weight: 600; color: #c9ced4;
}
.prompt-label em {
  margin-left: 8px; font-style: normal; font-weight: 500; color: #8b8e93; font-size: 11px;
}
.scene-prompt {
  margin: 6px 0 0; max-width: min(560px, 100%);
  padding: 10px 12px; border-radius: 12px;
  background: #ffffff0a; border: 1px solid var(--line-soft);
  color: #c5c9ce; font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; max-height: 160px; overflow: auto;
}
.gen-status { color: var(--muted); font-size: 14px; }
.gen-status.bad { color: var(--red); }
.error-banner {
  color: #ffb4b8; background: #f4212e1a; border: 1px solid #f4212e55;
  border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45;
}
.size-gate {
  margin: 8px 0 12px; padding: 12px 14px; border-radius: 14px;
  background: #1d9bf014; border: 1px solid #1d9bf055; color: #d7ecfb;
  font-size: 14px; line-height: 1.5;
}
.size-gate p { margin: 0 0 10px; }
.size-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.size-row input {
  flex: 1; min-width: 180px; height: 38px; padding: 0 12px;
  border-radius: 12px; border: 1px solid #ffffff24; background: #121417; color: #fff;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-3); font-size: 12px; flex-shrink: 0;
}
.bubble-wrap { position: relative; max-width: 100%; }
.bubble-copy {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  width: 26px; height: 26px; border-radius: 8px; padding: 0;
  display: grid; place-items: center; font-size: 13px; line-height: 1;
  background: #ffffff14; border: 1px solid var(--line); color: var(--secondary);
  opacity: 0; transition: opacity .12s ease;
}
.bubble-wrap:hover .bubble-copy, .bubble-copy:focus-visible { opacity: 1; }
.bubble-copy:hover { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.bubble-copy.done { background: #00ba7c; border-color: #00ba7c; color: #fff; opacity: 1; }
.bubble { position: relative; max-width: 100%;
  padding: 12px 16px; border-radius: 18px;
  background: #ffffff0d; border: 1px solid var(--line-soft);
  line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.message.user .bubble {
  width: fit-content;
  max-width: 100%;
  background: #2f3338;
  border: 0;
  color: #f7f8f8;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs img, .result-card img {
  width: 148px; height: 148px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); cursor: zoom-in; background: #000;
}
.result-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.result-card {
  width: 220px; background: #141618; border: 1px solid var(--line-soft);
  border-radius: 16px; overflow: hidden;
}
.result-card img { width: 100%; height: 220px; object-fit: cover; }
.result-card.skeleton {
  width: 200px;
  height: 266px;
  min-height: 266px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(120% 80% at 50% 110%, rgba(40, 70, 110, 0.18), transparent 55%),
    #111214;
  position: relative;
}
.result-card.skeleton .spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.result-card.skeleton .tank-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}
.result-card.skeleton .tank-mark span {
  animation: markPulse 2.4s ease-in-out infinite;
}
@keyframes markPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(255,255,255,0.18), 0 0 22px rgba(80,160,255,0.45), 0 10px 24px rgba(0,0,0,0.35); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 1px rgba(255,255,255,0.28), 0 0 38px rgba(90,175,255,0.75), 0 10px 24px rgba(0,0,0,0.35); }
}
.result-card.skeleton .gen-label {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2;
  text-align: center; font-size: 12px; letter-spacing: 0.08em; color: #9fc6f5;
  pointer-events: none;
}
.result-card.skeleton .gen-label i {
  display: inline-block; width: 3px; height: 3px; margin-left: 3px;
  border-radius: 50%; background: currentColor; vertical-align: middle;
  animation: genDot 1.1s ease-in-out infinite;
}
.result-card.skeleton .gen-label i:nth-child(2) { animation-delay: 0.15s; }
.result-card.skeleton .gen-label i:nth-child(3) { animation-delay: 0.3s; }
@keyframes genDot {
  0%, 80%, 100% { opacity: 0.22; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.result-card.skeleton .tank-mark span {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: #f4f8ff;
  background: linear-gradient(135deg, #8ad0ff, #1d9bf0 58%, #7c5cff);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.18),
    0 0 22px rgba(80,160,255,0.45),
    0 10px 24px rgba(0,0,0,0.35);
  animation: tankPulse 2.4s ease-in-out infinite;
}
@keyframes tankPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(255,255,255,0.18), 0 0 18px rgba(80,160,255,0.35), 0 10px 24px rgba(0,0,0,0.35); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 1px rgba(255,255,255,0.28), 0 0 32px rgba(120,190,255,0.62), 0 10px 24px rgba(0,0,0,0.35); }
}
.result-card .ph, .card .ph {
  height: 180px;
  background: linear-gradient(90deg, #16181c, #242830, #16181c);
  background-size: 200% 100%;
  animation: slide 1.6s infinite;
}
.result-card .ph.empty, .card .ph.empty {
  animation: none; background: #121417; color: #8b8e93;
  display: grid; place-items: center; font-size: 13px;
}
.result-card footer { display: flex; justify-content: space-between; gap: 6px; padding: 8px; font-size: 12px; color: var(--muted); }
.result-card .fail-reason { padding: 0 8px 10px; color: var(--red); font-size: 12px; line-height: 1.4; }
.result-card .pass-reason { padding: 0 8px 10px; color: #8bd4a0; font-size: 12px; line-height: 1.45; }
.result-card .ok { color: var(--green); }
.result-card .bad { color: var(--red); }
.pass-why {
  margin: 10px 0 0; max-width: min(560px, 100%);
  text-align: left; font-size: 13px; line-height: 1.5; color: #d7dde3;
}

.thinking { display: flex; align-items: center; gap: 10px; color: var(--secondary); }
.dots span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: var(--blue); animation: blink 1.2s infinite;
}
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

.progress {
  margin-top: 8px; padding: 10px 0 2px;
  border-left: 3px solid var(--blue); padding-left: 12px;
}
.progress-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.progress-head .steps { flex: 1; margin-top: 0; }
.stop-btn {
  flex-shrink: 0; height: 28px; padding: 0 12px; border-radius: 999px;
  border: 1px solid #f4212e66; background: #f4212e22; color: #ffb4b8;
  font-size: 12px; font-weight: 650;
}
.stop-btn:hover { background: #f4212e; color: #fff; }
.stop-btn:disabled { opacity: .55; cursor: default; }
.bar { height: 4px; border-radius: 99px; overflow: hidden; background: #ffffff12; }
.bar > i {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: slide 1.4s infinite;
}
@keyframes slide { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.elapsed { margin-top: 6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }
.progress-log {
  margin-top: 10px; max-height: 220px; overflow: auto;
  font-size: 13px; line-height: 1.45; color: var(--secondary);
}
.progress-log div { padding: 5px 0; border-bottom: 1px solid #ffffff0d; }
.progress-log b { color: #d7dbe0; margin-right: 6px; font-weight: 650; }

.composer {
  position: relative;
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto 36px;
  padding: 14px 16px 12px;
  border-radius: 22px;
  background: #ffffff12;
  box-shadow: inset 0 0 0 1px #ffffff18, 0 0 42px #6ec4ff12, 0 24px 76px #00000075;
  backdrop-filter: blur(18px) saturate(145%);
}
.composer-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: end; }
.composer textarea {
  resize: none; min-height: 72px; max-height: 180px; padding: 18px 10px 8px;
  background: transparent; border: 0; outline: none; font-size: 18px; line-height: 1.5;
}
.icon-btn, .send-btn {
  width: 48px; height: 48px; border-radius: 999px; background: #ffffff14; font-size: 22px;
}
.send-btn { width: auto; min-width: 88px; padding: 0 22px; background: #f7f8f8; color: #111; font-weight: 700; font-size: 16px; }
.composer-tools {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 10px 8px 4px; color: var(--secondary); font-size: 14px;
  align-items: center;
}
.tool-chip {
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: #ffffff10; border: 1px solid #ffffff1f; color: #e9eaec; font-weight: 600;
}
.tool-chip:hover, .tool-chip.open { background: #1d9bf024; border-color: #1d9bf066; color: #fff; }
.mode-chip.on { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
/* 补问卡片里的选项也是 .tool-chip：以前只有 .mode-chip.on 有样式，
   普通 .tool-chip 点中之后状态存上了、颜色一点没变——用户以为「点了没反应」。 */
.clarify-q .tool-chip.on { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.composer.is-chat .composer-tools .tool-chip[data-panel],
.composer.is-chat .count-tool { opacity: .35; }
.count-tool { display: flex; align-items: center; gap: 8px; }
.composer-tools input[type="number"] {
  width: 72px; height: 38px; background: #121417; border: 1px solid #ffffff24; border-radius: 12px;
  padding: 0 10px; color: #fff; font-size: 14px; font-weight: 600;
}
.composer-tools select {
  position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none;
}
.picker-pop {
  position: absolute; left: 16px; bottom: calc(100% + 10px); z-index: 40;
  width: min(340px, calc(100% - 32px));
  padding: 10px; border-radius: 16px;
  background: #101114f2; border: 1px solid #ffffff22;
  box-shadow: 0 16px 40px #000000b0;
  backdrop-filter: blur(18px);
}
.picker-title { font-size: 12px; color: #9aa0a6; margin-bottom: 10px; letter-spacing: .04em; }
.ratio-grid, .res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ratio-card, .res-card, .choice-card {
  min-height: 52px; border-radius: 12px; border: 1px solid #ffffff18;
  background: #1a1c20; color: #f2f3f5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; font-weight: 650; font-size: 12px;
}
.ratio-card:hover, .res-card:hover, .choice-card:hover { background: #22252b; }
.ratio-card.active, .res-card.active, .choice-card.active {
  border-color: #1d9bf0; background: #1d9bf01f; color: #fff; box-shadow: inset 0 0 0 1px #1d9bf066;
}
.ratio-icon {
  width: 16px; height: 16px; border: 1.5px solid currentColor; border-radius: 3px; opacity: .9;
  display: grid; place-items: center; font-size: 9px; font-weight: 800;
}
.muted-line { color: var(--secondary); margin-bottom: 8px; }
.memory-wrap {
  overflow: auto; padding: 0 28px 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.memory-col {
  background: #0c0d0eaa; border: 1px solid var(--line-soft); border-radius: 14px; padding: 16px;
}
.memory-col.wide { grid-column: 1 / -1; }
.memory-col h2 { font-size: 15px; margin-bottom: 10px; }
.pref-list, .mem-list { display: grid; gap: 8px; }
.gold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.gold-card {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #ffffff0a; padding: 0; text-align: left; color: inherit; cursor: pointer;
}
.gold-card img { width: 100%; height: 112px; object-fit: cover; display: block; }
.gold-card span { display: block; padding: 6px 8px; font-size: 11px; color: var(--secondary); }
.mem-item, .pref-item {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 10px; background: #ffffff0a; font-size: 13px;
}
.mem-item button { color: var(--muted); }
.mem-form { display: flex; gap: 8px; margin-top: 10px; }
.mem-form input {
  flex: 1; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: #121417; padding: 0 10px;
}
.mem-form button { padding: 0 12px; border-radius: 10px; background: #ffffff14; }
.steps {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px;
}
.steps span {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid #ffffff18; color: #8b8e93;
}
.steps span.on { color: #fff; border-color: #1d9bf066; background: #1d9bf024; }
.steps span.done { color: #00ba7c; border-color: #00ba7c55; }
.res-card { min-height: 56px; }
.res-box {
  border: 1.5px solid currentColor; border-radius: 4px; opacity: .9;
}
.res-box.k1 { width: 12px; height: 12px; }
.res-box.k2 { width: 16px; height: 16px; }
.res-box.k4 { width: 20px; height: 20px; }
.chip-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.choice-card { min-height: 36px; flex-direction: row; justify-content: flex-start; padding: 0 12px; }
.drop-zone { position: relative; }
.drop-mask {
  display: none; position: absolute; inset: 16px; z-index: 8;
  border: 1.5px dashed #6ec4ff99; border-radius: 24px;
  background: #081018cc; color: #f7f8f8; font-size: 22px; font-weight: 650;
  place-items: center; pointer-events: none; backdrop-filter: blur(8px);
}
.drop-zone.dragover .drop-mask { display: grid; }
.drop-zone.dragover .composer { box-shadow: inset 0 0 0 1px #6ec4ff66, 0 0 42px #6ec4ff22; }
.composer-files { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 8px; }
.file-chip { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); display: block; }
.file-chip-wrap { position: relative; width: 64px; height: 64px; }
.file-chip-wrap.scene { outline: 2px solid #ffd400aa; border-radius: 10px; }
.file-role {
  position: absolute; left: 3px; top: 3px; z-index: 2;
  border: 0; border-radius: 6px; padding: 3px 7px; font-size: 11px; font-weight: 700;
  background: #1d9bf0; color: #fff; cursor: pointer;
}
.file-chip-wrap.scene .file-role { background: #ffd400; color: #111; }
.file-chip-wrap.flower { outline: 2px solid #ff6b9aaa; border-radius: 10px; }
.file-chip-wrap.flower .file-role { background: #ff6b9a; color: #fff; }
.file-chip-wrap.feedback { outline: 2px solid #00ba7caa; border-radius: 10px; }
.file-chip-wrap.feedback .file-role { background: #00ba7c; color: #fff; }
.file-x {
  position: absolute; right: 2px; top: 2px; z-index: 2;
  width: 18px; height: 18px; border: 0; border-radius: 999px;
  background: #000a; color: #fff; font-size: 12px; line-height: 18px; cursor: pointer;
}
.clarify-gate .clarify-q { margin-bottom: 10px; }
.clarify-input {
  margin-top: 6px; width: min(360px, 100%); padding: 6px 10px; border-radius: 999px;
  background: #0c0d0e; border: 1px solid var(--line); color: var(--text); font-size: 13px;
}
.clarify-input::placeholder { color: #6f7276; }
.clarify-gate p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.mention-chip {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid #6ec4ff88; cursor: pointer;
}
.mention-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mention-chip b {
  position: absolute; left: 4px; top: 4px; font-size: 11px; line-height: 1;
  background: #1d9bf0; color: #fff; border-radius: 6px; padding: 2px 4px;
}
.mention-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 280px; overflow: auto; }
.mention-item {
  position: relative; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden;
  background: #111; cursor: pointer; aspect-ratio: 1;
}
.mention-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mention-item.on { outline: 2px solid #1d9bf0; }
/* 悬停放大：缩略图只有 ~100px，看不清是哪一张。预览贴在面板右侧，贴不下就翻到左侧。 */
.mention-preview {
  position: fixed; z-index: 90; pointer-events: none;
  padding: 6px; border-radius: 12px;
  background: #0b0c0e; border: 1px solid var(--line);
  box-shadow: 0 18px 48px #000a;
  /* JS 只给落点（面板右侧、与悬停那一格齐平）；宽高写死 + translateY(-50%)，
     图加载前后来回都不会跑偏，再由 scale 放大出来。 */
  width: 312px;
  transform-origin: left center;
  transform: translate(0, -50%) scale(0.9);
  opacity: 0;
  transition: transform .16s ease-out, opacity .12s ease-out;
}
.mention-preview.show { transform: translate(0, -50%) scale(1); opacity: 1; }
.mention-preview img {
  display: block; width: 300px; height: 300px; object-fit: contain; border-radius: 8px;
}
.mention-preview span {
  display: block; margin-top: 4px; font-size: 12px; color: var(--secondary);
  max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.mention-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px;
  font-size: 11px; color: #fff; background: #0008;
}
.result-card { position: relative; }
.result-card .at-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  border: 0; border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700;
  background: #111c; color: #fff; cursor: pointer;
}
.result-card .at-btn:hover, .result-card .at-btn.on { background: #1d9bf0; }
.result-card .qa-bar {
  display: flex; gap: 6px; padding: 0 8px 10px;
}
.result-card .qa-bar button {
  border: 0; border-radius: 999px; padding: 4px 10px; font-size: 12px;
  background: #2a2e33; color: #f7f8f8; cursor: pointer;
}
.result-card .qa-bar button.danger { background: #3a1d22; color: #ff8a95; }
.result-card .qa-bar button:hover { background: #1d9bf0; color: #fff; }
.result-card .qa-bar button.danger:hover { background: #f4212e; color: #fff; }
.ctx-menu {
  position: fixed; z-index: 80; min-width: 148px; padding: 6px;
  background: #1a1d22; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 40px #0008;
}
.ctx-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: #f7f8f8; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.ctx-menu button:hover { background: #1d9bf033; }
.ctx-menu button.danger { color: #ff8a95; }

.help-wrap {
  padding: 0 28px 40px;
  width: min(880px, 100%);
  display: grid;
  gap: 16px;
}
/* 更新日志是「日期 + 几条短句」的列表，摊开更省地方；使用说明是整段说明文，
   保持 880 的窄栏更好读，所以只放宽这一页。 */
#pageUpdates .help-wrap {
  width: min(1400px, 100%);
  /* 用 columns 而不是 grid：各日期长短差很多（09-20 有十几条，别的只有三四条），
     grid 会把短的那些堆在左边、右边下半截全空。columns 由浏览器按总高度自动平衡。 */
  display: block;
  /* 最多 2 栏：3 栏读起来要来回跳，太累。每栏至少 420px，窗口窄了会自动退回 1 栏。 */
  columns: 2 420px;
  column-gap: 20px;
}
/* 日期块不许被拆到两栏里 */
#pageUpdates .help-block { break-inside: avoid; margin-bottom: 16px; }
.help-block {
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #ffffff08;
}
.help-block h2 { font-size: 16px; margin-bottom: 10px; }
.help-block p, .help-block li { color: var(--secondary); font-size: 14px; line-height: 1.55; }
.help-block ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.help-block b { color: var(--text); font-weight: 650; }
.help-block code {
  font-family: inherit; font-size: 13px; color: #d7ecfb;
  background: #1d9bf018; border: 1px solid #1d9bf033;
  border-radius: 6px; padding: 1px 6px;
}
.report-head { padding: 28px 28px 12px; }
.report-head h1 { font-size: 28px; margin-bottom: 14px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #ffffff08; min-width: 110px;
}
.stat b { display: block; font-size: 20px; }
.stat span { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--secondary); }
.chip.active { background: #ffffff14; color: var(--text); }
.report-grid {
  overflow: visible; padding: 12px 28px 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; align-items: stretch;
}
.fail-log { padding: 8px 28px 28px; }
.fail-log h2 { font-size: 16px; margin-bottom: 10px; }
.card {
  display: flex; flex-direction: column;
  background: #0c0d0eaa; border: 1px solid var(--line-soft); border-radius: 14px;
  overflow: hidden; min-height: 0;
}
.card img { width: 100%; height: 220px; object-fit: cover; cursor: zoom-in; background: #000; flex-shrink: 0; }
.card .meta {
  padding: 10px 12px 14px; font-size: 13px;
  display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0;
}
.card .meta p {
  color: var(--muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 长验收说明默认只露 3 行：点开看全文，鼠标移开卡片自动收回，避免长短不一把版面撑乱 */
.card .meta p.reason-text { cursor: pointer; }
.card .meta p.reason-text:hover { color: var(--secondary); }
/* 展开就是要看全文：不加面板框、不限高，和卡片同宽铺开；鼠标移开卡片自动收回 */
.card .meta p.reason-text.open {
  display: block; -webkit-line-clamp: unset; overflow: visible; white-space: pre-wrap;
}
/* 长验收说明默认收起来，点一下才展开 */
.reason-toggle {
  align-self: flex-start; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: #8ec8ff;
}
.reason-toggle:hover { color: #fff; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.actions button {
  flex: 1 1 auto; min-width: 72px; white-space: nowrap;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: #ffffff14; font-size: 12px;
}
.actions .danger { color: var(--red); }

.modal {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: #050608d8; backdrop-filter: blur(10px);
}
.modal-card {
  width: min(460px, calc(100% - 32px));
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: #141618;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px #00000088;
}
.modal-card h3 { font-size: 18px; margin-bottom: 8px; }
.modal-card p { color: var(--secondary); font-size: 13px; margin-bottom: 12px; }
.modal-card textarea {
  width: 100%; min-height: 110px; resize: vertical;
  padding: 12px; border-radius: 12px;
  background: #0c0d0e; border: 1px solid var(--line);
  color: var(--text); line-height: 1.5;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal-actions button { padding: 8px 14px; border-radius: 999px; background: #ffffff14; }
.modal-actions button.danger { background: #f4212e; color: #fff; }
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: #000c;
  display: grid; place-items: center; padding: 24px 24px 108px;
}
.lightbox-stage {
  position: relative;
  width: min(92vw, 1400px);
  height: 72vh;
  overflow: hidden;
  border-radius: 12px;
  background: #0008;
  justify-self: center;
  align-self: center;
  touch-action: none;
}
.lightbox-inner {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.lightbox img {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  pointer-events: none;
  user-select: none;
}
.lightbox-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  cursor: crosshair;
}
.lightbox-stage.is-panning .lightbox-canvas { cursor: grab; }
.lightbox-stage.is-panning.is-drag .lightbox-canvas { cursor: grabbing; }
.lightbox-zoom-label {
  min-width: 44px; text-align: center; padding: 5px 6px;
  color: #111; font-variant-numeric: tabular-nums; font-size: 12px;
  pointer-events: none;
}
.lightbox-note {
  position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%);
  z-index: 82; display: flex; gap: 8px; align-items: center;
  background: #111c; padding: 8px; border-radius: 999px;
  border: 1px solid #ffffff22; backdrop-filter: blur(10px);
}
.lightbox-note input {
  width: min(420px, 58vw); padding: 8px 12px; border-radius: 999px;
  background: #0c0d0e; border: 1px solid var(--line); color: var(--text);
}
.lightbox-note button { padding: 6px 12px; border-radius: 999px; background: #fff; color: #111; font-size: 13px; }
.lightbox-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; gap: 6px; align-items: center; z-index: 81;
}
.lightbox-bar button {
  padding: 5px 11px; border-radius: 999px; background: #fff; color: #111;
  font-size: 13px; line-height: 1.35; pointer-events: auto;
}
.lightbox-bar button:hover { background: #e9eaeb; }
.region-chip {
  position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden;
  border: 1px solid #ffd400aa; cursor: pointer;
}
.region-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.region-chip b {
  position: absolute; left: 4px; top: 4px; font-size: 11px; line-height: 1;
  background: #ffd400; color: #111; border-radius: 6px; padding: 2px 4px;
}

.mem-hint {
  margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  font-size: 13px; color: var(--secondary); line-height: 1.55;
  background: #1d9bf014; border: 1px solid #1d9bf033;
}
/* ---------------------------------------------------------------- 视频页 */
.build-tag { margin-left: 8px; font-size: 11px; color: #6f7276; }
.style-intro {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: #ffffff08; border: 1px solid var(--line-soft);
}
.style-intro-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.style-intro-head em, .style-intro-head span { font-size: 11px; color: var(--muted); }
.style-intro p { margin: 0 0 6px; font-size: 12px; line-height: 1.6; }
.style-intro-sections { max-height: 320px; overflow: auto; }
.style-sec + .style-sec { margin-top: 8px; }
.style-sec h4 { margin: 0 0 3px; font-size: 12px; color: var(--text); font-weight: 600; }
.style-sec ul { margin: 0; padding-left: 16px; }
.style-sec li { font-size: 12px; line-height: 1.7; color: var(--secondary); }
.video-warn { margin: 6px 0 0; font-size: 12px; color: #ffd27a; }
/* 对话里的成片播放器：出片后直接在这儿播，不用再去「我的视频」翻 */
.chat-video { margin: 0; max-width: 360px; }
.chat-video video {
  width: 100%; display: block; border-radius: 12px;
  background: #000; border: 1px solid var(--line-soft);
}
.chat-video figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 6px; font-size: 12px; color: var(--muted);
}
.chat-video figcaption a { text-decoration: none; }
/* 后台「视频模型」卡片：三家供应商各一块，路由默认折叠 */
.video-providers { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.video-provider {
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: #ffffff08; padding: 8px 12px;
}
.video-provider > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text);
  list-style: none; padding: 2px 0;
}
.video-provider > summary::-webkit-details-marker { display: none; }
.video-provider > summary::before { content: "▸ "; color: var(--muted); }
.video-provider[open] > summary::before { content: "▾ "; }
.video-provider[open] > summary { margin-bottom: 8px; }
.video-routes { margin: 4px 0 2px; }
.video-routes > summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 2px 0; }
.settings-label input[data-video-route] { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.video-wrap {
  padding: 0 28px 120px; width: min(980px, 100%); display: grid; gap: 16px; align-content: start;
}
/* 网格子项默认 min-width:auto：里面一旦有不肯折行的内容，整列会被撑破、卡片宽出容器。
   显式给 0，让卡片的宽度由 .video-wrap 说了算。 */
.video-wrap > * { min-width: 0; }
/* 首帧 / 尾帧 切换 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button {
  background: transparent; border: 0; color: var(--secondary);
  padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: #ffffff14; color: var(--text); }
.video-picked { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.video-source.on-last::after {
  content: "尾帧"; position: absolute; right: 4px; bottom: 4px;
  background: #1d9bf0; color: #fff; font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 5px;
}
.video-source.on-first::after {
  content: "首帧"; position: absolute; left: 4px; bottom: 4px;
  background: #00ba7c; color: #fff; font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 5px;
}
.video-source-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.video-source-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
  /* 不给它自己的滚动条：嵌套滚动会吃掉滚轮，页面只留一个滚动条 */
}
.video-source {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-soft); background: #111; cursor: pointer;
}
.video-source img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-source.on { outline: 2px solid #1d9bf0; }
.video-list { display: grid; gap: 14px; }
.video-card {
  display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 14px;
  padding: 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: #0f1011;
}
.video-card video { width: 100%; border-radius: 10px; background: #000; display: block; }
.video-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.video-meta strong { font-size: 14px; }
.video-audit { font-size: 12px; color: #ffd27a; margin: 0; }
#videoPrompt {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  /* 高度由 autoGrow() 跟着内容长：脚本写多长就多高，不用在里面滚 */
  min-height: 84px; max-height: 640px; overflow-y: hidden; resize: none;
  background: #0c0d0e; border: 1px solid var(--line); color: var(--text);
  font-size: 13px; line-height: 1.65;
}
/* 智能体识图后的定位结论：产品 / 场景 / 人群 / 类型。
   不要用 nowrap：一长就把网格列撑破，整张卡片会宽出容器。 */
.video-analysis {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 10px;
  background: #ffffff08; border: 1px solid var(--line-soft);
  font-size: 12px; line-height: 1.7; color: var(--secondary);
  overflow-wrap: anywhere;
}
.video-analysis b { color: var(--text); font-weight: 600; }
.video-analysis span { display: inline; margin-right: 12px; }
@media (max-width: 760px) {
  .video-card { grid-template-columns: 1fr; }
}

.mem-pager {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 0 2px; font-size: 12px; color: var(--muted);
}
.mem-pager button {
  padding: 4px 10px; border-radius: 8px; font-size: 12px;
  background: #ffffff10; border: 1px solid var(--line); color: var(--secondary); cursor: pointer;
}
.mem-pager button:hover:not(:disabled) { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.mem-pager button:disabled { opacity: .4; cursor: default; }

.settings-wrap {
  padding: 0 28px 40px; width: min(880px, 100%); display: grid; gap: 16px; align-content: start;
}
.settings-card {
  padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 16px; background: #ffffff08;
}
.settings-card h2 { font-size: 15px; margin-bottom: 12px; }
.settings-label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--secondary); }
.settings-label input, .settings-label select {
  display: block; width: 100%; margin-top: 5px; padding: 8px 10px; border-radius: 9px;
  background: #0c0d0e; border: 1px solid var(--line); color: var(--text); font-size: 13px;
}
.settings-row { display: flex; gap: 12px; flex-wrap: wrap; }
.settings-row .settings-label { flex: 1 1 200px; }
.settings-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 设置项里的按钮统一小一号：.tool-chip 是 38px、.send-btn 更胖，并排会很怪 */
.settings-actions .tool-chip,
.settings-actions .send-btn {
  height: 32px; min-width: 0; padding: 0 14px; border-radius: 999px;
  font-size: 13px; line-height: 30px;
}
.settings-actions .send-btn { font-weight: 600; }
.settings-msg { font-size: 13px; color: #8bd4a0; }
.settings-msg.bad { color: #ffb4b8; }
.user-list { display: grid; gap: 10px; }
.user-row { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: #0f1011; }
.user-row.off { opacity: 0.6; }
.user-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #ffffff12; color: var(--secondary);
}
.user-tag.owner { background: #ffd40022; color: #ffd400; }
.user-tag.ok { color: #8bd4a0; }
.user-tag.bad { color: #ffb4b8; }
.user-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.user-team {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 12px; color: var(--muted);
}
.user-team select {
  padding: 4px 8px; border-radius: 8px; font-size: 12px;
  background: #0c0d0e; border: 1px solid var(--line); color: var(--text);
}
.user-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.user-actions button {
  padding: 4px 10px; border-radius: 8px; font-size: 12px;
  background: #ffffff10; border: 1px solid var(--line); color: var(--secondary); cursor: pointer;
}
.user-actions button:hover { background: #1d9bf0; border-color: #1d9bf0; color: #fff; }
.user-actions button.danger:hover { background: #f4212e; border-color: #f4212e; }

/* 登录 / 初始化管理员：纯表单页，不依赖 JS */
.login-body {
  display: grid; place-items: center; min-height: 100%;
}
.login-card {
  width: min(420px, calc(100% - 32px));
  padding: 28px 26px 22px; border-radius: 18px;
  background: #ffffff0a; border: 1px solid var(--line);
  box-shadow: 0 24px 60px #0008;
}
.login-brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.login-title { font-size: 20px; margin-bottom: 14px; }
.login-hint { color: var(--secondary); font-size: 13px; line-height: 1.6; margin-bottom: 14px; }
.login-label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--secondary); }
.login-label input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border-radius: 10px; background: #0c0d0e; border: 1px solid var(--line); color: var(--text);
}
.login-btn {
  width: 100%; margin-top: 6px; padding: 11px 14px; border-radius: 10px;
  background: #1d9bf0; color: #fff; font-weight: 650; cursor: pointer; border: 0;
}
.login-btn:hover { background: #1a8ad8; }
.login-error { color: #ffb4b8; font-size: 13px; margin: 4px 0 10px; }
.login-foot { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-foot code { color: #d7ecfb; background: #1d9bf018; border-radius: 4px; padding: 0 4px; }

@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 5; height: 100%; transform: translateX(-100%); }
  .hero { padding-top: 6vh; }
}

/* 「显示更早的消息」那一行。注意：往这个文件里插样式时，
   锚点要用完整选择器，别用 `.chat {` 这种片段——它会在
   `#pageChat:not(.has-thread) .chat {` 中间匹配上，把一条规则劈成两半。 */
.earlier-wrap { display: flex; justify-content: center; padding: 4px 0 10px; }
.earlier-wrap button { cursor: pointer; }

/* 大图：先把已缓存的缩略图显示出来（打开即见），原图下载完再换上 */
.lightbox-loading {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; z-index: 3;
  background: #000000aa; color: #fff; font-size: 12px; letter-spacing: .5px;
  pointer-events: none;
}
#lightboxImg.sharpening { animation: lbSharp .28s ease-out; }
@keyframes lbSharp { from { opacity: .45 } to { opacity: 1 } }

/* 侧栏的余额行 */
.balance-line {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: #ffffff08; border: 1px solid var(--line-soft); border-radius: 9px;
  padding: 7px 10px; margin-bottom: 8px; color: var(--secondary); font-size: 12px;
}
.balance-line b { color: var(--text); font-weight: 600; }
.balance-line:hover { background: #ffffff14; }
.balance-line.low { border-color: #ffd27a55; }
.balance-line.low b { color: #ffd27a; }
.balance-line em { color: var(--muted); font-style: normal; }

/* 后台的用量明细：两栏小表 */
.usage-table { display: flex; gap: 20px; flex-wrap: wrap; margin: 5px 0 2px; }
.usage-col { flex: 1 1 240px; min-width: 0; }
.usage-col h4 { margin: 0 0 4px; font-size: 12px; color: var(--text); font-weight: 600; }
.usage-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--secondary); line-height: 1.8; }
.usage-row em { color: var(--muted); font-style: normal; }

/* 更新提示横幅：横在顶部，不挡内容也不打断操作 */
.update-banner {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 999px;
  background: #1b1c1e; border: 1px solid var(--line);
  box-shadow: 0 6px 24px #0009; font-size: 13px; color: var(--text);
  max-width: min(680px, 92vw);
}
.update-banner b { color: var(--blue); font-variant-numeric: tabular-nums; }
.update-banner button {
  background: var(--blue); color: #fff; border: 0; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.ub-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue);
  animation: ubPulse 1.1s ease-in-out infinite; flex: none;
}
@keyframes ubPulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* 更新日志页的 three.js 动画背景。
   要点：铺满整页、压在内容下面、不吃鼠标事件；内容整体抬一层。 */
#pageUpdates { position: relative; }
.updates-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
#pageUpdates > .report-head,
#pageUpdates > .help-wrap { position: relative; z-index: 1; }
/* 顶部淡出：粒子别在标题后面糊成一片 */
.updates-bg::after { content: none; }

/* 「场景图」档位下的选择器：横在输入框上方 */
.scene-picker {
  margin: 0 0 8px; padding: 10px;
  border: 1px solid var(--line-soft); border-radius: 12px; background: #ffffff08;
}
.scene-picker-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--secondary); margin-bottom: 8px;
}
.scene-picker-head #scenePickCount { margin-right: auto; }
.scene-picker-head button { cursor: pointer; }
.scene-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px; max-height: 150px; overflow-y: auto;
}
.scene-pick {
  position: relative; padding: 0; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: #0c0d0e; cursor: pointer;
  aspect-ratio: 1; 
}
.scene-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-pick.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.scene-pick.on::after {
  content: "✓"; position: absolute; right: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 11px; line-height: 16px; text-align: center;
}
