/* ============================================================
   AI出图集成系统 — 出图工作台  · 设计系统
   暖色深色调，珊瑚/琥珀强调色，作品集质感
   ============================================================ */

:root {
  /* surfaces — warm near-black, layered */
  --bg:        #0b0a09;
  --bg-grad-1: #15110d;
  --bg-grad-2: #0b0a09;
  --panel:     #131210;
  --panel-2:   #1a1815;
  --panel-3:   #221f1b;
  --inset:     #0e0d0b;

  /* hairlines */
  --line:      rgba(255, 246, 235, 0.07);
  --line-2:    rgba(255, 246, 235, 0.12);
  --line-strong: rgba(255, 246, 235, 0.18);

  /* text */
  --tx:        #f6f1ea;
  --tx-2:      #b8b0a6;
  --tx-3:      #837b71;
  --tx-4:      #565049;

  /* brand — warm coral→amber */
  --a1:        #ff9a5a;   /* amber  */
  --a2:        #ff6f61;   /* coral  */
  --a3:        #ff8d7a;
  --accent-soft: rgba(255, 122, 90, 0.14);
  --accent-line: rgba(255, 122, 90, 0.38);
  --grad:      linear-gradient(135deg, #ffb070 0%, #ff7e61 52%, #ff6585 100%);
  --grad-dim:  linear-gradient(135deg, rgba(255,176,112,.16), rgba(255,101,133,.16));

  --good:      #5fd6a0;

  /* radii */
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 15px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 50px -28px rgba(0,0,0,.9);
  --shadow-pop:  0 30px 80px -32px rgba(0,0,0,.85);
  --glow:        0 12px 34px -12px rgba(255,120,90,.55);

  --ease: cubic-bezier(.22,.61,.36,1);

  --font: "Plus Jakarta Sans", -apple-system, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--tx);
  background:
    radial-gradient(1200px 700px at 14% -8%, rgba(255,128,84,.10), transparent 60%),
    radial-gradient(1000px 800px at 100% 0%, rgba(255,101,133,.06), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2) 38%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: .1px;
}
::selection { background: rgba(255,122,90,.32); color: #fff; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,246,235,.10); border-radius: 20px;
  border: 3px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,246,235,.18); background-clip: padding-box; }

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 296px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.side {
  position: relative;
  display: flex; flex-direction: column;
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, rgba(20,17,14,.72), rgba(11,10,9,.72));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 13px; padding: 2px 6px 0; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--grad);
  box-shadow: var(--glow), 0 0 0 1px rgba(255,255,255,.18) inset;
  font-weight: 800; font-size: 19px; color: #2a140c; letter-spacing: -1px;
  flex-shrink: 0;
}
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.brand-sub  { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; font-weight: 500; }

/* segmented tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin-top: 22px; padding: 4px;
  background: var(--inset); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.tab {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
  color: var(--tx-3); transition: color .18s var(--ease);
}
.tab svg { width: 15px; height: 15px; }
.tab.on { color: #2a140c; }
.tab .pill {
  position: absolute; inset: 0; border-radius: 10px; z-index: -1;
  background: var(--grad); box-shadow: var(--glow);
}

.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--tx-4); margin: 24px 8px 10px; display: flex; align-items: center; gap: 8px;
}
.side-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* preset list */
.presets { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.preset {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--r-sm); text-align: left;
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.preset + .preset { margin-top: 2px; }
.preset:hover { background: rgba(255,246,235,.045); }
.preset.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.preset.dim { opacity: .42; }
.preset.dim:hover { opacity: .7; }

.thumb {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  position: relative; overflow: hidden;
}
.thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.16), transparent 50%);
}
.preset-body { flex: 1; min-width: 0; }
.preset-name {
  font-size: 13px; font-weight: 600; color: var(--tx);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.preset.on .preset-name { color: var(--tx); }
.preset-meta { font-size: 11px; color: var(--tx-4); margin-top: 1px; }
.count {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--tx-3); background: rgba(255,246,235,.05);
}
.preset.on .count { color: var(--a1); background: rgba(255,122,90,.16); }

