/* ============================================================
 *  玲珑 AI — 样式表
 *  设计语言：纯黑底 + 金色主色 (#D4AF37)，玻璃拟态与描边
 *  ============================================================ */

:root {
  --gold: #D4AF37;
  --gold-lt: #F3E5AB;
  --gold-dk: #8a6d1f;
  --gold-dim: rgba(212, 175, 55, .3);
  --gold-soft: rgba(212, 175, 55, .08);
  --bg: #000;
  --panel: #0a0a0a;
  --panel2: #050505;
  --line: rgba(255, 255, 255, .06);
  --line2: rgba(255, 255, 255, .12);
  --txt: #e8e8e8;
  --txt2: #9ca3af;
  --txt3: #6b7280;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 12px;
  --sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--txt); overflow: hidden;
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,.4); }
::-webkit-scrollbar-track { background: transparent; }
.serif { font-family: var(--serif); }
[hidden] { display: none !important; }

/* ================= 布局骨架 ================= */
#app { height: 100vh; display: flex; flex-direction: column; }

/* ================= 顶栏 ================= */
header {
  height: 60px; min-height: 60px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 22px; z-index: 60;
  border-bottom: 1px solid var(--line); position: relative;
  background: rgba(0,0,0,.85); backdrop-filter: blur(14px);
  transition: background .4s, border-color .4s;
}
header.home-mode {
  background: linear-gradient(180deg, rgba(0,0,0,.75), transparent);
  border-bottom-color: transparent; backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 11px; cursor: pointer; flex-shrink: 0; }
.logo-badge {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold-dim); border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.06), transparent);
  color: var(--gold); font-family: var(--serif); font-weight: 700; font-size: 20px;
  transition: border-color .4s, box-shadow .4s;
}
.logo:hover .logo-badge { border-color: var(--gold); box-shadow: 0 0 18px rgba(212,175,55,.25); }
.logo-name {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  letter-spacing: .18em; color: #fff; white-space: nowrap;
}
.logo-name i { font-style: normal; color: var(--gold); }

nav { display: flex; gap: 4px; }
.nav-btn {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px;
  border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--txt3); transition: all .22s; white-space: nowrap;
}
.nav-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-btn:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-btn.active { color: var(--gold); background: var(--gold-soft); }

.header-right { display: flex; align-items: center; gap: 9px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  border-radius: 99px; font-size: 13px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--txt2);
  transition: all .2s; white-space: nowrap; flex-shrink: 0;
}
.pill svg { width: 12px; height: 12px; }
.pill:hover { background: rgba(255,255,255,.09); }
.pill small { font-size: 10px; letter-spacing: .12em; color: var(--txt3); }
.pill.gold { border-color: var(--gold-dim); background: var(--gold-soft); color: var(--gold); }
.pill.gold:hover { background: rgba(212,175,55,.18); border-color: rgba(212,175,55,.65); }
.pill.gold-outline { border-color: var(--gold-dim); color: var(--gold); cursor: pointer; }
.pill.gold-outline b { color: var(--gold-lt); font-weight: 700; }
.pill.gold-outline:hover { background: var(--gold-soft); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-dk));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #000; letter-spacing: .02em;
  transition: box-shadow .25s, transform .2s;
}
.avatar:hover { box-shadow: 0 0 0 3px rgba(212,175,55,.2); transform: scale(1.04); }

@media (max-width: 1240px) { .nav-btn span { display: none; } .nav-btn { padding: 9px; } }
@media (max-width: 900px) { #btn-uid, #btn-gold { display: none; } }

/* ================= 视图容器 ================= */
.view { display: none; flex: 1; min-height: 0; position: relative; }
.view.active { display: flex; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= 首页（紫雾 · 弧形轮播） ================= */
#view-home {
  position: relative; flex-direction: column; align-items: stretch; justify-content: flex-start;
  text-align: left; overflow: hidden; background: #120a18;
}
#nebula { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-veil {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(120% 80% at 50% 46%, rgba(148,86,196,.18), transparent 62%),
    radial-gradient(80% 60% at 12% 88%, rgba(96,48,138,.28), transparent 70%),
    radial-gradient(70% 55% at 88% 12%, rgba(126,72,168,.20), transparent 72%),
    linear-gradient(180deg, rgba(10,5,15,.55), rgba(10,5,15,.15) 40%, rgba(8,4,12,.72));
}
.home-inner { position: relative; z-index: 5; flex: 1; min-height: 0; padding: 34px 58px 22px; }

.home-top { position: relative; }
.hero-title {
  font-family: var(--serif); font-size: clamp(32px, 3.8vw, 58px);
  font-weight: 300; color: #f4eefb; line-height: 1.58; letter-spacing: .035em;
  margin: 26px 0 0 11.5%; max-width: 720px;
  text-shadow: 0 2px 40px rgba(0,0,0,.45);
}
.hero-cta {
  position: absolute; left: 50%; bottom: 19%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 26px;
  padding: 11px 18px 11px 24px; border-radius: 8px;
  background: #dcc0f7; color: #2c1546; font-size: 13.5px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(180,120,240,.18);
  transition: transform .25s, box-shadow .25s, background .25s;
}
.hero-cta:hover { transform: translate(-50%, -2px); background: #e7d2fc; box-shadow: 0 12px 40px rgba(190,135,246,.32); }
.hero-cta svg { width: 15px; height: 15px; }

.home-lead { position: absolute; left: 11.5%; top: 50.5%; }
.hl-1 {
  font-family: var(--serif); font-size: 18px; color: #b96cf0;
  letter-spacing: .12em; margin: 0 0 8px; text-shadow: 0 0 24px rgba(185,108,240,.5);
}
.hl-2 { font-size: 13.5px; color: #cfc4dd; letter-spacing: .16em; margin: 0; }

.carousel-stage {
  position: absolute; left: 50%; top: 37%; transform: translateX(-50%);
  width: min(880px, 74%); height: clamp(168px, 24vh, 232px);
  perspective: 1100px; perspective-origin: 50% 44%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 13%, #000 87%, transparent 100%);
}
.carousel {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
}
.carousel .c-card {
  position: absolute; left: 50%; top: 0;
  width: clamp(92px, 7.4vw, 112px); height: 100%;
  margin-left: calc(clamp(92px, 7.4vw, 112px) / -2);
  border-radius: 3px; overflow: hidden; cursor: pointer;
  background: #1a1024;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  transition: box-shadow .3s;
  backface-visibility: hidden;
}
.carousel .c-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel .c-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,6,18,.28), rgba(12,6,18,.05) 45%, rgba(12,6,18,.42));
}
.carousel .c-card:hover { box-shadow: 0 26px 60px rgba(180,120,240,.32); }

