/* 迈锐生图工作台 · 暗色影棚风格（2026-11-13 重新设计）
   思路：做图的地方，画面是主角。界面退到深色里，只留一条琥珀色的主线（和迈锐 OA 登录页同一个色系）。
   工作台一屏放完：左边是“怎么做”（提示词、参考图、全部用下拉的选项、生成），右边是“做出来的”（大画面 + 底下一条胶片）。 */
:root {
  color-scheme: dark;
  --bg: #08090c; --panel: #101216; --panel-2: #161920; --panel-3: #1d2129;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13); --line-3: rgba(255, 255, 255, .22);
  --text: #eef0f4; --soft: #c3c8d2; --muted: #8a92a0; --dim: #5b6270;
  --gold: #ffb547; --gold-2: #ff7a45; --gold-soft: rgba(255, 181, 71, .12); --gold-line: rgba(255, 181, 71, .38);
  --grad: linear-gradient(135deg, #ffc266 0%, #ff9a4a 55%, #ff7a45 100%);
  --ok: #5fd39a; --ok-soft: rgba(95, 211, 154, .12); --err: #ff7b7b; --err-soft: rgba(255, 107, 107, .11); --warn: #ffb547;
  --r: 14px; --r-s: 10px;
  --shadow: 0 24px 70px -18px rgba(0, 0, 0, .75), 0 2px 10px rgba(0, 0, 0, .35);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  color: var(--text); font: 14px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(255, 150, 70, .10), transparent 62%),
    radial-gradient(900px 600px at 105% 110%, rgba(70, 110, 255, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
h1, h3, h4 { margin: 0; font-weight: 600; }
h4 { font-size: 12px; color: var(--muted); letter-spacing: .06em; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #ffd08a; }
img { max-width: 100%; }
input, select, textarea, button { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(255, 181, 71, .32); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }
[hidden] { display: none !important; }

/* ---------- 通用 ---------- */
input[type=text], input[type=number], input[type=search], input[type=date], input[type=month], select, textarea {
  border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 7px 11px; background: var(--panel-2); color: var(--text); min-width: 0; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a92a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(255, 181, 71, .13); }
input[type=checkbox] { accent-color: var(--gold); width: 15px; height: 15px; vertical-align: -2px; }
textarea { width: 100%; resize: vertical; }
.num { width: 92px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.pre { white-space: pre-wrap; word-break: break-word; margin: 0 0 12px; }
.clip { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clip2 { max-width: 420px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; margin: 18px 0; }
.empty, .boot { color: var(--muted); text-align: center; padding: 48px 12px; }
.why { color: var(--err); }
.note { color: var(--gold); background: var(--gold-soft); border-radius: 8px; padding: 6px 10px; margin: 0; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 16px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.dim { opacity: .5; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--soft); border-radius: var(--r-s); padding: 7px 15px; cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s, color .15s, transform .08s; }
.btn:hover { border-color: var(--line-3); background: var(--panel-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #1f1206; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); color: #1f1206; }
.btn.danger { color: var(--err); border-color: rgba(255, 123, 123, .3); }
.btn.danger:hover { background: var(--err-soft); }
.btn.small { padding: 4px 11px; font-size: 12px; border-radius: 8px; }
.btn.big { padding: 12px 18px; font-size: 15px; width: 100%; border-radius: 12px; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--gold); cursor: pointer; padding: 0; font-size: 12px; font-weight: 400; }
.link:hover { color: #ffd08a; }
.x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.x:hover { color: var(--text); }

/* ---------- 顶栏 ---------- */
.top { display: flex; align-items: center; gap: 16px; height: 56px; flex: none; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(10, 11, 14, .72); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: .02em; }
.brand:hover { color: var(--text); }
.brand img { width: 26px; height: 26px; }
.top nav { display: flex; gap: 2px; margin-left: 10px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.top nav a { padding: 4px 14px; border-radius: 8px; color: var(--muted); font-size: 13px; transition: color .15s, background .15s; }
.top nav a:hover { color: var(--text); }
.top nav a.on { background: rgba(255, 255, 255, .09); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(95, 211, 154, .22); border-radius: 999px; padding: 2px 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip.warn { background: var(--gold-soft); color: var(--gold); border-color: var(--gold-line); }
.who { color: var(--soft); font-size: 13px; }
.banner { background: var(--gold-soft); color: var(--gold); padding: 8px 20px; border-bottom: 1px solid rgba(255, 181, 71, .2); font-size: 13px; flex: none; }
.banner.err { background: var(--err-soft); color: var(--err); border-color: rgba(255, 123, 123, .22); }
.main { padding: 22px; max-width: 1500px; margin: 0 auto; width: 100%; }
.foot { text-align: center; padding: 5px 12px; font-size: 11px; flex: none; line-height: 1.4; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--muted); }

/* ---------- 登录 ---------- */
.login { flex: 1; min-height: 76vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card, .plain-box { background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)); border: 1px solid var(--line-2); border-radius: 22px; padding: 44px 36px 36px; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow); }
.login-card .logo { width: 60px; height: 60px; margin-bottom: 16px; filter: drop-shadow(0 10px 26px rgba(255, 140, 60, .45)); }
.login-card h1, .plain-box h1 { font-size: 22px; margin-bottom: 8px; letter-spacing: .04em; }
.login-card .btn { margin-top: 22px; }
body.plain { align-items: center; justify-content: center; }
.plain-box .btn { margin: 6px 3px 0; }

/* ---------- 工作台：一屏放完 ---------- */
.wb { flex: 1; min-height: 0; display: grid; grid-template-columns: 448px minmax(0, 1fr); gap: 14px; }
.composer { min-height: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.cmp-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.cmp-foot { flex: none; padding: 12px 16px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .22); display: grid; gap: 9px; }
.sec-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); letter-spacing: .06em; margin-bottom: 7px; }
.sec-label .tools { display: inline-flex; gap: 14px; letter-spacing: 0; }

.prompt-box { flex: 1 1 150px; min-height: 132px; display: flex; flex-direction: column; }
.prompt-wrap { flex: 1; min-height: 0; position: relative; display: flex; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(0, 0, 0, .28); transition: border-color .15s, box-shadow .15s; }
.prompt-wrap:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(255, 181, 71, .12); }
.prompt { flex: 1; border: 0 !important; background: none !important; box-shadow: none !important; resize: none; padding: 12px 14px 26px; font-size: 14.5px; line-height: 1.7; border-radius: 14px; }
.prompt-count { position: absolute; right: 12px; bottom: 7px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; pointer-events: none; }

.refs { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding-bottom: 2px; }
.ref { width: 52px; height: 52px; flex: none; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--line-2); background: var(--panel-2); }
.ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref .x { position: absolute; top: 0; right: 0; background: rgba(0, 0, 0, .68); color: #fff; border-radius: 0 0 0 8px; font-size: 15px; padding: 0 5px 1px; opacity: 0; transition: opacity .12s; }
.ref:hover .x { opacity: 1; }
.ref.add { border: 1px dashed var(--line-3); font-size: 22px; font-weight: 300; color: var(--muted); cursor: pointer; background: none; display: flex; align-items: center; justify-content: center; transition: border-color .15s, color .15s, background .15s; }
.ref.add:hover { border-color: var(--gold-line); color: var(--gold); background: var(--gold-soft); }
.ref.gone::after { content: "已清理"; font-size: 10px; color: var(--muted); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.refs-tip { color: var(--dim); font-size: 12px; white-space: nowrap; }

.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opts .span2 { grid-column: span 2; }
.opts .span3 { grid-column: 1 / -1; }
/* 下拉：标签在上、选中的值在下 */
.dd { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; height: 52px; padding: 6px 30px 7px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .035); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; min-width: 0; }
.dd:hover { border-color: var(--line-3); background: rgba(255, 255, 255, .06); }
.dd.open { border-color: var(--gold-line); background: rgba(255, 181, 71, .06); box-shadow: 0 0 0 3px rgba(255, 181, 71, .11); }
.dd-label { grid-column: 1 / -1; font-size: 11px; color: var(--muted); letter-spacing: .05em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-value { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 7px; min-width: 0; }
.dd-value.unset { color: var(--muted); font-weight: 400; }
.dd-side { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dd::after { content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .18s, margin .18s, border-color .15s; }
.dd.open::after { transform: rotate(225deg); margin-top: -1px; border-color: var(--gold); }
.dd-input { height: 52px; padding: 6px 12px 7px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .035); display: grid; align-content: center; transition: border-color .15s, box-shadow .15s; }
.dd-input:focus-within { border-color: var(--gold-line); box-shadow: 0 0 0 3px rgba(255, 181, 71, .11); }
.dd-input input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0; font-size: 14px; font-weight: 500; width: 100%; }
.shape { display: inline-block; flex: none; border: 1.5px solid currentColor; border-radius: 2.5px; opacity: .75; }

/* 下拉弹出的菜单（挂在 body 上，不会被左边的滚动区裁掉） */
.menu { position: fixed; z-index: 30; overflow-y: auto; padding: 6px; border-radius: 14px; background: rgba(26, 29, 37, .96); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5); animation: pop .13s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.menu-tip { padding: 6px 10px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 380px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; border-radius: 9px; padding: 8px 10px; cursor: pointer; color: var(--soft); min-height: 36px; }
.menu-item:hover:not(:disabled) { background: rgba(255, 255, 255, .07); color: var(--text); }
.menu-item.on { background: var(--gold-soft); color: var(--text); }
.menu-item .mi-main { flex: 1; min-width: 0; display: grid; }
.menu-item b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-item .mi-badge { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.menu-item .mi-check { width: 14px; height: 8px; flex: none; border-left: 2px solid transparent; border-bottom: 2px solid transparent; transform: rotate(-45deg) translateY(-2px); }
.menu-item.on .mi-check { border-color: var(--gold); }
.menu-item:disabled { opacity: .4; }
.menu-item .shape { color: var(--muted); }
.menu-item.on .shape { color: var(--gold); }

.cost { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); min-height: 19px; }
.cost b { color: var(--text); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.cost .why { text-align: right; }
.go { height: 50px; border: 0; border-radius: 14px; background: var(--grad); color: #1f1206; font-size: 16px; font-weight: 700; letter-spacing: .3em; text-indent: .3em; cursor: pointer; box-shadow: 0 12px 34px -10px rgba(255, 140, 60, .65), inset 0 1px 0 rgba(255, 255, 255, .35); transition: filter .15s, transform .08s, box-shadow .2s; }
.go:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 16px 40px -10px rgba(255, 140, 60, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.go:active:not(:disabled) { transform: translateY(1px); }
.go:disabled { background: var(--panel-3); color: var(--dim); box-shadow: none; opacity: 1; }
.fine { font-size: 11px; color: var(--dim); line-height: 1.5; margin: 0; }

/* 右边：大画面 + 胶片 */
.stage { min-height: 0; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #0c0d11; }
.viewer { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.4px) 0 0 / 22px 22px, radial-gradient(700px 420px at 50% 42%, rgba(255, 170, 90, .055), transparent 70%); }
.blank { text-align: center; color: var(--muted); max-width: 380px; }
.blank .mark { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 22px; border: 1px solid var(--line-2); background: linear-gradient(145deg, rgba(255, 181, 71, .16), rgba(255, 122, 69, .04)); display: flex; align-items: center; justify-content: center; }
.blank .mark i { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); filter: blur(.3px); box-shadow: 0 0 34px rgba(255, 150, 70, .7); }
.blank b { display: block; color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 6px; letter-spacing: .04em; }
.shot { position: relative; max-width: 100%; max-height: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.shot img { max-width: 100%; max-height: 100%; height: 100%; width: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07); cursor: zoom-in; background: var(--panel-2); animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: scale(.985) translateY(6px); } to { opacity: 1; transform: none; } }
.viewer-bar { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 15px; border-radius: 14px; background: rgba(14, 16, 21, .78); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.viewer-bar .meta { flex: 1; min-width: 0; display: grid; }
.viewer-bar .meta b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .meta span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-bar .acts { display: flex; gap: 6px; flex: none; }
.viewer.has-bar { padding-bottom: 82px; }
.viewer-tag { position: absolute; left: 16px; top: 14px; font-size: 12px; color: var(--soft); background: rgba(14, 16, 21, .7); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tiles { width: 100%; height: 100%; display: grid; gap: 12px; }
.tiles.n1 { grid-template-columns: minmax(0, 1fr); }
.tiles.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles.n3, .tiles.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.tiles.tall.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.tiles.tall.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.viewer.has-tag { padding-top: 52px; }
.tile { position: relative; min-height: 0; min-width: 0; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; }
.tile.img { padding: 0; border-color: transparent; background: none; cursor: zoom-in; }
.tile.img img { max-width: 100%; max-height: 100%; height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px -18px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .07); animation: rise .35s ease-out; }
.tile.busy::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 190, 110, .075) 50%, transparent 70%); background-size: 220% 100%; animation: sweep 1.9s linear infinite; }
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.tile.bad { border-color: rgba(255, 123, 123, .25); background: var(--err-soft); }
.tile .t-title { font-size: 14px; font-weight: 600; position: relative; }
.tile .t-sub { font-size: 12px; color: var(--muted); max-width: 320px; position: relative; }
.tile.bad .t-sub { color: #ffb1b1; }
.ring { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .1); border-top-color: var(--gold); border-right-color: var(--gold-2); animation: spin 1s linear infinite; position: relative; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: min(220px, 70%); height: 3px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: var(--grad); transition: width .5s; }
.bang { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 123, 123, .18); color: var(--err); font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; }

.film { flex: none; height: 92px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .3); overflow-x: auto; }
.film-label { flex: none; font-size: 11px; color: var(--dim); letter-spacing: .08em; writing-mode: vertical-rl; margin-right: 2px; }
.frame { flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; padding: 0; position: relative; display: flex; align-items: center; justify-content: center; transition: transform .12s, border-color .15s, box-shadow .15s; }
.frame:hover { transform: translateY(-2px); border-color: var(--line-3); }
.frame.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 181, 71, .28), 0 8px 22px -8px rgba(255, 150, 70, .55); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame .ring { width: 22px; height: 22px; border-width: 2px; }
.frame.bad { border-color: rgba(255, 123, 123, .4); background: var(--err-soft); color: var(--err); font-weight: 700; }
.frame .n { position: absolute; right: 3px; bottom: 3px; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 5px; background: rgba(0, 0, 0, .7); color: var(--soft); }
.film-more { flex: none; margin-left: auto; padding-left: 10px; font-size: 12px; white-space: nowrap; }
.film-empty { color: var(--dim); font-size: 12px; }

