/* ================= 基础 ================= */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --portrait: #db2777;
  --general: #2563eb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e9f2;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
  --header-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ================= 顶栏 ================= */
.header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 14px; height: 100%; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.logo-mark svg { display: block; }

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 7px 13px; border-radius: 999px; font-size: 14px; color: var(--ink-2);
  font-weight: 500; transition: .15s; white-space: nowrap;
}
.nav a:hover { background: #eef0f7; color: var(--ink); }
.nav a.active { background: #eef0fb; color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #cbd2e6; background: #fafbff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px var(--brand);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c7c7; }
.btn-danger:hover { background: #fff5f5; border-color: #eaa; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }

.credits-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff7e8; color: #b45309; border: 1px solid #fde3b8;
  padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
}

.burger { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }

/* ================= Hero ================= */
.hero { padding: 28px 0 8px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -140px 0 auto; height: 460px; z-index: -1;
  background:
    radial-gradient(600px 260px at 18% 20%, rgba(99, 102, 241, .16), transparent 70%),
    radial-gradient(520px 240px at 82% 8%, rgba(219, 39, 119, .13), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid var(--line); padding: 5px 13px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow);
}
.hero-badge b { color: var(--brand); }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 52px); line-height: 1.16; margin: 12px 0 0;
  letter-spacing: -1.2px; font-weight: 850;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand), var(--portrait));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(15px, 2vw, 18px); color: var(--muted); margin: 10px 0 16px; max-width: 620px; }

.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 20px; }
.hero-stats div b { display: block; font-size: 22px; letter-spacing: -.5px; }
.hero-stats div span { font-size: 13px; color: var(--muted); }