/* footer / status */
.side-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  color: var(--tx-2); background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.settings-btn:hover { border-color: var(--line-2); background: var(--panel-3); }
.settings-btn svg { width: 16px; height: 16px; opacity: .8; }

.status {
  margin-top: 12px; display: flex; flex-direction: column; gap: 7px;
  font-size: 11.5px;
}
.status-row { display: flex; align-items: center; gap: 8px; color: var(--tx-3); }
.status-row b { color: var(--tx-2); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(95,214,160,.16); }
.kbd { color: var(--tx-4); font-variant-numeric: tabular-nums; }

/* ============================================================
   MAIN
   ============================================================ */
.main { overflow-y: auto; padding: 30px 38px 48px; }
.main-inner { max-width: 1280px; margin: 0 auto; }

/* page header */
.head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.head-l { flex: 1; min-width: 0; }
.h-title { font-size: 27px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.h-desc  { font-size: 13.5px; color: var(--tx-2); margin: 9px 0 0; line-height: 1.6; max-width: 720px; }
.h-meta  { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 11px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--tx-2);
  background: var(--panel-2); border: 1px solid var(--line);
}
.chip svg { width: 13px; height: 13px; opacity: .7; }
.chip b { color: var(--tx); }
.chip.accent { color: var(--a1); border-color: var(--accent-line); background: var(--accent-soft); }

/* layout grid */
.grid { display: grid; grid-template-columns: 384px 1fr; gap: 22px; align-items: start; }

/* ---------- form card ---------- */
.card {
  background: linear-gradient(180deg, rgba(26,24,21,.9), rgba(17,15,13,.9));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.form { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.lab { font-size: 12px; font-weight: 700; color: var(--tx-2); letter-spacing: .2px; display: flex; align-items: center; gap: 5px; }
.req { color: var(--a2); }
.hint { font-size: 11.5px; color: var(--tx-4); line-height: 1.5; margin-top: -2px; }

.inp, .sel {
  width: 100%; height: 42px; padding: 0 13px;
  background: var(--inset); border: 1px solid var(--line);
  border-radius: var(--r-sm); color: var(--tx); font-size: 13.5px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
textarea.inp { height: auto; min-height: 76px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.inp::placeholder { color: var(--tx-4); }
.inp:focus, .sel:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #100e0c;
}
.inp.err { border-color: rgba(255,111,97,.65); box-shadow: 0 0 0 3px rgba(255,111,97,.16); }

.sel-wrap { position: relative; }
.sel { appearance: none; padding-right: 34px; cursor: pointer; }
.sel-wrap svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--tx-3); pointer-events: none; }

.row3 { display: grid; grid-template-columns: 1.5fr 1fr 0.8fr; gap: 12px; }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.btn-primary {
  flex: 1; height: 46px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 800;
  color: #2a140c; background: var(--grad); box-shadow: var(--glow);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .14s var(--ease), box-shadow .16s var(--ease), filter .16s var(--ease);
}
.btn-primary svg { width: 17px; height: 17px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 40px -12px rgba(255,120,90,.7); filter: saturate(1.05); }
.btn-primary:active { transform: translateY(0); }
.btn-primary[disabled] { filter: grayscale(.5) brightness(.8); box-shadow: none; cursor: not-allowed; transform: none; }
.btn-ghost {
  height: 46px; padding: 0 18px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 700;
  color: var(--tx-2); background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.btn-ghost svg { width: 15px; height: 15px; }
.btn-ghost:hover { border-color: var(--line-2); color: var(--tx); background: var(--panel-3); }

/* prompt preview drawer inside card */
.prompt-box {
  margin: 0 22px 22px; padding: 15px 16px; border-radius: var(--r-md);
  background: var(--inset); border: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.7; color: var(--tx-2);
  animation: rise .3s var(--ease) both;
}
.prompt-box .pb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.pb-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--a1); }
.pb-copy { font-size: 11.5px; color: var(--tx-3); display: flex; align-items: center; gap: 5px; }
.pb-copy:hover { color: var(--tx); }
.prompt-box code { color: var(--tx); background: rgba(255,122,90,.1); padding: 1px 6px; border-radius: 5px; font-family: inherit; }

