/* =========================================================
   首页工作台 —— 视觉基准 home-v3.html（design-system v1.1）
   只引 tokens.css 的语义层变量，不手写色值。
   ========================================================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg-page); color: var(--fg-1);
       font-family: var(--font-sans); font-size: var(--fs-sm); line-height: 1.55;
       -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
@supports (font-variant-numeric: tabular-nums) { body { font-variant-numeric: tabular-nums; } }

:root { --r-card: 14px; }

/* =========================================================
   顶栏
   ========================================================= */
.topbar { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter);
          border-bottom: var(--hairline); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; display: block; flex: none; background: #fff; box-shadow: 0 0 0 1px rgba(26, 24, 21, .08); }
.nav { margin-left: 16px; display: flex; gap: 2px; }
.nav a, .nav button { font-size: 13px; color: var(--fg-2); padding: 6px 9px; border-radius: var(--r-sm);
                      background: none; border: 0; cursor: pointer; transition: color var(--dur-1) var(--ease-out); }
.nav a:hover, .nav button:hover { background: var(--ink-50); color: var(--fg-1); }
.right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.pts { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px;
       border: 1px solid var(--ink-200); border-radius: var(--r-full); font-size: 12px; color: var(--fg-2);
       background: var(--paper); }
.pts .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-600); flex: none; }
.pts b { font-family: var(--font-mono); font-weight: 500; color: var(--fg-1); font-size: 13px; }

/* 签到/礼包弹层卡片（原顶栏签到小卡已下线，统一走弹层） */
.pts-wrap { position: relative; display: inline-flex; }

.gift-box { max-width: 320px; text-align: center; }
.gift-box .pop-acts { justify-content: center; margin-top: 2px; }
.gift-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em;
                text-transform: uppercase; color: var(--brand-600); }
.gift-box h3 { margin: 2px 0 0; font-size: 16px; }
.gift-amount { font-family: var(--font-mono); font-size: 30px; font-weight: 600;
               color: var(--ink-900); letter-spacing: -.02em; padding: 2px 0 0; }
.gift-box p { justify-self: center; max-width: 240px; }

.btn { height: 36px; padding: 0 15px; border-radius: var(--r-md); border: 1px solid transparent;
       font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
       gap: 6px; cursor: pointer; white-space: nowrap;
       transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out); }
.btn-primary { background: var(--btn-primary-bg); color: #fff; box-shadow: 0 1px 2px rgba(29,106,229,.28); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); }
.btn-primary:active { background: var(--btn-primary-bg-pressed); transform: translateY(1px); }
.btn-secondary { background: var(--paper); color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.btn-secondary:hover { background: var(--btn-secondary-canvas, var(--canvas)); border-color: var(--btn-secondary-border-hover); }
.btn-ghost { background: transparent; color: var(--btn-ghost-fg); }
.btn-ghost:hover { background: var(--btn-ghost-bg-hover); }
.btn[disabled] { background: transparent; color: var(--fg-3); border-color: var(--ink-200); box-shadow: none; cursor: default; }
.btn:focus-visible { outline: none; box-shadow: var(--sh-focus); }
.sign { height: 30px; padding: 0 12px; font-size: 12px; }
.sign em { font-style: normal; font-family: var(--font-mono); opacity: .82; }

/* =========================================================
   首屏
   ========================================================= */
.hero { max-width: 1240px; margin: 0 auto; padding: 30px var(--gutter) 0; }

.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px;
           color: var(--fg-3); letter-spacing: 0.02em; margin-bottom: 13px; }
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: var(--brand-600); flex: none; }

.h1 { margin: 0 0 14px; font-size: clamp(27px, 3.6vw, 47px); line-height: 1.14;
      letter-spacing: -0.035em; font-weight: 600; }
.lead { margin: 0 0 22px; font-size: 14px; line-height: 1.72; color: var(--fg-2);
        max-width: 37em; text-wrap: pretty; }
.lead b { color: var(--fg-1); font-weight: 500; white-space: nowrap; }

/* ---------- 工作台：左纸右屏 ---------- */
.tool { display: flex; flex-direction: column; border: 1px solid var(--ink-200); border-radius: var(--r-card);
        overflow: hidden; background: var(--paper); box-shadow: var(--sh-2);
        height: clamp(400px, 58vh, 540px); }
.panes { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
.pane { position: relative; min-width: 0; display: flex; flex-direction: column; }

.pane-head { height: 42px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px;
             border-bottom: var(--hairline); font-size: 12px; color: var(--fg-3); }
.pane-head .tag { display: inline-flex; align-items: center; gap: 6px; }
.pane-head .tag i { width: 5px; height: 5px; border-radius: 1px; background: var(--brand-600); flex: none; }
.pane-head .tag span { color: var(--fg-1); font-size: 12.5px; font-weight: 500; letter-spacing: -0.005em; }
/* 分辨率紧跟「原图」标签，不随右侧工具条显隐左右跳；靠右交给 .mtools 的 margin-left:auto */
.pane-head .meta { margin-left: 2px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.01em; }
/* 工作区全屏按钮：贴头部最右；全屏态 #tool 铺满视口但露出顶部导航（topbar z-20 > tool z-15） */
.pane-head .fs-btn { margin-left: auto; flex: none; height: 26px; padding: 0 9px; font-size: 11.5px; }
/* 滚动条锁定：overflow hidden 隐藏滚动条时用 scrollbar-gutter 保住右侧预留区，
   视口宽度恒定 → 页面元素不发生横向重排（否则居中容器会左右跳） */
html.stage-lock { overflow: hidden; scrollbar-gutter: stable; }
body.stage-full #tool {
  position: fixed; left: 0; right: 0;
  top: var(--stage-top, 56px); z-index: 15;
  height: calc(100vh - var(--stage-top, 56px));
  border-radius: 0; border: 0; box-shadow: none;
  will-change: transform;
}
/* 飞行动画由 JS 逐帧插值 transform（不触发重排，内部元素按终态布局排好、无收尾回缩） */

.pane-body { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }

.frame { position: absolute; inset: 14px; }
.frame > img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.frame > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.frame > canvas { position: absolute; display: block; }

/* 左：上传 / 图片 */
.empty-note { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.drop { border: 1.5px dashed #CFC7B8; border-radius: var(--r-md); padding: 30px 30px;
        display: grid; justify-items: center; gap: 10px; background: rgba(255, 255, 255, .66);
        transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out); }
.drop:hover, .drop.over { border-color: #B4AA98; background: var(--paper); }
.drop .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--paper);
            border: 1px solid var(--ink-200); display: grid; place-items: center; color: var(--fg-3);
            margin: 0 auto; box-shadow: var(--sh-1); }
.drop .t1 { font-size: 13.5px; color: var(--fg-1); letter-spacing: -0.01em; }
.drop .t2 { font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }
.drop .btn { margin-top: 4px; }