.home-bottom {
  position: absolute; left: 58px; right: 58px; bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.hb-mark { color: rgba(235,225,245,.55); }
.hb-mark svg { width: 20px; height: 20px; display: block; }
.hb-ctrl { display: flex; align-items: center; gap: 14px; }
.hb-btn {
  width: 26px; height: 26px; border-radius: 50%; color: #cabbe0; font-size: 16px;
  line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.hb-btn:hover { color: #fff; background: rgba(200,160,255,.14); }
.hb-idx { font-size: 12px; color: rgba(226,214,240,.5); letter-spacing: .12em; min-width: 48px; text-align: center; }

/* ================= 按钮 ================= */
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 40px; border-radius: 10px; font-weight: 700; font-size: 16px;
  color: #000; background: linear-gradient(90deg, #D4AF37, #F3E5AB, #D4AF37);
  background-size: 200% 100%;
  box-shadow: 0 0 22px rgba(212,175,55,.22);
  transition: transform .25s, box-shadow .25s, background-position .5s;
}
.btn-gold:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 40px rgba(212,175,55,.5); background-position: 100% 0; }
.btn-gold:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-gold.sm, .btn-ghost.sm { padding: 9px 22px; font-size: 14px; border-radius: 8px; }
.btn-gold.full { width: 100%; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 40px; border-radius: 10px; font-weight: 600; font-size: 16px;
  color: var(--gold); border: 1px solid var(--gold-dim);
  background: var(--gold-soft); transition: all .25s;
}
.btn-ghost:hover { background: rgba(212,175,55,.14); transform: translateY(-2px); }

/* ================= 工坊布局 ================= */
#view-workspace { flex-direction: row; }

.sidebar {
  width: 232px; min-width: 232px; background: var(--panel);
  border-right: 1px solid var(--line); padding: 14px 12px;
  overflow-y: auto; flex-shrink: 0;
}
.sb-head {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--gold-dim); border-radius: 11px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(212,175,55,.07), transparent);
}
.sb-head-icon {
  width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--gold-dim);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.sb-head-icon svg { width: 16px; height: 16px; }
.sb-head b { display: block; font-size: 12px; letter-spacing: .1em; color: #fff; }
.sb-head i {
  font-style: normal; font-size: 10px; letter-spacing: .2em; color: var(--green);
  display: flex; align-items: center; gap: 4px;
}
.sb-head i::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .3; } }
.sb-group {
  font-size: 11px; letter-spacing: .26em; color: var(--txt3);
  margin: 15px 6px 9px;
}
.tool {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 13px 6px; margin-bottom: 8px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  color: var(--txt2); transition: all .2s;
}
.tool svg { width: 19px; height: 19px; opacity: .72; }
.tool b { font-size: 13px; font-weight: 600; }
.tool i { font-style: normal; font-size: 9px; letter-spacing: .12em; color: var(--txt3); }
.tool:hover { border-color: var(--line2); color: #fff; }
.tool.active {
  border-color: var(--gold-dim); background: var(--gold-soft); color: var(--gold);
  box-shadow: 0 0 18px rgba(212,175,55,.1);
}
.tool.active svg, .tool.active i { opacity: 1; color: var(--gold); }

/* ---- 分组卡片式布局（浮雕圆雕：两列网格，参考原站） ---- */
.sb-group--card {
  margin: 18px 0 10px; padding: 11px 8px; text-align: center;
  font-size: 13.5px; font-weight: 700; letter-spacing: .22em; color: var(--gold);
  border: 1px solid var(--line2); border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.sb-tools--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sb-tools--grid .tool {
  margin-bottom: 0; padding: 12px 6px 11px; gap: 6px; min-height: 84px;
  border-radius: 12px; border-color: var(--line2);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  justify-content: center;
}
.sb-tools--grid .tool b, .sb-tools--grid .tool i {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-tools--grid .tool svg {
  width: 42px; height: 42px; padding: 0; border-radius: 0;
  background: none; border: 0;
  opacity: 1; box-sizing: border-box;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.42));
}
.sb-tools--grid .tool b { font-size: 11.5px; letter-spacing: .02em; }
.sb-tools--grid .tool i { font-size: 9px; letter-spacing: .1em; }
.sb-tools--grid .tool:last-child:nth-child(odd) { grid-column: auto; }
.sb-tools--grid .tool.active { border-color: rgba(255,255,255,.35); }
.sb-tools--grid .tool.active svg { border: 0; background: none; filter: drop-shadow(0 3px 9px rgba(0,0,0,.55)); }

/* ================= AI 对话：右侧创作控制中心 ================= */
.chat-rail {
  width: 296px; min-width: 296px; flex-shrink: 0;
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.cr-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cr-head-ico { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--gold); }
.cr-head-ico svg { width: 17px; height: 17px; }
.cr-head b { font-size: 15px; letter-spacing: .04em; }
.cr-body { flex: 1; overflow-y: auto; padding: 14px; }
.cr-temp {
  border: 1px solid var(--line2); border-radius: 12px; padding: 14px 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.cr-temp-title { display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 13.5px; font-weight: 600; }
.cr-temp-title svg { width: 15px; height: 15px; }
.cr-temp-title em { font-style: normal; font-size: 11.5px; color: var(--txt2); font-weight: 400; }
.cr-temp-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 8px; font-size: 11.5px; color: var(--txt2); }
.cr-temp-row b {
  font-size: 12.5px; font-weight: 700; color: var(--gold);
  background: rgba(212,175,55,.12); border-radius: 6px; padding: 2px 9px;
}
#temp-range { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; border-radius: 99px; background: rgba(255,255,255,.16); outline: none; }
#temp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.18); cursor: pointer;
}
#temp-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold); cursor: pointer; }
.cr-note { margin: 12px 0 0; font-size: 11px; line-height: 1.85; color: var(--txt3); }
.cr-sect { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.cr-sect-t { display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .06em; color: var(--txt2); }
.cr-sect-t svg { width: 14px; height: 14px; color: var(--gold); }
.cr-clear {
  font-size: 11px; color: var(--txt2); border: 1px solid var(--line2);
  border-radius: 7px; padding: 4px 9px; background: rgba(255,255,255,.03);
}
.cr-clear:hover { color: var(--gold); border-color: var(--gold-dim); }
.cr-list { display: flex; flex-direction: column; gap: 9px; }
.cr-item {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  padding: 12px 11px; border-radius: 11px; border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  transition: border-color .2s, transform .2s, background .2s;
}
.cr-item:hover { border-color: rgba(212,175,55,.4); transform: translateY(-1px); }
.cr-item.active { border-color: var(--gold-dim); background: rgba(212,175,55,.07); }
.cr-item-ico {
  width: 30px; height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid rgba(212,175,55,.25); background: rgba(212,175,55,.08); color: var(--gold);
}
.cr-item-ico svg { width: 15px; height: 15px; }
.cr-item-main { flex: 1; min-width: 0; }
.cr-item-main b { display: block; font-size: 13px; font-weight: 600; color: var(--txt); }
.cr-item-main i {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; font-style: normal; font-size: 11px; line-height: 1.65; color: var(--txt3);
}
.cr-item.active .cr-item-main b { color: var(--gold); }
.cr-item-bolt { color: var(--gold); font-size: 12px; }

/* 对话区 */
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 26px 28px 12px; display: flex; flex-direction: column; gap: 18px; }