/* ---------- result panel ---------- */
.result {
  min-height: 560px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(20,18,16,.6), rgba(13,12,10,.6));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.result-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.result-head h3 { margin: 0; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.result-head h3 .sq { width: 8px; height: 8px; border-radius: 3px; background: var(--grad); }
.runstat { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--tx-3); }
.runstat b { color: var(--tx); font-variant-numeric: tabular-nums; }
.runstat .live { color: var(--a1); }
.result-body { flex: 1; padding: 22px; display: flex; }

/* empty state */
.empty { margin: auto; text-align: center; max-width: 460px; }
.empty-frame {
  width: 132px; aspect-ratio: 4/3; margin: 0 auto 22px; border-radius: var(--r-md);
  border: 1.5px dashed var(--line-strong); display: grid; place-items: center;
  background: radial-gradient(120px 80px at 50% 30%, rgba(255,122,90,.1), transparent 70%);
  position: relative;
}
.empty-frame svg { width: 34px; height: 34px; color: var(--tx-3); }
.empty-frame .spark {
  position: absolute; width: 18px; height: 18px; color: var(--a1);
  top: -8px; right: -8px; animation: twinkle 2.6s var(--ease) infinite;
}
.empty h4 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.empty p { margin: 0; font-size: 13px; color: var(--tx-3); line-height: 1.65; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.ex {
  padding: 8px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--tx-2);
  background: var(--panel-2); border: 1px solid var(--line);
  transition: all .16s var(--ease);
}
.ex:hover { color: var(--tx); border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }

/* result grid */
.gallery { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; align-content: start; }
.shot {
  border-radius: var(--r-md); overflow: hidden; position: relative;
  border: 1px solid var(--line); background: var(--inset);
  animation: rise .45s var(--ease) both;
}
.shot .canvas { aspect-ratio: 3/2; position: relative; overflow: hidden; }
.shot .canvas::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 40%);
  mix-blend-mode: overlay;
}
.shot-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.shot-cap { font-size: 11.5px; color: var(--tx-3); }
.shot-cap b { color: var(--tx-2); font-weight: 600; }
.shot-acts { display: flex; gap: 6px; opacity: 0; transform: translateY(4px); transition: all .18s var(--ease); }
.shot:hover .shot-acts { opacity: 1; transform: none; }
.ico-btn { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--tx-2); background: var(--panel-3); border: 1px solid var(--line); transition: all .15s var(--ease); }
.ico-btn:hover { color: var(--tx); border-color: var(--accent-line); background: var(--accent-soft); }
.ico-btn svg { width: 14px; height: 14px; }
.shot .badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 9px; border-radius: 7px; font-size: 10.5px; font-weight: 700;
  background: rgba(8,7,6,.66); backdrop-filter: blur(6px); color: var(--tx); border: 1px solid var(--line-2);
}

/* skeleton */
.sk { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--inset); }
.sk .canvas { aspect-ratio: 3/2; background:
  linear-gradient(100deg, transparent 20%, rgba(255,246,235,.06) 40%, transparent 60%) var(--inset);
  background-size: 240% 100%; animation: shimmer 1.25s linear infinite; }
.sk .bar { height: 9px; margin: 12px; border-radius: 5px; background: rgba(255,246,235,.06); width: 60%; }

/* ---------- history gallery ---------- */
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.hcard {
  border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line);
  background: var(--panel); box-shadow: var(--shadow-card);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.hcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.hcard .canvas { aspect-ratio: 3/2; position: relative; }
.hcard .canvas::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 55%, rgba(7,6,5,.7)); }
.hcard-foot { padding: 12px 14px; }
.hcard-title { font-size: 13px; font-weight: 700; }
.hcard-sub { font-size: 11.5px; color: var(--tx-4); margin-top: 3px; display:flex; gap:8px; }

/* floating help */
.fabs { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 12px; z-index: 30; }
.fab { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--tx-2);
  background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); transition: all .16s var(--ease); }
.fab:hover { color: var(--tx); border-color: var(--accent-line); transform: translateY(-2px); }
.fab svg { width: 18px; height: 18px; }

/* animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -140% 0; } }
@keyframes twinkle { 0%,100% { opacity: .4; transform: scale(.85) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(12deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
  .result { min-height: 460px; }
}

/* ---------- theme toggle (sidebar) ---------- */
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 10px;
  background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md);
}
.seg-opt {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  color: var(--tx-3); transition: color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.seg-opt svg { width: 14px; height: 14px; }
.seg-opt:hover { color: var(--tx-2); }
.seg-opt.on { color: var(--tx); background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg-opt.on svg { color: var(--a1); }

/* ============================================================
   LIGHT THEME
   ============================================================ */
html[data-theme="light"] {
  --bg:        #f6f2eb;
  --bg-grad-1: #fbf8f2;
  --bg-grad-2: #f1ece3;
  --panel:     #ffffff;
  --panel-2:   #f4efe7;
  --panel-3:   #ebe4d9;
  --inset:     #f1ece3;

  --line:        rgba(60, 45, 28, 0.10);
  --line-2:      rgba(60, 45, 28, 0.16);
  --line-strong: rgba(60, 45, 28, 0.24);

  --tx:  #2b2620;
  --tx-2: #5f574c;
  --tx-3: #8c8275;
  --tx-4: #b4aa9b;

  --accent-soft: rgba(255, 110, 80, 0.12);
  --accent-line: rgba(255, 110, 80, 0.42);

  --shadow-card: 0 1px 0 rgba(255,255,255,.7) inset, 0 16px 38px -24px rgba(80,58,36,.45);
  --shadow-pop:  0 26px 64px -28px rgba(80,58,36,.40);
  --glow:        0 12px 28px -12px rgba(255,120,90,.42);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1200px 700px at 14% -8%, rgba(255,150,92,.16), transparent 60%),
    radial-gradient(1000px 800px at 100% 0%, rgba(255,120,140,.09), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2) 40%);
}
html[data-theme="light"] *::-webkit-scrollbar-thumb { background: rgba(60,45,28,.16); background-clip: padding-box; }
html[data-theme="light"] *::-webkit-scrollbar-thumb:hover { background: rgba(60,45,28,.28); background-clip: padding-box; }
html[data-theme="light"] ::selection { background: rgba(255,122,90,.26); color: #2b2620; }

html[data-theme="light"] .side {
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(250,246,239,.62));
}
html[data-theme="light"] .card {
  background: linear-gradient(180deg, #ffffff, #fbf8f3);
}
html[data-theme="light"] .result {
  background: linear-gradient(180deg, #ffffff, #faf6f0);
}
html[data-theme="light"] .inp:focus,
html[data-theme="light"] .sel:focus { background: #ffffff; }
html[data-theme="light"] .shot .badge {
  background: rgba(255,255,255,.82); color: #2b2620; border-color: rgba(60,45,28,.14);
}
html[data-theme="light"] .empty-frame {
  background: radial-gradient(120px 80px at 50% 30%, rgba(255,122,90,.14), transparent 70%);
}
html[data-theme="light"] .brand-mark { color: #3a1d10; }

/* ============================================================
   本应用补充：真实图片 / 弹层 / 设置 / 历史分页 / 提示
   （沿用上方设计系统的变量与类名）
   ============================================================ */
.hidden { display: none !important; }

/* 结果图块用真实 <img> 替换占位 canvas */
.shot img { width: 100%; height: auto; display: block; cursor: zoom-in; background: var(--inset); }
.shot.failed .canvas { aspect-ratio: 3/2; display: grid; place-items: center; gap: 8px; text-align: center; padding: 16px; color: var(--a2); font-size: 12px; line-height: 1.5; background: var(--inset); }
.shot.failed .canvas .big { font-size: 24px; }

/* 历史卡片用真实图片 */
.hcard .himg { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: var(--inset); cursor: zoom-in; }
.hcard .himg.failed { display: grid; place-items: center; color: var(--a2); font-size: 11px; text-align: center; padding: 10px; }

/* 表单提示信息 */
.form-msg { margin: 10px 22px 0; font-size: 12.5px; min-height: 16px; }
.form-msg.err { color: var(--a2); } .form-msg.ok { color: var(--good); }

/* 未配置 key 横幅 */
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--a1);
  border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 18px; font-size: 13px; font-weight: 600; }
.banner button { background: var(--grad); color: #2a140c; border-radius: var(--r-sm); padding: 8px 16px; font-weight: 700; box-shadow: var(--glow); }

/* 分页 */
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 26px 0 4px; font-size: 12.5px; color: var(--tx-3); }
.pager button { background: var(--panel-2); border: 1px solid var(--line); color: var(--tx); border-radius: var(--r-sm); padding: 8px 16px; font-weight: 600; }
.pager button:hover:not(:disabled) { border-color: var(--accent-line); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 弹层（图片放大 / 设置 / prompt 详情） ---------- */
.lb { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 28px; animation: rise .2s var(--ease) both; }
.lb-bg { position: absolute; inset: 0; background: rgba(6,5,4,.74); backdrop-filter: blur(5px); }
.lb-card { position: relative; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); box-shadow: var(--shadow-pop); max-width: 1060px; width: 96%; max-height: 92vh; overflow-y: auto; padding: 24px; }
.lb-x { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--tx-2); background: var(--panel-3); border: 1px solid var(--line); font-size: 18px; z-index: 2; }
.lb-x:hover { color: var(--tx); border-color: var(--accent-line); }
.lb-img { width: 100%; border-radius: var(--r-md); background: var(--inset); max-height: 80vh; object-fit: contain; }
.lb-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
@media (max-width: 760px) { .lb-grid { grid-template-columns: 1fr; } }
.lb-card h3 { margin: 0 0 14px; font-size: 18px; font-weight: 800; }
.kv { font-size: 12.5px; margin-bottom: 9px; color: var(--tx-2); }
.kv b { color: var(--tx-3); font-weight: 500; margin-right: 5px; }
.det-prompt { background: var(--inset); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; font-size: 12px;
  white-space: pre-wrap; max-height: 240px; overflow-y: auto; line-height: 1.65; color: var(--tx-2); margin-top: 6px; }

/* 设置面板字段（复用 .field/.inp/.sel/.lab） */
.set-grid { display: flex; flex-direction: column; gap: 16px; }
.set-row { display: flex; gap: 10px; align-items: flex-end; }
.set-row .field { flex: 1; }
.model-pick select { width: 100%; height: 40px; margin-top: 8px; background: var(--inset); color: var(--tx);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 10px; }
.set-msg { font-size: 12px; min-height: 16px; margin-top: 4px; }
.set-msg.err { color: var(--a2); } .set-msg.ok { color: var(--good); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--tx-2); cursor: pointer; margin: 8px 0 4px; }
.clear-link { color: var(--a2); cursor: pointer; }