.hero-art {
  border-radius: 20px; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 16px; overflow: hidden;
}
.hero-art canvas { width: 100%; height: 300px; display: block; border-radius: 12px; background: #f1f3f9; }

/* ================= 区块 ================= */
section { padding: 22px 0; }
.sec-head { margin-bottom: 16px; }
.sec-head .kicker {
  font-size: 12px; font-weight: 800; letter-spacing: 1.6px; color: var(--brand); text-transform: uppercase;
}
.sec-head h2 { font-size: clamp(22px, 3.4vw, 32px); margin: 8px 0 8px; letter-spacing: -.6px; font-weight: 800; }
.sec-head p { color: var(--muted); margin: 0; max-width: 680px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }

/* ================= 选型指南 ================= */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.guide-card { position: relative; overflow: hidden; padding: 22px; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.guide-card::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.guide-card.general::after { background: linear-gradient(90deg, var(--general), #60a5fa); }
.guide-card.portrait::after { background: linear-gradient(90deg, var(--portrait), #f472b6); }
.guide-card .tagline { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; }
.guide-card.general .tagline { color: var(--general); }
.guide-card.portrait .tagline { color: var(--portrait); }
.guide-card h3 { margin: 6px 0 4px; font-size: 24px; letter-spacing: -.4px; }
.guide-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }

.guide-figure {
  border-radius: 14px; padding: 14px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 14px; border: 1px dashed var(--line); background: #fafbff;
}
.guide-figure svg { flex: none; }
.guide-card.portrait .guide-figure { background: #fffafb; }

.kv { display: flex; gap: 8px; font-size: 14px; margin: 6px 0; }
.kv b { flex: none; width: 62px; color: var(--muted); font-weight: 600; }

.tip {
  border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6;
  display: flex; gap: 9px; align-items: flex-start;
}
.tip-blue { background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; }
.tip-pink { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.tip-amber { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.tip-green { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.tip i { font-style: normal; flex: none; }

.rule-banner {
  margin-top: 20px; border-radius: 18px; padding: 22px;
  background: linear-gradient(120deg, #1e1b4b, #4c1d95 55%, #831843);
  color: #fff; box-shadow: var(--shadow-lg);
}
.rule-banner h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.3px; }
.rule-banner p { margin: 0 0 16px; color: rgba(255, 255, 255, .74); font-size: 14px; }
.rule-steps { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.rule-step { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; padding: 16px; }
.rule-step .no { font-size: 11px; letter-spacing: 1.4px; opacity: .7; font-weight: 800; }
.rule-step h4 { margin: 4px 0 6px; font-size: 17px; }
.rule-step p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .78); line-height: 1.6; }
.rule-arrow { display: grid; place-items: center; font-size: 22px; color: rgba(255, 255, 255, .5); }

/* ================= 工作台 ================= */
/* align-items 必须是 stretch：左右两栏都要撑到行高，
   否则「我的模型」内容少时会矮一截，右边看上去缺一块 */
.work { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: stretch; }

/* 面板改成纵向 flex：标题固定、内容区吃掉剩余高度并可滚动、底部操作栏贴底。
   上限高度是为了模型卡片很多时不会把整页拉得过长，提交按钮始终留在视野内 */
.work > .panel {
  display: flex; flex-direction: column; overflow: hidden;
  max-height: min(920px, calc(100vh - 140px));
}
.work > .panel > .panel-b { flex: 1 1 0%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-h { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.panel-b { padding: 18px; }

.fam-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.fam-tab {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 12px; cursor: pointer; text-align: left; transition: .16s;
}
.fam-tab:hover { border-color: #c7cde6; }
.fam-tab b { display: block; font-size: 15px; }
.fam-tab span { font-size: 12px; color: var(--muted); }
.fam-tab.on[data-fam="general"] { border-color: var(--general); background: #eff6ff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.fam-tab.on[data-fam="general"] b { color: var(--general); }
.fam-tab.on[data-fam="portrait"] { border-color: var(--portrait); background: #fdf2f8; box-shadow: 0 0 0 3px rgba(219, 39, 119, .1); }
.fam-tab.on[data-fam="portrait"] b { color: var(--portrait); }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* 支付方式选择（PayPal / 微信） */
.payways { display: grid; gap: 9px; }
.payway {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: .15s;
}
.payway:hover { border-color: #cbd2e6; }
.payway.on { border-color: var(--brand); background: #f5f6ff; box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.payway input { width: auto; margin: 3px 0 0; accent-color: var(--brand); }
.payway span { display: flex; flex-direction: column; gap: 3px; }
.payway b { font-size: 14px; font-weight: 750; }
.payway i { font-style: normal; font-size: 12.5px; color: var(--muted); }

select, input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; outline: none; transition: .15s; font-size: 14px;
}
select:focus, input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
textarea { resize: vertical; min-height: 74px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; transition: .15s; font-weight: 600; color: var(--ink-2);
}
.chip:hover { border-color: #c7cde6; }
.chip.on { border-color: var(--brand); background: #eef0ff; color: var(--brand); }
.chip .cost { font-size: 11px; opacity: .75; margin-left: 4px; }
/* 格式 chip 的能力角标（仅下载 / 较慢）：说明「生成后能不能在网页里看」，
   真源分别是 src/preview.js 的 supportedExtensions 与 viewer.js 的 LOADERS 表 */
.chip .tag { font-size: 11px; opacity: .72; margin-left: 5px; font-weight: 500; }
.chip .tag.no { color: var(--danger); opacity: .9; }
.chip .tag.slow { color: var(--warn); opacity: .9; }
#fmtWarn.no { color: var(--danger); }
#fmtWarn.slow { color: var(--warn); }

.drop {
  border: 2px dashed #d5dae9; border-radius: 14px; padding: 22px 16px; text-align: center;
  cursor: pointer; transition: .16s; background: #fbfcff;
}
.drop:hover, .drop.over { border-color: var(--brand); background: #f4f5ff; }
.drop .big { font-size: 26px; }
.drop p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb { position: relative; width: 78px; }
.thumb img { width: 78px; height: 78px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.thumb .slot { font-size: 10px; text-align: center; color: var(--muted); margin-top: 3px; }
.thumb .x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid #fff; font-size: 12px; line-height: 16px;
  cursor: pointer; text-align: center;
}

.adv-toggle { font-size: 13px; color: var(--brand); cursor: pointer; font-weight: 600; user-select: none; }
.range-row { display: flex; align-items: center; gap: 10px; }
input[type=range] { flex: 1; accent-color: var(--brand); }
.range-val { min-width: 62px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.switch input { accent-color: var(--brand); width: 16px; height: 16px; }

.submit-bar { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 14px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fcfcff; border-radius: 0 0 var(--radius) var(--radius); }
.cost-note { font-size: 13px; color: var(--muted); }
.cost-note b { color: var(--ink); }
/* 余额不足提示：独占一行排在提交按钮下方（flex:1 0 100% 强制换行，不影响原布局） */
.cost-warn { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; line-height: 1.5; color: var(--warn); background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; }
.cost-warn b { color: var(--ink); }
/* ⚠️ 必须有这一条：`.cost-warn` 设了 display:flex，会盖掉浏览器默认的 [hidden]{display:none}，
   于是 hidden 属性失效、空提示框常驻。 */
.cost-warn[hidden] { display: none; }

/* ================= 模型列表 ================= */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.mcard .preview { position: relative; aspect-ratio: 1; background: linear-gradient(140deg, #eef1f8, #e3e8f5); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
a.mcard .preview, .mcard a.preview { display: grid; text-decoration: none; color: inherit; }
.mcard a.preview:hover img { transform: scale(1.04); }
.mcard .preview img { width: 100%; height: 100%; object-fit: cover; }
.mcard .badge {
  position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; color: #fff;
}
.mcard .badge.general { background: var(--general); }
.mcard .badge.portrait { background: var(--portrait); }
.mcard .st {
  position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: rgba(15, 23, 42, .68); color: #fff;
}
.mcard .st.success { background: var(--ok); }
.mcard .st.failed { background: var(--danger); }
.mcard .st.processing, .mcard .st.queueing, .mcard .st.created { background: var(--brand); }
/* queued（还在本站队列里排队）刻意用琥珀色，跟「已经在跑」的蓝色区分开：
   用户一眼就能看出「它还没开始」，而不是「它卡住了」 */
.mcard .st.queued { background: #b45309; }
.mcard .body { padding: 11px 12px; }
.mcard .body .name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .body .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mcard .body .ops { display: flex; gap: 6px; margin-top: 9px; }

.spinner {
  width: 26px; height: 26px; border: 3px solid #dbe0ee; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty .big { font-size: 40px; opacity: .35; }

/* 「我的模型」被拉伸后，内容区要跟着撑满，
   否则空状态会缩在顶部、下方留一大片空白，看起来像缺了一块 */
#gallery > .panel-b { display: flex; flex-direction: column; }
#galleryBox { flex: 1 1 0%; min-height: 0; display: flex; flex-direction: column; }
#galleryBox .empty { flex: 1 1 0%; display: flex; flex-direction: column; justify-content: center; }
#galleryBox .gallery { align-content: start; }

/* ================= 价格 ================= */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; position: relative; transition: .18s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pcard.hot { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.pcard .ribbon {
  position: absolute; top: -11px; left: 22px; background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 11px; font-weight: 800; padding: 3px 11px; border-radius: 999px;
}
.pcard h4 { margin: 0; font-size: 16px; }
.pcard .amt { font-size: 34px; font-weight: 850; letter-spacing: -1.4px; margin: 8px 0 2px; }
.pcard .amt small { font-size: 15px; font-weight: 600; color: var(--muted); }
.pcard .unit { font-size: 13px; color: var(--muted); }
.pcard ul { list-style: none; padding: 0; margin: 14px 0 18px; font-size: 13.5px; }
.pcard li { padding: 4px 0 4px 20px; position: relative; color: var(--ink-2); }
.pcard li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

.pay-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 20px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.step .n {
  width: 26px; height: 26px; border-radius: 8px; background: #eef0ff; color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 8px;
}
.step b { display: block; font-size: 14.5px; }
.step p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

/* ================= FAQ ================= */
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq summary { padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--muted); font-weight: 700; }
.faq details[open] summary::after { content: '−'; }
.faq .a { padding: 0 16px 15px; color: var(--muted); font-size: 14px; }

/* ================= 页脚 ================= */
.footer { background: #0f1330; color: #a9b0d0; padding: 40px 0 26px; margin-top: 18px; }
.footer h5 { color: #fff; margin: 0 0 10px; font-size: 14px; }
.footer p, .footer li { font-size: 13.5px; margin: 4px 0; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer .grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 26px; }
.footer .bottom { border-top: 1px solid #232a52; margin-top: 26px; padding-top: 16px; font-size: 12.5px; color: #6f78a3; }
/* 服务时间的「访客当地等效时段」：默认不占位（用类切换而不是 [hidden] ——
   本文件里 display 声明会盖掉 HTML 的 hidden 属性，历史上踩过）。 */
.svc-local { display: none; }
.svc-local.on { display: block; margin-top: 2px; font-size: 12.5px; color: #7d86ad; }

/* ================= 弹窗 ================= */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px);
  z-index: 200; display: grid; place-items: center; padding: 18px; overflow: auto;
}
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 460px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .18s ease-out;
}
.modal.wide { max-width: 640px; }
.modal.full { max-width: 1100px; }
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0; } }
.modal-h { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h b { font-size: 16px; }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: 0; padding: 0 4px; }
.modal-b { padding: 18px; max-height: 74vh; overflow: auto; }
.modal-f { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fcfcff; }

.qr-box { text-align: center; }
.qr-box img { width: 240px; height: 240px; object-fit: contain; margin: 0 auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.qr-placeholder {
  width: 240px; height: 240px; margin: 0 auto; border: 1px dashed var(--line); border-radius: 14px;
  display: grid; place-items: center; color: var(--muted); font-size: 13px; background: #fafbff; text-align: center; padding: 20px;
}
.order-no {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 17px; font-weight: 800;
  letter-spacing: 1px; background: #f1f3fa; padding: 9px 14px; border-radius: 10px; display: inline-block;
}

/* ================= 3D 预览器 ================= */
.viewer-wrap { position: relative; background: #0f1330; border-radius: 14px; overflow: hidden; }
.viewer-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.viewer-hud {
  position: absolute; left: 12px; top: 12px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5;
}
.hud-pill {
  background: rgba(15, 23, 42, .62); color: #fff; font-size: 12px; padding: 5px 11px;
  border-radius: 999px; backdrop-filter: blur(6px);
}
.hud-pill.hud-warn { background: rgba(217, 119, 6, .82); }
.viewer-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 5; }
.tool-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(15, 23, 42, .62); color: #fff; cursor: pointer; backdrop-filter: blur(6px);
  display: grid; place-items: center; font-size: 15px;
}
.tool-btn.on { background: var(--brand); border-color: transparent; }
.viewer-loading {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  background: #0f1330; color: #8b93bd; font-size: 13px; z-index: 8;
}
.viewer-pct {
  font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 700;
  color: var(--brand); letter-spacing: .5px; min-height: 19px;
}
/* WebGL 上下文丢失提示：盖在画布上，别让人对着一块空白猜（见 js/gl-guard.js） */
.gl-lost {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 10px;
  background: rgba(15, 19, 48, .82); color: #cfd4ef; font-size: 13px;
  text-align: center; padding: 16px; z-index: 9;
}

/* ================= 底部移动端导航 ================= */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: none;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar .in { display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button {
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted);
  font-size: 11px; display: grid; gap: 2px; justify-items: center;
}
.tabbar button span.ic { font-size: 19px; line-height: 1; }
.tabbar button.on { color: var(--brand); font-weight: 700; }

/* ================= Toast ================= */
.toaster { position: fixed; z-index: 300; top: 76px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: 90vw; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.toast.ok { background: #065f46; } .toast.err { background: #991b1b; }

/* ================= 后台 ================= */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: #0f1330; color: #a9b0d0; padding: 18px 12px; }
.admin-side .brand { color: #fff; font-weight: 800; font-size: 16px; padding: 4px 10px 16px; display: flex; align-items: center; gap: 8px; }
.admin-side a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
  font-size: 14px; cursor: pointer; color: #a9b0d0;
}
.admin-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-side a.on { background: var(--brand); color: #fff; font-weight: 600; }
.admin-main { padding: 22px; min-width: 0; background: var(--bg); position: relative; }
.admin-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-top h1 { margin: 0; font-size: 21px; letter-spacing: -.4px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px; box-shadow: var(--shadow); }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 25px; font-weight: 850; letter-spacing: -.8px; margin-top: 2px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl th { background: #fafbff; font-size: 12.5px; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.tbl tr:hover td { background: #fcfcff; }
.tbl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }

.badge-st { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge-st.pending { background: #fffbeb; color: #92400e; }
.badge-st.paid { background: #ecfdf5; color: #065f46; }
.badge-st.rejected { background: #fef2f2; color: #991b1b; }
.badge-st.cancelled { background: #f1f5f9; color: #475569; }
.badge-st.success { background: #ecfdf5; color: #065f46; }
.badge-st.failed { background: #fef2f2; color: #991b1b; }
.badge-st.running { background: #eef2ff; color: #3730a3; }

/* 逻辑删除（2026-09-17）：用户在前台删掉的任务在后台依然可见，靠一个醒目的标签
   把它和正常任务区分开。整行轻微压暗，但不隐藏 —— 隐藏就等于又变回物理删除了。 */
.tag-del {
  display: inline-block; margin-right: 6px; padding: 2px 7px; border-radius: 999px;
  background: #fef2f2; color: #991b1b; font-size: 10.5px; font-weight: 800; vertical-align: 1px;
}
tr.row-deleted td { opacity: .72; }
tr.row-deleted:hover td { opacity: 1; }

/* ---------- 侧栏未读小红点 ---------- */
.mini-dot {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 16px; text-align: center; vertical-align: 1px;
}
.side-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.side-dot.hide { display: none; }

/* ---------- 新订单 / 新工单提醒条 ---------- */
.alert-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -6px 0 16px; padding: 11px 14px; border-radius: 13px;
  background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12;
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 22px -14px rgba(217, 119, 6, .55);
}
.alert-bar.hide { display: none; }
.alert-bar .ab-ic { font-size: 17px; line-height: 1; }
.alert-bar .ab-text b { color: #9a3412; }
/* 闪动：呼吸式描边 + 底色脉冲，2.4 秒一轮，克制到不刺眼但一定注意得到 */
@keyframes alertPulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 119, 6, .42); background: #fff7ed; }
  50%  { box-shadow: 0 0 0 7px rgba(217, 119, 6, 0); background: #ffedd5; }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); background: #fff7ed; }
}
.alert-bar.flash { animation: alertPulse 1.2s ease-in-out 3; }
/* 临时高亮：点击侧栏「去看」时把对应区块刷一下，帮管理员定位 */
@keyframes flashRow { 0%, 100% { background: transparent; } 30% { background: #fef3c7; } }
.flash-row td { animation: flashRow 1s ease-in-out 2; }

/* ---------- 提醒设置浮层 ---------- */
.alert-pop {
  position: absolute; right: 22px; top: 66px; z-index: 60; width: 330px; max-width: calc(100vw - 44px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  box-shadow: var(--shadow-lg);
}
.alert-pop.hide { display: none; }
.alert-pop .ap-h { font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.alert-pop .ap-row {
  display: flex; align-items: flex-start; gap: 8px; padding: 7px 0;
  font-size: 13px; color: var(--ink-2); line-height: 1.6; cursor: pointer;
}
.alert-pop .ap-row input { margin-top: 3px; accent-color: var(--brand); flex: none; }
/* 重复提醒那一行不是 label，别继承 label 的手型与顶对齐 */
.alert-pop .ap-row-plain { cursor: default; align-items: center; justify-content: space-between; }
.alert-pop .ap-row-plain .ap-lab { flex: 1; }
.alert-pop .ap-row-plain select { width: auto; flex: none; padding: 4px 8px; font-size: 12.5px; }
.alert-pop .ap-note { margin: 8px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
.alert-pop .ap-note.warn { color: #b45309; }
.alert-pop .ap-f { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ---------- 顶栏当前操作者 ---------- */
/* 多人/多端管后台时，「我现在是用哪个号在操作」必须一眼可见 —— 尤其写操作只输密码不显示账号，
   输错账号改错数据的代价远大于这里多占的一点宽度 */
.whoami {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 5px 11px; border-radius: 999px; background: var(--bg-2, #f4f4f6);
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2, #444);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.whoami:empty { display: none; }

/* ---------- 派发关闭红横幅（SUBMIT_DISPATCH=0 防呆） ---------- */
.dispatch-warn {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 0 0 14px; padding: 10px 14px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 13px; line-height: 1.6;
}
.dispatch-warn[hidden] { display: none; }
.dispatch-warn b { font-weight: 800; }

/* ---------- 积分流水 ---------- */
.ledger-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ledger-sum .ls { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.ledger-sum .ls .l { font-size: 12.5px; color: var(--muted); }
.ledger-sum .ls .v { font-size: 21px; font-weight: 850; letter-spacing: -.5px; margin-top: 2px; }
.amt-in { color: #059669; font-weight: 800; }
.amt-out { color: #dc2626; font-weight: 800; }

/* ---------- 工单 ---------- */
.tk-msgs { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; max-height: 52vh; overflow-y: auto; }
.tk-msg { display: flex; gap: 10px; align-items: flex-start; }
.tk-msg .av {
  flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 14px; background: #eef0ff; color: var(--brand);
}
/* ⚠️ 客服消息用 .staff 而不是 .admin：`.admin` 是后台布局根容器（display:grid; min-height:100vh），
   气泡一旦复用这个类名就会被撑成整屏高、把对话区挤爆（2026-10-29 实测：单条客服消息 940px）。 */
.tk-msg.staff .av { background: #ecfdf5; color: #047857; }
.tk-msg .bub { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; max-width: 78%; }
/* 聊天惯例：对方（客服）在左、自己在右。旧版把客服放右边，
   与微信/几乎所有 IM 相反，看着像「客服在跟我抢话」。 */
.tk-msg.user { flex-direction: row-reverse; }
.tk-msg.user .bub { background: #eef2ff; border-color: #dbe2ff; }
.tk-msg .meta { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.tk-msg .txt { font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
/* 状态流转等系统节点：居中细字，不参与对话气泡视觉 */
.tk-sys { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.tk-sys span { background: #f1f5f9; border-radius: 999px; padding: 3px 11px; }
.tk-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.tk-reply textarea { flex: 1; min-height: 62px; resize: vertical; }

/* ================= 响应式 ================= */
@media (max-width: 1000px) {
  .work { grid-template-columns: 1fr; }
  .hero-stats { gap: 20px; }
  /* 单列时不再需要等高与内部滚动，交给页面自身滚动 */
  .work > .panel { max-height: none; }
  .work > .panel > .panel-b { overflow-y: visible; }
  #gallery > .panel-b { min-height: 320px; }
}

@media (max-width: 768px) {
  body { padding-bottom: 62px; font-size: 14.5px; }
  .container { padding: 0 14px; }
  .nav { display: none; }
  .burger { display: grid; place-items: center; }
  .hero { padding: 20px 0 8px; }
  .hero-art { margin-top: 18px; }
  .hero-art canvas { height: 230px; }
  section { padding: 18px 0; }
  .guide-grid, .rule-steps { grid-template-columns: 1fr; }
  .rule-arrow { transform: rotate(90deg); padding: 2px 0; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .footer .grid { grid-template-columns: 1fr; gap: 18px; }
  .tabbar { display: block; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .modal-b { max-height: 66vh; }
  .admin { grid-template-columns: 1fr; }
  .admin-side { display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .admin-side .brand { padding: 0 8px 0 0; flex: none; }
  .admin-side a { flex: none; white-space: nowrap; }
  .admin-main { padding: 14px; }
}

@media (max-width: 480px) {
  .price-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 14px; }
  .hero-stats div b { font-size: 19px; }
}

/* 移动端抽屉 */
.drawer {
  position: fixed; inset: 0; z-index: 150; display: none;
}
.drawer.on { display: block; }
.drawer .bg { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.drawer .panel-m {
  position: absolute; right: 0; top: 0; bottom: 0; width: 240px; background: #fff;
  padding: 18px; box-shadow: var(--shadow-lg); animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer .panel-m a { display: block; padding: 11px 8px; border-bottom: 1px solid var(--line); font-weight: 600; }

/* ================= 顶部公告 ================= */
.announce {
  background: linear-gradient(90deg, #4338ca, #6d28d9 55%, #4f46e5);
  color: #fff; font-size: 13px;
}
.announce .container {
  display: flex; align-items: center; gap: 8px;
  height: 38px; overflow: hidden; white-space: nowrap;
}
.announce .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex: none;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .25);
}
.announce b { flex: none; font-weight: 700; letter-spacing: .3px; }
.announce .txt { color: rgba(255, 255, 255, .82); overflow: hidden; text-overflow: ellipsis; }
.announce a {
  flex: none; margin-left: auto; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  transition: background .15s;
}
.announce a:hover { background: rgba(255, 255, 255, .3); }

/* ================= 资产展示画廊 ================= */
/* 双轴筛选：第一行「类别」是主筛选轴（按钮更重），第二行「材质」是次筛选轴。
   两个轴是 AND 关系，各自带件数角标，切类别时材质行会按该类别重算。 */
.asset-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.asset-filter-row { display: flex; align-items: flex-start; gap: 10px; }
.asset-filter-row .flabel {
  flex: 0 0 auto; font-size: 12px; color: var(--muted); font-weight: 600;
  line-height: 30px; letter-spacing: .5px;
}
.asset-filter { display: flex; flex-wrap: wrap; gap: 8px; }
.asset-filter button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 6px 14px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  transition: all .15s;
}
.asset-filter button i {
  font-style: normal; font-size: 11px; opacity: .6; margin-left: 5px;
}
.asset-filter button:hover { border-color: var(--brand); color: var(--brand); }
.asset-filter button.on {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}
.asset-filter button.on i { opacity: .85; }
/* 主筛选轴（类别）：默认就比次轴重一档，未选中也能一眼看出这是主轴 */
.asset-filter-main button {
  font-size: 14px; font-weight: 600; padding: 7px 16px;
  background: #f6f7fe; border-color: #dfe3f7;
}
.asset-filter-sub button { padding: 4px 12px; font-size: 12.5px; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 16px;
}
.asset-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

.asset-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.asset-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #c7d2fe;
}
.asset-thumb {
  position: relative; aspect-ratio: 1 / 1; background: #f1f3fa;
  display: grid; place-items: center; overflow: hidden;
}
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-thumb .hover-mask {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(30, 27, 75, .55); color: #fff; font-weight: 700; font-size: 14.5px;
  opacity: 0; transition: opacity .18s;
}
.asset-card:hover .hover-mask { opacity: 1; }
.asset-thumb .fmt {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: rgba(15, 23, 42, .62); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; letter-spacing: .3px;
}
/* 类别徽标：卡片右上角，与左上角的格式角标对称。
   类别是主轴，所以在「全部」视图里不做筛选也能一眼看出每件属于哪一类。 */
.asset-thumb .cat-badge {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  background: var(--brand); color: #fff; font-weight: 700;
  font-size: 11px; padding: 3px 9px; border-radius: 999px; letter-spacing: .4px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .35);
}

.asset-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.asset-body h4 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.asset-body .desc { font-size: 12.8px; color: var(--muted); line-height: 1.55; margin: 0; }
/* 标签行贴底：原先靠 .asset-foot 的 margin-top:auto 撑开，底行移除后由这里接管，
   否则同排卡片描述行数不同会导致标签高度参差 */
.asset-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.asset-tags span {
  font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: #eef2ff; color: #4338ca;
}

/* ================= 功能特色 ================= */
.feat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 16px;
}
.feat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 20px; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.feat-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c7d2fe;
}
.feat-ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; margin-bottom: 13px;
}
.feat-card h3 { margin: 0 0 7px; font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.feat-card p { margin: 0; color: var(--muted); font-size: 13.6px; line-height: 1.72; }
.feat-card p b { color: var(--ink-2); }

/* ================= 使用步骤 ================= */
.how-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 16px;
}
.how-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 20px 20px; overflow: hidden;
}
.how-no {
  position: absolute; right: 14px; top: 2px;
  font-size: 62px; font-weight: 800; line-height: 1;
  color: #eef1fa; letter-spacing: -3px; user-select: none;
}
.how-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.how-card > p { margin: 0; color: var(--muted); font-size: 13.6px; line-height: 1.72; }
.how-tip {
  margin-top: 14px; padding: 9px 12px; border-radius: 10px;
  background: #f8f9fd; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.6;
}

/* ================= 响应式补充 ================= */
@media (max-width: 768px) {
  .announce .container { height: 34px; font-size: 12px; gap: 6px; }
  .announce .txt { display: none; }
  .announce a { margin-left: auto; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .asset-body { padding: 11px 12px 13px; }
  .asset-body .desc { display: none; }
  .asset-body h4 { font-size: 14px; }
  .feat-card, .how-card { padding: 18px 16px; }
  .feat-ic { width: 38px; height: 38px; font-size: 17px; margin-bottom: 10px; }
  .tabbar .in { grid-template-columns: repeat(5, 1fr); }
}

/* ================= 积分消耗速查表 ================= */
.credit-table { display: flex; flex-direction: column; gap: 2px; }
.ct-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) minmax(80px, 1fr) 96px;
  align-items: center; gap: 14px;
  padding: 9px 12px; border-radius: var(--radius-sm);
}
.ct-row:nth-child(even) { background: #fafbff; }
.ct-row.top { background: linear-gradient(90deg, #eef2ff, #fafbff); }
.ct-name { display: flex; flex-direction: column; min-width: 0; }
.ct-name b { font-size: 14px; font-weight: 700; }
.ct-name span { font-size: 12px; color: var(--muted); }
.ct-bar { height: 8px; border-radius: 999px; background: #eef1fa; overflow: hidden; }
.ct-bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.ct-row.top .ct-bar i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.ct-val { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ct-val b { font-size: 16px; font-weight: 800; color: var(--ink); margin-right: 2px; }

/* 输入框提示里的跳转链接 */
.field .hint .lnk { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.field .hint .lnk:hover { color: var(--brand-2); }

/* 弹窗里的行内文字按钮（忘记密码 / 返回登录）：视觉上像链接，语义上仍是 button
   —— 用 <button> 才能被键盘 Tab 到、被读屏念成可操作元素 */
.link-btn {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--brand-2); }

@media (max-width: 480px) {
  .asset-grid { grid-template-columns: 1fr 1fr; }
  .asset-thumb .hover-mask { display: none; }
  .ct-row { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 10px; }
  .ct-bar { grid-column: 1 / -1; }
}

/* ================= 独立模型预览页（model.html） ================= */
.mpage-body { background: #f6f7fb; }

.mpage-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.mpage-back {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink); font-size: 13.5px; font-weight: 600;
  text-decoration: none;
}
.mpage-back:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.mpage-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.mpage-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.mpage-badge {
  font-size: 11px; font-weight: 800; color: #fff;
  padding: 3px 8px; border-radius: 999px;
}
.mpage-badge.fam-general { background: var(--general); }
.mpage-badge.fam-portrait { background: var(--portrait); }

.mpage-state {
  font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #f1f2f6; color: var(--muted);
  white-space: nowrap;
}
.mpage-state.st-success { background: #dcfce7; color: #166534; }
.mpage-state.st-failed { background: #fee2e2; color: #b91c1c; }
.mpage-state.st-processing, .mpage-state.st-queueing, .mpage-state.st-created { background: #dbeafe; color: #1d4ed8; }
.mpage-state.st-queued { background: #fef3c7; color: #b45309; }

.mpage-main {
  display: grid; grid-template-columns: 1fr 360px; gap: 18px;
  padding: 18px; max-width: 1440px; margin: 0 auto;
  align-items: start;
}
/* 必须确保 hidden 属性生效：JS 用 el.hidden = true 切状态，但下面的 .mpage-auth / .mpage-err
   显式 display:flex 会覆盖 hidden 默认 display:none。统一在底部用 !important 兜底 */
[hidden] { display: none !important; }
.mpage-viewer { display: flex; flex-direction: column; gap: 12px; position: relative; }
.mwrap {
  width: 100%; min-height: calc(100vh - 140px);
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(140deg, #eef1f8, #e3e8f5);
  position: relative; overflow: hidden;
}
.mtip { margin: 0; }

/* 大文件慢提示：浮在视口底部，不参与布局。
 * 为什么是 `fixed` 而不是相对画布 absolute：`.mwrap` 是 `min-height: calc(100vh - 140px)`，
 * 整个 `.mpage-viewer` 比视口更高 —— 相对它定位到 bottom 就是在**视口外**
 * （2026-11-03 实测：absolute 版本 y=821/视口 860，提示条被裁掉大半，等于没提示）。
 * 用户等的时候眼睛在画布中央，提示必须**不用滚动就能看见**，所以钉在视口上。
 * 另两个好处：不推布局（不触发画布 resize 变形）、不进 `#mWrap`
 * （渲染层建画面时会 `innerHTML=''`，放里面会被清掉）。 */
#mSlow {
  position: fixed; left: 12px; bottom: 12px; z-index: 40;
  max-width: min(560px, calc(100vw - 24px));
  box-shadow: 0 8px 24px rgba(15, 20, 40, .18);
}

.mpage-aside { display: flex; flex-direction: column; gap: 14px; }
.mpage-aside .panel { background: #fff; }

.mparam {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 12px;
}
.mparam:last-child { border-bottom: none; }
.mparam .k { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.mparam .v { font-size: 13.5px; font-weight: 600; text-align: right; word-break: break-all; }

.minputs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.minputs img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); background: #f1f2f6;
}

.mfile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); text-decoration: none;
  transition: .15s;
}
.mfile:last-child { margin-bottom: 0; }
.mfile:hover { border-color: var(--brand); background: var(--brand-soft); }
.mfile-name { font-size: 13.5px; font-weight: 600; }
.mfile-act { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.mfile:hover .mfile-act { color: var(--brand-2); }

/* 打包下载（多文件任务的主入口 · 2026-10-28）
 * 视觉上必须比散装文件"重"一档：用户第一眼要看到"一键拿走整包"，
 * 散装列表则折进 <details> 里当备选（要点某一个单独文件时才展开）。 */
.mfile-zip {
  align-items: center; gap: 12px; padding: 12px 13px;
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px -8px rgba(79, 70, 229, .75);
}
.mfile-zip:hover { background: linear-gradient(135deg, var(--brand-2), var(--brand)); border-color: transparent; }
.mfile-zip-ico { font-size: 20px; line-height: 1; }
.mfile-zip-main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.mfile-zip-main b { font-size: 14px; font-weight: 700; }
.mfile-zip-main small { font-size: 12px; opacity: .85; }
.mfile-zip .mfile-act { color: #fff; white-space: nowrap; flex: 0 0 auto; }
.mfile-zip:hover .mfile-act { color: #fff; }
/* 打包要等服务端从对象存储把整包拉回来，这段时间界面必须有「在动」的证据：
   只把文字换成「正在取包…」还不够——静态文本会被当成已经卡死。 */
.mfile-zip.is-busy { cursor: progress; }
.mfile-zip.is-busy .mfile-zip-ico { animation: zip-busy-pulse 1.1s ease-in-out infinite; }
@keyframes zip-busy-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.88); }
}
@media (prefers-reduced-motion: reduce) {
  .mfile-zip.is-busy .mfile-zip-ico { animation: none; }
}

.mfiles-split { margin-top: 10px; }
.mfiles-split > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 6px 2px; border-radius: 8px;
}
.mfiles-split > summary::-webkit-details-marker { display: none; }
.mfiles-split > summary::before { content: '▸ '; font-weight: 700; }
.mfiles-split[open] > summary::before { content: '▾ '; }
.mfiles-split > summary:hover { color: var(--brand); }
.mfiles-split-b { margin-top: 8px; }

.mpage-auth, .mpage-err {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

@media (max-width: 900px) {
  .mpage-main { grid-template-columns: 1fr; }
  .mwrap { min-height: 50vh; }
  .mpage-title b { max-width: 200px; }
}
@media (max-width: 600px) {
  .mpage-top { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .mpage-main { padding: 12px; }
  .mwrap { min-height: 56vh; }
}

/* ============================================================
 *  语言切换器（11 语言 · 2026-09-19）
 * ============================================================ */
.lang-mount { display: flex; align-items: center; }
.lang-mount-m { margin-top: 12px; }
.lang-dd { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.lang-flag { font-size: 14px; line-height: 1; }
.lang-cur { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.lang-caret { font-size: 10px; opacity: .6; }
.lang-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 176px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(20, 28, 60, .14); padding: 6px;
}
.lang-opt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; color: var(--ink);
  border-radius: 9px; padding: 8px 10px; font-size: 13.5px;
  cursor: pointer; text-align: start;
  text-decoration: none; /* 选项是真实 <a> 链接：切语言 = 换 URL */
}
.lang-opt:hover { background: var(--brand-soft); }
.lang-opt.on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.lang-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.lang-check { font-size: 12px; }

/* ============================================================
 *  购买积分弹窗（2026-10-29）
 *  版式对齐站点盒子：顶部账号横幅 → 左栏权益 → 右栏套餐卡 + 付款条。
 *  币种符号来自服务端下发的 currencySymbol（语言决定），此处不写死 ¥。
 * ============================================================ */
.buy-banner {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  background: linear-gradient(120deg, #1e1b4b, #312e81 55%, #4c1d95);
  color: #fff;
}
.buy-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .18); display: grid; place-items: center;
  font-weight: 800; font-size: 18px; letter-spacing: -.5px;
}
.buy-acc { font-size: 13.5px; line-height: 1.55; min-width: 0; }
.buy-acc b { font-weight: 700; word-break: break-all; }
.buy-acc-sub { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.buy-banner .buy-faq {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; font-size: 12.5px; padding: 6px 12px; flex: none;
}
.buy-banner .buy-faq:hover { background: rgba(255, 255, 255, .26); }
.buy-banner .buy-x {
  background: none; border: 0; color: rgba(255, 255, 255, .78); font-size: 22px;
  line-height: 1; cursor: pointer; padding: 0 2px; flex: none;
}
.buy-banner .buy-x:hover { color: #fff; }

.buy-wrap { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 16px; }
.buy-side {
  background: #f8f9fe; border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 16px; align-self: start;
}
.buy-side-t { font-weight: 750; font-size: 13.5px; margin-bottom: 10px; color: var(--ink); }
.buy-side ul { margin: 0; padding-inline-start: 15px; color: var(--ink-2); font-size: 12.4px; line-height: 1.85; }
.buy-side li { margin-bottom: 2px; }
.buy-side-lnk { display: inline-block; margin-top: 12px; font-size: 12.8px; cursor: pointer; }

.buy-main { min-width: 0; }
.buy-main-h { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 15px; }
.buy-main-ic {
  width: 34px; height: 34px; border-radius: 10px; background: #eef0ff;
  display: grid; place-items: center; font-size: 17px; flex: none;
}
.buy-main-t { font-weight: 800; font-size: 15.5px; color: var(--ink); }
.buy-main-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.buy-label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; }

.pkg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pkg-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 17px 8px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.pkg-card:hover { border-color: #c7cbf0; }
.pkg-card.on {
  border-color: var(--brand); background: #f7f7ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .1);
}
.pkg-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pkg-price { font-size: 24px; font-weight: 850; letter-spacing: -.6px; color: var(--ink); line-height: 1.2; }
.pkg-card.on .pkg-price { color: var(--brand); }
.pkg-old { font-size: 12px; color: var(--muted); }
.pkg-per { font-size: 11.5px; color: var(--muted); }
.pkg-ribbon {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.pkg-ribbon.hot { background: var(--brand); }

.buy-sum {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
  padding: 13px 16px; border-radius: 12px; background: #f8f9fe; border: 1px solid var(--line);
}
.buy-sum-l { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--muted); }
.buy-sum-l b { font-size: 26px; font-weight: 850; letter-spacing: -.8px; color: var(--danger); line-height: 1.15; }
.buy-sum .buy-go {
  margin-inline-start: auto; padding: 11px 30px; font-size: 15px; font-weight: 750;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: 0;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .75);
}
.buy-sum .buy-go:hover { filter: brightness(1.07); }

.buy-meta { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.buy-line { font-size: 12.8px; color: var(--ink-2); }
.buy-line.ok { color: var(--ok); }
.buy-line.warn { color: var(--warn); }
.buy-agree { margin-top: 10px; font-size: 12px; color: var(--muted); }
.buy-notes { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.buy-notes-t { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.buy-notes p { margin: 0 0 3px; font-size: 12px; color: var(--muted); line-height: 1.65; }

/* ============================================================
 *  客服会话窗（2026-10-29）
 *  版式对齐站点盒子「联系客服」：头部 + 对话区 + 描述框 + 发送按钮。
 *  用户不再先填「分类/标题/订单号」表单 —— 那些字段对客服分派没有作用
 *  （onesite 工单接口也只认 subject/content），只会挡住「说句话就有人回」这件事。
 * ============================================================ */
.modal.cs-modal { max-width: 800px; }
.cs-modal .modal-h { gap: 9px; }
.cs-ic {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #eef2ff; color: var(--brand); display: grid; place-items: center; font-size: 15px;
}
.cs-title { font-size: 16px; font-weight: 800; }
.cs-tag {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  background: #f1f5f9; border-radius: 999px; padding: 3px 9px; margin-inline-start: 2px;
}
.cs-tag.hot { background: #eef2ff; color: var(--brand); }
.cs-body { padding: 16px 18px; }
.cs-thread {
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  padding: 14px; height: 42vh; min-height: 240px; overflow-y: auto;
  display: flex; flex-direction: column;
}
.cs-thread .tk-msgs { max-height: none; overflow: visible; }
.cs-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }
.cs-empty .big { font-size: 26px; display: block; margin-bottom: 6px; }
.cs-input {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 12px 14px; display: flex; flex-direction: column;
}
.cs-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .1); }
.cs-input textarea {
  border: 0; padding: 0; resize: none; min-height: 96px; font: inherit;
  font-size: 13.5px; line-height: 1.7; outline: none; background: transparent;
}
.cs-count { font-size: 11.5px; color: var(--muted); text-align: end; }
.cs-count.ok { color: var(--ok); }
.cs-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.cs-hist { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-hist-btn {
  font-size: 12px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-family: inherit;
}
.cs-hist-btn.on { border-color: var(--brand); color: var(--brand); background: #f5f6ff; font-weight: 700; }
/* 工单「有新回复」标记：胶囊内的小圆点（不是角标，所以不复用 .mini-dot 的绝对定位） */
.tk-new-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); margin-right: 5px; vertical-align: middle;
}

@media (max-width: 860px) {
  .buy-wrap { grid-template-columns: 1fr; }
  .buy-side { order: 2; }
  .pkg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .buy-sum { flex-wrap: wrap; }
  .buy-sum .buy-go { width: 100%; margin-inline-start: 0; }
}

/* ============================================================
 *  RTL（阿拉伯语 dir=rtl 时由 html[dir=rtl] 生效）
 *  972 行以 flex/grid 为主的布局会自动镜像；这里只兜底少数
 *  硬编码了物理方向的规则（margin-left / text-align: right …）。
 * ============================================================ */
[dir="rtl"] .modal-h .x { margin-left: auto; margin-right: 0; }
[dir="rtl"] .announce a { margin-left: auto; margin-right: 0; }
[dir="rtl"] .hint { margin-left: 6px; margin-right: 0; }
[dir="rtl"] .mparam .v, [dir="rtl"] .ct-val, [dir="rtl"] .range-val { text-align: left; }
[dir="rtl"] .lang-pop { right: auto; left: 0; }
