/* ==========================================================================
   Lumina AI · 设计系统
   ========================================================================== */
:root {
    --accent: #6d5efc;
    --accent-2: #b06bff;
    --accent-3: #4ad6f7;
    --bg: #07070d;
    --bg-soft: #0c0c15;
    --panel: rgba(255, 255, 255, .042);
    --panel-strong: rgba(255, 255, 255, .07);
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #eceaf7;
    --text-dim: #b3b0c9;
    --muted: #8b88a6;
    --ok: #37d99a;
    --warn: #ffb347;
    --danger: #ff6b81;
    --radius-lg: 22px;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow: 0 24px 60px rgba(0, 0, 0, .55);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, .35);
    --glow: 0 12px 40px rgba(109, 94, 252, .38);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* hidden 属性必须真的隐藏：只要元素自己设了 display（如 .pay-chip 的 inline-flex），
   浏览器对 [hidden] 自带的 display:none 就会被盖掉，这里统一兜底 */
[hidden] { display: none !important; }

html, body { min-height: 100%; }

/* 所有页面都把竖向滚动条的那 10px 位置**预留**出来。
   创作台是「整页一屏、内部各自滚动」，body 上没有滚动条，
   不预留的话它的内容就比作品库/我的账户宽 10px（右边缘对不齐）。 */
html { scrollbar-gutter: stable; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: content-box; }

/* 背景光晕 --------------------------------------------------------------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg-orbs span:nth-child(1) { width: 620px; height: 620px; top: -240px; left: -140px; background: radial-gradient(circle, rgba(109, 94, 252, .85), transparent 65%); animation: float1 22s ease-in-out infinite; }
.bg-orbs span:nth-child(2) { width: 520px; height: 520px; top: 8%; right: -180px; background: radial-gradient(circle, rgba(176, 107, 255, .7), transparent 65%); animation: float2 26s ease-in-out infinite; }
.bg-orbs span:nth-child(3) { width: 460px; height: 460px; bottom: -220px; left: 32%; background: radial-gradient(circle, rgba(74, 214, 247, .42), transparent 65%); animation: float1 30s ease-in-out infinite reverse; }
@keyframes float1 { 50% { transform: translate3d(60px, 40px, 0) scale(1.08); } }
@keyframes float2 { 50% { transform: translate3d(-70px, 50px, 0) scale(1.05); } }

/* 顶栏 ------------------------------------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(18px);
    background: linear-gradient(180deg, rgba(7, 7, 13, .92), rgba(7, 7, 13, .68));
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1580px;
    margin: 0 auto;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo {
    width: 38px; height: 38px; border-radius: 12px; object-fit: cover;    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center;
    /* 字色保持白色（原来就是这样，之前那次改动已回退）；
       只在字下加一层很淡的深色投影，白字在亮紫渐变上也读得清 */
    color: #fff; font-weight: 800; font-size: 18px; line-height: 1;
    letter-spacing: -.02em;
    text-shadow: 0 1px 2px rgba(24, 12, 54, .45);
    box-shadow: var(--glow), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
/* 站点图标上传后是 <img>：不要那层紫色渐变底，透明 PNG / SVG 才不会串色；
   用 contain 而不是 cover —— 非正方形的图标（尤其是宽 logo 形状的 SVG）不会被裁掉两边 */