/* AI 对话模式：参数面板由底部输入栏取代 */
#view-workspace.chat-mode .params { display: none; }
#view-workspace.chat-mode .stage-main {
  align-items: stretch; justify-content: stretch; padding: 0; background-image: none;
}
#view-workspace.chat-mode .chat-view { width: 100%; }
#view-workspace.chat-mode .stage-corner { display: none; }

/* ---- 底部对话输入栏 ---- */
.chat-composer { flex-shrink: 0; padding: 8px 24px 12px; background: linear-gradient(180deg, rgba(20,20,24,0), var(--panel2) 42%); }
.cc-box {
  max-width: 780px; margin: 0 auto; padding: 13px 13px 10px;
  background: #15151a; border: 1px solid rgba(255,255,255,.1); border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0,0,0,.46), inset 0 1px 0 rgba(255,255,255,.05);
  transition: border-color .2s, box-shadow .2s;
}
.cc-box:focus-within {
  border-color: rgba(212,175,55,.5);
  box-shadow: 0 14px 36px rgba(0,0,0,.5), 0 0 0 3px rgba(212,175,55,.09);
}
#chat-input {
  display: block; width: 100%; min-height: 26px; max-height: 168px; resize: none;
  background: transparent; border: 0; outline: none; padding: 2px 4px 0;
  color: var(--txt); font-family: inherit; font-size: 14px; line-height: 1.8;
}
#chat-input::placeholder { color: var(--txt3); }
.cc-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.cc-left { display: flex; align-items: center; gap: 7px; }
.cc-ico {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: var(--txt2); border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035);
  transition: color .2s, border-color .2s, background .2s;
}
.cc-ico:hover { color: var(--gold); border-color: rgba(212,175,55,.4); background: rgba(212,175,55,.07); }
.cc-ico svg { width: 15px; height: 15px; }
.cc-right { display: flex; align-items: center; gap: 12px; }
.cc-hint { font-size: 11px; color: var(--txt3); white-space: nowrap; }
.cc-hint b {
  font-weight: 600; color: var(--txt2); font-size: 10.5px; letter-spacing: .01em;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px; padding: 1px 5px;
}
.cc-send {
  display: flex; align-items: center; gap: 6px; height: 33px; padding: 0 16px;
  border-radius: 9px; font-size: 13.5px; font-weight: 700; color: #241b06;
  background: linear-gradient(180deg, #eacb6b, #c8a03a);
  box-shadow: 0 4px 14px rgba(212,175,55,.22);
  transition: filter .2s, transform .12s;
}
.cc-send:hover { filter: brightness(1.06); }
.cc-send:active { transform: translateY(1px); }
.cc-send:disabled { opacity: .55; cursor: default; filter: none; }
.cc-send svg { width: 14px; height: 14px; }
.cc-note { max-width: 780px; margin: 9px auto 0; text-align: center; font-size: 10.5px; color: var(--txt3); letter-spacing: .02em; }
@media (max-width: 860px) {
  .chat-composer { padding: 8px 12px 10px; }
  .cc-hint { display: none; }
}
.chat-intro { margin: auto; text-align: center; color: var(--txt3); }
.chat-intro .ci-ico {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line2); color: var(--gold);
}
.chat-intro .ci-ico svg { width: 26px; height: 26px; }
.chat-intro p { color: var(--txt2); font-size: 14px; }
.chat-intro small { display: block; margin-top: 8px; font-size: 11.5px; }
.msg { display: flex; gap: 11px; max-width: 860px; }
.msg.user { flex-direction: row-reverse; align-self: flex-end; }
.msg-av {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.msg.ai .msg-av { background: linear-gradient(180deg, rgba(212,175,55,.92), rgba(138,109,31,.92)); color: #1a1405; }
.msg.user .msg-av { background: rgba(255,255,255,.1); color: var(--txt2); }
.msg-col { min-width: 0; }
.msg-name { display: block; font-size: 10.5px; letter-spacing: .08em; color: var(--txt3); margin-bottom: 6px; }
.msg.user .msg-name { text-align: right; }
.msg-body {
  padding: 12px 15px; border-radius: 12px; font-size: 13.5px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word;
}
.msg.ai .msg-body { background: rgba(255,255,255,.045); border: 1px solid var(--line2); color: var(--txt); }
.msg.user .msg-body { background: rgba(212,175,55,.1); border: 1px solid rgba(212,175,55,.24); color: #f4e7bd; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: tdot 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 1240px) { .chat-rail { display: none !important; } }

/* ---- 参数面板 ---- */
.params {
  width: 296px; min-width: 296px; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  overflow-y: auto; flex-shrink: 0;
}
.params-head { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.params-head h3 { font-size: 17px; font-weight: 700; color: #fff; }
.params-head small { font-size: 12px; color: var(--txt3); letter-spacing: .12em; }
.params-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 17px; flex: 1; }
.f-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 700; color: var(--txt2);
  letter-spacing: .12em; margin-bottom: 8px;
}
.rand {
  display: flex; align-items: center; gap: 5px; color: var(--gold);
  font-size: 13px; font-weight: 600; letter-spacing: 0;
}
.rand svg { width: 12px; height: 12px; }
.rand:hover { color: #fff; }
textarea {
  width: 100%; height: 100px; padding: 11px 13px; border-radius: 9px;
  background: var(--panel2); border: 1px solid rgba(255,255,255,.1);
  color: var(--txt); font-size: 15px; line-height: 1.7;
  resize: none; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(212,175,55,.18); }
textarea::placeholder { color: #374151; }
.char-count { text-align: right; font-size: 12px; color: var(--txt3); margin-top: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  padding: 6px 12px; font-size: 13px; border-radius: 7px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--txt3); transition: all .2s;
}
.chip:hover { border-color: var(--gold-dim); color: var(--gold); }
.chip.on {
  background: var(--gold-soft); border-color: var(--gold-dim);
  color: var(--gold); font-weight: 600;
}
.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opt {
  padding: 9px 4px; text-align: center; border-radius: 8px;
  border: 1px solid var(--line); color: var(--txt3);
  line-height: 1.3; transition: all .18s;
}
.opt b { display: block; font-size: 14px; font-weight: 600; }
.opt i { font-style: normal; font-size: 11px; opacity: .72; }
.opt:hover { border-color: var(--line2); color: var(--txt2); }
.opt.sel { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 700; }
.opt.sel i { opacity: .85; }

.gen-btn {
  margin-top: auto; width: 100%; min-height: 48px; padding: 14px;
  border-radius: 11px; font-weight: 800; font-size: 17px; color: #000;
  background: linear-gradient(90deg, #D4AF37, #F3E5AB, #D4AF37);
  background-size: 200% 100%;
  box-shadow: 0 0 22px rgba(212,175,55,.22);
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: all .25s;
}
.gen-btn svg { width: 16px; height: 16px; }
.gen-btn .cost { font-size: 14px; font-weight: 700; opacity: .72; }
.gen-btn:hover:not(:disabled) { box-shadow: 0 0 38px rgba(212,175,55,.5); transform: translateY(-1px); background-position: 100% 0; }
.gen-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.gen-hint { text-align: center; font-size: 12px; color: var(--txt3); letter-spacing: .1em; margin-top: 8px; }

/* ---- 主舞台 ---- */
.stage { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--panel2); }
.stage-top {
  height: 46px; min-height: 46px; display: flex; align-items: center;
  gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.sys-ready {
  display: flex; align-items: center; gap: 7px; color: var(--green);
  font-size: 12px; letter-spacing: .1em; white-space: nowrap;
}
.sys-ready::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
.task-name { color: var(--txt3); letter-spacing: .05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-top .spacer { flex: 1; }
.model-select {
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  color: var(--txt2); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; outline: none; max-width: 160px; cursor: pointer;
}
.model-select:hover { border-color: var(--gold-dim); color: var(--gold); }
.model-select option { background: #111; color: var(--txt); }
.btn-hist {
  display: flex; align-items: center; gap: 6px; padding: 8px 13px;
  border-radius: 8px; font-size: 13px; color: var(--txt2);
  border: 1px solid transparent; transition: all .2s; white-space: nowrap;
}
.btn-hist svg { width: 13px; height: 13px; }
.btn-hist:hover, .btn-hist.open { color: var(--gold); background: rgba(255,255,255,.05); }

.stage-main {
  flex: 1; position: relative; display: flex; align-items: center;
  justify-content: center; overflow: hidden; padding: 20px;
  background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 26px 26px;
}
.stage-corner { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 8px; z-index: 4; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(0,0,0,.5); color: var(--txt3);
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

/* 空态 */
.placeholder { text-align: center; color: var(--txt3); user-select: none; }
.placeholder .ph-icon {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.22);
}
.placeholder .ph-icon svg { width: 26px; height: 26px; }
.placeholder p { font-size: 14px; color: var(--txt2); }
.placeholder small { display: block; font-size: 12px; opacity: .65; margin-top: 7px; }

/* 生成中 */
.progress-wrap { width: min(460px, 76%); text-align: center; }
.progress-title { font-size: 14px; color: var(--txt2); margin-bottom: 4px; }
.progress-sub { font-size: 12px; color: var(--txt3); }
.progress-bar {
  height: 3px; border-radius: 2px; overflow: hidden; margin: 18px 0 12px;
  background: rgba(255,255,255,.08);
}
.progress-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  box-shadow: 0 0 14px rgba(212,175,55,.7);
  transition: width .35s ease;
}
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt2); }
.progress-meta b { color: var(--gold); }
.progress-steps { display: flex; justify-content: space-between; margin-top: 22px; }
.pstep {
  flex: 1; font-size: 11px; color: var(--txt3);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pstep::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,.15); transition: all .3s;
}
.pstep.done { color: var(--txt2); }
.pstep.done::before { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,.7); }
.pstep.now { color: var(--gold); font-weight: 600; }
.pstep.now::before { background: var(--gold); animation: pulse 1s infinite; }

/* 流式思考区 */
.think-box {
  margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  font-size: 12px; color: var(--txt3); line-height: 1.8;
  max-height: 96px; overflow: hidden; text-align: left;
  font-family: Monaco, "Courier New", monospace;
  white-space: pre-wrap; word-break: break-all;
}

/* 结果 */
.result-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; }
/* 缩放查看容器：边框阴影移到容器上，内部裁切 */
.zoom-stage {
  position: relative; overflow: hidden; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 24px 70px rgba(0,0,0,.75), 0 0 46px rgba(212,175,55,.07);
  line-height: 0; cursor: grab; touch-action: none; background: #050505;
}
.zoom-stage:active { cursor: grabbing; }
.zoom-stage img {
  max-width: 100%; max-height: 62vh; user-select: none;
  -webkit-user-drag: none; will-change: transform; transform-origin: 0 0;
}
.zoom-bar {
  position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 2px;
  background: rgba(10,10,12,.8); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px;
  opacity: 0; transition: opacity .2s; z-index: 5; line-height: 1;
}
.zoom-stage:hover .zoom-bar, .zoom-stage:active .zoom-bar, .zoom-stage.zoomed .zoom-bar { opacity: 1; }
.zoom-bar button {
  width: 26px; height: 26px; display: grid; place-items: center;
  color: var(--txt2); border-radius: 6px; font-size: 16px; background: none;
}
.zoom-bar button:hover { color: var(--gold); background: rgba(255,255,255,.07); }
.zoom-bar .zpct { min-width: 46px; text-align: center; font-size: 12px; color: var(--txt2); cursor: pointer; }
.zoom-bar .zpct:hover { color: var(--gold); }
.zoom-hint { font-size: 11px; color: var(--txt3); letter-spacing: .5px; }
.result-caption { text-align: center; }
.result-caption b { display: block; font-size: 16px; color: #fff; font-weight: 600; }
.result-caption span { font-size: 12px; color: var(--txt3); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ra-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 17px;
  border-radius: 8px; font-size: 13px; color: var(--txt2);
  border: 1px solid var(--line); background: rgba(0,0,0,.45);
  transition: all .2s; white-space: nowrap;
}
.ra-btn svg { width: 13px; height: 13px; }
.ra-btn:hover { color: var(--gold); border-color: var(--gold-dim); }
.ra-btn.full { width: 100%; justify-content: center; }
.ra-btn.on { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-soft); }

/* ---- 工作区内查看历史作品 ---- */
.work-wrap {
  width: min(940px, 100%); max-height: 100%;
  overflow-y: auto; padding: 2px 6px 52px 2px;   /* 底部让开左下角悬浮按钮 */
  gap: 12px; scrollbar-width: thin;
}
.work-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .6px; color: var(--gold);
  border: 1px solid var(--gold-dim); background: var(--gold-soft);
  padding: 3px 11px; border-radius: 99px; white-space: nowrap;
}
.work-chip svg { width: 12px; height: 12px; }
/* 展示画面尽量占满画布：高度随窗口自适应，宽度不超过容器 */
.work-wrap .zoom-stage img { max-height: min(56vh, calc(100vh - 330px)); max-width: 100%; }
.work-wrap .result-caption b { font-size: 17px; }
.work-prompt {
  width: min(760px, 100%); text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.02); padding: 10px 14px;
}
.work-prompt b {
  display: block; font-size: 11px; font-weight: 500;
  color: var(--txt3); letter-spacing: .6px; margin-bottom: 5px;
}
.work-prompt p {
  font-size: 12.5px; color: var(--txt2); line-height: 1.75;
  max-height: 62px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  scrollbar-width: thin;
}
.work-noimg {
  width: min(420px, 100%); min-height: 200px; padding: 26px 20px;
  border-radius: 12px; border: 1px dashed var(--line2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--txt3); text-align: center;
}
.work-noimg svg { width: 34px; height: 34px; opacity: .5; }
.work-noimg b { font-size: 13px; color: var(--txt2); font-weight: 600; }
.work-noimg small { font-size: 11px; opacity: .8; }