/* ---------- 提示词模板弹窗 ---------- */
.pick { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.pick-main { flex: 1; text-align: left; border: 0; background: none; padding: 10px 6px; cursor: pointer; display: grid; border-radius: 8px; }
.pick-main:hover { background: rgba(255, 255, 255, .05); }

/* ---------- 图库 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; position: relative; transition: transform .15s, border-color .15s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); border-color: var(--line-3); box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .8); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--panel-2); }
.card figcaption { padding: 10px 12px 12px; font-size: 12px; }
.card figcaption b { font-weight: 600; }
.card.picked { outline: 2px solid var(--gold); outline-offset: 2px; }
.badge { position: absolute; top: 9px; left: 9px; background: rgba(255, 181, 71, .92); color: #1f1206; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(4, 5, 8, .68); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: #14171d; border: 1px solid var(--line-2); border-radius: 18px; max-width: 480px; width: 100%; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-box.wide { max-width: 1120px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 18px; overflow: auto; }
.detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(290px, 1fr); gap: 20px; }
.detail-img { background: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.4px) 0 0 / 20px 20px, #0c0d11; border-radius: 14px; display: flex; align-items: center; justify-content: center; min-height: 260px; padding: 14px; }
.detail-img img { max-height: 74vh; border-radius: 10px; box-shadow: 0 20px 60px -18px rgba(0, 0, 0, .9); }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0 0 14px; font-size: 13px; }
.detail dt { color: var(--muted); white-space: nowrap; }
.detail dd { margin: 0; word-break: break-word; }
.detail .banner { border-radius: 10px; border: 0; margin-bottom: 12px; padding: 7px 11px; }
.prompt-text { background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; max-height: 180px; overflow: auto; }
.form .field, .field { display: grid; gap: 5px; margin-bottom: 12px; }
.field span { font-size: 12px; color: var(--muted); }
.field.line { grid-template-columns: 220px auto 1fr; align-items: center; gap: 12px; }
.field.line span { font-size: 13px; color: var(--text); }
.field.line em { font-style: normal; color: var(--muted); font-size: 12px; }

/* ---------- 我的、管理 ---------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--gold); border-color: var(--gold); font-weight: 600; }
.box, .stat { background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .018)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.box { margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { display: grid; gap: 3px; }
.stat span { color: var(--muted); font-size: 12px; letter-spacing: .05em; }
.stat b { font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; background: rgba(255, 255, 255, .025); letter-spacing: .04em; }
tbody tr:hover td { background: rgba(255, 255, 255, .022); }
tr:last-child td { border-bottom: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 3px 14px; }
.checks label { white-space: nowrap; font-size: 12px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 130px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 6px; margin-bottom: 20px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.bar-col i { width: 100%; background: var(--grad); border-radius: 3px 3px 0 0; min-height: 1px; opacity: .9; }
.bar-col span { font-size: 10px; color: var(--dim); }

#toasts { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 40; pointer-events: none; justify-items: center; }
.toast { background: rgba(30, 34, 43, .95); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 18px; max-width: 86vw; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); animation: pop .16s ease-out; }
.toast.err { border-color: rgba(255, 123, 123, .45); color: #ffc9c9; background: rgba(56, 22, 24, .95); }

/* 工作台这一页：整页不滚动，内容卡在一屏里 */
html[data-page="wb"] body { height: 100vh; height: 100dvh; overflow: hidden; }
html[data-page="wb"] .main { flex: 1; min-height: 0; max-width: none; padding: 14px 14px 4px; display: flex; }

@media (max-width: 900px) {
  html[data-page="wb"] body { height: auto; overflow: auto; }
  html[data-page="wb"] .main { display: block; padding: 12px; }
  .wb { display: flex; flex-direction: column; }
  .opts { grid-template-columns: 1fr 1fr; }
  .opts .span2 { grid-column: 1 / -1; }
  .cmp-body { overflow: visible; }
  .prompt-box { flex: none; height: 190px; }
  .stage { height: 78vh; }
  .detail { grid-template-columns: 1fr; }
  .main { padding: 14px; }
  .top { padding: 0 12px; gap: 8px; height: auto; min-height: 52px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .top nav { margin-left: 0; }
  .field.line { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .viewer-bar { flex-wrap: wrap; }
}
@media (max-height: 760px) and (min-width: 901px) {
  .prompt-box { flex-basis: 104px; min-height: 104px; }
  .ref { width: 44px; height: 44px; }
  .dd, .dd-input { height: 48px; padding-top: 5px; padding-bottom: 6px; }
  .cmp-body { gap: 10px; padding-top: 12px; }
  .film { height: 80px; }
  .frame { width: 56px; height: 56px; }
  .go { height: 46px; }
}