.upbar { margin: 14px auto 0; width: min(220px, 70%); }
.upbar-track { height: 4px; border-radius: var(--r-full); background: var(--ink-100); overflow: hidden; }
.upbar-track i { display: block; height: 100%; width: 2%; background: var(--progress-fill); border-radius: var(--r-full);
                 transition: width var(--dur-2) var(--ease-out); }
.upbar-text { display: block; margin-top: 7px; font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); }

/* 候选框（SVG） */
.mks { touch-action: manipulation; }
.mkg { pointer-events: auto; cursor: pointer; }
.mkg rect { fill: rgba(60,54,46,.06); stroke: #9C968C; stroke-width: 2; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; }
.mkg circle { fill: #8F8A81; }
.mkg text { fill: #fff; font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-anchor: middle; }
.mkg text.pl { fill: #6B665E; font-family: var(--font-sans); font-size: 11px; font-weight: 400; text-anchor: start; }
.mkg:hover rect { fill: rgba(60,54,46,.10); }
.mkg.sel rect { fill: rgba(29,106,229,.16); stroke: var(--brand-600); stroke-width: 3; stroke-dasharray: none; }
.mkg.sel circle { fill: var(--brand-600); }

#maskCanvas { touch-action: none; cursor: crosshair; z-index: 2; }

/* 左侧识别进度：复用右侧那套 .gen，只把底图留着（模糊一档），两边进度长得一样 */
.gen.analyze { background: rgba(250, 247, 241, .76); backdrop-filter: blur(3px); }

/* 画笔工具条：现在挂在图片头部（.pane-head 内一行），这里只保留通用按钮样式 */
.tb { height: 26px; min-width: 26px; padding: 0 8px; border: 0; border-radius: var(--r-full); background: transparent;
      font-size: 11.5px; color: var(--fg-2); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tb:hover { background: var(--ink-50); }
.tb.on { background: var(--ink-900); color: #fff; }
.tb[disabled] { opacity: .32; cursor: default; }
.sz { display: flex; align-items: center; gap: 3px; padding: 0 4px; }
.sz button { width: 22px; height: 22px; padding: 0; border: 1px solid transparent; background: transparent; border-radius: 50%;
             display: grid; place-items: center; cursor: pointer; }
.sz button i { display: block; border-radius: 50%; background: var(--fg-3); }
.sz button.on { border-color: var(--ink-900); }
.sz button.on i { background: var(--ink-900); }

/* ---------- 右：3D 舞台 ---------- */
.pane-stage { background: var(--paper); border-left: var(--hairline); border-radius: 0 var(--r-card) 0 0; }

.viewer { position: absolute; inset: 0; display: block; overflow: hidden;
          background: radial-gradient(120% 90% at 50% 10%, #F3EFE8 0%, #E7E1D7 72%); }
.viewer canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none;
                 transition: opacity var(--dur-4) var(--ease-out); }
.viewer canvas#c3d { position: absolute; }
.viewer canvas:active { cursor: grabbing; }
.viewer.is-generating canvas, .viewer.is-generating .stage-badge { opacity: 0; }
.stage-badge { position: absolute; left: 14px; bottom: 12px; z-index: 3; display: inline-flex; align-items: center;
               gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--r-full);
               background: rgba(255,255,255,.78); border: 1px solid var(--ink-200);
               font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .04em; color: var(--fg-3);
               pointer-events: none; backdrop-filter: blur(6px); }
.stage-badge[hidden] { display: none !important; }

/* 生成进度：只在舞台正中一处，有旧结果时降为卡片（见下方 .gen.over） */

/* 旧版分阶段列表（.prog 已无标记引用） */
.prog { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 16px; padding: 24px; z-index: 3; }
.prog .pct { font-family: var(--font-mono); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; color: var(--fg-1); line-height: 1; }
.prog .stages { display: grid; gap: 9px; width: min(300px, 84%); }
.prog .stg { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--fg-3); }
.prog .stg i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-200); flex: none; }
.prog .stg.done i { background: var(--ink-900); }
.prog .stg.now i { background: var(--brand-600); box-shadow: 0 0 0 3px var(--brand-50); }
.prog .stg.now { color: var(--fg-1); }
.prog .stg span:last-child { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; }
.prog .bar { width: min(300px, 84%); height: 5px; border-radius: var(--r-full); background: var(--ink-100); overflow: hidden; }
.prog .bar i { display: block; height: 100%; width: 0%; background: var(--progress-fill); border-radius: var(--r-full);
               transition: width var(--dur-2) var(--ease-out); }
.prog .note { font-size: 11.5px; color: var(--fg-3); text-align: center; }

/* 失败 / 额度 / 空态卡片 */
.status { position: absolute; inset: 0; z-index: 3; display: grid; align-content: center; justify-items: center;
          gap: 10px; padding: 28px; text-align: center; }
.status-t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.status-d { font-size: 12.5px; color: var(--fg-3); line-height: 1.7; max-width: 30ch; }
.status-acts { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.status-acts .btn { height: 34px; }

/* ---------- 底部操作条 ---------- */
.toolbar { flex: none; height: 60px; min-height: 60px; border-top: var(--hairline); background: var(--paper);
           display: flex; align-items: center; gap: 12px; padding: 0 14px; }
.toolbar .info { font-size: 12.5px; color: var(--fg-2); min-width: 0; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
.toolbar .info b { color: var(--fg-1); font-weight: 500; }
.toolbar .barhint { font-size: 11.5px; color: var(--fg-3); white-space: nowrap;
                    padding-left: 12px; border-left: 1px solid var(--ink-100); }
.toolbar .barhint:empty { display: none; }
.toolbar .sp { margin-left: auto; }
.toolbar .acts { display: flex; gap: 8px; flex: none; }
.toolbar .btn { height: 34px; }

/* ---------- 下载菜单 ---------- */
.dlmenu { position: fixed; z-index: 60; width: 288px; padding: 8px; border-radius: 12px;
          background: var(--paper); border: 1px solid var(--ink-200); box-shadow: var(--sh-2); }
.dlmenu-h { font-size: 10.5px; color: var(--fg-3); letter-spacing: .05em; padding: 4px 8px 7px; }
.dlmenu button { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 8px; border: 0;
                 background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.dlmenu button:hover { background: var(--ink-50); }
.dlmenu button b { font-family: var(--font-mono); font-size: 12px; color: var(--fg-1); font-weight: 600; min-width: 34px; }
.dlmenu button span { font-size: 11.5px; color: var(--fg-3); }
.dlmenu button[disabled] { opacity: .45; cursor: default; }
.dlmenu-stl { border-top: var(--hairline); margin-top: 4px; padding-top: 4px; }
/* GLB 行：左边是下载入口，右边是「一个场景 / 分别下载」滑块 */
.dlglb { display: flex; align-items: center; gap: 6px; }
.dlmenu .dlglb-main { flex: 1 1 auto; width: auto; min-width: 0; }
.dlglb-main span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dltoggle { position: relative; flex: none; display: inline-flex; padding: 2px; border-radius: var(--r-full);
            background: var(--ink-100); }
.dltoggle-thumb { position: absolute; top: 2px; left: 0; height: 22px; border-radius: var(--r-full);
                  background: var(--paper); box-shadow: var(--sh-1);
                  transition: transform .24s cubic-bezier(.34, 1.16, .64, 1), width .24s var(--ease-out); }
.dltoggle.instant .dltoggle-thumb { transition: none; }
.dlmenu .dltoggle button { position: relative; z-index: 1; width: auto; height: 22px; padding: 0 9px; border: 0;
                           border-radius: var(--r-full); background: transparent; font-size: 10.5px;
                           color: var(--fg-3); white-space: nowrap; display: inline-flex; align-items: center;
                           cursor: pointer; transition: color .18s var(--ease-out); }
.dlmenu .dltoggle button:hover { color: var(--fg-1); }
.dlmenu .dltoggle button.on { background: transparent; color: var(--fg-1); }
@media (prefers-reduced-motion: reduce) {
  .dltoggle-thumb { transition: none; }
}
.dlsize { display: flex; align-items: center; gap: 6px; padding: 0 8px 6px; font-size: 11.5px; color: var(--fg-3); }
.dlsize input { width: 62px; height: 26px; padding: 0 7px; border: 1px solid var(--ink-200); border-radius: 6px;
                background: var(--paper); font-size: 12px; font-family: var(--font-mono); color: var(--fg-1); }
.dlsize input:focus { outline: none; border-color: var(--brand-400); box-shadow: var(--sh-focus); }
.dlmenu-sep { margin-top: 4px; padding: 8px 8px 3px; border-top: var(--hairline);
              font-size: 10.5px; color: var(--fg-3); letter-spacing: .05em; }
.dlmenu [hidden] { display: none !important; }
.dlmenu-note { font-size: 11px; color: var(--fg-3); padding: 6px 8px 2px; line-height: 1.5; }

/* ---------- 规格条 ---------- */
.spec { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px;
        border-top: 1px solid var(--ink-300); border-bottom: var(--hairline); }
.spec .sp-i { padding: 13px 16px 14px 0; }
.spec .sp-i + .sp-i { padding-left: 16px; border-left: var(--hairline); }
.spec .k { display: block; font-size: 10px; letter-spacing: .06em; color: var(--fg-3); margin-bottom: 5px; }
.spec .v { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; }
.spec .v b { font-family: var(--font-mono); font-weight: 500; color: var(--fg-1); font-size: 13px; }

/* =========================================================
   区块
   ========================================================= */
.sec { max-width: 1240px; margin: 0 auto; padding: 64px var(--gutter) 0; }
.sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.sec h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.sec .sub { margin: 0; font-size: 12.5px; color: var(--fg-3); }

.steps { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: start;
         border-top: 1px solid var(--ink-900); padding-top: 26px; }
.steps-h h2 { margin: 0 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.steps-h p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--fg-3); max-width: 26ch; }
.steps-h .accent { margin-top: 16px; display: inline-flex; align-items: center; gap: 7px;
                   font-family: var(--font-mono); font-size: 11px; color: var(--fg-2);
                   padding: 5px 10px; border: 1px solid var(--ink-200); border-radius: var(--r-full); background: var(--paper); }
.steps-h .accent i { width: 5px; height: 5px; border-radius: 50%; background: var(--success-600); }
.step-list { border-top: var(--hairline); }
.step { display: grid; grid-template-columns: 46px 176px 1fr; gap: 16px; align-items: baseline;
        padding: 17px 0; border-bottom: var(--hairline); }
.step .n { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); letter-spacing: .02em; }
.step .t { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.step .d { font-size: 12.5px; color: var(--fg-3); line-height: 1.72; }

.cases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.case { border: var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--paper);
        transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.case:hover { border-color: var(--ink-200); box-shadow: var(--sh-2); }
.case .art { position: relative; aspect-ratio: 4/3; overflow: hidden;
             background: linear-gradient(168deg, #F2EFE8 0%, #EAE6DC 56%, #DFDACC 100%);
             display: grid; place-items: center; }
.case .art svg { position: relative; width: 74%; height: 74%; z-index: 1; display: block; }
.case .art img { position: relative; width: 100%; height: 100%; z-index: 1; display: block; object-fit: contain; }
.case .cap { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-top: var(--hairline); }
.case .cap b { font-family: var(--font-mono); font-weight: 500; color: var(--fg-3); font-size: 10.5px; }
.case .cap .nm { font-size: 12px; color: var(--fg-1); }
.case .cap .ms { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); }

.foot { max-width: 1240px; margin: 72px auto 0; padding: 22px var(--gutter) calc(30px + var(--safe-b));
        border-top: var(--hairline); display: flex; align-items: center; gap: 18px;
        font-size: 11.5px; color: var(--fg-3); }
.foot .brand-s { font-weight: 600; color: var(--fg-2); font-size: 12.5px; }
.foot a:hover { color: var(--fg-1); }
.foot .sp { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .03em; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(8px);
         z-index: 80; max-width: min(420px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 10px;
         background: var(--ink-900); color: #fff; font-size: 12.5px; line-height: 1.5;
         box-shadow: 0 8px 24px rgba(26,24,21,.24); opacity: 0; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger-600, #B42323); }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1024px) {
  .steps { grid-template-columns: 240px 1fr; gap: 36px; }
  .step { grid-template-columns: 38px 150px 1fr; gap: 12px; }
}
@media (max-width: 900px) {
  .hero { padding: 14px 12px 0; }
  /* v4 手机稿：标题下面直接就是工具卡，不再放眉题和引文 */
  .eyebrow, .lead { display: none; }
  .h1 { font-size: 19px; letter-spacing: -0.02em; margin-bottom: 14px; }
  .lead { font-size: 13.5px; }
  .tool { height: auto; }
  .panes { grid-template-columns: 1fr; grid-template-rows: 1.1fr 1fr; }
  .pane { min-height: 250px; }
  .pane-stage { border-radius: 0; border-left: 0; border-top: var(--hairline); }
  .spec { grid-template-columns: 1fr 1fr; border-bottom: 0; }
  .spec .sp-i { padding: 11px 12px 12px 0; }
  .spec .sp-i + .sp-i { padding-left: 12px; }
  .spec .sp-i:nth-child(2n+1) { border-left: 0; }
  .spec .sp-i:nth-child(n+3) { border-top: var(--hairline); }
  .sec { padding-top: 46px; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .steps-h p { max-width: none; }
  .step { grid-template-columns: 34px 1fr; gap: 4px 12px; padding: 14px 0; }
  .step .d { grid-column: 2; }
  .cases { grid-template-columns: 1fr 1fr; gap: 10px; }
  .case .art svg { width: 72%; height: 72%; }
  .sec-h { flex-direction: column; align-items: flex-start; gap: 7px; }
  .foot { margin-top: 46px; flex-wrap: wrap; gap: 12px 16px; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .toolbar { height: 56px; gap: 8px; padding: 0 10px; }
  .toolbar .barhint { display: none; }
  .toolbar .info { font-size: 12px; }
  .toolbar .btn { height: 32px; padding: 0 11px; font-size: 12.5px; }
}

/* =========================================================
   通栏底栏左侧动作（结果态「换一张图」）
   ========================================================= */
.left-tools { display: flex; gap: 6px; flex: none; }
.left-tools .btn { height: 30px; padding: 0 11px; font-size: 12px; }
.left-tools:empty { display: none; }

/* 手机端作品库入口 */
.lib-link { display: none; font-size: 12.5px; color: var(--fg-2); padding: 6px 8px; border-radius: var(--r-sm); }
.lib-link:hover { background: var(--ink-50); color: var(--fg-1); }
.nav a.on { color: var(--fg-1); background: var(--ink-50); }

/* =========================================================
   作品库
   ========================================================= */
#libraryPage { max-width: 1240px; margin: 0 auto; padding: 26px var(--gutter) 64px; }
.lib-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.lib-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.lib-sub { margin: 6px 0 0; font-size: 12.5px; color: var(--fg-3); }
.lib-head-acts { margin-left: auto; display: flex; gap: 8px; }

.lib-bar { display: flex; align-items: center; gap: 12px; padding: 10px 0;
           border-top: var(--hairline); border-bottom: var(--hairline); }
.seg { display: flex; gap: 2px; padding: 2px; background: var(--ink-50); border-radius: var(--r-sm); }
.seg button { height: 26px; padding: 0 11px; border: 0; background: transparent; border-radius: var(--r-xs);
              font-size: 12px; color: var(--fg-3); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--fg-1); box-shadow: var(--sh-1); }
.lib-count { font-size: 12px; color: var(--fg-3); }
.lib-total { margin-left: auto; font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); }

.lib-list { margin-top: 2px; }
.thead, .lib-row { display: grid; grid-template-columns: 64px minmax(0, 1.9fr) 126px 100px 92px 170px;
                   gap: 14px; align-items: center; }
.thead { height: 34px; font-size: 11px; color: var(--fg-3); border-bottom: var(--hairline); }
.thead .th-acts { text-align: right; }
.lib-row { padding: 10px 0; border-bottom: var(--hairline); cursor: pointer;
           transition: background-color var(--dur-1) var(--ease-out); }
.lib-row:hover { background: rgba(255, 255, 255, .6); }

.thumb { width: 64px; height: 48px; border-radius: var(--r-sm); background: var(--bg-subtle);
         border: var(--hairline); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { color: var(--ink-400); }

.name { min-width: 0; }
.name .t { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 7px;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name .s { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--fg-3);
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-xs);
        font-size: 10.5px; white-space: nowrap; }
.mode.tex { background: var(--brand-50); color: var(--brand-700); }
.mode.ver { background: var(--ink-50); color: var(--fg-3); border: var(--hairline); }

.lib-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.lib-status { font-size: 11.5px; white-space: nowrap; }
.lib-status.done { color: var(--success-600); }
.lib-status.running { color: var(--brand-700); }
.lib-status.queued { color: var(--fg-3); }
.lib-status.failed { color: var(--danger-600); }

.row-acts { display: flex; justify-content: flex-end; gap: 4px; }
.iBtn { width: 30px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm);
        color: var(--fg-3); cursor: pointer; display: grid; place-items: center; }
.iBtn:hover { background: var(--ink-50); color: var(--fg-1); }
.iBtn.del:hover { background: var(--danger-50, #FBEDED); color: var(--danger-600); }
.iBtn[disabled] { opacity: .35; cursor: default; }
.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover { background: var(--danger-700, #971C1C); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }

/* 空态 */
.lib-empty { display: grid; place-items: center; padding: 90px 0 60px; }
.lib-empty-in { display: grid; justify-items: center; text-align: center; gap: 12px; max-width: 380px; }
.lib-empty-in .box { width: 96px; height: 96px; border-radius: var(--r-lg, 14px); border: 1.5px dashed var(--ink-300);
                     display: grid; place-items: center; color: var(--ink-400); }
.lib-empty-in h2 { margin: 6px 0 0; font-size: 16px; font-weight: 600; }
.lib-empty-in p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--fg-3); }
.lib-empty-in .row2 { display: flex; gap: 8px; margin-top: 4px; }

/* 套餐弹窗（订阅卡） */
.pop-box.pricing-box { max-width: 680px; gap: 12px; padding: 18px 20px 16px; }  /* 压过 .pop-box 的 340px；三卡一行，收窄改善宽高比 */
.pricing-box h3 { font-size: 17px; }
.pricing-sub { font-size: 12px; color: var(--fg-3); }
.plan-list { display: grid; gap: 8px; }
.plan-grid { display: grid; gap: 10px; }
.plan-grid.sub-grid { grid-template-columns: repeat(3, 1fr); }
.plan.premium { display: grid; gap: 6px; padding: 16px 13px; border-radius: 14px; align-content: start;
                background: linear-gradient(140deg, var(--brand-50) 0%, #FFFFFF 78%);
                border: 1px solid var(--brand-400); position: relative; }
.plan.premium.rec { border-color: var(--brand-600); box-shadow: 0 8px 22px -14px rgba(29, 106, 229, .55); }
.plan.premium .nm { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.plan.premium .nm .tagx { font-size: 10.5px; padding: 1.5px 8px; border-radius: 999px;
                          background: var(--brand-600); color: #fff; font-weight: 600; }
.plan.premium .daily { display: inline-flex; align-items: center; gap: 4px; width: fit-content;
                       font-size: 12px; font-weight: 600; color: var(--brand-700);
                       background: rgba(29, 106, 229, .10); border-radius: 999px; padding: 4px 10px; }
.plan.premium .daily b { font-family: var(--font-mono); }
.plan.premium .pt { font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.plan.premium .pt i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--fg-3); }
.plan.premium .pr { font-size: 15px; color: var(--ink-900); font-weight: 600; display: flex; align-items: baseline; gap: 6px; }
.plan.premium .pr i { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--fg-3); }
.plan.premium .first { font-size: 12px; font-weight: 600; color: var(--brand-700); }
.plan.premium .nt { font-size: 11.5px; color: var(--fg-3); line-height: 1.5; }
.plan.premium .buy { margin-top: 6px; height: 36px; font-size: 13px; border-radius: 9px; border: 0; cursor: pointer;
                     background: var(--btn-primary-bg); color: var(--btn-primary-fg); font-family: inherit;
                     transition: background .16s ease; }
.plan.premium .buy:hover:not(:disabled) { background: var(--btn-primary-bg-hover); }
.plan.premium .buy:disabled { background: #ececee; color: #9aa0a6; cursor: not-allowed; }
@media (max-width: 560px) {
  .pop-box.pricing-box { max-width: 340px; }
  .plan-grid.sub-grid { grid-template-columns: 1fr; }
}
.pay-qr { display: grid; gap: 10px; justify-items: center; padding: 8px 0 0; }
.pay-qr h4 { margin: 0; font-size: 14px; }
.pay-qr #qrBox { width: 180px; height: 180px; padding: 10px; background: #fff;
                 border-radius: 10px; border: var(--hairline); }
.pay-amount { margin: 0; font-family: var(--font-mono); font-size: 18px; font-weight: 600; }
.pay-tip { font-size: 11.5px; color: var(--fg-3); }

/* 确认弹层（删除作品 / 刷新清空） */
.pop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
       background: rgba(26, 24, 21, .28); padding: 20px; }
.pop-box { width: 100%; max-width: 340px; background: var(--paper); border-radius: 14px;
           box-shadow: 0 18px 48px -18px rgba(26, 24, 21, .35); padding: 20px; display: grid; gap: 14px; }
.pop-box h3 { margin: 0; font-size: 15px; font-weight: 600; }
.pop-box p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--fg-3); }
.pop-acts { display: flex; gap: 8px; justify-content: flex-end; }

/* 登录 / 注册弹层 */
.auth-tabs { display: flex; gap: 4px; background: var(--bg-subtle); border-radius: 9px; padding: 3px; }
.auth-tab { flex: 1; height: 30px; border: 0; border-radius: 7px; background: transparent;
            font-size: 12.5px; color: var(--fg-3); cursor: pointer; transition: all .16s ease; }
.auth-tab.on { background: var(--paper); color: var(--fg-1); font-weight: 600;
               box-shadow: 0 1px 4px rgba(26, 24, 21, .12); }
.auth-field { display: grid; gap: 5px; font-size: 12px; color: var(--fg-2); }
.auth-field input { height: 38px; border: var(--hairline); border-radius: 9px; padding: 0 12px;
                    background: var(--paper); color: var(--fg-1); font-size: 13.5px; font-family: inherit;
                    outline: none; transition: border-color .16s ease; }
.auth-field input:focus { border-color: var(--brand-600); }
.auth-err { color: var(--danger-600) !important; font-size: 12.5px !important; }
/* 顶部提示条：未注册引导 / 登录失效。注意 .pop-box p 的优先级更高，颜色字号要 !important */
.auth-hint { padding: 8px 10px; border-radius: 9px; background: var(--brand-50);
             color: var(--brand-700) !important; font-size: 12.5px !important; line-height: 1.55 !important; }
.auth-switch { font-size: 12.5px !important; color: var(--fg-3) !important; }
.auth-switch .auth-kind-btn { margin-left: 2px; }
/* 隐藏字段用占位保高：切换登录/注册/短信时弹窗高度不变。
   密码与验证码互斥出现，叠在同一格位，总高度恒为三行 */
.auth-stack { display: grid; }
.auth-stack > .auth-field { grid-area: 1 / 1; }
.auth-field.blank { visibility: hidden; }
.auth-sms { display: flex; gap: 8px; }
.auth-sms input { flex: 1; min-width: 0; }
.auth-send { width: 112px; height: 38px; flex: none; border: 0; border-radius: 9px;
             background: var(--bg-subtle); color: var(--brand-700); font-size: 12.5px;
             cursor: pointer; transition: background .16s ease; font-family: inherit; }
.auth-send:hover:not([disabled]) { background: var(--brand-50); }
.auth-send[disabled] { color: var(--fg-disabled, var(--fg-3)); cursor: default; }
.auth-kind { display: flex; justify-content: flex-end; min-height: 19px; }
.auth-kind-btn { border: 0; background: none; padding: 0; font-size: 12px; color: var(--brand-700);
                 cursor: pointer; font-family: inherit; }
.auth-kind-btn:hover { text-decoration: underline; }

/* 账号胶囊 + 账号菜单（退出登录收在菜单里） */
.acct { border: 0; background: var(--bg-surface); cursor: pointer; font-family: inherit;
        transition: background .16s ease; }
.acct:hover { background: var(--ink-50); }
.acctmenu { width: 220px; display: grid; gap: 9px; padding: 12px 14px 14px; }
.acct-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
            padding: 0 4px; font-size: 12px; color: var(--fg-3); }
.acct-row b { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--fg-1); }
.acct-logout { height: 34px; border-radius: 9px; border: var(--hairline); background: transparent;
               color: var(--fg-1); font-size: 12.5px; cursor: pointer; margin-top: 2px;
               transition: background .16s ease; font-family: inherit; }
.acct-logout:hover { background: var(--btn-ghost-bg-hover); }

@media (max-width: 900px) {
  .lib-link { display: inline-flex; }
  .thead { display: none; }
  .lib-row { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; padding: 12px; align-items: start;
             border: var(--hairline); border-radius: 12px; margin-bottom: 10px; background: var(--paper); }
  .lib-row:hover { background: var(--paper); }
  .lib-row .name { padding-top: 2px; }
  .meta-m { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
  .row-acts { grid-column: 2 / -1; justify-content: flex-start; gap: 8px; }
  .row-acts .btn-sm { height: 40px; padding: 0 16px; font-size: 13px; }
  .iBtn { width: 44px; height: 44px; }
  .lib-head { align-items: flex-start; flex-wrap: wrap; }
  .lib-head-acts { margin-left: 0; width: 100%; }
  .lib-head-acts .btn { width: 100%; height: 40px; }
  #libraryPage { padding-top: 18px; }
  .left-tools { margin-left: auto; }
  .left-tools .left-ghost { display: none; }
  .thead th:nth-child(3) { display: none; }
}
@media (min-width: 901px) { .meta-m { display: contents; } }


/* 手机端顶栏：品牌/作品库/点数都不换行，签到文案在窄屏收短 */
.sign-more { display: inline; }
@media (max-width: 900px) {
  .brand { flex: none; white-space: nowrap; }
  .lib-link { flex: none; white-space: nowrap; }
  .pts { white-space: nowrap; flex: none; }
  .sign { flex: none; white-space: nowrap; }
}
@media (max-width: 560px) {
  .topbar { gap: 6px; padding: 0 10px; height: 52px; }
  .brand { font-size: 13px; gap: 6px; }
  .brand .mark { width: 18px; height: 18px; }
  .lib-link { font-size: 12px; padding: 6px 5px; }
  .right { gap: 6px; }
  .pts { height: 28px; padding: 0 8px; gap: 4px; font-size: 11.5px; }
  .pts b { font-size: 12px; }
  .sign { height: 28px; padding: 0 9px; font-size: 11.5px; }
  .sign-more { display: none; }
}

/* =========================================================
   左面板：候选列 + 图片区
   ========================================================= */
.left-body { flex-direction: row; align-items: stretch; justify-content: flex-start; }
.stage-wrap { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; }

.cand-col { flex: 0 0 88px; width: 88px; display: flex; flex-direction: column; gap: 8px;
            padding: 12px 8px; overflow-y: auto; overflow-x: hidden;
            border-right: var(--hairline); background: var(--paper); }
.cand-col::-webkit-scrollbar { width: 6px; }
.cand-col::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 3px; }

.cand { position: relative; flex: none; width: 72px; height: 60px; padding: 0; cursor: pointer;
        border: 2px solid transparent; border-radius: 8px; background: var(--bg-subtle);
        overflow: hidden; transition: border-color var(--dur-1) var(--ease-out); }
.cand img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cand .n { position: absolute; left: 3px; top: 3px; min-width: 15px; height: 15px; padding: 0 3px;
           border-radius: 4px; background: rgba(26, 24, 21, .62); color: #fff;
           font-family: var(--font-mono); font-size: 9.5px; line-height: 15px; text-align: center; }
.cand:hover { border-color: var(--ink-300); }
/* 蓝框只给正在编辑的那个（cur）；勾选（sel）只用右上角 ✓ 表示 */
.cand.cur { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-50); }
.cand.cur .n { background: var(--brand-600); }
.cand .pl { position: absolute; left: 0; right: 0; bottom: 0; height: 15px; line-height: 15px;
            text-align: center; font-size: 9.5px; color: #fff; background: rgba(60, 54, 46, .72); }

/* 工具条已上移到图片头部，这里不再需要浮动定位 */

@media (max-width: 900px) {
  .left-body { flex-direction: column; align-items: stretch; }
  .stage-wrap { order: 1; }
  .cand-col { order: 2; flex: none; width: 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden;
              border-right: 0; border-top: var(--hairline); padding: 8px 10px; gap: 8px; }
  .mtools .tb { height: 24px; padding: 0 6px; font-size: 11px; }
  .mtools .sz button { width: 20px; height: 20px; }
}

/* 白模入口在所有宽度都保留：文字链，手机上会自动换行 */
@media (max-width: 560px) {
  .btn-link { font-size: 11px; }
}
/* =========================================================
   结果态：导出物体勾选 + 场景/分别
   ========================================================= */
.export-panel { position: absolute; left: 12px; top: 12px; z-index: 4; min-width: 148px; max-width: 240px;
                padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.92);
                border: 1px solid var(--ink-200); box-shadow: var(--sh-1); backdrop-filter: blur(6px); }
.export-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
               font-size: 11px; color: var(--fg-3); margin-bottom: 5px; }
.export-head span { font-family: var(--font-mono); }
.export-list { display: grid; gap: 1px; max-height: 168px; overflow: auto; }
.export-item { display: flex; align-items: center; gap: 7px; padding: 3px 2px; border-radius: 6px;
               font-size: 12px; color: var(--fg-1); cursor: pointer; }
.export-item:hover { background: var(--ink-50); }
.export-item input { width: 14px; height: 14px; accent-color: var(--brand-600); flex: none; }
.export-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.export-mode { height: 26px; padding: 1px; }
.export-mode button { height: 22px; padding: 0 8px; font-size: 11px; }

@media (max-width: 900px) {
  .export-panel { left: 8px; top: 8px; padding: 6px 8px; max-width: 190px; }
  .export-list { max-height: 120px; }
  .export-mode { height: 24px; }
  .export-mode button { height: 20px; font-size: 10.5px; padding: 0 6px; }
}
@media (max-width: 560px) {
  .toolbar .left-tools .export-mode { display: none; }
}

/* 多选候选：蓝框只给当前编辑（cur）；勾选态靠 ✓ 勾选框，不加外框 */
.cand.cur { border-color: var(--brand-600); background: var(--paper); }
.cand.cur .n { background: var(--brand-600); }
.cand.active { box-shadow: 0 0 0 2px var(--brand-600); }
.mkg.active rect { stroke-width: 4; }
.mkg.active circle { fill: var(--brand-600); }
.export-item.bad { opacity: .55; cursor: default; }

/* =========================================================
   home-v4：候选多选列 + 镜像导出列 + 阶段进度
   ========================================================= */
.tool { height: clamp(440px, 64vh, 580px); }
.pane-head { height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 10px; }
.pane-head .tag { flex: none; white-space: nowrap; }
.pane-head .meta { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-body { display: flex; flex-direction: column; }

/* 左：候选列 + 图片区 */
.leftgrid { position: absolute; inset: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); }
.leftgrid.nocand { grid-template-columns: minmax(0, 1fr); }
.cands { border-right: var(--hairline); overflow-y: auto; overflow-x: hidden; padding: 8px 6px;
         display: grid; gap: 6px; align-content: start; grid-auto-rows: max-content; }
.cands::-webkit-scrollbar { width: 4px; }
.cands::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 2px; }
.cand { position: relative; display: grid; gap: 2px; padding: 4px; border-radius: var(--r-sm);
        border: 1.5px solid transparent; background: none; cursor: pointer; text-align: left;
        /* 覆盖早期单列版本的固定 72×60：v4 的缩略图 + 标签要按内容撑开 */
        width: auto; height: auto; }