img.brand-logo { background: rgba(255, 255, 255, .07); object-fit: contain; }
/* 图片 logo 模式：前端只显示这张图，站点名/副标题整块不渲染 */
.brand-img { height: 38px; max-width: 240px; width: auto; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.brand-text em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: 11px; font-size: 14px; color: var(--text-dim);
    transition: .18s; white-space: nowrap;
}
.nav-link svg { flex: 0 0 auto; opacity: .85; }
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.is-active { color: #fff; background: linear-gradient(135deg, rgba(109, 94, 252, .95), rgba(176, 107, 255, .85)); box-shadow: var(--glow); }
.nav-link.is-active svg { opacity: 1; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* 右上角那组「我的账户 / 后台管理」：贴着积分徽章，间距按 topbar-right 自己的来 */
.topbar-right .nav { margin-left: 0; }
.points-chip {
    /* 图标放大到 22.5px 后，纵向内边距收一点，整颗 chip 的高度基本不变（仍比头像矮） */
    display: inline-flex; align-items: center; gap: 7px; padding: 4px 14px; border-radius: 99px;
    background: rgba(109, 94, 252, .14); border: 1px solid rgba(109, 94, 252, .32); color: #cfc8ff;
    font-size: 13px; transition: .18s;
}
.points-chip svg { flex: 0 0 auto; }
.points-chip .points-icon { transition: filter .18s; }
.points-chip:hover .points-icon { filter: brightness(1.18) saturate(1.1); }
.points-chip:hover { background: rgba(109, 94, 252, .24); }
.points-chip b { font-weight: 700; color: #fff; }
.user-menu { position: relative; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer;
    background: linear-gradient(135deg, rgba(109, 94, 252, .9), rgba(74, 214, 247, .7));
    color: #fff; font-weight: 700; display: grid; place-items: center;
}
.dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    /* 宽度按内容自适应：正好包住文字，不留多余空白；长邮箱也不会把菜单顶出屏幕 */
    width: max-content; min-width: 132px; max-width: min(320px, calc(100vw - 32px));
    padding: 8px;
    background: rgba(16, 16, 26, .97); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s;
}
.dropdown.is-open { opacity: 1; visibility: visible; transform: none; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-head strong { font-size: 14px; }
.dropdown-head span { font-size: 12px; color: var(--muted); word-break: break-all; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    padding: 9px 11px; border-radius: 10px; border: 0;
    background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13.5px; white-space: nowrap;
}
.dropdown svg { flex: 0 0 auto; opacity: .8; transition: .16s; }
.dropdown a:hover, .dropdown button:hover { background: var(--panel-strong); color: #fff; }
.dropdown a:hover svg, .dropdown button:hover svg { opacity: 1; }
.dropdown [data-logout]:hover { color: #ffb3bf; background: rgba(255, 107, 129, .12); }

.announce {
    max-width: 1580px; margin: 14px auto 0; padding: 10px 16px; display: flex; align-items: center; gap: 10px;
    background: linear-gradient(90deg, rgba(109, 94, 252, .18), rgba(176, 107, 255, .08));
    border: 1px solid rgba(109, 94, 252, .3); border-radius: 14px; color: #ded9ff; font-size: 13.5px;
}
.announce p { margin: 0; flex: 1; }
.announce button { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

.container { max-width: 1580px; margin: 0 auto; padding: 22px; }
/* 按钮 ------------------------------------------------------------------ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    background: var(--panel-strong); color: var(--text); cursor: pointer; font-size: 14px; font-weight: 600;
    transition: .18s; white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 16px 46px rgba(109, 94, 252, .5); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover { color: #fff; border-color: var(--line-strong); }
.btn-danger { background: rgba(255, 107, 129, .14); border-color: rgba(255, 107, 129, .4); color: #ffb3bf; }
.btn-danger:hover { background: rgba(255, 107, 129, .24); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 14px; }
.btn-block { width: 100%; }

/* 全站动效开关（后台「系统设置 → 站点信息 → 按钮高亮过渡动效」）-----------------
   默认状态：各元素自己那条 0.16~0.2s 的轻微过渡（跟以前一样）。
   打开后（body 上多一个 .ui-motion）：
     · 过渡时间统一拉长到 0.34s，并明确列出会变的属性 —— 高亮"亮起来"和"暗下去"都走过渡，
       不会一松鼠标就"啪"地跳回去（关键：transition 写在元素本体上，而不是只写在 :hover 里）；
     · 缓动用 ease-out，亮起来快、收得住；
     · 按下去有轻微缩放反馈。
   只影响观感，不影响任何功能。 */
body.ui-motion .btn,
body.ui-motion .nav-link,
body.ui-motion .points-chip,
body.ui-motion .dropdown a,
body.ui-motion .dropdown button,
body.ui-motion .chip,
body.ui-motion .ratio-chip,
body.ui-motion .pay-chip,
body.ui-motion .segmented button,
body.ui-motion .tab,
body.ui-motion .tabs button,
body.ui-motion .lselect-trigger,
body.ui-motion .loption,
body.ui-motion .icon-tile,
body.ui-motion .check,
body.ui-motion .fav,
body.ui-motion .thumb,
body.ui-motion .recent-card,
body.ui-motion .package,
body.ui-motion .acct-nav a,
body.ui-motion .admin-nav a,
body.ui-motion .stat,
body.ui-motion .card,
body.ui-motion .masonry-item,
body.ui-motion .table.data tbody tr {
    transition:
        background-color .34s ease-out,
        background .34s ease-out,
        color .34s ease-out,
        border-color .34s ease-out,
        box-shadow .34s ease-out,
        opacity .34s ease-out,
        filter .34s ease-out,
        transform .22s cubic-bezier(.2, .9, .3, 1.15);
}
body.ui-motion .btn:active:not(:disabled) { transform: scale(.975); }
body.ui-motion .switch i { transition: background-color .34s ease-out, border-color .34s ease-out, box-shadow .34s ease-out; }
body.ui-motion .switch i::after { transition: left .3s cubic-bezier(.2, .9, .3, 1.15), background-color .34s ease-out; }
body.ui-motion .input,
body.ui-motion .select,
body.ui-motion .textarea,
body.ui-motion .lselect-trigger { transition: border-color .34s ease-out, box-shadow .34s ease-out, background-color .34s ease-out, color .34s ease-out; }
/* 鼠标移入时"浮"起来一点点：除了主按钮，标签 / 芯片 / 分段按钮也一起浮，
   让"鼠标移入移出"这件事在哪儿都是平滑的（active 的分段按钮不浮，免得跟高亮滑块错开） */
body.ui-motion .segmented button:not(.is-active):hover,
body.ui-motion .tabs button:not(.is-active):hover,
body.ui-motion .chip:not(.is-active):hover,
body.ui-motion .ratio-chip:not(.is-active):hover,
body.ui-motion .pay-chip:not(.is-active):hover,
body.ui-motion .icon-tile:not(.is-active):hover { transform: translateY(-1px); }
/* 系统设置里说明了「减弱动态效果」的浏览器偏好：这种用户就别硬塞动画 */
@media (prefers-reduced-motion: reduce) {
    body.ui-motion .btn,
    body.ui-motion .nav-link,
    body.ui-motion .points-chip,
    body.ui-motion .lselect-trigger,
    body.ui-motion .loption,
    body.ui-motion .chip,
    body.ui-motion .icon-tile,
    body.ui-motion .switch i,
    body.ui-motion .switch i::after,
    body.ui-motion .input,
    body.ui-motion .select,
    body.ui-motion .textarea {
        transition-duration: .01ms;
    }
    body.ui-motion .btn:active:not(:disabled) { transform: none; }
}
.btn-icon { padding: 8px; width: 34px; height: 34px; border-radius: 10px; }
/* 加载态：原内容留在原位占位（不可见），转圈浮在上面居中 —— 按钮尺寸不会变，
   所以不会出现「去付款 → 打开中… 把表格最后一列撑宽、请求回来又缩回去」的一跳 */
.is-loading { position: relative; pointer-events: none; }
.btn-loading-ghost { visibility: hidden; }
.btn-loading-live {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    gap: 6px; white-space: nowrap; overflow: hidden;   /* 兜底：再挤也不会溢出按钮 */
}
.btn-loading-live .spinner { width: 14px; height: 14px; border-width: 2px; }
/* 转圈的时候别把按钮压到半透明，不然「正在处理」看着像「被禁用了」 */
.btn.is-loading:disabled { opacity: .92; }

/* 卡片与面板 ------------------------------------------------------------ */
.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 20px; backdrop-filter: blur(16px); box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 18px; }
/* 但并排放在网格里的卡片不该吃这个「叠放间距」：否则同一行的第二张会比第一张低 18px
   （仪表盘的「最近积分流水 / 最近订单」、账号安全的「修改密码 / 账号信息」都踩过这个坑） */
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title h2, .card-title h3 { margin: 0; font-size: 16px; }
.card-title .sub { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
/* 网格里的卡片之间的间距交给 gap：卡片自己带的 .mt-* 会把同一行的卡片顶下去 28px，
   看着就是「这一块和旁边那块没对齐」（后台邮件设置页的「邮件模板」就踩过这个坑） */
.grid > .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.muted { color: var(--muted); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 10px; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.hidden { display: none !important; }

/* 表单 ------------------------------------------------------------------ */
.field { margin-bottom: 15px; }
/* 注意 :not(.switch)：开关本身也是 <label>，如果被这条规则命中会变成 display:block，
   里面的 <i> 轨道就退化成行内元素、宽高失效，只剩一个白色圆点 */
/* 字段标题：直接子 label 和「左标题 + 右数值」里那层的 label 用完全一样的字体样式 */
.field > label:not(.switch), .field .row-between > label, .label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 7px; font-weight: 600; letter-spacing: .02em; }
.field .row-between > label { margin-bottom: 0; }
.label .req { color: var(--danger); }
.input, .select, .textarea {
    width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .34); border: 1px solid var(--line); color: var(--text);
    outline: none; transition: .16s; font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(109, 94, 252, .75); box-shadow: 0 0 0 3px rgba(109, 94, 252, .16); }
.input::placeholder, .textarea::placeholder { color: #6b6885; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238b88a6' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* 原生控件（下拉展开的选项列表、复选框、单选框、日期选择器…）跟随深色主题渲染。
   不加这些的话，点开 select 弹出的会是系统浅色菜单，跟整体风格完全脱节；
   部分浏览器还会继承到浅色文字，导致选项看不清。 */
html { color-scheme: dark; }
.select, select { color-scheme: dark; }
.select option, select option {
    background-color: #14141f;
    color: var(--text);
    padding: 8px 10px;
}
.select optgroup, select optgroup {
    background-color: #0d0d15;
    color: var(--muted);
    font-style: normal;
}
.select option:checked, select option:checked {
    background-color: var(--accent);
    background-image: linear-gradient(0deg, var(--accent), var(--accent));
    color: #fff;
}
/* 复选框 / 单选框也用主题色，深色底下勾选状态才看得清 */
input[type="checkbox"], input[type="radio"] { color-scheme: dark; accent-color: var(--accent); cursor: pointer; }
table.data input[type="checkbox"] { width: 15px; height: 15px; vertical-align: middle; margin: 0; }

/* ---- 自绘下拉框（原生 select 的展开列表由系统绘制，无法与整站风格统一，这里整体替换） ---- */
.lselect { position: relative; display: block; width: 100%; }
.lselect.is-auto { width: auto; }
.lselect-native { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.lselect-trigger {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 13px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, .34);
    border: 1px solid var(--line); color: var(--text); font-size: 14px; text-align: left;
    cursor: pointer; transition: .16s;
    /* 行高写成整数像素：整块高度＝整数，展开动效结束、transform 撤掉时像素落点才不会各行不同 */
    line-height: 20px;
}
.lselect.is-auto .lselect-trigger { min-width: 132px; }
.lselect-trigger:hover { border-color: var(--line-strong); }
.lselect-trigger:disabled { cursor: not-allowed; }
.lselect.is-open .lselect-trigger { border-color: rgba(109, 94, 252, .75); box-shadow: 0 0 0 3px rgba(109, 94, 252, .16); }
.lselect.is-disabled { opacity: .55; pointer-events: none; }
/* 图标与名称的间距：收起状态和菜单项都用同一个 10px，视觉上才一致
   （菜单项原来是 gap 10 + 图标自带 9px 右边距 = 19px，名字离图标太远，现在减半） */
.lselect-label { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; overflow: hidden; white-space: nowrap; }
.lselect-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 收起状态也把附注（如「3 积分/张」）靠右显示 */
.lselect-suffix { flex: 0 0 auto; margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
/* 厂商图标（模型下拉用）：收起状态和展开菜单里都是同一个尺寸，跟文字垂直居中。
   18px（偶数）+ 20px 行高 → 图标在行里的偏移正好 10px（整数），像素稳稳落在格子上 */
.lselect-icon { flex: 0 0 auto; display: inline-flex; align-items: center; }
.lselect-icon-img, .loption-icon-img { width: 18px; height: 18px; display: block; object-fit: contain; }
.model-icon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-right: 6px; object-fit: contain; }
.lselect-caret {
    flex: 0 0 auto; width: 0; height: 0; margin-top: 2px;
    border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 5.5px solid var(--muted);
    transition: transform .2s;
}
.lselect.is-open .lselect-caret { transform: rotate(180deg); }

.lselect-menu {
    position: fixed; z-index: 420; max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
    padding: 6px; background: rgba(16, 16, 26, .98); border: 1px solid var(--line-strong);
    border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(20px);
    animation: selectPop .16s cubic-bezier(.2, .9, .3, 1.15);
}
.lselect-menu.is-up { animation-name: selectPopUp; }
@keyframes selectPop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes selectPopUp { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.loption {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--text-dim);
    font-size: 13.5px; text-align: left; cursor: pointer; transition: .14s;
    /* 行高 20px + 上下内边距 9px ＝ 每行正好 38px（整数）。
       以前用默认行高（22.275px），行高是小数 → 每行的像素落点错开，
       展开动画结束、transform 撤掉的那一瞬间，某些行的图标会"跳"1px。 */
    line-height: 20px;
}
.loption-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 菜单项最左边的厂商图标：间距就用 .loption 的 gap（10px）——
   原来图标自己还带 9px 右边距，加起来 19px 显得名字离图标太远，现在正好减半 */
.loption-icon { flex: 0 0 auto; display: inline-flex; align-items: center; }
/* 选项右侧的附注（如模型下拉里的「3 积分/张」）：margin-left:auto 把它和对号一起推到最右边，
   对号本来就在最后，所以它正好落在对号前面 */
.loption-suffix { flex: 0 0 auto; margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.loption:hover .loption-suffix, .loption.is-active .loption-suffix { color: rgba(255, 255, 255, .8); }
.loption.is-selected .loption-suffix { color: rgba(255, 255, 255, .92); }
.loption-check { display: none; flex: 0 0 auto; font-size: 12px; opacity: .95; }
.loption:hover, .loption.is-active { background: var(--panel-strong); color: #fff; }
.loption.is-selected { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.loption.is-selected .loption-check { display: block; }
.loption:disabled { opacity: .38; cursor: not-allowed; background: transparent; }
.input-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

.segmented { display: flex; padding: 4px; background: rgba(0, 0, 0, .32); border: 1px solid var(--line); border-radius: 14px; gap: 4px; position: relative; }
.segmented button {
    flex: 1; border: 0; background: transparent; color: var(--text-dim); padding: 10px 12px;
    border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; transition: .18s;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    position: relative; z-index: 1;
}
/* 「两个按钮」的高亮滑块：绝对定位在容器里，跟着 is-active 走（位置由 ui.js 算）。
   打开动效开关时它会在两颗按钮之间平滑滑过去，而不是"旧按钮灭、新按钮亮"地闪一下 */
.seg-pill {
    position: absolute; left: 0; top: 0; z-index: 0; opacity: 0; pointer-events: none;
    border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px rgba(109, 94, 252, .35);
    will-change: transform, width, height;
}
body.ui-motion .seg-pill {
    transition:
        transform .34s cubic-bezier(.2, .9, .3, 1.15),
        width .34s cubic-bezier(.2, .9, .3, 1.15),
        height .26s ease-out,
        opacity .2s ease-out;
}
/* 高亮交给滑块画，按钮自己不再画一层（文字颜色保留），否则两层叠在一起会"糊" */
.segmented.has-pill > button.is-active,
.segmented.has-pill > button.is-active:hover { background: transparent; box-shadow: none; }
.segmented button:hover { color: #fff; }
.segmented button.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 22px rgba(109, 94, 252, .35); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* 标题后面的「?」提示按钮：鼠标移入/键盘聚焦时浮出说明（原来常显的 .input-hint 挪进来了） */
.tip { position: relative; display: inline-flex; align-items: center; margin-left: 6px; vertical-align: middle; }
.tip-dot {
    width: 15px; height: 15px; padding: 0; border-radius: 50%; cursor: help;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05);
    color: var(--muted); font-size: 10px; line-height: 1; font-weight: 600;
    transition: .16s;
}
.tip-dot:hover, .tip:focus-within .tip-dot { color: #fff; border-color: var(--accent); background: rgba(109, 94, 252, .3); }
/* 气泡本体由 JS 挂到 body 上（.tip-pop），这样不会被左栏的滚动容器 / 卡片 backdrop-filter 裁掉。
   页面里的 .tip-body 只是文字来源，永远不显示。 */
.tip-body { display: none; }
.tip-pop {
    position: fixed; z-index: 900; max-width: 200px; pointer-events: none;
    padding: 8px 10px; border-radius: 10px;
    font-size: 11.5px; line-height: 1.55; text-align: left; white-space: normal;
    color: var(--text-dim); background: rgba(20, 18, 36, .98);
    border: 1px solid var(--line-strong); box-shadow: var(--shadow);
    opacity: 0; transform: translateY(4px); transition: opacity .16s, transform .16s;
}
.tip-pop.is-on { opacity: 1; transform: translateY(0); }
.tip-pop b { color: var(--text); font-weight: 600; }
.chip {
    padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
    color: var(--text-dim); font-size: 12.5px; cursor: pointer; transition: .16s;
}
.chip:hover { border-color: var(--line-strong); color: #fff; }
.chip.is-active { background: rgba(109, 94, 252, .22); border-color: rgba(109, 94, 252, .55); color: #fff; }

/* 画面比例：小方框直观显示比例 */
.ratio-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; }
.ratio-shape { display: inline-block; flex: 0 0 auto; border: 1.5px solid currentColor; border-radius: 3px; opacity: .65; }
/* 「自动」用闪星图标：原来那个虚线三角太丑 */
.ratio-shape.is-auto {
    width: 20px; height: 20px; border: 0; opacity: .8; border-radius: 0;
    display: flex; align-items: center; justify-content: center; background: none;
}
.ratio-chip.is-active .ratio-shape { opacity: 1; }
/* 「查看对比」现在是开关样式（.switch）；这里只把它在右上角那一排里对齐得跟小按钮一样高 */
.stage-head .switch { font-size: 13px; padding: 0 2px; }
.stage-head .switch i { transform: scale(.92); }
/* 创作台里画面比例排成**两行**（11 个 → 第一行 6 个、第二行 5 个）：图标在上、文字在下。
   图标那一行固定 24px 高并居中（各比例图标高度不一样也能对齐），
   文字单独一行，于是每行的文字都在同一条底线上。 */
.studio-panel #ratioChips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.studio-panel #ratioChips .ratio-chip {
    display: grid; grid-template-rows: 24px auto; align-items: center; justify-items: center;
    min-width: 0; gap: 3px;
    padding: 6px 2px 5px; font-size: 10.5px; line-height: 1.15;
}
.studio-panel #ratioChips .ratio-chip span { font-size: 10.5px; white-space: nowrap; }
.studio-panel #ratioChips .ratio-shape { margin: 0 auto; align-self: center; }

/* 生成中的任务 */
.queue-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--panel); }
.queue-item:last-child { margin-bottom: 0; }
.queue-item.is-current { border-color: rgba(109, 94, 252, .55); background: rgba(109, 94, 252, .08); }
.progress-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 9px 0 6px; }
.progress-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: width .45s ease; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 400; color: var(--text-dim); }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* 轨道：flex 里用 flex-basis 锁宽，万一外层不是 flex（例如被当成 block），
   inline-block + min-width 也能撑开，两条路都保证看得见 */
.switch i {
    display: inline-block; flex: 0 0 40px; width: 40px; min-width: 40px; height: 22px; box-sizing: border-box;
    border-radius: 999px; background-color: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .14);
    position: relative; transition: background-color .2s, border-color .2s;
}
.switch i::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); transition: left .2s;
}
.switch input:checked + i {
    background-color: var(--accent);
    background-image: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
}
.switch input:checked + i::after { left: 20px; }
.switch > span, .switch > em { min-width: 0; }
/* 小号开关：用在卡片标题右侧那一排（「查看对比」） */
.switch-sm { gap: 8px; font-size: 13px; }
.switch-sm i { flex: 0 0 34px; width: 34px; min-width: 34px; height: 19px; }
.switch-sm i::after { width: 13px; height: 13px; }
.switch-sm input:checked + i::after { left: 17px; }
/* 条件不满足时（例如还没上传图片 logo）开关禁用 */
.switch.is-disabled { opacity: .5; cursor: not-allowed; }

.range { width: 100%; appearance: none; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .14); outline: none; }
.range::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 0 0 4px rgba(109, 94, 252, .18); }
.range-value { font-family: var(--mono); font-size: 12px; color: var(--accent-3); min-width: 42px; text-align: right; }

/* 徽标 ------------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); }
.badge-ok { background: rgba(55, 217, 154, .13); border-color: rgba(55, 217, 154, .34); color: #8ef0c8; }
.badge-warn { background: rgba(255, 179, 71, .13); border-color: rgba(255, 179, 71, .34); color: #ffd79b; }
.badge-danger { background: rgba(255, 107, 129, .13); border-color: rgba(255, 107, 129, .34); color: #ffb3bf; }
.badge-accent { background: rgba(109, 94, 252, .18); border-color: rgba(109, 94, 252, .4); color: #cfc8ff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(55, 217, 154, .18); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 129, .18); }

/* 创作台布局 ------------------------------------------------------------ */
.studio { display: grid; grid-template-columns: 388px minmax(0, 1fr); gap: 20px; align-items: start; }
.studio-panel { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; padding-right: 4px; }

/* 创作台整页不顶出屏幕：页头 / 公告 / 主体 / 页脚 撑满一屏，
   超出的内容在左右两栏内部各自滚动，页面本身不出现滚动条。
   注意 flex 基准必须用 0（写成 auto 会按内容高度算，把页脚挤到屏幕外），
   宽度显式 100%（flex 容器里的 auto 外边距会让它按内容宽度收缩）。 */
body.page-create {
    height: 100vh; height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column;
}
.page-create .topbar { flex: 0 0 auto; }
.page-create .announce { flex: 0 0 auto; }
.page-create .site-footer { flex: 0 0 auto; margin-top: 0; padding: 12px 22px; }
.page-create .container {
    flex: 1 1 0;              /* 只吃剩余空间，页脚永远留在屏幕内 */
    width: 100%;             /* 宽度跟普通块级一样撑满（上限仍是 max-width） */
    min-height: 0;
    display: flex; flex-direction: column; overflow: hidden;
}
.page-create .studio {
    flex: 1 1 0; min-height: 0; align-items: stretch;
    grid-template-rows: minmax(0, 1fr);   /* 行高严格等于可用高度，左栏才能内部滚动 */
}
.page-create .studio-panel {
    position: static; top: auto; max-height: none; height: auto; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
}
.page-create .studio > section {
    display: flex; flex-direction: column; gap: 12px; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; padding-right: 4px;
}
.page-create .stage { flex: 1 1 auto; min-height: 320px; }
.page-create .studio > section > .card { margin-top: 0; flex: 0 0 auto; }
.panel-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; backdrop-filter: blur(16px); box-shadow: var(--shadow-soft); }
.panel-card + .panel-card { margin-top: 14px; }

