/* 绘风摄影工坊 · 前端样式 */
:root{
  --brand:#6f5cf1; --brand-2:#9a7bf3; --brand-soft:#f0ecff;
  --ink:#1b1f31; --gray:#7c8298; --gray-2:#a6abbb;
  --line:#e7e5f1; --bg:#ffffff; --bg-2:#f5f4fb; --bg-3:#faf9ff; --card:#ffffff;
  --ok:#0ea472; --ok-bg:#e7f8f1; --warn:#c8811a; --warn-bg:#fdf3e3;
  --err:#d9534f; --err-bg:#fdeceb; --info:#5b7cf0; --info-bg:#eef2ff;
  --r:12px; --r-sm:8px; --sh:0 1px 3px rgba(29,32,55,.04),0 8px 24px rgba(29,32,55,.05);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  color:var(--ink);background:var(--bg-2);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased;
  min-height:100vh;display:flex;flex-direction:column;
}
a{color:var(--brand);text-decoration:none}
a:hover{color:var(--brand-2)}
img{max-width:100%;display:block}
h1,h2,h3,h4{margin:0 0 12px;font-weight:600;line-height:1.35}
h1{font-size:26px}h2{font-size:20px}h3{font-size:16px}
p{margin:0 0 12px}
.muted{color:var(--gray)}.small{font-size:12.5px}.center{text-align:center}
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}
.row{display:flex;gap:12px;align-items:center}
.row.between{justify-content:space-between}
.row.wrap{flex-wrap:wrap}
.spacer{flex:1}