/* ---------- 参考图上传（拖拽 / 点击 / 粘贴） ---------- */
.ref-block { margin-top: 16px; }
.ref-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ref-head .lab { font-size: 12px; font-weight: 700; color: var(--tx-2); }
.ref-head .ref-tip { font-size: 11px; color: var(--tx-4); }
.ref-zone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  padding: 16px; display: grid; place-items: center; gap: 6px; text-align: center;
  color: var(--tx-3); cursor: pointer; transition: all .16s var(--ease);
  background: radial-gradient(140px 70px at 50% 0%, rgba(255,122,90,.06), transparent 70%);
}
.ref-zone:hover, .ref-zone.drag { border-color: var(--accent-line); color: var(--tx-2); background: var(--accent-soft); }
.ref-zone svg { width: 22px; height: 22px; opacity: .7; }
.ref-zone .rz-main { font-size: 12.5px; font-weight: 600; }
.ref-zone .rz-sub { font-size: 11px; color: var(--tx-4); }
.ref-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ref-thumb { position: relative; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-2); background: var(--inset); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  background: rgba(8,7,6,.7); color: #fff; font-size: 14px; line-height: 1; border: 1px solid var(--line-2); }
.ref-thumb .rm:hover { background: var(--a2); }
.ref-note { font-size: 11.5px; color: var(--good); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