/* 创作台左栏：上面是「设置滚动区」，下面是固定的「开始生成」。
   两者是 flex 里的兄弟节点，所以滚动区在按钮**上方**就结束了，
   设置不会滚到按钮底下（之前用 position:sticky 会把内容盖在按钮后面）。
   按钮条不再是卡片（外面那层卡片会让按钮比上面的卡片窄一圈），
   滚动区为了滚动条留了 4px 右边距，按钮条也留同样的 4px —— 两边右边缘严格对齐。
   这几条只在左栏里真有 .panel-scroll 包裹层时生效，测试用的 studio.html 不受影响。 */
@media (min-width: 1181px) {
    /* 注意：左栏**不能**写 overflow:hidden/auto —— 按钮条紧贴在栏底，一裁就把「开始生成」的发光
       （0 12px 40px 的紫色光晕）整圈切掉了，看着就像发光没了。
       滚动交给里面的 .panel-scroll（它自己有 overflow-y:auto），外面这层保持 visible 就好。 */
    .page-create .studio-panel:has(> .panel-scroll) { display: flex; flex-direction: column; overflow: visible; }
    .page-create .studio-panel:has(> .panel-scroll) > .panel-scroll {
        flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px;
    }
    .page-create .studio-panel:has(> .panel-scroll) > .panel-submit {
        flex: 0 0 auto; margin-top: 9px; padding-right: 4px;
    }
}
/* 「开始生成」比通用大按钮矮一点（原来 56px 太高，占了一屏的 1/12），
   宽度不用管：它是 btn-block，父级留的边距跟上面对齐就行 */