/* ---------- 布局 ---------- */
.nav{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50}
.nav-in{max-width:1180px;margin:0 auto;padding:0 20px;height:60px;display:flex;align-items:center;gap:24px}
.logo{display:flex;align-items:center;gap:9px;font-size:17px;font-weight:600;color:var(--ink)}
.logo span{width:28px;height:28px;border-radius:8px;background:linear-gradient(135deg,var(--brand),var(--brand-2));display:inline-flex;align-items:center;justify-content:center;color:#fff;font-size:15px}
/* 后台上传的 Logo 图片（未上传时为上面的文字标识） */
.logo-img img{max-height:30px;width:auto;display:block;object-fit:contain}
.admin-lg-img img{max-height:24px;width:auto;display:block;object-fit:contain}
.nav-links{display:flex;gap:6px;flex:1}
.nav-links a{padding:7px 13px;border-radius:8px;color:var(--gray);font-size:14px}
.nav-links a:hover{background:var(--bg-2);color:var(--ink)}
.nav-links a.on{background:var(--brand-soft);color:var(--brand);font-weight:500}
.nav-right{display:flex;align-items:center;gap:12px}
.credits-chip{display:inline-flex;align-items:center;gap:6px;background:var(--brand-soft);color:var(--brand);padding:5px 12px;border-radius:20px;font-size:13px;font-weight:500}
.credits-chip b{font-size:15px}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}
.step-num{width:34px;height:34px;border-radius:9px;background:var(--brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:17px;font-weight:700;margin-bottom:12px;box-shadow:0 2px 5px rgba(111,92,241,.18)}
[data-theme="dark"] .step-num{background:linear-gradient(135deg,var(--d-gold),var(--d-gold-2));color:#08080a;box-shadow:0 2px 6px rgba(200,155,92,.22)}

.wrap{max-width:1180px;margin:0 auto;padding:28px 20px 64px;flex:1 0 auto;align-self:center;width:100%}
.foot{border-top:1px solid var(--line);background:#fff;padding:28px 20px;color:var(--gray);font-size:13px;flex-shrink:0}
.foot-in{max-width:1180px;margin:0 auto;display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}

/* ---------- 组件 ---------- */
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh)}
.card-pad{padding:22px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:9px 18px;border-radius:var(--r-sm);border:1px solid transparent;font-size:14px;cursor:pointer;transition:.15s;background:var(--brand);color:#fff;font-family:inherit}
.btn:hover{background:var(--brand-2);color:#fff}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn.ghost:hover{border-color:var(--brand);color:var(--brand);background:#fff}
.btn.line{background:transparent;border-color:var(--brand);color:var(--brand)}
.btn.line:hover{background:var(--brand-soft)}
.btn.sm{padding:5px 12px;font-size:13px}
.btn.lg{padding:12px 26px;font-size:15px;border-radius:10px}
.btn.block{width:100%}
.btn.danger{background:var(--err)}.btn.danger:hover{background:#b8261d}
.btn.gray{background:var(--gray)}

.field{margin-bottom:16px}
.field label{display:block;margin-bottom:6px;font-size:13px;color:var(--ink);font-weight:500}
.field .hint{font-size:12px;color:var(--gray-2);margin-top:5px}
.input,.select,.textarea{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm);font-size:14px;font-family:inherit;background:#fff;color:var(--ink);transition:.15s}
.input:focus,.select:focus,.textarea:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(111,92,241,.12)}
.textarea{min-height:120px;resize:vertical;line-height:1.7}
.input-group{display:flex;gap:8px}
.input-group .input{flex:1}

.alert{padding:11px 14px;border-radius:var(--r-sm);font-size:13.5px;margin-bottom:14px;border:1px solid transparent}
.alert.ok{background:var(--ok-bg);color:#0b6b3d;border-color:#c9e8d6}
.alert.err{background:var(--err-bg);color:#a02017;border-color:#f5cfcc}
.alert.warn{background:var(--warn-bg);color:#8a5a10;border-color:#f2dfba}
.alert.info{background:var(--info-bg);color:#14539e;border-color:#cfe0fb}

.badge{display:inline-block;padding:2px 9px;border-radius:20px;font-size:12px;line-height:1.7;border:1px solid transparent}
.badge.gray{background:var(--bg-2);color:var(--gray)}
.badge.ok{background:var(--ok-bg);color:#0b6b3d}
.badge.err{background:var(--err-bg);color:#a02017}
.badge.warn{background:var(--warn-bg);color:#8a5a10}
.badge.info{background:var(--info-bg);color:#14539e}
.badge.brand{background:var(--brand-soft);color:var(--brand)}

table.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
table.tbl th,table.tbl td{padding:11px 12px;text-align:left;border-bottom:1px solid var(--line);vertical-align:middle}
table.tbl th{background:var(--bg-3);font-weight:500;color:var(--gray);font-size:12.5px;white-space:nowrap}
table.tbl tr:hover td{background:var(--bg-3)}
table.tbl .num{font-variant-numeric:tabular-nums}

.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:20px;overflow-x:auto}
.tabs a{padding:9px 16px;color:var(--gray);border-bottom:2px solid transparent;font-size:14px;white-space:nowrap}
.tabs a.on{color:var(--brand);border-bottom-color:var(--brand);font-weight:500}

.pager{display:flex;gap:6px;justify-content:center;margin-top:22px;flex-wrap:wrap}
.pager a,.pager span{padding:6px 12px;border:1px solid var(--line);border-radius:var(--r-sm);background:#fff;color:var(--gray);font-size:13px}
.pager a:hover{border-color:var(--brand);color:var(--brand)}
.pager .on{background:var(--brand);border-color:var(--brand);color:#fff}

.empty{padding:56px 20px;text-align:center;color:var(--gray-2)}
.empty .ic{font-size:40px;margin-bottom:10px;opacity:.35}

/* ---------- 上传区 ---------- */
.upload-zone{border:2px dashed var(--line);border-radius:var(--r);padding:24px;text-align:center;cursor:pointer;transition:.18s;background:var(--bg-3)}
.upload-zone:hover,.upload-zone.over{border-color:var(--brand);background:var(--brand-soft)}
.upload-zone .ic{font-size:26px;margin-bottom:6px}
.upload-zone .t{font-weight:500;margin-bottom:3px}
.upload-zone .s{font-size:12.5px;color:var(--gray-2)}
.thumbs{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.thumb{position:relative;width:88px;height:88px;border-radius:10px;overflow:hidden;border:1px solid var(--line);background:var(--bg-2)}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb .del{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:13px;line-height:20px;text-align:center;cursor:pointer;border:none;padding:0}
.thumb .tag{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,.55);color:#fff;font-size:11px;text-align:center;padding:2px 0}
.thumb-note{font-size:12.5px;line-height:1.6;color:var(--gray-2);background:var(--bg-2);border:1px solid var(--line);border-radius:8px;padding:10px 12px}

/* ---------- 页面横向滚动治理 + 套餐卡两列栅格（2026-09-07） ---------- */
html,body{overflow-x:hidden}
.pkg-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media(max-width:1100px){.pkg-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){
  .pkg-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .pkg-grid .pkg{padding:14px 8px}
  .pkg-grid .nm{font-size:14px}
  .pkg-grid .cr{font-size:22px}
  .pkg-grid .pr{font-size:17px}
  .pkg-grid .pkg .btn{padding:8px 2px;font-size:13px;width:100%}
}

/* ---------- 比例选择按钮（AI 写真生成页） ---------- */
.ratio-group{display:flex;gap:10px;flex-wrap:wrap}
.ratio-btn{padding:10px 18px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font-size:14px;cursor:pointer;transition:.15s;min-width:64px;touch-action:manipulation}
.ratio-btn:hover{border-color:var(--brand);color:var(--brand)}
.ratio-btn.active{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.ratio-btn:disabled{opacity:.55;cursor:not-allowed}
.quality-btn{padding:8px 18px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font-size:14px;cursor:pointer;transition:.15s;min-width:56px;touch-action:manipulation}
.quality-btn:hover{border-color:var(--brand);color:var(--brand)}
.quality-btn.active{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
.gen-sum{border-top:1px solid var(--line);padding-top:14px}
.gen-sum .row{padding:5px 0;font-size:13.5px}

/* ---------- 通用弹窗（参考图视觉分析失败提示等） ---------- */
.modal-mask{position:fixed;inset:0;z-index:9000;background:rgba(17,17,26,.55);display:flex;align-items:center;justify-content:center;padding:20px}
.modal-box{width:100%;max-width:520px;background:var(--bg);border:1px solid var(--line);border-radius:var(--r);padding:22px;box-shadow:0 18px 60px rgba(17,17,26,.28);max-height:86vh;overflow:auto}

/* ---------- 作品微调（纯前端） ---------- */
.tweak-box{max-width:560px}
.tweak-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.tweak-stage{background:#0b0b10;border-radius:var(--r);overflow:hidden;display:flex;align-items:center;justify-content:center;max-height:56vh;position:relative;touch-action:none}
.tweak-stage canvas{max-width:100%;max-height:56vh;display:block}
.tweak-loading{margin:8px 0;color:var(--brand);font-size:13px}
.tweak-ctrls{margin-top:6px}
.tweak-row{display:flex;align-items:center;gap:12px;padding:4px 0}
.tweak-row label{width:96px;flex:none;font-size:13.5px;color:var(--gray-1)}
.tweak-num{display:inline-block;min-width:30px;text-align:right;color:var(--brand);font-variant-numeric:tabular-nums}
.tweak-row input[type=range]{flex:1;accent-color:var(--brand);height:4px}
.tweak-divider{display:flex;align-items:center;gap:10px;margin:8px 0 2px;color:var(--gray-2);font-size:12px;letter-spacing:.04em}
.tweak-divider::before,.tweak-divider::after{content:"";height:1px;background:var(--line,#e6e8ee);flex:1}
/* 分组手风琴：点击分隔条展开/收起（互斥：同一时间只允许展开一个分组） */
.tweak-divider.tweak-group-hd{cursor:pointer;user-select:none;transition:color .12s}
.tweak-divider.tweak-group-hd:hover{color:var(--gray-1)}
.tweak-divider.tweak-group-hd .tweak-chevron{
  display:inline-block;font-style:normal;font-size:10px;line-height:1;
  color:var(--gray-2);margin-left:2px;transition:transform .18s ease;
}
.tweak-divider.tweak-group-hd[aria-expanded="false"] .tweak-chevron{transform:rotate(-90deg)}
.tweak-divider.tweak-group-hd[aria-expanded="false"]{opacity:.85}
/* 头部范围：包裹画布做绝对定位叠加层 + 折叠面板 */
#tweakStage{position:relative;display:inline-block;line-height:0;transform-origin:0 0;touch-action:none}
#tweakOverlay{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}
.tweak-compare{position:absolute;top:8px;right:8px;z-index:6;padding:5px 12px;border-radius:20px;border:1px solid rgba(255,255,255,.4);background:rgba(20,20,28,.62);color:#fff;font-size:12.5px;cursor:pointer;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);user-select:none;-webkit-user-select:none;touch-action:none}
.tweak-compare.on{background:var(--brand);border-color:var(--brand)}
.tweak-compare:active{background:rgba(20,20,28,.85)}
.brush-cursor{position:fixed;z-index:20;border:1.5px solid rgba(255,255,255,.85);border-radius:50%;pointer-events:none;display:none;transform:translate(-50%,-50%);box-shadow:0 0 0 1px rgba(0,0,0,.35);mix-blend-mode:difference}
#tweakStage.brush-on{cursor:none}
.tweak-btn-row{display:flex;gap:8px;align-items:center;margin:2px 0 6px}
.tweak-btn-row .tweak-range-btn{margin:0}
.tweak-range-btn{margin:2px 0 4px}
.tweak-range-btn.active{border-color:var(--brand);color:var(--brand)}
.tweak-head-range{margin:2px 0 4px 2px;padding:2px 0 2px 10px;border-left:2px solid var(--brand)}
.tweak-head-range .tweak-row{padding:4px 0}
.tweak-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}
.tweak-actions .btn{flex:0 0 auto}

/* 电脑端左右布局（左图右参）；手机端保持上下布局 */
.tweak-body{display:block}
@media (min-width:861px){
  .tweak-box{max-width:960px;overflow:hidden}    /* 禁止上下滚动 */
  .tweak-body{display:flex;gap:20px;align-items:flex-start}
  .tweak-left{flex:1 1 auto;min-width:0}
  .tweak-right{flex:0 0 320px;max-width:340px}
  .tweak-right .tweak-ctrls{margin-top:0}
  .tweak-right .tweak-actions{margin-top:16px;justify-content:stretch}
  .tweak-right .tweak-actions .btn{flex:1 1 auto}
  /* 给 head(≈50px)+modal padding(44px) 留出空间，确保不撑出滚动条 */
  .tweak-stage{max-height:calc(86vh - 100px)}
  .tweak-stage canvas{max-height:calc(86vh - 100px)}
}
/* 复位视图按钮（左上角，与对比按钮呼应） */
.tweak-reset-view{position:absolute;top:8px;left:8px;z-index:6;padding:5px 12px;border-radius:20px;border:1px solid rgba(255,255,255,.4);background:rgba(20,20,28,.62);color:#fff;font-size:12.5px;cursor:pointer;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);user-select:none;-webkit-user-select:none;touch-action:none}
.tweak-reset-view:active{background:rgba(20,20,28,.85)}
/* 画笔撤销/恢复 */
.brush-undo-row{display:flex;gap:8px;padding:4px 0 2px}
.brush-undo-row .btn{flex:1 1 0;min-width:0}
.brush-undo-row .btn:disabled{opacity:.4;cursor:not-allowed}


.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px}
.tpl{border:1px solid var(--line);border-radius:var(--r);overflow:hidden;cursor:pointer;transition:.18s;background:#fff;position:relative}
.tpl:hover{transform:translateY(-2px);box-shadow:var(--sh)}
.tpl.on{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.tpl .cov{height:112px;background:var(--bg-2) center/cover no-repeat;display:flex;align-items:center;justify-content:center;color:var(--gray-2);font-size:13px}
.tpl .bd{padding:11px 13px}
.tpl .nm{font-weight:500;margin-bottom:2px}
.tpl .ct{font-size:12px;color:var(--gray-2)}
.tpl .chk{position:absolute;top:8px;right:8px;width:20px;height:20px;border-radius:50%;background:var(--brand);color:#fff;font-size:12px;line-height:20px;text-align:center;display:none}
.tpl.on .chk{display:block}

/* ---------- 生成进度 ---------- */
.gen-panel{text-align:center;padding:34px 20px}
.spin{width:44px;height:44px;border:3px solid var(--brand-soft);border-top-color:var(--brand);border-radius:50%;animation:sp .8s linear infinite;margin:0 auto 16px}
@keyframes sp{to{transform:rotate(360deg)}}
.result-img{border-radius:var(--r);overflow:hidden;background:var(--bg-2)}
.result-img img{width:100%}

/* ---------- 套餐 ---------- */
.pkg{border:1px solid var(--line);border-radius:var(--r);padding:24px 20px;text-align:center;background:#fff;position:relative;transition:.18s}
.pkg:hover{border-color:var(--brand);box-shadow:var(--sh)}
.pkg.hot{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.pkg .tg{position:absolute;top:-10px;left:50%;transform:translateX(-50%);background:var(--brand);color:#fff;font-size:12px;padding:2px 12px;border-radius:20px}
.pkg .nm{font-size:16px;font-weight:600;margin-bottom:6px}
.pkg .cr{font-size:30px;font-weight:600;color:var(--brand);margin-bottom:2px}
.pkg .cr small{font-size:14px;font-weight:400;color:var(--gray)}
.pkg .pr{font-size:22px;font-weight:600;margin:12px 0 4px}
.pkg .pr small{font-size:14px;font-weight:400;color:var(--gray)}
.pkg .old{font-size:13px;color:var(--gray-2);text-decoration:line-through}

.studio-grid{display:grid;grid-template-columns:1fr 340px;gap:16px;align-items:start}
.studio-grid>div:last-child{position:sticky;top:76px}

/* ---------- 右侧任务折叠栏 ---------- */
.drawer{position:fixed;top:60px;right:0;bottom:0;width:344px;max-width:92vw;background:#fff;
  border-left:1px solid var(--line);display:flex;flex-direction:column;z-index:40;
  transition:transform .22s ease;box-shadow:-4px 0 20px rgba(20,20,40,.05)}
.drawer.closed{transform:translateX(100%)}
.drawer-hd{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
.drawer-hd .ttl{font-weight:600;font-size:14px;flex:1}
.drawer-hd .cnt{background:var(--brand-soft);color:var(--brand);border-radius:20px;padding:1px 9px;font-size:12px}
.drawer-bd{flex:1;overflow-y:auto;padding:12px}
.drawer-sum{border-bottom:1px solid var(--line);padding:10px 14px;flex-shrink:0;background:var(--bg-3)}
.drawer-sum .row{padding:4px 0;font-size:13px}
.drawer-handle{position:fixed;right:0;top:50%;transform:translateY(-50%);z-index:41;
  background:var(--brand);color:#fff;border:none;border-radius:8px 0 0 8px;padding:14px 7px;
  cursor:pointer;font-size:12px;line-height:1.3;writing-mode:vertical-rl;letter-spacing:2px;
  box-shadow:-2px 0 10px rgba(20,20,40,.16);display:none;font-family:inherit}
.drawer-handle .n{display:inline-block;background:rgba(255,255,255,.28);border-radius:10px;padding:1px 5px;margin-top:6px;writing-mode:horizontal-tb}
body.drawer-closed .drawer-handle{display:block}

.tk{border:1px solid var(--line);border-radius:10px;margin-bottom:10px;overflow:hidden;background:#fff}
.tk.cur{border-color:var(--brand);box-shadow:0 0 0 2px var(--brand-soft)}
.tk-hd{display:flex;align-items:center;gap:8px;padding:8px 10px;background:var(--bg-3);font-size:12.5px}
.tk-hd .nm{flex:1;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-bd{padding:10px}
.tk-img{border-radius:8px;overflow:hidden;background:var(--bg-2);cursor:pointer}
.tk-img img{width:100%;display:block}
.tk-acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.tk-acts .btn{padding:4px 10px;font-size:12px}
.tk-prog{text-align:center;padding:18px 10px}
.tk-prog .spin{width:28px;height:28px;border-width:2px;margin-bottom:10px}
.tk-meta{font-size:11.5px;color:var(--gray-2);margin-top:6px}
.tk-cache{font-size:11px;color:#0f7a44;margin-top:4px}

@media(min-width:1180px){
  body.drawer-open .wrap{padding-right:368px}
}
@media(max-width:1179px){
  .drawer{top:60px}
}

/* ---------- 后台 ---------- */
.admin{display:flex;min-height:100vh;background:var(--bg-2);padding-left:212px}
.side{width:212px;background:#1e1e32;color:#c9c9d8;flex-shrink:0;position:fixed;left:0;top:0;bottom:0;overflow-y:auto;z-index:10}
.side .lg{padding:18px 20px;font-size:16px;font-weight:600;color:#fff;border-bottom:1px solid rgba(255,255,255,.07)}
.side .gp{padding:14px 20px 5px;font-size:11px;color:#6f6f88;letter-spacing:.5px}
.side a{display:flex;align-items:center;gap:9px;padding:9px 20px;color:#c9c9d8;font-size:13.5px;border-left:3px solid transparent}
.side a:hover{background:rgba(200,155,92,.10);color:#fff}
.side a.on{background:rgba(111,92,241,.18);color:#fff;border-left-color:var(--brand)}
[data-theme="dark"] .side a:hover{background:rgba(255,255,255,.05);color:#fff}
[data-theme="dark"] .side a.on{background:rgba(255,255,255,.06);color:#fff;border-left-color:rgba(255,255,255,.25)}
.side .ic{width:16px;text-align:center;opacity:.85}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{height:56px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;gap:16px}
.topbar .ttl{font-size:16px;font-weight:600}
.content{padding:24px;flex:1}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:18px 20px}
.stat .lb{font-size:12.5px;color:var(--gray);margin-bottom:6px}
.stat .vl{font-size:26px;font-weight:600;line-height:1.2}
.stat .ex{font-size:12px;color:var(--gray-2);margin-top:4px}

/* ---------- 后台亮色主题配色（参考 pastel glass：粉→紫→青） ---------- */
[data-theme="light"] .admin{
  --brand:#6f5cf1;
  --brand-2:#9a7bf3;
  --brand-soft:rgba(111,92,241,.10);
  background:linear-gradient(135deg,#f5f4fb 0%,#faf9ff 50%,#eeedf8 100%);
}
[data-theme="light"] .admin .side{
  background:#ffffff;
  color:#6b7280;
  border-right:1px solid rgba(0,0,0,.05);
}
[data-theme="light"] .admin .side .lg{color:#1f2937;border-bottom-color:#f3f4f6}
[data-theme="light"] .admin .side .gp{color:#9ca3af}
[data-theme="light"] .admin .side a{color:#6b7280}
[data-theme="light"] .admin .side a:hover{background:rgba(111,92,241,.07);color:#1f2937}
[data-theme="light"] .admin .side a.on{
  background:rgba(111,92,241,.10);
  color:var(--brand);
  border-left-color:var(--brand);
}
[data-theme="light"] .admin .content .card{
  border:none;
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(135deg,#6f5cf1,#9a7bf3 50%,#c9bffb) border-box;
  border:1px solid transparent;
}
[data-theme="light"] .admin .btn:not(.ghost):not(.line){
  background:linear-gradient(135deg,#6f5cf1,#9a7bf3);
  border-color:transparent;
  color:#fff;
}
[data-theme="light"] .admin .btn:not(.ghost):not(.line):hover{
  background:linear-gradient(135deg,#5b48e0,#8a68ef);
}
[data-theme="light"] .admin .tabs{
  background:#f3f4f6;
  border-radius:10px;
  padding:4px;
  gap:4px;
  border-bottom:none;
  margin-bottom:20px;
  width:fit-content;
}
[data-theme="light"] .admin .tabs a{
  padding:8px 16px;
  border-radius:8px;
  border-bottom:none;
  color:#6b7280;
  white-space:nowrap;
}
[data-theme="light"] .admin .tabs a:hover{color:#1f2937}
[data-theme="light"] .admin .tabs a.on{
  background:#fff;
  color:var(--brand);
  box-shadow:0 2px 8px rgba(111,92,241,.18);
  font-weight:500;
}

.bar{height:8px;background:var(--bg-2);border-radius:6px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--brand);border-radius:6px}

.code-box{background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:12px;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px;word-break:break-all;max-height:280px;overflow:auto;line-height:1.9}

.qr-box{width:210px;height:210px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:var(--r);display:flex;align-items:center;justify-content:center;padding:10px}
.qr-box img,.qr-box canvas{width:100%;height:100%}

/* ---------- toast ---------- */
#toast{position:fixed;top:18px;left:50%;transform:translateX(-50%);z-index:9999;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.tst{padding:10px 18px;border-radius:var(--r-sm);background:#1c2030;color:#fff;font-size:13.5px;box-shadow:0 6px 20px rgba(0,0,0,.18);animation:tin .22s ease}
.tst.ok{background:#0f7a44}.tst.err{background:#c02b20}.tst.warn{background:#b4700f}
@keyframes tin{from{opacity:0;transform:translateY(-12px)}}

/* ---------- 登录注册 ---------- */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:30px 20px;background:linear-gradient(160deg,#f5f4fb 0%,#faf9ff 45%,#eeedf8 100%)}
[data-theme="dark"] .auth-wrap{background:linear-gradient(160deg,#0b0d12 0%,#14171f 50%,#0b0d12 100%)}
.auth-box{width:100%;max-width:420px}
.auth-box .hd{text-align:center;margin-bottom:22px}
.auth-box .hd .lg{display:inline-flex;align-items:center;gap:9px;font-size:20px;font-weight:600;color:var(--ink)}
.auth-box .hd .lg span{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:17px}

/* ---------- 后台独立登录页（深色，不复用上面的 .auth-* 浅色样式） ---------- */
body.adm-login{min-height:100vh;color:#fff;background:linear-gradient(160deg,#0b0d12 0%,#14171f 55%,#191d27 100%)}
body.adm-login .adm-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
body.adm-login .adm-box{width:100%;max-width:380px}
body.adm-login .adm-hd{text-align:center;margin-bottom:20px}
body.adm-login .adm-hd .lg{display:inline-flex;align-items:center;gap:8px;font-size:20px;font-weight:700;color:#fff;letter-spacing:.5px}
body.adm-login .adm-hd .lg span{width:28px;height:28px;border-radius:8px;background:linear-gradient(135deg,#6f5cf1,#9a7bf3);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:15px}
body.adm-login .adm-hd p{margin:0;color:rgba(255,255,255,.62)}
/* 卡片内部回归浅底深字，保证输入框、标签可读 */
body.adm-login .card{color:var(--ink);border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.35)}
body.adm-login .adm-tip{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:14px;font-size:12px;color:rgba(255,255,255,.55)}
body.adm-login .adm-tip b{font-weight:600;color:rgba(255,255,255,.8)}
body.adm-login .adm-tip a{color:rgba(255,255,255,.62)}
body.adm-login .adm-tip a:hover{color:rgba(255,255,255,.95)}

@media(max-width:900px){
  .g4{grid-template-columns:repeat(2,1fr)}
  .g3{grid-template-columns:repeat(2,1fr)}
  .side{width:64px}
  .side .gp,.side a span{display:none}
  .side a{justify-content:center;padding:12px 0}
}
@media(max-width:640px){
  .g2,.g3,.g4{grid-template-columns:1fr}
  .studio-grid{grid-template-columns:1fr}
  .studio-grid>div:last-child{position:static}
  .nav-links{display:none}
  .hide-mobile{display:none!important}
  .nav-right{margin-left:auto}
  .wrap{padding:18px 14px 48px}
  .content{padding:16px}
  .card-pad{padding:16px}
}

/* ---------- 首页样例图堆叠轮播 ---------- */
.sample-stack{
  position:relative;width:100%;min-height:340px;
  user-select:none;-webkit-user-select:none;
  touch-action:pan-y;       /* 允许竖向滚动页面，水平留给 JS */
  outline:none;
}
.ss-track{
  position:relative;width:100%;margin:0 auto;
  perspective:1100px;
}
.ss-card{
  position:absolute;
  border-radius:18px;overflow:hidden;
  background:var(--brand-soft);border:1px solid rgba(111,92,241,.16);
  box-shadow:0 8px 24px rgba(20,20,40,.10),0 2px 6px rgba(20,20,40,.06);
  display:block;cursor:grab;
  transition:filter .25s ease;
  will-change:transform,filter;
}
.ss-card:active{cursor:grabbing}
.ss-card.ss-active{box-shadow:0 14px 38px rgba(20,20,40,.18),0 4px 10px rgba(20,20,40,.10)}
.ss-card img{width:100%;height:100%;object-fit:cover;display:block;-webkit-user-drag:none;user-select:none;pointer-events:none}
.ss-card .ss-ph{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,rgba(111,92,241,.10),rgba(154,123,243,.18));
  color:var(--brand);font-size:14px;font-weight:500;
}
.ss-card .ss-title{
  position:absolute;left:0;right:0;bottom:0;padding:10px 12px;
  background:linear-gradient(to top,rgba(0,0,0,.55),rgba(0,0,0,0));
  color:#fff;font-size:12.5px;line-height:1.4;
  opacity:0;transition:opacity .25s;
}
.ss-card.ss-active .ss-title{opacity:1}
.sample-stack.ss-dragging .ss-card{transition:opacity .12s ease}
.sample-stack.ss-dragging{cursor:grabbing}
.ss-arrow{
  position:absolute;top:50%;transform:translateY(-50%);
  width:36px;height:36px;border-radius:50%;
  border:1px solid rgba(111,92,241,.20);background:#fff;
  color:var(--brand);font-size:22px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 14px rgba(20,20,40,.10);
  z-index:30;transition:transform .15s,background .15s,color .15s;
}
.ss-arrow:hover{background:var(--brand);color:#fff;transform:translateY(-50%) scale(1.06)}
.ss-arrow:active{transform:translateY(-50%) scale(0.94)}
.ss-arrow-left{left:8px}
.ss-arrow-right{right:8px}
@media(max-width:640px){
  .ss-arrow{width:30px;height:30px;font-size:18px}
  .ss-arrow-left{left:4px}
  .ss-arrow-right{right:4px}
  /* 仅手机端裁剪样例卡两侧溢出，避免整页横向滚动；桌面端保留完整堆叠展示 */
  .sample-stack{min-height:280px;overflow:hidden}
  .muted[style*="19.5px"]{font-size:15px !important}
}
@media(hover:none){
  .ss-arrow{display:none}        /* 触屏设备不显示箭头，靠手势 */
}

/* ============================================================
   暗色主题（参考 hf.ins8023.top 配色：暖调近黑 + 铜金点缀）
   触发：<html data-theme="dark">，由前台 JS 写入
   实现方式：覆写关键色，不动 light theme 的 :root，避免回退风险
   ============================================================ */
:root{
  --d-bg:#0b0d12;               /* 页面底色（与照片工具一致） */
  --d-bg-2:#14171f;             /* 卡片底色 */
  --d-bg-3:#191d27;             /* 更深一层（表单 input / tabs 头） */
  --d-txt:#f0f1f7;              /* 主文字 */
  --d-txt-2:rgba(240,241,247,.62);
  --d-txt-3:rgba(240,241,247,.38);
  --d-line:#262b37;
  --d-line-2:#1d222c;
  --d-gold:#c89b5c;
  --d-gold-2:#e8c68d;
  --d-brand:#c89b5c;            /* 暗色下品牌色替换为暖铜金 */
  --d-brand-2:#e8c68d;
  --d-brand-soft:rgba(200,155,92,.10);
  --d-ok:#34a87e;
  --d-warn:#d29b46;
  --d-err:#e26863;
  --d-info:#6aa8ec;
}
[data-theme="dark"]{
  --brand:var(--d-brand);
  --brand-2:var(--d-brand-2);
  --brand-soft:var(--d-brand-soft);
  --ink:var(--d-txt);
  --gray:var(--d-txt-2);
  --gray-2:var(--d-txt-3);
  --line:var(--d-line);
  --bg:var(--d-bg);
  --bg-2:var(--d-bg);
  --bg-3:var(--d-bg-3);
  --card:var(--d-bg-2);
  --ok:var(--d-ok);
  --warn:var(--d-warn);
  --err:var(--d-err);
  --info:var(--d-info);
  --sh:0 1px 3px rgba(0,0,0,.6), 0 8px 24px rgba(0,0,0,.35);
}
[data-theme="dark"] body{
  background:var(--d-bg);
  color:var(--d-txt);
}
[data-theme="dark"] a{color:var(--d-gold)}
[data-theme="dark"] a:hover{color:var(--d-gold-2)}

/* 关键组件覆写（这些 hardcode #fff 的元素需要单独再覆盖一次，因为 var(--bg) 在 dark 已经是 #08080a） */
[data-theme="dark"] .nav,
[data-theme="dark"] .foot,
[data-theme="dark"] .card,
[data-theme="dark"] .btn.ghost,
[data-theme="dark"] .btn.ghost:hover,
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea,
[data-theme="dark"] .pager a, [data-theme="dark"] .pager span,
[data-theme="dark"] .ratio-btn, [data-theme="dark"] .quality-btn,
[data-theme="dark"] .tpl,
[data-theme="dark"] .pkg,
[data-theme="dark"] .drawer,
[data-theme="dark"] .tk,
[data-theme="dark"] .topbar,
[data-theme="dark"] .stat,
[data-theme="dark"] .qr-box,
[data-theme="dark"] .ss-arrow{
  background:var(--d-bg-2);
  color:var(--d-txt);
  border-color:var(--d-line);
}
[data-theme="dark"] .nav{border-bottom-color:var(--d-line)}
[data-theme="dark"] .foot{border-top-color:var(--d-line)}
[data-theme="dark"] .card{box-shadow:var(--sh)}
[data-theme="dark"] .input::placeholder,
[data-theme="dark"] .textarea::placeholder{color:var(--d-txt-3)}
[data-theme="dark"] .input:focus,
[data-theme="dark"] .select:focus,
[data-theme="dark"] .textarea:focus{
  border-color:var(--d-brand);
  box-shadow:0 0 0 3px rgba(200,155,92,.18);
}
[data-theme="dark"] .logo span{background:linear-gradient(135deg,var(--d-gold),var(--d-gold-2));color:#08080a}
[data-theme="dark"] .nav-links a{color:var(--d-txt-2)}
[data-theme="dark"] .nav-links a:hover{background:var(--d-bg-3);color:var(--d-txt)}
[data-theme="dark"] .nav-links a.on{background:var(--d-brand-soft);color:var(--d-gold)}
[data-theme="dark"] .credits-chip{background:var(--d-brand-soft);color:var(--d-gold)}
[data-theme="dark"] .avatar{background:linear-gradient(135deg,var(--d-gold),var(--d-gold-2));color:#08080a}
[data-theme="dark"] .badge.ok{background:rgba(52,168,126,.16);color:#7dd3b3}
[data-theme="dark"] .badge.err{background:rgba(226,104,99,.16);color:#efaba7}
[data-theme="dark"] .badge.warn{background:rgba(210,155,70,.16);color:#e1bf85}
[data-theme="dark"] .badge.info{background:rgba(106,168,236,.16);color:#a9c8ee}
[data-theme="dark"] .badge.brand{background:var(--d-brand-soft);color:var(--d-gold)}
[data-theme="dark"] .badge.gray{background:var(--d-bg-3);color:var(--d-txt-2)}
[data-theme="dark"] .alert.ok{background:rgba(52,168,126,.12);color:#7dd3b3;border-color:rgba(52,168,126,.3)}
[data-theme="dark"] .alert.err{background:rgba(226,104,99,.12);color:#efaba7;border-color:rgba(226,104,99,.3)}
[data-theme="dark"] .alert.warn{background:rgba(210,155,70,.12);color:#e1bf85;border-color:rgba(210,155,70,.3)}
[data-theme="dark"] .alert.info{background:rgba(106,168,236,.12);color:#a9c8ee;border-color:rgba(106,168,236,.3)}
[data-theme="dark"] .muted{color:var(--d-txt-2)}
[data-theme="dark"] table.tbl th{background:var(--d-bg-3);color:var(--d-txt-2)}
[data-theme="dark"] table.tbl td,
[data-theme="dark"] table.tbl th{border-bottom-color:var(--d-line)}
[data-theme="dark"] .tabs{border-bottom-color:var(--d-line)}
[data-theme="dark"] .tabs a{color:var(--d-txt-2)}
[data-theme="dark"] .tabs a.on{color:var(--d-gold);border-bottom-color:var(--d-gold)}
[data-theme="dark"] .pager .on{background:var(--d-gold);border-color:var(--d-gold);color:#08080a}
[data-theme="dark"] .btn.ghost:hover{border-color:var(--d-gold);color:var(--d-gold)}
[data-theme="dark"] .btn{background:var(--d-gold);color:#08080a;border-color:transparent}
[data-theme="dark"] .btn:hover{background:var(--d-gold-2);color:#08080a}
[data-theme="dark"] .btn.line{background:transparent;border-color:var(--d-gold);color:var(--d-gold)}
[data-theme="dark"] .btn.line:hover{background:var(--d-brand-soft)}
[data-theme="dark"] .btn.danger{background:var(--d-err)}
[data-theme="dark"] .btn.gray{background:var(--d-txt-3);color:var(--d-txt)}
[data-theme="dark"] .upload-zone{background:var(--d-bg-3);border-color:var(--d-line)}
[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.over{border-color:var(--d-gold);background:rgba(200,155,92,.08)}
[data-theme="dark"] .upload-zone .s{color:var(--d-txt-3)}
[data-theme="dark"] .thumb{border-color:var(--d-line);background:var(--d-bg-3)}
[data-theme="dark"] .pkg{background:var(--d-bg-2);border-color:var(--d-line)}
[data-theme="dark"] .pkg.recommend{outline-color:var(--d-gold)}
[data-theme="dark"] .pkg .nm{color:var(--d-txt)}
[data-theme="dark"] .tpl{border-color:var(--d-line);background:var(--d-bg-2)}
[data-theme="dark"] .drawer{border-left-color:var(--d-line)}
[data-theme="dark"] .tk{border-color:var(--d-line);background:var(--d-bg-2)}
[data-theme="dark"] .qr-box{border-color:var(--d-line)}
[data-theme="dark"] .topbar{border-bottom-color:var(--d-line)}
[data-theme="dark"] .stat{border-color:var(--d-line)}
[data-theme="dark"] .ratio-btn.active,
[data-theme="dark"] .quality-btn.active{background:var(--brand);border-color:var(--brand);color:#fff;font-weight:600}
[data-theme="dark"] .ss-card{background:var(--d-bg-3);border-color:var(--d-line);box-shadow:0 8px 24px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3)}
[data-theme="dark"] .ss-card.ss-active{box-shadow:0 14px 38px rgba(0,0,0,.55), 0 4px 10px rgba(0,0,0,.4)}
[data-theme="dark"] .ss-card .ss-ph{background:linear-gradient(135deg,rgba(200,155,92,.08),rgba(200,155,92,.18));color:var(--d-gold)}
[data-theme="dark"] .ss-arrow{background:var(--d-bg-2);color:var(--d-gold);border-color:rgba(200,155,92,.3)}
[data-theme="dark"] .ss-arrow:hover{background:var(--d-gold);color:#08080a}
[data-theme="dark"] .field label{color:var(--d-txt)}

/* 首页 hero 卡片渐变背景（暗色下换暖金淡渐变） */
[data-theme="dark"] body.home .hero,
[data-theme="dark"] .card[style*="linear-gradient(135deg,#f4f1ff"]{
  background:linear-gradient(135deg,#10131b 0%,#14171f 100%) !important;
  border:1px solid var(--d-line);
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3{color:var(--d-txt)}

/* 主题切换按钮 */
.theme-switch{
  display:inline-flex;align-items:center;gap:6px;
  background:var(--bg-2);border:1px solid var(--line);
  border-radius:999px;padding:5px 12px;font-size:13px;cursor:pointer;
  color:var(--ink);transition:.18s;font-family:inherit;
}
.theme-switch:hover{border-color:var(--brand);color:var(--brand)}
.theme-switch.on{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}
[data-theme="dark"] .theme-switch{background:var(--d-bg-2);border-color:var(--d-line);color:var(--d-txt)}
[data-theme="dark"] .theme-switch:hover{border-color:var(--d-gold);color:var(--d-gold)}
[data-theme="dark"] .theme-switch.on{border-color:var(--d-gold);color:var(--d-gold);background:var(--d-brand-soft)}
.theme-switch .dot{width:8px;height:8px;border-radius:50%;background:var(--gray-2);transition:.18s}
[data-theme="dark"] .theme-switch .dot{background:var(--d-gold)}

/* 滚动条（暗色下更暗） */
[data-theme="dark"] ::-webkit-scrollbar{width:8px;height:8px}
[data-theme="dark"] ::-webkit-scrollbar-track{background:var(--d-bg)}
[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#2b3140}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{background:var(--d-gold)}
[data-theme="dark"] ::selection{background:var(--d-gold);color:#08080a}

/* 后台侧栏：dark 主题下与主体同色（统一暗色调），其它默认样式保留 */
[data-theme="dark"] .side{background:#0a0c10}

/* ---------- 首页 Hero 标题图片：图片优先于文字，支持 亮/暗主题 × 桌面/手机 四态 ---------- */
.hero-title-imgs{display:block;text-align:center}
.ht-img{display:none;max-width:100%;height:auto;margin:0 auto 10px}
/* 限制标题图尺寸：仅设上限，保持原始比例不变形（桌面更宽、手机更窄） */
.hero-title-imgs .ht-desk{max-width:700px;max-height:200px;width:auto}
.hero-title-imgs .ht-mob{max-width:320px;max-height:140px;width:auto}

/* 桌面端图（ht-desk）≥641px 显示；手机端图（ht-mob）≤640px 显示 */
@media (min-width:641px){
  .hero-title-imgs .ht-mob{display:none!important}
  .hero-title-imgs .ht-desk.ht-s{display:inline-block}                 /* 仅一张图：两主题通用 */
  [data-theme="light"] .hero-title-imgs .ht-desk.ht-l{display:inline-block}
  [data-theme="dark"]  .hero-title-imgs .ht-desk.ht-d{display:inline-block}
}
@media (max-width:640px){
  .hero-title-imgs .ht-desk{display:none!important}
  .hero-title-imgs .ht-mob.ht-s{display:inline-block}
  [data-theme="light"] .hero-title-imgs .ht-mob.ht-l{display:inline-block}
  [data-theme="dark"]  .hero-title-imgs .ht-mob.ht-d{display:inline-block}
}

/* ---------- Logo 亮/暗主题双图切换 ---------- */
.logo-img img.lg-dark,.admin-lg-img img.lg-dark{display:none}
[data-theme="dark"] .logo-img img.lg-light,[data-theme="dark"] .admin-lg-img img.lg-light{display:none}
[data-theme="dark"] .logo-img img.lg-dark,[data-theme="dark"] .admin-lg-img img.lg-dark{display:block}

/* ---------- 首页 hero 卡（桌面/手机留白由这里控制） ---------- */
.hero-card{padding:48px 32px 40px;border-radius:var(--r)}
.hero-samples{margin:40px auto 0}
@media(max-width:640px){
  .hero-card{padding:36px 14px 22px;border-radius:16px}
  /* 样例区左右负 margin 撑到灰色卡边界，overflow 裁剪以"底层框"为准 */
  .hero-samples{margin:22px -14px 0;max-width:none}
}

/* ---------- 底部 footer：手机端居中 ---------- */
@media(max-width:640px){
  .foot-in{flex-direction:column;text-align:center;align-items:center;gap:10px}
}

/* ---------- 手机端右侧悬浮按钮（主题/微信码/回顶） ---------- */
.fab-group{display:none}
@media(max-width:640px){
  .fab-group{display:flex;flex-direction:column;gap:12px;position:fixed;right:12px;top:calc(50% + 50px);transform:translateY(-50%);z-index:200}
  .fab{
    width:46px;height:46px;border-radius:50%;
    border:1px solid var(--line);background:var(--bg-2);
    color:var(--ink);cursor:pointer;
    display:flex;align-items:center;justify-content:center;
    box-shadow:0 6px 18px rgba(15,18,30,.14);
    -webkit-tap-highlight-color:transparent;transition:.15s;font-family:inherit;
  }
  .fab:active{transform:scale(.92)}
  .fab svg{width:22px;height:22px;fill:currentColor}
  /* 主题按钮：亮色显示月亮(切暗)，暗色显示太阳(切亮) */
  .fab[data-role="theme"] .ic-moon{display:block}
  .fab[data-role="theme"] .ic-sun{display:none}
  [data-theme="dark"] .fab[data-role="theme"] .ic-moon{display:none}
  [data-theme="dark"] .fab[data-role="theme"] .ic-sun{display:block}
  .fab-qr-pop{
    position:fixed;left:50%;top:42%;transform:translate(-50%,-50%);
    width:min(280px,84vw);background:#fff;border-radius:16px;
    padding:18px;box-shadow:0 18px 50px rgba(0,0,0,.25);
    z-index:210;text-align:center;
  }
  .fab-qr-pop img{width:100%;height:auto;border-radius:8px;display:block}
  .fab-qr-pop .x{position:absolute;top:-10px;right:-10px;width:26px;height:26px;border-radius:50%;
    background:var(--gray);color:#fff;border:none;cursor:pointer;font-size:14px;line-height:1}
  .fab-qr-pop p{margin:10px 0 2px;font-size:12px;color:#666}
}

/* ---------- 图转视频（video/img2video）单页工具 ----------
   颜色一律取主题变量，浅色/深色自动跟随，无需 [data-theme] 覆写 */
.i2v{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px;align-items:start}
.i2v-fld{margin-bottom:14px}
.i2v-fld:last-of-type{margin-bottom:16px}
.i2v-lb{display:block;font-weight:500;margin-bottom:6px}
.i2v-lb em{font-style:normal;color:var(--brand);font-size:12px;margin-left:4px}
.i2v-lb span{color:var(--gray-2);font-size:12px;margin-left:4px}
.i2v-hint{font-size:12.5px;color:var(--gray-2);margin-top:6px;line-height:1.65;word-break:break-all}
.i2v-hint code{background:var(--bg-2);border:1px solid var(--line);border-radius:5px;padding:1px 5px;font-size:12px}
.i2v-zone{padding:20px}
.i2v-ck{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--gray);cursor:pointer;user-select:none}
.i2v-stage{
  min-height:250px;border:1px dashed var(--line);border-radius:var(--r);
  background:var(--bg-3);display:flex;align-items:center;justify-content:center;padding:14px;
}
.i2v-stage video{width:100%;height:auto;border-radius:10px;background:#000}
.i2v-ph{text-align:center;color:var(--gray-2);padding:0 8px}
.i2v-text{
  background:var(--bg-3);border:1px solid var(--line);border-radius:8px;
  padding:10px 12px;margin:12px 0 0;white-space:pre-wrap;word-break:break-all;
  max-height:220px;overflow:auto;font-size:12.5px;color:var(--gray);
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
}
@media(max-width:860px){
  .i2v{grid-template-columns:1fr}
}
/* 图转视频：.btn 的 display:inline-flex 会盖掉 [hidden] 的 display:none，
   导致未生成时「新窗口打开 / 下载视频 / 复制地址」直接露出来，这里强制收口 */
.i2v [hidden]{display:none!important}

/* 图转视频：供应商/参数区补充样式（同样只吃主题变量） */
.i2v-row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.i2v-chip{
  display:inline-block;margin-left:8px;padding:1px 8px;border-radius:20px;
  font-size:11.5px;font-weight:400;background:var(--bg-2);color:var(--gray-2);
  border:1px solid var(--line);vertical-align:1px;
}
.i2v-chip.on{background:var(--brand-soft);color:var(--brand);border-color:transparent}
.i2v-bar{height:6px;border-radius:99px;background:var(--bg-2);border:1px solid var(--line);overflow:hidden;margin:0 0 12px}
.i2v-bar i{display:block;height:100%;width:0;background:var(--brand);border-radius:99px;transition:width .35s ease}
.i2v-alert{
  background:var(--warn-bg);color:var(--warn);border:1px solid transparent;
  border-radius:var(--r-sm);padding:10px 14px;font-size:13px;margin-bottom:16px;line-height:1.7;
}
.i2v-alert code{background:rgba(0,0,0,.06);border-radius:5px;padding:1px 5px;font-size:12px}
[data-theme="dark"] .i2v-alert{background:rgba(210,155,70,.14);color:#e1bf85}
[data-theme="dark"] .i2v-alert code{background:rgba(255,255,255,.08)}
[data-theme="dark"] .i2v-chip{background:var(--d-bg-3);border-color:var(--d-line);color:var(--d-txt-3)}
[data-theme="dark"] .i2v-chip.on{background:var(--d-brand-soft);color:var(--d-gold);border-color:transparent}
[data-theme="dark"] .i2v-bar{background:var(--d-bg-3);border-color:var(--d-line)}

/* 图转视频：画幅比例按钮组（.ic b 的宽高按比例内联给出，这里只负责外框与配色） */
.i2v-ratios{display:flex;flex-wrap:wrap;gap:8px}
.i2v-ratio{
  display:inline-flex;align-items:center;gap:6px;flex:none;
  padding:6px 11px;border-radius:var(--r-sm);cursor:pointer;font-family:inherit;
  background:var(--bg-2);border:1px solid var(--line);color:var(--gray);
  font-size:13px;line-height:1;
  transition:background .18s,border-color .18s,color .18s;
}
.i2v-ratio:hover{border-color:var(--brand);color:var(--brand)}
.i2v-ratio .ic{width:18px;height:18px;display:flex;align-items:center;justify-content:center;flex:none}
.i2v-ratio .ic b{display:block;border:1.5px solid currentColor;border-radius:2px;opacity:.7}
.i2v-ratio.on{background:var(--brand-soft);border-color:transparent;color:var(--brand);font-weight:500}
.i2v-ratio.on .ic b{opacity:1}
[data-theme="dark"] .i2v-ratio{background:var(--d-bg-3);border-color:var(--d-line);color:var(--d-txt-3)}
[data-theme="dark"] .i2v-ratio:hover{border-color:var(--d-gold);color:var(--d-gold)}
[data-theme="dark"] .i2v-ratio.on{background:var(--d-brand-soft);color:var(--d-gold);border-color:transparent}

/* 图转视频：窄屏适配
   1) 5 个比例按钮等分一行，避免放不下时出现「4+1」孤行；
   2) 时长/生成模式改单列，否则下拉框太窄会把「首帧驱动（让这张图动起来）」截断 */
@media (max-width:520px){
  .i2v-row2{grid-template-columns:1fr}
  .i2v-ratios{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
  .i2v-ratio{justify-content:center;padding:7px 4px;gap:4px;font-size:12px}
}

/* 图转视频：失败详情框（红）—— 与 .i2v-alert 同用，靠后定义覆盖成红色 */
.i2v-alert-err{
  background:rgba(214,69,69,.09);color:#b93b3b;border:1px solid rgba(214,69,69,.22);
  white-space:pre-wrap;word-break:break-word;
}
[data-theme="dark"] .i2v-alert-err{background:rgba(214,69,69,.16);color:#e79a9a;border-color:rgba(214,69,69,.3)}

/* 图转视频：原「排查帮助区」（.i2v-help / .i2v-steps / .i2v-faq）已按用户要求整块下线，
   对应的样式一并无用，已删除。若日后要恢复那一段说明，把 DOM 放回去后样式可从这里删掉前的
   版本找回（git 或部署包历史里都有）。 */

/* ============================================================
   图转视频 2026-09-10 布局调整（新增部分，全部只追加）
   1) 「AI 大模型相关参数」收进弹窗 .i2v-mask / .i2v-modal；
   2) 「生成结果」下方新增最近生成历史 .i2v-his。
   （画幅原本有个只读展示 .i2v-ro，已按用户要求连同该区块一起下线，样式一并删除）
   颜色仍全部取主题变量，浅色/深色自动跟随。
   ============================================================ */

/* ---- 标题行 + 配置状态 ---- */
.i2v-trow{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:4px}
.i2v-trow h3{margin:0}
.i2v-trow .btn{margin:0}
.i2v-cfgline{font-size:12.5px;color:var(--gray-2);margin:0 0 18px;line-height:1.7}

/* ---- AI 模型配置弹窗 ---- */
.i2v-mask{
  position:fixed;inset:0;z-index:200;padding:18px;
  background:rgba(12,12,16,.5);
  display:flex;align-items:center;justify-content:center;
}
.i2v-mask[hidden]{display:none!important}
.i2v-modal{
  width:min(520px,100%);max-height:88vh;overflow:auto;
  background:#fff;border:1px solid var(--line);border-radius:var(--r);
  box-shadow:0 24px 60px rgba(0,0,0,.28);
}
.i2v-modal-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 20px 0}
.i2v-modal-h h3{margin:0}
.i2v-x{
  flex:none;width:30px;height:30px;border-radius:50%;cursor:pointer;font-family:inherit;
  background:var(--bg-2);border:1px solid var(--line);color:var(--gray);
  font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;
}
.i2v-x:hover{color:var(--brand);border-color:var(--brand)}
.i2v-modal-b{padding:14px 20px 2px}
.i2v-modal-f{display:flex;gap:10px;padding:14px 20px 20px}
body.i2v-noscroll{overflow:hidden}
[data-theme="dark"] .i2v-modal{background:var(--d-bg-2);color:var(--d-txt);border-color:var(--d-line)}
[data-theme="dark"] .i2v-x{background:var(--d-bg-3);border-color:var(--d-line);color:var(--d-txt-2)}

/* ---- 最近生成（历史） ---- */
.i2v-his{margin-top:18px;border-top:1px solid var(--line);padding-top:14px}
.i2v-his-h{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.i2v-his-h h4{margin:0;font-size:14px}
.i2v-his-note{font-size:12px;color:var(--gray-2)}
.i2v-hi{
  border:1px solid var(--line);border-radius:var(--r-sm);
  padding:10px 12px;margin-bottom:8px;background:var(--bg-3);
}
.i2v-hi:last-child{margin-bottom:0}
.i2v-hi-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.i2v-hi-top>span:not(.badge){font-size:12px;color:var(--gray-2)}
.i2v-hi-prompt{
  font-size:12.5px;color:var(--gray);line-height:1.6;margin-bottom:6px;word-break:break-word;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.i2v-hi-link{
  display:block;font-size:12.5px;color:var(--brand);line-height:1.6;
  word-break:break-all;text-decoration:none;
}
.i2v-hi-link:hover{text-decoration:underline}
.i2v-hi-nourl{font-size:12.5px;color:var(--gray-2);line-height:1.6;word-break:break-word}
.i2v-hi-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.i2v-hi-acts .btn{margin:0}
.i2v-hi-empty{font-size:12.5px;color:var(--gray-2);margin:0}
[data-theme="dark"] .i2v-hi{background:var(--d-bg-3);border-color:var(--d-line)}
[data-theme="dark"] .i2v-his{border-top-color:var(--d-line)}

/* 窄屏：历史里的按钮允许换行排布，别把地址挤没 */
@media (max-width:520px){
  .i2v-his-h h4{width:100%}
  .i2v-hi-acts .btn,.i2v-hi-acts a{flex:1 1 auto;justify-content:center}
}

/* ==================== 穿搭槽位勾选（形象打造） ==================== */

/* 槽位行：名称 + 提示 + 商品网格 */
.slot-row{margin-bottom:18px}
.slot-row:last-child{margin-bottom:0}
.slot-hd{
  display:flex;align-items:baseline;justify-content:space-between;
  margin-bottom:8px;gap:8px;
}
.slot-name{font-size:14px;font-weight:600}
.slot-name .req{color:var(--err,#e5484d)}
.slot-tip{font-size:12px}

/* 商品网格：小卡片自适应换行 */
.goods-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));
  gap:10px;
}
.goods-card{
  position:relative;display:block;cursor:pointer;
  border:1.5px solid var(--line);border-radius:var(--r-sm);
  padding:6px;background:var(--bg-2);transition:border-color .15s,box-shadow .15s,transform .15s;
}
.goods-card:hover{border-color:var(--brand);transform:translateY(-1px)}
.goods-card input{position:absolute;opacity:0;pointer-events:none}
.goods-card input:checked ~ .goods-check{
  opacity:1;transform:scale(1);
}
/* 勾中态：整卡高亮 */
.goods-card:has(input:checked){
  border-color:var(--brand);
  box-shadow:0 0 0 1px var(--brand);
  background:color-mix(in srgb,var(--brand) 6%,var(--bg-2));
}
.goods-card.skip:has(input:checked){
  border-color:var(--gray-2);box-shadow:none;background:var(--bg-2);
}
.goods-img{
  aspect-ratio:1/1;border-radius:var(--r-sm);overflow:hidden;
  display:flex;align-items:center;justify-content:center;
  background:var(--bg-3);margin-bottom:6px;
}
.goods-img img{width:100%;height:100%;object-fit:cover;display:block}
.goods-nm{
  font-size:12.5px;line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.goods-pr{font-size:12px;color:var(--gray-2);margin-top:2px}
.goods-check{
  position:absolute;top:6px;right:6px;width:20px;height:20px;
  display:flex;align-items:center;justify-content:center;
  border-radius:50%;background:var(--brand);color:#fff;font-size:12px;font-style:normal;
  opacity:0;transform:scale(.4);transition:all .15s;
}
.skip-ic{
  width:56px;height:56px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;color:var(--gray-2);
  border:2px dashed var(--gray-2);
}

/* 购买卡片：结果图上的单品购买入口 */
.buy-ic{font-style:normal;margin-right:4px}

/* 暗色主题适配 */
[data-theme="dark"] .goods-card{background:var(--d-bg-2);border-color:var(--d-line)}
[data-theme="dark"] .goods-card:hover{border-color:var(--brand)}
[data-theme="dark"] .goods-card:has(input:checked){background:color-mix(in srgb,var(--brand) 10%,var(--d-bg-2))}
[data-theme="dark"] .goods-card.skip:has(input:checked){background:var(--d-bg-2)}
[data-theme="dark"] .goods-img{background:var(--d-bg-3)}
[data-theme="dark"] .skip-ic{border-color:var(--gray-2)}

/* 窄屏：商品网格最小卡片宽度收紧 */
@media (max-width:520px){
  .goods-grid{grid-template-columns:repeat(auto-fill,minmax(84px,1fr))}
}

/* 数字输入框去掉上下小箭头（spinner）：外观更干净，键盘上下键仍可微调 */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
input[type=number]{-moz-appearance:textfield;appearance:textfield}