/* ---- 历史面板 ---- */
.history {
  width: 0; min-width: 0; background: var(--panel);
  border-left: 1px solid transparent; overflow: hidden;
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: width .3s ease, min-width .3s ease, border-color .3s;
}
.history.open { width: 272px; min-width: 272px; border-left-color: var(--line); }
.hist-head {
  padding: 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.hist-head b { display: flex; align-items: center; gap: 8px; font-size: 15px; white-space: nowrap; }
.hist-head b svg { width: 15px; height: 15px; color: var(--gold); }
.hist-close { color: var(--txt3); font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.hist-close:hover { color: #fff; background: rgba(255,255,255,.06); }
.hist-scope {
  margin-left: auto; margin-right: 4px; font-size: 12px; color: var(--gold);
  border: 1px solid var(--gold-dim); background: var(--gold-soft);
  padding: 3px 9px; border-radius: 20px; cursor: pointer; transition: all .2s; white-space: nowrap;
}
.hist-scope:hover { background: rgba(212,175,55,.18); }
.hist-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.hist-foot { padding: 12px; border-top: 1px solid var(--line); flex-shrink: 0; }
.hist-item {
  border: 1px solid var(--line); border-radius: 11px; padding: 11px;
  background: rgba(255,255,255,.02); cursor: pointer; transition: all .2s;
}
.hist-item:hover { border-color: var(--gold-dim); background: var(--gold-soft); }
.hist-item.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold-dim), 0 0 18px rgba(212,175,55,.12);
}
.hist-item.active .hi-name { color: var(--gold); }
.hist-thumb {
  width: 100%; height: 84px; border-radius: 8px; object-fit: cover;
  margin-bottom: 9px; background: #111;
}
.hi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; }
.hi-name {
  font-size: 13px; font-weight: 600; color: var(--txt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hi-status { font-size: 11px; padding: 3px 8px; border-radius: 99px; white-space: nowrap; flex-shrink: 0; }
.st-done { color: var(--green); background: rgba(34,197,94,.12); }
.st-run { color: var(--gold); background: var(--gold-soft); }
.st-fail { color: var(--red); background: rgba(239,68,68,.12); }
.hi-meta { font-size: 11px; color: var(--txt3); display: flex; justify-content: space-between; gap: 8px; }
.hi-prompt {
  font-size: 11px; color: var(--txt3); margin-top: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; color: var(--txt3); padding: 30px 16px;
  text-align: center;
}
.empty-state svg { width: 36px; height: 36px; opacity: .38; }
.empty-state b { font-size: 14px; color: var(--txt2); font-weight: 500; }
.empty-state small { font-size: 12px; opacity: .7; }

/* ================= 画廊 / 个人作品网格 ================= */
#view-gallery { flex-direction: column; padding: 28px 36px 36px; overflow-y: auto; }
.gal-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.gal-head h2 { font-size: 24px; color: #fff; font-weight: 600; }
.gal-head p { font-size: 13px; color: var(--txt3); margin-top: 6px; }
.gal-grid {
  display: grid; gap: 15px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.gal-card {
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: var(--panel); cursor: pointer; transition: all .25s;
}
.gal-card:hover { border-color: var(--gold-dim); transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.gal-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; background: #0d0d0d; display: block; }
.gal-body { padding: 12px 14px 14px; }
.gal-body b {
  display: block; font-size: 14px; color: var(--txt); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-body .gal-sub {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 11px; color: var(--txt3); margin-top: 7px;
}
.gal-body .likes { color: var(--gold); display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.gal-badge {
  display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 99px;
  border: 1px solid var(--gold-dim); color: var(--gold); margin-top: 8px;
}
.loading-inline {
  grid-column: 1 / -1; text-align: center; padding: 40px 0;
  color: var(--txt3); font-size: 13px;
}

/* ================= 个人中心 ================= */
#view-profile { flex-direction: column; padding: 30px 36px 40px; overflow-y: auto; }
.profile-wrap { display: flex; flex-direction: column; gap: 28px; }
.pf-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 30px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(160deg, rgba(212,175,55,.07), transparent 55%), var(--panel);
}
.pf-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dk));
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; color: #000; font-family: var(--serif);
}
.pf-name { font-size: 20px; font-weight: 600; color: #fff; }
.pf-id { font-size: 12px; color: var(--txt3); letter-spacing: .1em; }
.pf-stats { display: flex; gap: 52px; margin: 14px 0 6px; }
.pf-stats > div { text-align: center; }
.pf-stats b { display: block; font-size: 25px; font-weight: 700; color: var(--gold); font-family: var(--serif); }
.pf-stats span { font-size: 12px; color: var(--txt3); letter-spacing: .18em; }
.pf-works-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 14px; flex-wrap: wrap;
}
.pf-works-head h3 { font-size: 18px; color: #fff; font-weight: 600; }

/* ================= 会员 / 教程 / 占位页 ================= */
#view-pricing, #view-tutorial { flex-direction: column; padding: 34px 36px 44px; overflow-y: auto; }
.page-head { margin-bottom: 26px; }
.page-head h2 { font-size: 25px; color: #fff; font-weight: 600; }
.page-head p { font-size: 14px; color: var(--txt3); margin-top: 7px; }
.page-note { margin-top: 22px; font-size: 12px; color: var(--txt3); }
.price-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.price-card {
  border: 1px solid var(--line); border-radius: 15px; padding: 24px;
  background: var(--panel); position: relative; transition: all .25s;
}
.price-card.hot { border-color: var(--gold-dim); background: linear-gradient(160deg, rgba(212,175,55,.08), transparent 60%), var(--panel); }
.price-card h4 { font-size: 16px; color: #fff; font-weight: 600; }
.price-card .amount { font-size: 33px; font-weight: 700; color: var(--gold); font-family: var(--serif); margin: 12px 0 4px; }
.price-card .amount small { font-size: 14px; color: var(--txt3); font-weight: 400; margin-left: 4px; }
.price-card ul { list-style: none; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 10px; }
.price-card li { font-size: 13px; color: var(--txt2); display: flex; align-items: center; gap: 8px; }
.price-card li::before { content: "✓"; color: var(--gold); font-weight: 700; }
.price-tag {
  position: absolute; top: 16px; right: 16px; font-size: 11px; padding: 3px 9px;
  border-radius: 99px; background: var(--gold); color: #000; font-weight: 700;
}
.tut-grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.tut-card {
  border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  background: var(--panel);
}
.tut-card .num { font-size: 13px; color: var(--gold); letter-spacing: .22em; }
.tut-card h4 { font-size: 16px; color: #fff; margin: 10px 0 9px; font-weight: 600; }
.tut-card p { font-size: 13px; color: var(--txt3); line-height: 1.85; }
#view-placeholder { align-items: center; justify-content: center; }
.placeholder-page { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pp-icon {
  width: 72px; height: 72px; border-radius: 18px; border: 1px dashed var(--line2);
  display: flex; align-items: center; justify-content: center; color: var(--gold); opacity: .8;
}
.pp-icon svg { width: 30px; height: 30px; }
.placeholder-page h2 { font-size: 22px; color: #fff; font-weight: 600; }
.placeholder-page p { font-size: 14px; color: var(--txt3); margin-bottom: 10px; }

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,.78); backdrop-filter: blur(6px);
}
.modal-mask.show { display: flex; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; background: #0b0b0b; border: 1px solid var(--line2);
  border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.85);
  animation: popIn .28s cubic-bezier(.2,.9,.3,1.2); max-height: 92vh; overflow: auto;
}
@keyframes popIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 8px; color: var(--txt3); font-size: 16px; z-index: 3;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.07); }

/* 登录 */
.login-modal { width: min(430px, 100%); padding: 34px 32px 30px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .logo-badge { margin: 0 auto 14px; width: 48px; height: 48px; font-size: 25px; }
.login-brand h2 { font-family: var(--serif); font-size: 23px; letter-spacing: .14em; color: #fff; font-weight: 600; }
.login-brand h2 i { font-style: normal; color: var(--gold); }
.login-brand p { font-size: 13px; color: var(--txt3); margin-top: 8px; }
.tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 11px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); margin-bottom: 22px;
}
.tab {
  flex: 1; padding: 9px 4px; border-radius: 8px; font-size: 13px;
  color: var(--txt3); font-weight: 500; transition: all .2s; white-space: nowrap;
}
.tab:hover { color: var(--txt2); }
.tab.active { background: var(--gold-soft); color: var(--gold); font-weight: 700; }
.tab-pane { display: none; flex-direction: column; gap: 14px; }
.tab-pane.active { display: flex; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12px; color: var(--txt2); font-weight: 600; letter-spacing: .06em; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--panel2); border: 1px solid rgba(255,255,255,.11);
  color: var(--txt); font-size: 15px; outline: none; transition: all .2s;
}
.field input:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 1px rgba(212,175,55,.18); }
.field input::placeholder { color: #374151; }
.field input:disabled { opacity: .55; }
.code-field { position: relative; }
.code-field input { padding-right: 118px; }
.code-btn {
  position: absolute; right: 6px; bottom: 6px; top: 30px;
  padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--gold); background: var(--gold-soft); border: 1px solid var(--gold-dim);
  transition: all .2s; white-space: nowrap;
}
.code-btn:hover:not(:disabled) { background: rgba(212,175,55,.2); }
.code-btn:disabled { opacity: .45; cursor: not-allowed; color: var(--txt3); border-color: var(--line); background: rgba(255,255,255,.03); }
.field-err { font-size: 12px; color: var(--red); margin-top: -6px; min-height: 0; }
.field-err:empty { display: none; }
.login-tip { font-size: 12px; color: var(--txt3); line-height: 1.7; text-align: center; }
.login-err {
  margin-top: 14px; padding: 10px 13px; border-radius: 9px; font-size: 13px;
  color: #fca5a5; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.28);
  line-height: 1.6;
}
.login-err:empty { display: none; }

/* 作品详情 */
.detail-modal { width: min(960px, 100%); }
.detail-body { display: flex; gap: 0; flex-wrap: wrap; }
.detail-img {
  flex: 1 1 420px; min-width: 300px; background: #060606;
  display: flex; align-items: center; justify-content: center; padding: 26px;
  overflow: hidden; touch-action: none; cursor: grab; border-radius: 12px;
}
.detail-img:active { cursor: grabbing; }
.detail-img img {
  max-width: 100%; max-height: 66vh; border-radius: 12px;
  user-select: none; -webkit-user-drag: none; will-change: transform; transform-origin: 0 0;
}
.detail-info { flex: 1 1 320px; padding: 34px 30px 30px; display: flex; flex-direction: column; gap: 16px; }
.detail-info h2 { font-size: 22px; color: #fff; font-weight: 600; padding-right: 34px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-meta span {
  font-size: 12px; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--txt3); background: rgba(255,255,255,.03);
}
.detail-prompt {
  font-size: 13px; color: var(--txt2); line-height: 1.85;
  padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.025); max-height: 150px; overflow-y: auto;
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: auto; }