#generateBtn { padding: 9px 18px; font-size: 15px; border-radius: 12px; gap: 8px; }
/* 光晕：往下那层给足（比通用按钮更亮一点），向上只探 3px —— 按钮离上面滚动区只隔 9px，
   探太高就会给滚动区底边染色、跟滚动提示混在一起。 */
#generateBtn {
    box-shadow: 0 10px 26px rgba(109, 94, 252, .55);
    /* 高亮＝放大一点点、失去高亮＝缩回原大小，进出都走 transition（两个方向都自动渐变，不会闪）。
       不要用 requestAnimationFrame 做上下摆动：幅度起来太快会看着像"抖动"；也不要用 :hover 挂 animation，
       一移出动画被撤掉会瞬间跳回。 */
    transform: scale(1);
    transform-origin: 50% 50%;
    transition: box-shadow .34s ease-out, transform .34s cubic-bezier(.33, 0, .3, 1);
}
#generateBtn:hover:not(:disabled) {
    box-shadow: 0 14px 34px rgba(109, 94, 252, .72);
    transform: scale(1.03);
}
#generateBtn:active:not(:disabled) { transform: scale(1.005); transition-duration: .12s; }
@media (prefers-reduced-motion: reduce) {
    #generateBtn { transition: box-shadow .34s ease-out; }
    #generateBtn:hover:not(:disabled), #generateBtn:active:not(:disabled) { transform: scale(1); }
}
/* 窄屏是整页滚动：包裹层不自己滚，跟着页面走 */
.panel-scroll { min-height: 0; }

/* 滚动提示 ---------------------------------------------------------------
   以前滚动区底边也会出现一条"亮带"，但那只是**内容/卡片正好被裁在底边**的巧合
   （亮不亮取决于切到的是滑杆、文字还是空白），再叠上按钮光晕的一点染色，看着像提示其实不是。
   现在做成真的提示：下面还有内容时，在底边压一层深色渐隐；滚到底自动淡出。
   实现要点：::after 用 position: sticky 钉在滚动口的底边（absolute 会跟着内容滚），
   height + margin-top 一正一负抵消，不占布局、不产生多余的滚动距离。 */
.scroll-hint { position: relative; }
.scroll-hint::after {
    content: ''; display: block; position: sticky; bottom: 0; left: 0; right: 0;
    height: 30px; margin-top: -30px; pointer-events: none;
    background: linear-gradient(to top, rgba(9, 9, 16, .96), rgba(9, 9, 16, .72) 45%, rgba(9, 9, 16, 0));
    opacity: 0; transition: opacity .26s ease;
}
.scroll-hint.has-more::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .scroll-hint::after { transition: none; }
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.panel-head h3 svg { color: var(--accent-3); }

/* 左侧参数面板：整体收紧纵向节奏（卡片内外边距、标题与字段间距、输入框高度都收一点），
   一屏里能多放几项设置，少滚一点。只作用于创作台左栏，不影响其它页面。 */
.studio-panel .panel-card { padding: 10px 12px; }
/* 左栏本身不要任何底色/边框/阴影：卡片之间露出来的就是页面底色。
   （卡片自带的 30px 柔和阴影会把缝隙糊住，再加页面顶部的光晕，
   整栏看着就像「有独立背景色」。这里把左栏卡片的阴影去掉，缝隙就干净了。） */
.studio-panel { background: transparent; border: 0; box-shadow: none; }
.studio-panel > .panel-card, .panel-scroll > .panel-card { box-shadow: none; }
/* 注意：不能用 .panel-card + .panel-card —— index.php 在「模式切换」和「参考图」两个卡片中间
   插了一段内联脚本，相邻兄弟选择器会因此失效，两张卡片就贴在一起了（看着像一整块背景）。
   所以按「第几个 panel-card」来给间距，跟中间夹没夹别的元素无关。 */
.studio-panel > .panel-card, .panel-scroll > .panel-card { margin-top: 9px; }
.studio-panel > .panel-card:first-of-type, .panel-scroll > .panel-card:first-of-type { margin-top: 0; }
.studio-panel .panel-head { margin-bottom: 7px; }
.studio-panel .field { margin-bottom: 8px; }
.studio-panel .field:last-child { margin-bottom: 0; }
.studio-panel .chips { gap: 4px; }
.studio-panel .input-hint { margin-top: 3px; }
/* 模型 / 参考图 两张卡片：把内部空白也收一收，跟别的卡片一样紧凑 */
.studio-panel #modelMeta { margin-top: 6px; }
.studio-panel .dropzone { padding: 16px 14px; }
/* 「生成数量」下面那行提示：这个模型一次请求最多出几张。预留高度，免得切模型时布局上下跳 */
#countHint { min-height: 15px; }
#countHint.is-short { color: rgba(245, 196, 81, .92); }
.studio-panel .thumb-grid { margin-top: 9px; }
.studio-panel .thumb-grid:empty { display: none; }   /* 没上传参考图时不留空档 */
.studio-panel .segmented button { padding: 8px 12px; }
.studio-panel .select, .studio-panel .lselect-trigger { padding: 9px 12px; }
.studio-panel .textarea { min-height: 86px; }
.studio-panel .ratio-chip { padding: 5px 10px; }