.cand:hover { background: var(--ink-50); border-color: transparent; }
.cand .th { width: 100%; aspect-ratio: 4/3; border-radius: var(--r-xs); background-repeat: no-repeat;
            background-position: center; background-size: cover; background-color: var(--bg-subtle);
            box-shadow: inset 0 0 0 1px var(--line); }
.cand .no { position: absolute; left: 7px; top: 7px; width: 16px; height: 16px; border-radius: 50%;
            background: rgba(26, 24, 21, .72); color: #fff; font-family: var(--font-mono); font-size: 9.5px;
            display: grid; place-items: center; }
.cand .ck { position: absolute; right: 6px; top: 6px; width: 16px; height: 16px; border-radius: 4px;
            border: 1.5px solid #fff; background: rgba(26, 24, 21, .35);
            box-shadow: 0 0 0 1px rgba(26, 24, 21, .18); display: grid; place-items: center;
            color: transparent; font-size: 11px; line-height: 1; }
.cand.insel .ck { background: var(--brand-600); border-color: #fff; color: #fff; }
.cand .ck:hover { border-color: var(--brand-400); }
/* 编辑中的物体：蓝框 + 外圈，明确区别于「只是勾选」 */
.cand.cur { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-50); }
.cand.cur .lb { color: var(--fg-1); }
.cand .dot { position: absolute; left: 6px; bottom: 16px; width: 7px; height: 7px; border-radius: 50%;
             background: var(--warning-500, #B45309); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
/* 自建条目（框选/点选出来的）可以删掉：悬停出现，压在缩略图右下 */
.cand .del { position: absolute; right: 4px; bottom: 15px; width: 16px; height: 16px; border: 0; padding: 0;
             border-radius: 50%; background: rgba(26, 24, 21, .62); color: #fff; font-size: 11px; line-height: 16px;
             display: none; place-items: center; cursor: pointer; }
.cand:hover .del, .cand.cur .del { display: grid; }
.cand .del:hover { background: var(--danger-600, #B42318); }
.cand.user .lb { color: var(--brand-700); }
/* 勾选但不编辑：只用右上角 ✓ 表示（.cand.insel .ck），缩略图本身不加蓝框 */
.cand.cur { background: var(--brand-50); }
.cand.cur .no { background: var(--brand-600); }
.cand .lb { font-size: 10px; color: var(--fg-3); text-align: center; }
.cand.child .lb { color: var(--warning-600); }

/* 没图时候选列也占着位置，不随状态塌掉 */
.cand-empty { display: grid; place-items: center; align-content: center; gap: 2px;
              color: var(--fg-3); font-size: 11px; line-height: 1.6; text-align: center;
              border: 1.5px dashed #D5CDC0; border-radius: var(--r-sm); padding: 10px 4px; }

/* 图片区：底色跟右侧 3D 舞台同一个暖纸调，只比它浅一档，别一边白一边米 */
.stage { position: relative; min-width: 0; overflow: hidden;
         background: radial-gradient(120% 90% at 50% 10%, #FCFAF5 0%, #F4EFE7 72%); }
/* 三层（原图 / 框线 / 掩码）都由 layoutFrame() 统一按 aspect-contain + zoom/pan 定位 */
.stage img.photo { position: absolute; inset: auto; object-fit: contain; display: block; }
.stage svg.mks { position: absolute; inset: auto; display: block; }
.stage canvas { position: absolute; display: block; }
.stage #maskCanvas { touch-action: none; z-index: 2; }
.mask-warn { position: absolute; left: 10px; top: 10px; z-index: 5; max-width: calc(100% - 130px);
             padding: 4px 8px; border-radius: var(--r-full); background: var(--warning-50);
             color: var(--warning-600); border: 1px solid rgba(138, 80, 0, .18);
             font-size: 11px; line-height: 1.4; }

/* 头部工具条：跟着 .pane-head 走一行，不再浮在画面上 */
.mtools { display: flex; align-items: center; gap: 5px; margin-left: auto; flex: none;
          white-space: nowrap; }
.mtools[hidden] { display: none; }
/* 工具按钮靠 hidden 属性切换显隐，别被 display 规则顶掉 */
.mtools [hidden] { display: none !important; }
.mtools .seg { display: flex; align-items: center; gap: 1px; padding: 2px; border-radius: var(--r-full);
               background: var(--ink-50); }
.mtools .seg button { height: 24px; padding: 0 9px; border: 0; border-radius: var(--r-full);
                      background: transparent; font-size: 11px; color: var(--fg-3); cursor: pointer; }
.mtools .seg button:hover { color: var(--fg-1); }
.mtools .seg button.on { background: var(--ink-900); color: #fff; }
/* 新增物体：不是工具，是"进哪一档"的开关，用描边按钮把它和四种工具分开 */
.mtools .tb.add { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px 0 8px;
                  border: 1px solid var(--ink-200); border-radius: var(--r-full); color: var(--fg-2);
                  background: transparent; }
.mtools .tb.add:hover { border-color: var(--ink-300); color: var(--fg-1); background: var(--ink-50); }
.mtools .tb.add .ico { font-size: 13px; line-height: 1; color: var(--fg-3); min-width: 11px; text-align: center; }
.mtools .tb.add.on { background: var(--brand-50); border-color: rgba(29, 106, 229, .38); color: var(--brand-700); }
.mtools .tb.add.on .ico { color: var(--brand-700); }
/* 确定：新增阶段的唯一出口，用主色实心，和"当前选中的工具"区分开 */
.mtools .tb.ok { height: 24px; padding: 0 11px; margin-left: 2px;
                 background: var(--brand-600); color: #fff; font-weight: 500;
                 box-shadow: 0 1px 2px rgba(29, 106, 229, .28); }
.mtools .tb.ok:hover { background: var(--brand-700); color: #fff; }
.mtools .sz { display: flex; gap: 2px; }
.mtools .sz button { width: 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 50%;
                     background: transparent; display: grid; place-items: center; cursor: pointer; }
.mtools .sz button i { display: block; border-radius: 50%; background: var(--fg-3); }
.mtools .sz button.on { border-color: var(--ink-900); }
.mtools .sz button.on i { background: var(--ink-900); }
.mtools .div { width: 1px; height: 14px; background: var(--ink-100); }
.mtools .tb { height: 24px; padding: 0 7px; border: 0; border-radius: var(--r-full);
              background: transparent; font-size: 11px; color: var(--fg-2); cursor: pointer; }
.mtools .tb:hover { background: var(--ink-100); }
.mtools .tb[disabled] { color: var(--ink-200); background: none; cursor: default; }
/* 点选提示集：有几个点、一键清空 */
.mtools .ptchip { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 4px 0 7px;
                  border-radius: var(--r-full); background: var(--brand-50); color: var(--brand-700);
                  font-size: 10.5px; line-height: 1; }
.mtools .ptchip[hidden] { display: none; }
.mtools .ptchip button { width: 15px; height: 15px; border: 0; border-radius: 50%; background: transparent;
                         color: inherit; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.mtools .ptchip button:hover { background: rgba(29, 106, 229, .14); }

/* 光标只需两种：框选/点选是十字（取点用），画笔/橡皮是一个圆圈（由 brush-ring 按笔径画） */
.stage[data-tool="box"] #maskCanvas,
.stage[data-tool="point"] #maskCanvas { cursor: crosshair; }
.stage[data-tool="brush"] #maskCanvas,
.stage[data-tool="erase"] #maskCanvas { cursor: none; }
/* 空格/中键平移时统一抓手 */
.stage.panning #maskCanvas { cursor: grab !important; }
.stage.panning.dragging #maskCanvas { cursor: grabbing !important; }

/* 画笔/橡皮的圆形光标：直径就是当前笔径，顺带当尺寸预览 */
.brush-ring { position: absolute; z-index: 6; border-radius: 50%; pointer-events: none; display: none;
              transform: translate(-50%, -50%); }
.brush-ring.on { display: block; }
.brush-ring.brush { border: 1px solid rgba(29, 106, 229, .75);
                    box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.brush-ring.erase { border: 1.5px dashed rgba(194, 65, 12, .85); background: rgba(255, 255, 255, .28); }

/* 取掩码三步提示 */
.hint { position: absolute; left: 10px; bottom: 10px; z-index: 4; display: flex; align-items: center; gap: 4px;
        max-width: calc(100% - 104px); padding: 4px 5px 4px 10px; border-radius: var(--r-full);
        background: rgba(250, 248, 244, .95); border: 1px solid var(--ink-100); box-shadow: var(--sh-2);
        font-size: 10.5px; color: var(--fg-3); line-height: 1.4; }
.hint[hidden] { display: none; }
.hint b { color: var(--fg-1); font-weight: 500; }
.hint button { flex: none; width: 16px; height: 16px; border: 0; border-radius: 50%; background: transparent;
               color: var(--fg-3); font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.hint button:hover { background: var(--ink-100); color: var(--fg-1); }

/* 右下角倍率：点击回到适应窗口 */
.zoom-pill { position: absolute; right: 10px; bottom: 10px; z-index: 4; }
.zoom-pill[hidden] { display: none; }
.zoom-pill button { height: 22px; min-width: 46px; padding: 0 8px; border-radius: var(--r-full);
                    border: 1px solid rgba(26, 24, 21, .12); background: rgba(255, 255, 255, .92);
                    font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-2); cursor: pointer; }
.zoom-pill button:hover { background: #fff; color: var(--fg-1); }

/* 右：3D + 导出列 */
.rightgrid { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 100%; }
.rightgrid .viewer { position: relative; min-width: 0; }
.excol { display: flex; flex-direction: column; width: 88px; min-width: 88px; border-left: var(--hairline); }
/* 右列空态与左列候选列同一套：顶部一块虚线占位，不另画图标 */
.ex-placeholder { flex: 1 1 auto; padding: 8px 6px; text-align: center; color: var(--fg-3); }
.ex-placeholder .cand-empty { width: 100%; border-color: #E2DCD1; }
.excol .cands.mirror { border-right: 0; flex: 1 1 auto; min-height: 0; }
.exi { cursor: pointer; }
.exi.static { cursor: default; }
.exi.on { border-color: var(--brand-600); background: var(--brand-50); }
.exi.on .no { background: var(--brand-600); }
.exi.on .ck { background: var(--brand-600); border-color: #fff; color: #fff; }
.exi.on .lb { color: var(--brand-600); }
.exi.off { border-style: dashed; border-color: var(--ink-200); }
.exi.off .th { opacity: .4; filter: grayscale(1); }
.exi.off .lb { color: var(--fg-3); }
.exi.bad { opacity: .5; cursor: not-allowed; }

/* 生成中：进度只在舞台正中 */
.gen { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
       padding: 24px; text-align: center;
       background: radial-gradient(120% 90% at 50% 10%, #F5F2EC 0%, #E9E3D9 70%); }
.gen-in { display: grid; justify-items: center; gap: 12px; text-align: center; }
/* 右侧还留着上一份结果时：进度收成一条状态胶囊贴在舞台下沿，尽量不挡模型 */
.gen.over { background: transparent; pointer-events: none; place-items: end center;
            padding: 0 16px 54px; }
.gen.over .gen-in { display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
                    gap: 4px 10px; padding: 9px 15px; border-radius: var(--r-full);
                    background: rgba(250, 248, 244, .94); border: 1px solid var(--ink-100);
                    box-shadow: var(--sh-2); pointer-events: auto; }
.gen.over .pct { font-size: 15px; gap: 1px; }
.gen.over .pct span:last-child { font-size: 10.5px; }
.gen.over .bar { width: 76px; max-width: none; height: 3px; }
.gen.over .sub { font-size: 11.5px; }
.gen.over .note { font-size: 11px; }
.gen.over .note::before { content: '·'; margin: 0 6px 0 5px; color: var(--fg-3); }
.gen.over .note:empty { display: none; }
.gen .pct { display: flex; align-items: baseline; gap: 3px; font-family: var(--font-mono); font-size: 42px;
            line-height: 1; letter-spacing: -.03em; color: var(--fg-1); }
.gen .pct span:last-child { font-size: 16px; color: var(--fg-3); }
.gen .bar { width: 240px; max-width: 72%; height: 4px; border-radius: 2px; background: var(--ink-200); overflow: hidden; }
.gen .bar i { display: block; height: 100%; background: var(--brand-600); border-radius: 2px; transition: width .4s linear; }
.gen .sub { font-size: 12px; color: var(--fg-1); }
.gen .sub b { font-family: var(--font-mono); font-weight: 500; }
.gen .sub .dim { color: var(--fg-3); }
.gen .note { font-size: 11px; color: var(--fg-3); }

/* 通栏底栏 */
.toolbar { height: 56px; min-height: 56px; gap: 10px; padding: 0 12px; }
.toolbar .info { font-size: 11.5px; color: var(--fg-3); min-width: 0; overflow: hidden;
                 text-overflow: ellipsis; white-space: nowrap; }
.toolbar .info b { color: var(--fg-1); font-weight: 500; }
.toolbar .info .muted { color: var(--fg-3); }
.toolbar .sp { margin-left: auto; }
.toolbar .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-height: 34px; }
.billnote { font-size: 10.5px; color: var(--fg-3); white-space: nowrap; margin-right: 2px; }
.btn-link { border: 0; background: transparent; padding: 0 3px; font-size: 11.5px; color: var(--brand-700);
            cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px;
            text-decoration-thickness: 1px; }
.btn-link:hover { color: var(--brand-800); }
.bill-m { display: none; }
.tb-eta { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.tb-eta b { font-family: var(--font-mono); color: var(--fg-1); font-weight: 500; }
.dirty { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--warning-600);
         background: var(--warning-50); border-radius: var(--r-full); padding: 1px 7px; }

@media (max-width: 900px) {
  .tool { height: auto; }
  .panes { grid-template-columns: 1fr; grid-template-rows: auto; }
  /* v4 手机稿不画 GLB 角标 */
  .stage-badge { display: none; }
  /* 桌面下面板里的两块都是 absolute 铺满，手机改成静态流后必须撑满宽度 */
  .pane-body { align-items: stretch; justify-content: flex-start; }
  .leftgrid { position: static; display: flex; flex-direction: column; }
  .leftgrid > .stage { order: 1; min-height: 300px; }
  .leftgrid > .cands { order: 2; border-right: 0; border-top: var(--hairline); display: flex; gap: 6px;
                       overflow-x: auto; overflow-y: hidden; padding: 8px; min-height: 88px; }
  .cand-empty { align-self: center; width: 100%; border: 0; text-align: center; }
  .cand { flex: none; width: 68px; }
  .mtools { transform: scale(.94); transform-origin: right center; }
  /* 手机上工具条折到第二行，头部跟着长高 */
  .pane-head { height: auto; min-height: 40px; flex-wrap: wrap; padding: 6px 10px; row-gap: 6px; }
  .pane-head .mtools { margin-left: 0; width: 100%; justify-content: flex-end; }
  .rightgrid { position: static; display: flex; flex-direction: column; }
  .rightgrid .viewer { min-height: 240px; }
  .excol { width: 100%; min-width: 0; border-left: 0; border-top: var(--hairline); min-height: 116px; }
  .ex-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center;
                    flex: 1 1 auto; min-height: 116px; padding: 8px; }
  .excol .cands.mirror { display: flex; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 6px; }
  .exi { flex: none; width: 68px; }
  .toolbar { height: auto; min-height: 0; flex-direction: column; align-items: stretch; gap: 7px; padding: 7px 10px; }
  .toolbar .info { width: 100%; }
  .toolbar .sp { display: none; }
  .toolbar .acts { width: 100%; gap: 4px; justify-content: flex-end; min-height: 32px; }
  .toolbar .acts .btn { height: 32px; padding: 0 8px; }
  .toolbar .acts .btn-primary { flex: 1 1 auto; }
  .bill-m { display: inline; color: var(--fg-3); font-size: 10.5px; }
  .billnote { display: none; }
}

/* 360–420 宽：顶栏要同时放品牌 / 作品库 / 点数 / 签到，收紧间距别挤成一坨 */
@media (max-width: 420px) {
  .topbar { gap: 4px; }
  .right { gap: 4px; }
  .lib-link { padding: 6px 4px; }
  /* 窄屏先收掉有效期说明，把位置让给品牌和作品库的间隔 */
}