/* 确认弹窗 */
.confirm-modal { width: min(400px, 100%); padding: 28px; text-align: center; }
.confirm-modal h3 { font-size: 18px; color: #fff; margin-bottom: 12px; font-weight: 600; }
.confirm-modal p { font-size: 14px; color: var(--txt2); line-height: 1.8; margin-bottom: 24px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns button { flex: 1; }

/* ================= Toast / Loading ================= */
#toast {
  position: fixed; top: 78px; left: 50%; z-index: 500;
  transform: translateX(-50%) translateY(-14px); opacity: 0;
  padding: 11px 22px; border-radius: 11px; font-size: 14px;
  color: var(--gold); background: rgba(18,18,18,.97);
  border: 1px solid var(--gold-dim); pointer-events: none;
  box-shadow: 0 14px 40px rgba(0,0,0,.6); transition: all .3s;
  max-width: min(560px, 90vw); text-align: center; line-height: 1.6;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { color: #fca5a5; border-color: rgba(239,68,68,.4); }

.loading-mask {
  position: fixed; inset: 0; z-index: 600; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(0,0,0,.72); backdrop-filter: blur(3px);
  color: var(--txt2); font-size: 14px;
}
.loading-mask.show { display: flex; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(212,175,55,.2); border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 自适应 ================= */
@media (max-width: 1180px) {
  .history.open { width: 236px; min-width: 236px; }
  .params { width: 270px; min-width: 270px; }
}
@media (max-width: 860px) {
  #view-workspace { flex-direction: column; }
  .sidebar {
    width: 100%; min-width: 0; border-right: none;
    border-bottom: 1px solid var(--line); display: flex; gap: 8px;
    padding: 10px; overflow-x: auto; overflow-y: hidden; max-height: 78px;
  }
  .sb-head, .sb-group, .sb-group--card { display: none; }
  /* 窄屏侧栏为横向滚动条：网格容器与分组容器转为 contents，所有工具并成一行 */
  #tools-group1, .sb-tools, .sb-tools--grid { display: contents; }
  .sb-tools--grid .tool { min-height: 0; padding: 8px 12px; justify-content: flex-start; margin-bottom: 0; }
  .sb-tools--grid .tool svg { width: 24px; height: 24px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
  .tool { width: auto; min-width: 88px; flex: 0 0 auto; margin-bottom: 0; padding: 8px 12px; }
  .params { width: 100%; min-width: 0; max-height: 42vh; border-right: none; border-bottom: 1px solid var(--line); }
  .history { position: absolute; right: 0; top: 0; bottom: 0; z-index: 30; background: #0b0b0b; }
  .history.open { width: 84vw; min-width: 84vw; }
  #view-gallery, #view-profile, #view-pricing, #view-tutorial { padding: 20px 16px 28px; }
  .header-right .pill.gold span { display: none; }
  /* 首页移动端 */
  .home-inner { padding: 18px 18px 14px; }
  .hero-title { margin: 12px 0 0; font-size: 31px; line-height: 1.5; }
  .hero-cta { position: static; transform: none; margin: 18px 0 0 18px; }
  .home-lead { position: static; margin-top: 16px; }
  .carousel-stage { top: 44%; width: 94%; height: 26vh; perspective: 900px; }
  .carousel .c-card { width: 78px; margin-left: -39px; }
  .home-bottom { left: 18px; right: 18px; bottom: 12px; }
  .detail-info { padding: 24px 20px; }
}

/* ==================== 图片上传区（v2 新增） ==================== */
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  border: 1.5px dashed var(--line2);
  border-radius: 10px;
  padding: 18px 12px;
  cursor: pointer;
  color: var(--txt3);
  transition: border-color .18s, color .18s, background .18s;
  margin-bottom: 14px;
}
.upload-zone:hover { border-color: var(--gold); color: var(--txt2); background: rgba(212,175,55,.03); }
.upload-zone svg { width: 26px; height: 26px; opacity: .6; }
.upload-zone b { font-size: 13.5px; font-weight: 550; color: var(--txt2); }
.upload-zone i { font-size: 11.5px; font-style: normal; opacity: .7; }
.upload-zone.has-img { border-style: solid; padding: 8px; }
.upload-zone.has-img img {
  width: 100%; max-height: 150px; object-fit: contain;
  border-radius: 7px; background: #000;
}
.upload-zone input[type=file] { display: none; }

/* 视频结果 */
.result-video {
  width: 100%; max-width: 520px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000;
  display: block;
  margin: 0 auto 14px;
}

/* ==================== 视频创作面板 ==================== */
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-card {
  padding: 12px 8px; text-align: center; border-radius: 10px;
  border: 1px solid var(--line); color: var(--txt3);
  line-height: 1.45; transition: all .18s; background: rgba(0,0,0,.25);
}
.mode-card b { display: block; font-size: 14px; font-weight: 600; color: inherit; }
.mode-card i { font-style: normal; font-size: 11px; opacity: .75; }
.mode-card:hover { border-color: var(--line2); color: var(--txt2); }
.mode-card.sel {
  border-color: var(--gold); color: var(--gold);
  background: var(--gold-soft); box-shadow: 0 0 0 1px var(--gold-dim) inset;
}
.mode-card.sel i { opacity: .9; }
.v-tip { display: block; font-size: 11.5px; color: var(--txt3); margin: 8px 0 12px; }
.frame-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.frame-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-height: 96px; padding: 10px 6px;
  border: 1.5px dashed var(--line2); border-radius: 10px;
  color: var(--txt3); cursor: pointer; transition: border-color .18s, color .18s;
  overflow: hidden;
}
.frame-slot:hover { border-color: var(--gold); color: var(--txt2); }
.frame-slot svg { width: 20px; height: 20px; opacity: .6; }
.frame-slot b { font-size: 11.5px; font-weight: 550; }
.frame-slot.has-img { border-style: solid; padding: 4px; }
.frame-slot.has-img img { width: 100%; height: 78px; object-fit: cover; border-radius: 7px; }
.frame-slot.disabled { opacity: .38; cursor: not-allowed; }
.frame-slot.disabled:hover { border-color: var(--line2); color: var(--txt3); }
.frame-tag {
  position: absolute; left: 6px; top: 6px; font-style: normal;
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  background: rgba(0,0,0,.6); color: var(--gold); border: 1px solid var(--gold-dim);
}
.frame-clear {
  position: absolute; right: 6px; top: 6px; width: 20px; height: 20px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 1;
}
.frame-clear:hover { background: rgba(220,60,60,.8); }
.v-select {
  width: 100%; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px;
  border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--txt1);
  font-size: 12.5px; outline: none; cursor: pointer;
}
.v-select:focus { border-color: var(--gold-dim); }

/* ==================== 生成等待粒子特效 ==================== */
.progress-wrap.fx-mode { width: 100%; max-width: 100%; }
.fx-stage {
  position: relative; width: 100%; height: 60vh; max-height: 640px;
  border-radius: 14px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #343434 0%, #292929 55%, #1f1f1f 100%);
  border: 1px solid rgba(255,255,255,.06);
}
.fx-stage canvas { width: 100%; height: 100%; display: block; }
.fx-overlay {
  position: absolute; left: 0; right: 0; bottom: 26px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 24px; pointer-events: none;
}
.fx-overlay .progress-title { font-size: 16px; color: #f0f0f0; letter-spacing: 1px; margin-bottom: 2px; }
.fx-overlay .progress-bar { width: min(340px, 70%); background: rgba(255,255,255,.14); border-radius: 99px; }
.fx-overlay .progress-sub { color: #9a9a9a; }

/* ==================== 全屏最大化预览（Lightbox） ==================== */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  background: rgba(4,4,5,.94);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 28px;
}
.lightbox.show { display: flex; animation: lbIn .22s ease-out; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
body.lb-open { overflow: hidden; }

.lightbox-stage {
  position: relative; overflow: hidden;
  width: 100%; height: 100%; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  line-height: 0; cursor: grab; touch-action: none;
}
.lightbox-stage:active { cursor: grabbing; }
.lightbox-stage img {
  max-width: 100%; max-height: 100%; border-radius: 6px;
  user-select: none; -webkit-user-drag: none;
  will-change: transform; transform-origin: 0 0;
  box-shadow: 0 30px 90px rgba(0,0,0,.8);
  animation: lbImgIn .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes lbImgIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; } }

/* 工具条常显 */
.lightbox-stage .zoom-bar { opacity: 1; right: 14px; bottom: 14px; }

.lb-close {
  position: absolute; top: 16px; right: 20px; z-index: 10;
  width: 40px; height: 40px; display: grid; place-items: center;
  font-size: 27px; line-height: 1; color: var(--txt2);
  border-radius: 50%; background: rgba(20,20,22,.7);
  border: 1px solid var(--line); transition: all .18s;
}
.lb-close:hover { color: #fff; background: rgba(40,40,44,.9); transform: rotate(90deg); }

.lb-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  font-size: 12px; color: var(--txt3); letter-spacing: .6px; white-space: nowrap;
  pointer-events: none; background: rgba(10,10,12,.6); padding: 5px 14px; border-radius: 99px;
}

@media (max-width: 640px) {
  .lightbox { padding: 12px; }
  .lb-close { top: 10px; right: 12px; width: 36px; height: 36px; font-size: 23px; }
  .lightbox-stage .zoom-bar { right: 8px; bottom: 8px; }
  .lb-hint { bottom: 52px; font-size: 11px; }
}

/* ==================== AI 生成内容标识 ==================== */
.ai-tag {
  position: absolute; left: 12px; bottom: 12px; z-index: 6;
  font-size: 12px; line-height: 1; letter-spacing: .5px;
  color: rgba(255,255,255,.92);
  background: rgba(0,0,0,.45);
  padding: 5px 9px; border-radius: 5px;
  pointer-events: none; user-select: none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.12);
}
.lightbox-stage .ai-tag { left: 18px; bottom: 18px; z-index: 12; }
.detail-img .ai-tag { left: 10px; bottom: 10px; }


/* ==================== 顶栏管理后台入口 ==================== */
@media (max-width: 900px) { #btn-admin span { display: none; } }

/* 工具卡片角标：标注只出概念图、不产出真模型的工具 */
.tool { position: relative; }
.tool .tool-tag {
  position: absolute; top: 6px; right: 6px;
  font-style: normal; font-size: 10px; line-height: 1;
  padding: 3px 5px; border-radius: 6px;
  background: rgba(201, 162, 39, .16); color: #8a6d0b;
  border: 1px solid rgba(201, 162, 39, .35);
  pointer-events: none;
}