.dropzone {
    border: 1.5px dashed rgba(255, 255, 255, .18); border-radius: var(--radius); padding: 22px;
    text-align: center; cursor: pointer; transition: .2s; background: rgba(0, 0, 0, .22);
}
.dropzone:hover, .dropzone.is-over { border-color: rgba(109, 94, 252, .8); background: rgba(109, 94, 252, .09); }
.dropzone strong { display: block; font-size: 14px; margin-bottom: 4px; }
.dropzone span { font-size: 12px; color: var(--muted); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px; margin-top: 12px; }
.thumb-item { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #000; }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item button {
    position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .72); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center;
}

.stage {
    min-height: 560px; border-radius: var(--radius-lg); border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
    backdrop-filter: blur(16px); box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column;
}
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stage-head h2 { margin: 0; font-size: 17px; }
/* 标题后面跟的说明（例如「按住中间滑块左右拖动」）：跟着标题走，不占单独一行 */
.stage-hint { margin-left: 10px; font-size: 12.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
/* 渲染结果容器必须能被压缩：flex 子项默认 min-height:auto（= 内容高度），
   大图 / 竖图会把整个面板顶出屏幕。显式给 0 才能让下面的取景框真正被限制住。
   justify-content:center 让不满高的内容（比如宽图被宽度卡住的对比图）上下居中 ——
   文生图那张取景框是 flex:1 撑满的，不受影响。 */
#stageBody { min-height: 0; justify-content: center; }
/* 右上角操作排（放大 / 下载原图 / 作参考图 / 收藏 / 再来一批）：
   收藏是常驻按钮，需要自己的选中态配色（原来那个悬浮 ♥ 已随结果区一起删掉） */
#stageActions .fav-toggle.is-on { color: #ffb347; border-color: rgba(255, 179, 71, .5); }
#stageActions .fav-toggle.is-on:hover { color: #ffc46b; }
.stage-empty { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.stage-empty .orb {
    width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 30px;
    background: linear-gradient(135deg, rgba(109, 94, 252, .9), rgba(176, 107, 255, .7));
    display: grid; place-items: center; box-shadow: var(--glow); animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: translateY(-6px) rotate(2deg); box-shadow: 0 22px 60px rgba(109, 94, 252, .55); } }
.stage-empty h3 { font-size: 17px; }
.stage-empty p { color: var(--muted); max-width: 380px; margin: 0 auto; font-size: 13.5px; }

.progress-wrap { flex: 1; display: grid; place-items: center; text-align: center; }
.progress-ring { width: 148px; height: 148px; position: relative; margin: 0 auto 20px; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.progress-ring .track { stroke: rgba(255, 255, 255, .09); }
.progress-ring .bar { stroke: url(#ringGradient); transition: stroke-dashoffset .5s ease; }
.progress-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 700; font-family: var(--mono); }
.progress-stage { color: var(--text-dim); font-size: 14px; }
.progress-tip { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

/* 文生图：没有参考图、构不成对比，就把出图直接放进同一个取景框里 ——
   创作台不再有单独的结果区（大图 + 按钮行 + 缩略图切换那种），
   出图本身去下方「最近生成」或作品库看，下载入口在右上角「再来一批」前面。
   注意三处约束缺一不可，否则大图 / 竖图会把面板顶出去：
     · 容器 min-height:0 + max-height:100%：能压缩、且不超过面板
     · 图片 width/height:100% + object-fit:contain：图元素严格等于取景框大小，
       内容按比例缩放居中留边（不裁切、不溢出），而不是让图元素撑大容器 */
.compare-single {
    flex: 1 1 0; min-height: 0; max-height: 100%;
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); background: #0d0b1f; cursor: zoom-in;
    max-width: 100%;
    display: flex; align-items: center; justify-content: center;
    animation: rise .45s ease both;
}
.compare-single img { width: 100%; height: 100%; object-fit: contain; min-width: 0; min-height: 0; display: block; }
.result-item {
    position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
    /* 不再强制 1:1：按图片自身比例完整显示，1920×1080 的图就是 16:9 呈现，不会被裁成方形 */
    background: #05050a; cursor: zoom-in; animation: rise .45s ease both;
    transform: translateZ(0);
    clip-path: inset(0 round var(--radius));
    isolation: isolate;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.result-item img { width: 100%; height: auto; display: block; transition: transform .35s ease; }
.result-item:hover img { transform: scale(1.04); }
.result-item .overlay {
    position: absolute; inset: auto 0 0 0; padding: 30px 12px 11px; display: flex; gap: 8px; align-items: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, .82)); opacity: 0; transition: .24s;
}
.result-item:hover .overlay { opacity: 1; }
.result-item .overlay .btn { padding: 6px 11px; font-size: 12.5px; }
.result-item .fav {
    position: absolute; top: 9px; right: 9px; width: 32px; height: 32px; border-radius: 50%; border: 0;
    background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: .2s;
}
.result-item:hover .fav, .result-item .fav.is-on { opacity: 1; }
.result-item .fav.is-on { color: #ffb347; }
.result-meta { position: absolute; top: 9px; left: 9px; display: flex; gap: 6px; opacity: 0; transition: .2s; }
.result-item:hover .result-meta { opacity: 1; }

/* 渲染前后对比 ---------------------------------------------------------
   这一块现在只有取景框本身：标题「渲染前后对比」和拖动说明都在外面那行（stage-head），
   原来的 compare-head 小标题行已经删掉。 */

/* 两张图放进同一个盒子，都用绝对定位 + object-fit 填满：
   · 不管原图和出图尺寸是否一致，都在同一个取景框里裁切，能像素级完全重叠；
   · 图被盒子裁掉多余的边，永远不会顶出父级；
   · 图片不吃指针事件（pointer-events:none），避免拖动滑块时拖出图片 / 选中图片。 */
.compare {
    position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
    aspect-ratio: 1 / 1;                 /* 由 JS 按出图尺寸覆盖 */
    max-width: 100%;                     /* 高度上限也由 JS 按可视区域算出来，保证不顶出元素 */
    margin-inline: auto;
    background: #0d0b1f;
    cursor: ew-resize;
    user-select: none; -webkit-user-select: none;
    touch-action: none;                  /* 触屏上拖滑块不要带着页面滚 */
    /* 跟文生图那张取景框（.compare-single）同一套入场动效：
       点「最近生成」回看图生图时，对比图也是浮上来的，不是硬现 */
    animation: rise .45s ease both;
}
.compare img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    display: block; max-width: none; object-fit: cover;
    pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.compare .after { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 50% 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; left: 50%; cursor: ew-resize; }
/* 分界线只有 2px 太细，加一圈透明命中区，好抓一些（拖动仍然只在滑杆/分界线上生效） */
.compare .handle::before { content: ''; position: absolute; top: 0; bottom: 0; left: -9px; right: -9px; }
.compare .handle::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 15px; transition: transform .15s; }
.compare.is-dragging .handle::after { transform: translate(-50%, -50%) scale(1.08); }
.compare:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 最近生成：纵向再压一档 —— 卡片内边距、标题间距、缩略图与文字行高都收一点，
   把高度让给上面的渲染结果 */
#recentCard { padding: 12px 14px; }
#recentCard .card-title { margin-bottom: 9px; }
#recentCard .card-title h3 { font-size: 15px; }
/* 「最近生成」：固定一行，放不下的靠横向滚动查看 */
.recent-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.recent-card { position: relative; flex: 0 0 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.recent-card img { width: 96px; height: 54px; object-fit: cover; }
/* 任务号：贴在缩略图左上角的小胶囊。
   卡片只有 96px 宽，放进下面那行文字（时间 · 模式）会把「文生图」挤没，所以做成角标 */
.recent-id {
    position: absolute; top: 4px; left: 4px; z-index: 2; pointer-events: none;
    padding: 1px 5px; border-radius: 6px;
    font-family: var(--mono); font-size: 10px; font-weight: 600; line-height: 1.5;
    color: #fff; background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.recent-card .meta { padding: 4px 7px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 「第 2/4 张」角标：一次生成多张时贴在缩略图右上角 */
.recent-index {
    position: absolute; top: 4px; right: 4px; z-index: 2; pointer-events: none;
    padding: 1px 5px; border-radius: 6px;
    font-family: var(--mono); font-size: 10px; font-weight: 600; line-height: 1.5;
    color: #fff; background: rgba(124, 92, 255, .82);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* 正在排队 / 生成的占位卡片：跟正式卡片同尺寸，出图后原地换成缩略图 */
.recent-card.is-running {
    cursor: default;
    border-style: dashed; border-color: rgba(124, 92, 255, .45);
    background: linear-gradient(160deg, rgba(124, 92, 255, .16), rgba(18, 16, 34, .92));
}
.recent-card.is-running::after {   /* 呼吸光，表示还在跑 */
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 60% at 50% 40%, rgba(124, 92, 255, .28), transparent 70%);
    animation: recentPulse 1.8s ease-in-out infinite;
}
@keyframes recentPulse { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
.recent-progress {
    position: relative; height: 54px;
    display: flex; align-items: center; justify-content: center;
}
.recent-progress b { position: relative; z-index: 1; font-family: var(--mono); font-size: 14px; font-weight: 600; color: #fff; }
.recent-progress i {
    position: absolute; left: 0; bottom: 0; height: 3px;
    background: linear-gradient(90deg, #7c5cff, #4fd1c5);
    transition: width .45s ease;
}

/* 瀑布流 ----------------------------------------------------------------
   这里**不能用 CSS 多列布局（columns）**：多列的阅读顺序是「第一列排满再排第二列」（竖排），
   而我们要的是按作品顺序从左到右铺（横排）。所以摆列交给 JS（gallery.js: layoutMasonry）——
   卡片绝对定位，第 i 张落在第 i % 列数 列上，列内高度各自往下长，看起来还是瀑布流。 */
.masonry { position: relative; }
.masonry-item {
    /* 绝对定位 + top/left/width 全由 JS 算（横排瀑布流），所以不再用 margin 撑间距，
       也不用 break-inside（那是多列布局的属性） */
    position: absolute; top: 0; left: 0;
    border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--panel); cursor: zoom-in;
    /* 图片 hover 放大时必须被卡片裁掉，不能顶出卡片：
       overflow + 独立合成层(translateZ) + clip-path 三重保证，
       否则在 CSS 多列布局里，被 transform 的子元素会绕过圆角裁剪跑到卡片外面 */
    overflow: hidden;
    transform: translateZ(0);
    clip-path: inset(0 round var(--radius));
    isolation: isolate;
    /* 与创作台「渲染完成」里的结果卡片同一套入场浮动效果（rise 关键帧）；
       入场结束后 transform 回到上面的 translateZ(0)，不影响圆角裁剪 */
    animation: rise .45s ease both;
}
.masonry-item img { width: 100%; display: block; transition: transform .35s ease; }
.masonry-item:hover img { transform: scale(1.04); }
/* info 覆盖在图片底部：不再占据版面高度，图片不会被顶上去。
   一行两块，**底边对齐**：
     · 左边「#任务号 · 模型名」——位置固定在左下角（离底 9px，跟加这功能之前一样）
     · 右边「生成时间」+ 下面更小更淡的「将于 xxxx-xx-xx 过期」——整块贴着右下角
   任务号是 flex 里可压缩的那一项：时间那列有多宽就让出多少，绝不重叠（真放不下才省略号截断） */
.masonry-item .info {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 16px 12px 9px;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
    font-size: 12px; color: #e8e4f7;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55) 42%, rgba(0, 0, 0, .85));
    pointer-events: none;
}
.masonry-item .info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 左下角那串「#12 · 模型名」：底边跟右边时间那一列对齐，宽度可压缩 */
.masonry-item .info > span:first-child { min-width: 0; line-height: 1.2; }
/* 右下角：上面「生成时间」、下面「将于 xxxx-xx-xx 过期」（后台设了保留天数才有这一行） */
.masonry-item .info-times {
    display: flex; flex-direction: column; align-items: flex-end;
    flex: 0 0 auto; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.masonry-item .info .expire { font-style: normal; font-size: 11px; line-height: 1.2; color: rgba(232, 228, 247, .5); }
.masonry-item .info .expire.is-soon { color: rgba(245, 196, 81, .88); }
/* 收藏按钮：收藏过的常显，没收藏的要鼠标进卡片才出现，并且从「完全看不见」渐显。
   跟三个操作按钮同一套做法：一直渲染（不用 visibility，否则移入时不会走过渡、会直接闪），
   隐藏态 = 全透明 + pointer-events: none，靠底色/文字/模糊半径插值渐显渐隐 */
.masonry-item .fav {
    position: absolute; top: 9px; right: 9px; z-index: 3; width: 30px; height: 30px;
    border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
    background: rgba(0, 0, 0, 0); color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
    transform: scale(.8); pointer-events: none;
    transition: transform .2s ease, background .24s ease, color .24s ease,
                backdrop-filter .24s ease, -webkit-backdrop-filter .24s ease;
}
.masonry-item:hover .fav,
.masonry-item .fav.is-on,
.masonry-item:focus-within .fav {
    background: rgba(0, 0, 0, .55);
    color: #fff;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    transform: scale(1);
    pointer-events: auto;
}
.masonry-item .fav.is-on { color: #ffb347; }
.masonry-item .fav:hover { transform: scale(1.14); background: rgba(0, 0, 0, .72); }
.masonry-item .fav:active { transform: scale(.94); }
/* 悬浮操作条压在 info 上方，底部留白正好让 info 露出来。
   隐藏态**不用 visibility/display**：那样浏览器会认为元素「没渲染过」，
   移入时属性变化不会走过渡，直接闪出来。这里让它一直渲染，
   只用「全透明 + pointer-events: none」隐藏，移入时才会真的从 0 渐显。
   渐显也不动 opacity —— 元素自己带 backdrop-filter 时 opacity 过渡会先渲染出没模糊的方块，
   所以让「底色 / 描边 / 文字 / 模糊半径」一起插值。 */
.masonry-item .overlay {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    padding: 14px 10px 40px; display: flex; gap: 6px; justify-content: center;
    pointer-events: none;
}
.masonry-item .overlay::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
    opacity: 0; transition: opacity .24s ease;
}
.masonry-item:hover .overlay, .masonry-item:focus-within .overlay { pointer-events: auto; }
.masonry-item:hover .overlay::before, .masonry-item:focus-within .overlay::before { opacity: 1; }
.masonry-item .overlay .btn {
    position: relative; z-index: 1;
    background: rgba(16, 14, 28, 0);
    border: 1px solid rgba(255, 255, 255, 0);
    color: rgba(241, 237, 250, 0);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0);
    backdrop-filter: blur(0) saturate(150%);
    -webkit-backdrop-filter: blur(0) saturate(150%);
    transition: transform .2s ease, background .24s ease, border-color .24s ease,
                color .24s ease, box-shadow .24s ease, backdrop-filter .24s ease, -webkit-backdrop-filter .24s ease;
}
.masonry-item:hover .overlay .btn,
.masonry-item:focus-within .overlay .btn {
    background: rgba(16, 14, 28, .5);
    border-color: rgba(255, 255, 255, .16);
    color: #f1edfa;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
}
/* 单个按钮悬停：微微放大 + 底色再亮一点（写在后面，胜过上面的卡片 hover 规则） */
.masonry-item .overlay .btn:hover {
    background: rgba(30, 26, 48, .62);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
    transform: scale(1.06);
}
.masonry-item .overlay .btn:active { transform: scale(.97); }
/* 删除保持红调，同样从透明渐显 */
.masonry-item:hover .overlay .btn-danger,
.masonry-item:focus-within .overlay .btn-danger {
    background: rgba(118, 26, 44, .5);
    border-color: rgba(255, 107, 129, .36);
    color: #ffdde3;
}
.masonry-item .overlay .btn-danger:hover {
    background: rgba(156, 34, 56, .6);
    border-color: rgba(255, 107, 129, .58);
    color: #fff;
    transform: scale(1.06);
}
/* 触屏没有 hover：这几个按钮直接常显，否则点不到 */
@media (hover: none) {
    .masonry-item .overlay { pointer-events: auto; }
    .masonry-item .overlay::before { opacity: 1; }
    .masonry-item .overlay .btn {
        background: rgba(16, 14, 28, .5); border-color: rgba(255, 255, 255, .16);
        color: #f1edfa; backdrop-filter: blur(10px) saturate(150%);
    }
    .masonry-item .overlay .btn-danger { background: rgba(118, 26, 44, .5); border-color: rgba(255, 107, 129, .36); color: #ffdde3; }
    .masonry-item .fav { background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); transform: scale(1); pointer-events: auto; }
}

/* 工具条 / 筛选 -------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 130px; }
.search-input { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-input .input { padding-left: 36px; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* 表格 ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); clip-path: inset(0 round var(--radius)); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: rgba(255, 255, 255, .035); color: var(--text-dim); font-weight: 600; font-size: 12.5px; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .03); }
table.data td.wrap { white-space: normal; min-width: 220px; }
table.data .actions { display: flex; gap: 6px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; }
.pagination button {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
    background: var(--panel); color: var(--text-dim); cursor: pointer;
}
.pagination button.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* 提示条 / 空状态 ------------------------------------------------------ */
.alert { border-radius: 14px; padding: 13px 16px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text-dim); }
.alert-ok { background: rgba(55, 217, 154, .1); border-color: rgba(55, 217, 154, .3); color: #a9f0d3; }
.alert-danger { background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .32); color: #ffc0ca; }
.alert-warn { background: rgba(255, 179, 71, .1); border-color: rgba(255, 179, 71, .3); color: #ffdca8; }
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty svg { opacity: .5; margin-bottom: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat {
    padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
    display: flex; flex-direction: column; gap: 4px;
}
.stat b { font-size: 24px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; }
.stat span { font-size: 12.5px; color: var(--muted); }

/* 弹窗 ------------------------------------------------------------------ */
.modal-root:empty { display: none; }
.modal-mask {
    position: fixed; inset: 0; z-index: 200; background: rgba(4, 4, 9, .72); backdrop-filter: blur(6px);
    display: grid; place-items: center; padding: 24px; animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
    width: 100%; max-width: 560px; max-height: 86vh; padding: 22px;
    background: rgba(16, 16, 26, .98); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2);
    /* 滚动条默认贴着 padding 盒边缘，两端会戳出圆角。
       这里改成：外层弹窗不滚动（overflow:hidden）＋ 内层 .modal-body 滚动，
       内层被弹窗 22px 内边距整体缩进，滚动条永远落在圆角以内；
       附带好处是标题栏与底部按钮栏固定不动。 */
    display: flex; flex-direction: column; overflow: hidden;
}
.modal.modal-lg { max-width: 860px; }
.modal.modal-xl { max-width: 1100px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex: 0 0 auto; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex: 0 0 auto; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }

.toast-stack { position: fixed; right: 20px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 12px 16px; border-radius: 13px; background: rgba(18, 18, 28, .97); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow); font-size: 13.5px; min-width: 220px; max-width: 360px; animation: slideIn .24s ease;
    display: flex; align-items: flex-start; gap: 9px;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } }
.toast.is-ok { border-color: rgba(55, 217, 154, .45); }
.toast.is-error { border-color: rgba(255, 107, 129, .45); }
.toast.is-warn { border-color: rgba(255, 179, 71, .45); }

.lightbox {
    position: fixed; inset: 0; z-index: 250; background: rgba(3, 3, 8, .94); backdrop-filter: blur(10px);
    display: grid; place-items: center; padding: 46px 24px 74px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 78vh; border-radius: 14px; box-shadow: var(--shadow); }
/* 弹层里放图的容器：单图 or 前后对比都塞这里 */
.lightbox-stage { display: flex; align-items: center; justify-content: center; }
/* 弹层里的图片一律禁止浏览器原生拖拽（否则按住一拖就拖出图片源文件，
   放大后的「拖动平移」也会被它抢走）；对比框里的图在 buildCompare 里也设了 draggable=false */
.lightbox img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
/* 放大后拖动平移时给个抓手光标 */
.lightbox.is-panning, .lightbox.is-panning .lightbox-stage img { cursor: grabbing; }
/* 左下角的操作提示：滚轮缩放 / 拖动平移 / 双击还原 */
.lightbox-zoomhint {
    position: absolute; left: 18px; bottom: 22px; z-index: 2;
    padding: 6px 10px; border-radius: 10px;
    font-size: 11.5px; line-height: 1.4; color: var(--text-dim);
    background: rgba(18, 16, 32, .82); border: 1px solid var(--line);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    pointer-events: none; user-select: none;
}
.lightbox-zoomhint b { color: var(--accent-3); font-weight: 600; font-family: var(--mono); }
/* 弹层里的对比框：按图片比例撑开，长边都不超出可视区。
   整块不再是拖动区（只有滑杆/分界线能拖），所以整块不要显示左右箭头光标；
   放大后由 JS 给整块换成 grab，光标移到分界线上时仍然是分界线自己的 ew-resize */
.lightbox-stage .compare {
    width: auto; height: auto; max-width: 92vw; max-height: 78vh;
    min-width: 260px; box-shadow: var(--shadow);
    cursor: default;
}
/* 选项卡：跟站内其它分段控件同一套外观，只是小一号 */
.lightbox-tabs { display: inline-flex; padding: 3px; border-radius: 12px; flex: 0 0 auto; }
.lightbox-tabs button { padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
.lightbox-close { position: absolute; top: 18px; right: 24px; border: 0; background: transparent; color: #fff; font-size: 34px; cursor: pointer; line-height: 1; }
/* 弹层底部这一行：以前它自己是「99px 圆角 + 底色 + 边框」的胶囊，里面又放了一个 .btn，
   看着就是按钮里套按钮。弹层底色本来就接近纯黑，文字不加外壳也看得清，
   所以外壳去掉，整行只留「下载原图」这一个按钮。 */
.lightbox-bar {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 14px;
    font-size: 12.5px; color: var(--text-dim);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
/* 尺寸信息 + 下载按钮的容器 */
.lightbox-actions { display: flex; align-items: center; gap: 14px; }
/* 有选项卡时：分辨率单独占一行、排在选项卡/下载按钮上方；下面一行仍是选项卡 + 下载 */
.lightbox-bar.has-tabs { flex-wrap: wrap; justify-content: center; column-gap: 14px; row-gap: 8px; }
.lightbox-bar.has-tabs .lightbox-actions { display: contents; }
.lightbox-bar.has-tabs #lightboxInfo { order: 1; flex: 0 0 100%; text-align: center; }
.lightbox-bar.has-tabs .lightbox-tabs { order: 2; }
.lightbox-bar.has-tabs #lightboxDownload { order: 3; }
/* 深色弹层上给这个按钮一点毛玻璃质感，跟作品库卡片上的按钮统一 */
.lightbox-bar .btn {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
}
.lightbox-bar .btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .32); }

/* 加载骨架 -------------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .12), rgba(255, 255, 255, .05)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 认证页 ---------------------------------------------------------------- */
/* 登录 / 注册 / 找回密码：整页正好一屏 —— 卡片居中，页脚永远贴在视口内（不出屏）。
   卡片太高时（小窗口）只让中间那块自己滚，页脚依然留在屏幕里。 */
body.page-auth { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
body.page-auth .container {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    display: flex; padding: 16px 22px;
}
/* 用 margin:auto 而不是 align-items:center —— 内容比容器高时前者不会被裁掉顶部，还能滚上去 */
body.page-auth .auth-wrap { margin: auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 8px 0; }
body.page-auth .site-footer { flex: 0 0 auto; margin-top: 0; padding: 14px 22px; }
.auth-wrap { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 30px 0; }
.auth-card { width: 100%; max-width: 430px; padding: 30px; }
.auth-card h1 { font-size: 23px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: #b9aeff; }

/* 邮箱验证码 ------------------------------------------------------------ */
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { white-space: nowrap; }

/* 支付页 ---------------------------------------------------------------- */
.pay-methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-bottom: 14px; }
.pay-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--panel); color: var(--text-dim);
    font: inherit; font-size: 12.5px; cursor: pointer; transition: .16s;
}
.pay-chip:hover { border-color: rgba(109, 94, 252, .55); color: var(--text); }
/* 关键：.pay-chip 设了 display，会盖掉浏览器对 [hidden] 自带的 display:none，
   所以折叠起来的支付方式必须显式再声明一次，否则「更多支付方式」形同虚设 */
.pay-chip[hidden] { display: none; }
.pay-chip.is-on { background: rgba(109, 94, 252, .22); border-color: rgba(109, 94, 252, .55); color: #fff; font-weight: 600; }
.pay-chip svg { flex: 0 0 auto; }
/* 「更多支付方式」：淡底无边框的小胶囊，右边一个细线箭头，展开时箭头转 180° */
.pay-chip-more {
    gap: 5px; padding-right: 11px; border-color: transparent; background: rgba(255, 255, 255, .055); color: var(--text-dim);
}
.pay-chip-more:hover,
.pay-chip-more.is-open { border-color: rgba(109, 94, 252, .42); background: rgba(109, 94, 252, .16); color: var(--text); }
.pay-chip-more .pay-more-text { white-space: nowrap; }
.pay-chip-more .pay-more-arrow {
    width: 12px; height: 12px; opacity: .9;
    transition: transform .22s cubic-bezier(.2, .9, .3, 1.15);
}
.pay-chip-more.is-open .pay-more-arrow { transform: rotate(180deg); }
.pay-chip .spinner { width: 12px; height: 12px; }
.pay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pay-amount { display: block; font-size: 28px; font-family: var(--mono); font-weight: 800; color: #fff; }
.pay-order { text-align: right; font-size: 12px; }
.pay-order code { font-family: var(--mono); font-size: 12px; color: #cfc9ff; }
/* 订单号和「复制」之间留点距离，不然挤在一起 */
.pay-order .btn { margin-left: 10px; vertical-align: middle; }
.pay-qr {
    display: grid; place-items: center; padding: 12px; border-radius: 16px; background: #fff;
    width: fit-content; margin: 0 auto 14px; border: 1px solid var(--line);
}
.pay-qr img { width: 240px; height: 240px; object-fit: contain; display: block; }
/* 已到账：二维码变灰，一眼就知道不用再扫了 */
.pay-qr.is-paid { opacity: .35; filter: grayscale(1); transition: .3s; }
.pay-tip { white-space: pre-line; font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 10px; }
.pay-tip:empty { display: none; }   /* 没填提示时不留空档 */
.pay-status { text-align: center; font-size: 13px; line-height: 1.9; padding: 10px 12px; border-radius: 12px; background: rgba(109, 94, 252, .1); }
.pay-status > div + div { margin-top: 2px; }
/* 「付款完成后请务必点击…」这句标红：用户最容易漏掉这一步，不点就没人给你核对到账 */
.pay-status-warn { color: var(--danger); font-weight: 600; }
.pay-raw { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.pay-raw code { flex: 1; min-width: 0; word-break: break-all; font-size: 11.5px; }

/* 账户页 ---------------------------------------------------------------- */
/* 版式：顶部导航（公共 header）+ 左侧导航 + 右侧正文，跟后台一个思路，
   但保留前台自己的圆角/渐变风格。─ */
.acct-shell {
    display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px; align-items: start;
}
.acct-side {
    position: sticky;
    /* 顶部导航大约 61px 高，再留出正文的上间距，滚动时侧栏正好贴在它下面 */
    top: 83px;
    display: flex; flex-direction: column; gap: 16px;
    /* 侧栏撑满一屏（顶栏 61 + 正文上留白 22 = 83 起算，再减掉底部留白），
       底部的「去创作 / 退出登录」才会落在屏幕底部，而不是紧贴在菜单下面显眼；
       菜单太多或屏幕太矮时，侧栏自己内部滚动。
       站点公告（.announce）会把正文整体下压约 59px，所以有公告时要把高度再减掉它，
       否则最后一个按钮会被顶出屏幕。 */
    height: calc(100vh - 105px);
    max-height: calc(100vh - 105px);
    overflow-y: auto;
    padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(18, 18, 30, .82), rgba(10, 10, 18, .82));
    backdrop-filter: blur(18px);
    max-height: calc(100vh - 105px); overflow: auto; overscroll-behavior: contain;
}
.acct-user { display: flex; align-items: center; gap: 11px; padding-bottom: 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.acct-avatar {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 17px;
    box-shadow: var(--glow), inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.acct-user-info { min-width: 0; display: flex; flex-direction: column; }
.acct-user-info strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-user-info span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.acct-nav { display: flex; flex-direction: column; gap: 4px; }
.acct-nav a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
    color: var(--text-dim); font-size: 14px; transition: .16s; white-space: nowrap;
}
.acct-nav a:hover { background: var(--panel-strong); color: #fff; }
.acct-nav a.is-active { background: linear-gradient(135deg, rgba(109, 94, 252, .95), rgba(176, 107, 255, .85)); color: #fff; box-shadow: var(--glow); }
.acct-nav a svg { flex: 0 0 auto; opacity: .9; }

.acct-side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
/* 有站点公告时，正文下压了约 59px：侧栏高度相应减少，底部两个按钮才不会被顶出屏幕 */
body:has(.announce) .acct-side { height: calc(100vh - 164px); max-height: calc(100vh - 164px); }

.acct-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* 正文顶部：左标题右指标，不做成一张大卡片（原来那个空框里的按钮已经去掉了，
   现在右边放的是「这一页的关键数字」，随页面变） */
.acct-top {
    display: flex; align-items: center; gap: 14px; padding: 2px 2px 14px;
    border-bottom: 1px solid var(--line);
}
.acct-top-title h1 { font-size: 19px; margin: 0 0 3px; letter-spacing: -.01em; }
.acct-top-title .sub { margin: 0; font-size: 12.5px; color: var(--muted); }
/* 标题块可以压缩：窄屏时让「说明」在左边自己换行，右边那句指标永远留在同一行 */
.acct-top-title { min-width: 0; }
/* 页头右侧那行字：纯文本，不套卡片（标签浅灰 + 数字加粗，跟标题同一行） */
.acct-metric {
    flex: 0 0 auto; display: flex; align-items: baseline; gap: 7px;
    font-size: 13px; color: var(--muted); white-space: nowrap;
}
.acct-metric b { font-size: 17px; font-weight: 800; font-family: var(--mono); letter-spacing: -.02em; color: var(--text); }
.acct-section { display: none; }
.acct-section.is-active { display: block; animation: fade .24s ease; }
/* 账号信息那两列 */
.acct-facts { display: flex; flex-direction: column; gap: 10px; }
.acct-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.acct-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.acct-facts span { font-size: 12.5px; color: var(--muted); }
.acct-facts b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 仪表盘「最近订单」的精简表：藏掉「订单号 / 时间」两列（订单号缩到套餐名下面），
   这样在半屏宽的卡片里也能一屏看完，不用左右拖 */
.table-compact th:nth-child(1), .table-compact td:nth-child(1),
.table-compact th:nth-child(5), .table-compact td:nth-child(5) { display: none; }
.table-compact td { padding-top: 9px; padding-bottom: 9px; }

.points-hero {
    padding: 26px; border-radius: var(--radius-lg); border: 1px solid rgba(109, 94, 252, .3);
    background: linear-gradient(135deg, rgba(109, 94, 252, .24), rgba(176, 107, 255, .1) 55%, rgba(74, 214, 247, .08));
    display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
}
.points-hero .big { font-size: 42px; font-weight: 800; font-family: var(--mono); letter-spacing: -.03em; line-height: 1; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.package {
    position: relative; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
    background: var(--panel); cursor: pointer; transition: .2s;
    /* 竖排 + 文字块 flex:1：同一行里不管描述几行、有没有「含赠送」，
       最下面的「立即购买」都会对齐到同一条线 */
    display: flex; flex-direction: column;
}
.package-body { flex: 1 1 auto; min-height: 0; }
.package:hover { border-color: rgba(109, 94, 252, .55); transform: translateY(-3px); }
.package .price { font-size: 26px; font-weight: 800; font-family: var(--mono); }
.package .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.package .pts { color: var(--accent-3); font-weight: 700; }
.package .tag { position: absolute; top: -10px; right: 14px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* 页脚 ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px; }
.footer-inner { max-width: 1580px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* 响应式 ---------------------------------------------------------------- */
@media (max-width: 1180px) {
    .studio { grid-template-columns: 1fr; }
    .studio-panel { position: static; max-height: none; }
    /* 窄屏恢复成整页滚动：两栏上下堆叠时，固定一屏高反而不好用 */
    body.page-create { height: auto; min-height: 100vh; overflow: visible; display: block; }
    .page-create .container { display: block; overflow: visible; }
    .page-create .studio { display: block; }
    .page-create .studio-panel { overflow: visible; }
    .page-create .studio > section { display: block; overflow: visible; padding-right: 0; }
    .page-create .stage { min-height: 460px; }
}
@media (max-width: 1080px) {
    /* 窄屏：侧栏收成横向一排可滑动的标签，正文占满宽度 */
    .acct-shell { grid-template-columns: 1fr; gap: 14px; }
    .acct-side { position: static; max-height: none; height: auto; overflow: visible; padding: 12px; gap: 12px; }
    .acct-user { padding-bottom: 10px; }
    .acct-nav { flex-direction: row; gap: 6px; overflow-x: auto; overscroll-behavior: contain; }
    .acct-nav a { padding: 9px 14px; }
    .acct-side-foot { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
    .acct-side-foot .btn { width: auto; }
}
@media (max-width: 860px) {
    .container { padding: 16px; }
    .topbar-inner { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
    .brand-text em { display: none; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    /* 右上角那组「我的账户 / 后台管理」不跟着换行占满一整行：它是 topbar-right 里的一员，
       换行了就会跑到最左边、离积分徽章很远（窄屏下必须保持"靠右、在积分前面"） */
    .topbar-right .nav { order: 0; width: auto; overflow: visible; }
    .stage { padding: 16px; min-height: 420px; }
    .acct-top { gap: 10px; }
    .acct-top-title h1 { font-size: 18px; }
}
@media (max-width: 560px) {
    body { font-size: 14px; }
    .result-grid { grid-template-columns: 1fr; }
}
