/* 智哥AI · 基础样式（从畅秀沿用，换了配色；智哥专属样式在文件末尾）
   不依赖任何海外 CDN 或网络字体，保证国内访问速度。 */

:root {
  /* 智哥AI：暖色、米白底、深棕字。暖橙是智哥的衣服色，只用在主操作和品牌上；黄色只给点数；青绿表示“做好了 / 通过” */
  --bg: #fdf7ef;
  --bg-alt: #f8eddf;
  --surface: #ffffff;
  --surface-2: #fffaf3;
  --line: #efe1cf;
  --text: #33261d;
  --muted: #7d6b5c;
  --accent: #ec7a2c;          /* 智哥橙 */
  --accent-dark: #c35f18;
  --accent-2: #ffc94a;        /* 点数黄 */
  --accent-2-ink: #8a5a00;
  --accent-ink: #ffffff;
  --violet: #2e9c7e;          /* 畅秀的紫色在这里换成青绿 */
  --ok: #2e9c7e;
  --danger: #d9473a;
  --screen: #1f1712;          /* 屏幕里的内容（预览、视频）保持深色 */
  --radius: 18px;
  --header-h: 69px;            /* 顶栏高度（含下边线）：悬浮元素的 top 都要让出它 */
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
          system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* 带 hidden 属性的元素一律隐藏，不被组件自己的 display 覆盖 */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: calc(18px * var(--fs));
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: .01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: calc(1200px * var(--fs)); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: calc(15px * var(--fs)); }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
/* 页内跳转、scrollIntoView 停下的位置不被顶栏挡住 */
html { scroll-padding-top: calc(var(--header-h) + 12px); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: auto; display: block; margin-top: -3px;}
.brand-name { font-size: calc(22px * var(--fs)); font-weight: 800; }
.brand-sub { font-size: calc(15px * var(--fs)); color: var(--muted); letter-spacing: .08em; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--muted); font-size: calc(17px * var(--fs)); }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.credits {
  font-size: calc(15px * var(--fs)); font-weight: 700; color: var(--accent-2-ink); background: #fff3cc;
  border: 1px solid #ffe08a; border-radius: 999px; padding: 3px 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: calc(44px * var(--fs)); height: auto; padding: 0 18px; border-radius: 12px;
  font: inherit; font-size: calc(17px * var(--fs)); font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(236, 122, 44, .28); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-lg { min-height: calc(52px * var(--fs)); height: auto; padding: 0 26px; font-size: calc(19px * var(--fs)); }
.btn-block { width: 100%; min-height: calc(48px * var(--fs)); height: auto; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-dark); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- 首页主视觉 ---------- */
.hero { padding: 64px 0 48px; }
.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--accent-dark); font-size: calc(16px * var(--fs)); letter-spacing: .12em; margin-bottom: 12px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 900; letter-spacing: -.01em; line-height: 1.18; }
.lead { color: var(--muted); font-size: calc(20px * var(--fs)); max-width: 30em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* 竖屏手机里的直播间：首页唯一的“重”元素，其余保持安静 */
.phone { margin: 0 auto; width: min(320px, 82vw); }
.phone-screen {
  position: relative; aspect-ratio: 9 / 19.5; overflow: hidden;
  border-radius: 40px; border: 10px solid #16141d; background: var(--screen); color: #fff;
  box-shadow: 0 30px 60px -20px rgba(22, 20, 29, .45), 0 0 0 1px #2c2936;
}
.ph-bg { position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 0%, #2b2f78 0%, #151338 50%, #08071a 100%); }
.ph-bg span { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .7; }
.ph-bg span:nth-child(1) { width: 70%; height: 30%; left: -10%; top: 18%; background: #2e9c7e; animation: drift-a 12s ease-in-out infinite; }
.ph-bg span:nth-child(2) { width: 60%; height: 26%; right: -12%; top: 46%; background: #ec7a2c; opacity: .45; animation: drift-b 12s ease-in-out infinite; }
.ph-bg span:nth-child(3) { width: 50%; height: 20%; left: 20%; bottom: 8%; background: #19c3e6; opacity: .35; animation: drift-c 8s ease-in-out infinite; }
@keyframes drift-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(18%, -10%) scale(1.12); } }
@keyframes drift-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-16%, 14%) scale(.9); } }
@keyframes drift-c { 0%,100% { transform: translate(0,0); } 50% { transform: translate(10%, -12%); } }
.ph-top { position: absolute; left: 12px; right: 12px; top: 14px; display: flex; align-items: center; gap: 8px; }
.ph-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #ffc531, #ec7a2c); border: 2px solid rgba(255,255,255,.8); }
.ph-host { display: grid; line-height: 1.2; font-size: calc(15px * var(--fs)); background: rgba(0,0,0,.28); padding: 3px 10px 3px 0; border-radius: 999px; }
.ph-host em { font-style: normal; font-size: calc(12px * var(--fs)); opacity: .75; }
.ph-live { margin-left: auto; font-size: calc(13px * var(--fs)); font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--accent); }
.ph-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #fff; margin-right: 5px; vertical-align: 1px; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ph-away { position: absolute; left: 0; right: 0; top: 32%; text-align: center; }
.ph-away p { margin: 0; }
.ph-away-title { font-size: calc(17px * var(--fs)); font-weight: 600; letter-spacing: .06em; opacity: .92; }
.ph-away-timer { font-size: calc(64px * var(--fs)); font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(140, 170, 255, .6); }
.ph-away-sub { font-size: calc(15px * var(--fs)); opacity: .8; }
.ph-chat { position: absolute; left: 12px; bottom: 16px; width: 72%; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ph-chat li {
  justify-self: start; font-size: calc(15px * var(--fs)); line-height: 1.4; padding: 4px 10px; border-radius: 12px; background: rgba(0,0,0,.32);
}
.ph-chat li b { color: #ffd76a; font-weight: 600; margin-right: 6px; }
/* 弹幕条数随便加：没有脚本时只显示前 3 条；有脚本时像真直播间一样一条条滚上来，始终最多 3 条 */
.ph-chat:not(.is-live) li:nth-child(n+4) { display: none; }
.ph-chat.is-live li { animation: chat-in .45s ease-out both; }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chat-fade { from { opacity: 0; } to { opacity: 1; } }
.phone figcaption { color: var(--muted); font-size: calc(15px * var(--fs)); margin-top: 14px; text-align: center; }

/* 按直播节奏分三列的工具表 */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; align-items: start; }
.flow-col { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.flow-col.is-live { border-color: rgba(236, 122, 44, .35); box-shadow: 0 10px 30px -18px rgba(236, 122, 44, .45); }
.flow-title { display: flex; align-items: center; gap: 8px; font-size: calc(18px * var(--fs)); margin: 0 0 10px; }
.flow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.is-live .flow-dot { background: var(--accent); }
.tool-row { display: grid; gap: 2px; padding: 12px 12px; margin: 0 -6px; border-radius: 12px; color: var(--text); }
.tool-row + .tool-row { border-top: 1px solid var(--line); }
.tool-row b { font-size: calc(19px * var(--fs)); }
.tool-row span { font-size: calc(16px * var(--fs)); color: var(--muted); }
.tool-row:hover { text-decoration: none; background: var(--surface-2); }
.tool-row:hover b { color: var(--accent-dark); }

/* ---------- 区块 ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: calc(32px * var(--fs)); letter-spacing: -.01em; }
.section-lead { color: var(--muted); max-width: 40em; font-size: calc(19px * var(--fs)); }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; scroll-margin-top: 80px;
}
.tool-card h3 { font-size: calc(20px * var(--fs)); margin-top: 12px; }
.tool-card p { color: var(--muted); font-size: calc(17px * var(--fs)); margin: 0; }
.tag {
  display: inline-block; font-size: calc(15px * var(--fs)); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}
.tag-soon { color: var(--accent-2-ink); border-color: #ffe08a; background: #fff8e0; }

.pricing { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.price-list li {
  display: flex; align-items: baseline; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
}
.price { font-size: calc(24px * var(--fs)); font-weight: 900; color: var(--accent); min-width: 3.4em; }

/* ---------- 登录 ---------- */
.auth { display: flex; justify-content: center; padding: 72px 20px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px;
}
.auth-card.center { text-align: center; }
.auth-card h1 { font-size: calc(26px * var(--fs)); }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.form label { font-size: calc(16px * var(--fs)); color: var(--muted); }
.form input {
  height: calc(46px * var(--fs)); padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: calc(18px * var(--fs));
  min-width: 0;   /* Firefox 按 size 属性算输入框默认宽度，加了字距的验证码框会把卡片撑破 */
}
.form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(236, 122, 44, .2); }
.form .btn-block { margin-top: 8px; }
.code-input { width: 100%; letter-spacing: .5em; font-size: calc(22px * var(--fs)) !important; text-align: center; font-variant-numeric: tabular-nums; }
.alert {
  background: #fff0f2; border: 1px solid #ffc2cc;
  color: #b4233c; border-radius: 10px; padding: 10px 14px; font-size: calc(16px * var(--fs));
}
.dev-note {
  background: #f1edff; border: 1px dashed #b9a8ff;
  border-radius: 10px; padding: 10px 14px; font-size: calc(16px * var(--fs));
}
.resend { margin-top: 16px; display: flex; gap: 8px; align-items: center; font-size: calc(16px * var(--fs)); }
.fineprint { margin-top: 18px; font-size: calc(15px * var(--fs)); color: var(--muted); }

/* ---------- 个人中心 ---------- */
.account { display: grid; gap: 16px; }
.account-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.panel p { margin: 0; }
.panel-value { font-size: calc(22px * var(--fs)); font-weight: 700; margin: 4px 0 !important; word-break: break-all; }
.panel-title { font-size: calc(21px * var(--fs)); }
.account form { margin-top: 8px; }

/* ---------- 可用的工具卡片 ---------- */
a.tool-card { display: block; color: inherit; transition: border-color .15s ease, transform .15s ease; }
a.tool-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.tag-live { color: var(--ok); border-color: rgba(15, 159, 116, .35); background: rgba(15, 159, 116, .07); }

/* ---------- 提示条 ---------- */
.notice {
  background: #e9f8f2; border: 1px solid #b6e8d6;
  color: #0b6b4f; border-radius: 10px; padding: 10px 14px; font-size: calc(16px * var(--fs)); margin-top: 16px;
}
.crumb { font-size: calc(15px * var(--fs)); color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }

/* ---------- 工具编辑器 ---------- */
.link-box {
  margin-top: 20px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
}
.link-label { font-size: calc(16px * var(--fs)); color: var(--muted); margin-bottom: 8px; }
.link-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-input {
  flex: 1 1 320px; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: calc(15px * var(--fs)) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.editor { display: grid; grid-template-columns: 360px 1fr; gap: 28px; margin-top: 28px; align-items: start; }
.editor-form { margin-top: 0; }
.form select {
  width: 100%; min-width: 0; max-width: 100%;
  height: calc(46px * var(--fs)); padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: calc(18px * var(--fs));
}
.form textarea {
  padding: 10px 14px; border-radius: 10px; resize: vertical; min-height: 96px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: calc(18px * var(--fs));
}
.form textarea:focus, .form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(236, 122, 44, .2); }
.link-label-2 { margin-top: 14px; }
/* 透明浮层预览：用模拟的直播画面衬底，看清叠加效果 */
.preview-frame.is-transparent {
  background:
    radial-gradient(60% 80% at 70% 60%, rgba(255, 181, 71, .25), transparent 70%),
    radial-gradient(50% 70% at 30% 70%, rgba(139, 108, 255, .3), transparent 70%),
    linear-gradient(160deg, #3a3150, #1a1626);
}
.check { display: flex; align-items: center; gap: 10px; color: var(--text) !important; font-size: calc(17px * var(--fs)) !important; margin-top: 6px; cursor: pointer; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

.theme-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-pick legend { font-size: calc(16px * var(--fs)); color: var(--muted); margin-bottom: 8px; padding: 0; }
.theme-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  font-size: calc(15px * var(--fs)); color: var(--text) !important;
}
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--accent); background: rgba(236, 122, 44, .1); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-swatch { width: 100%; height: 34px; border-radius: 6px; }
.theme-opt-starry  .theme-swatch { background: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px), linear-gradient(#26306b, #070818); }
.theme-opt-rain    .theme-swatch { background: repeating-linear-gradient(100deg, rgba(207,230,245,.25) 0 1px, transparent 1px 7px), linear-gradient(#0c141b, #1b2c36); }
.theme-opt-warm    .theme-swatch { background: radial-gradient(circle at 30% 50%, #ff7a59, transparent 60%), radial-gradient(circle at 75% 40%, #8b6cff, transparent 55%), #170e22; }
.theme-opt-minimal .theme-swatch { background: linear-gradient(135deg, #f7efe6, #f1e4ee); }
.theme-opt-sakura  .theme-swatch { background: radial-gradient(circle at 30% 40%, #ffd1e0 0 2px, transparent 3px), radial-gradient(circle at 70% 70%, #ffb6cc 0 2px, transparent 3px), linear-gradient(#ffe9f0, #f6c3d4); }
.theme-opt-snow    .theme-swatch { background: radial-gradient(circle at 25% 35%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 65% 60%, #fff 0 1.5px, transparent 2.5px), linear-gradient(#1c2a44, #3a4f73); }

.editor-preview { position: sticky; top: calc(var(--header-h) + 16px); }
.preview-frame {
  aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--screen); margin-bottom: 8px;
}
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.preview-frame.is-portrait { aspect-ratio: 9 / 16; max-width: 340px; margin-left: auto; margin-right: auto; }

.howto { margin-top: 40px; }
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.howto h3 { font-size: calc(18px * var(--fs)); margin-bottom: 8px; }
.howto ol { margin: 0; padding-left: 1.3em; color: var(--muted); font-size: calc(17px * var(--fs)); }
.howto li { margin-bottom: 4px; }

/* ---------- 话术助手 ---------- */
.chip-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick legend { font-size: calc(16px * var(--fs)); color: var(--muted); margin-bottom: 8px; padding: 0; width: 100%; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); font-size: calc(16px * var(--fs));
}
.chip input:checked + span { border-color: var(--accent); background: rgba(236, 122, 44, .14); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.script-results { min-height: 320px; }
.script-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.script-item {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font: inherit; font-size: calc(18px * var(--fs)); line-height: 1.7;
  position: relative; transition: border-color .15s ease;
}
.script-item:hover { border-color: var(--accent); }
.script-item.is-copied { border-color: var(--ok); }
.script-item.is-copied::after {
  content: "已复制"; position: absolute; right: 12px; top: 10px;
  font-size: calc(15px * var(--fs)); color: var(--ok);
}
.script-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 我的浮层列表 ---------- */
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head .panel-title { margin: 0; }
.overlay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.overlay-list li { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.overlay-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.overlay-link {
  display: block; font: calc(15px * var(--fs)) ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; word-break: break-all;
}
.overlay-actions { display: flex; gap: 10px; }
.overlay-actions form { margin: 0 !important; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: calc(15px * var(--fs)); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a, .footer-links span { color: var(--muted); white-space: nowrap; }

/* 手机上的第二行导航：顶栏放不下时显示在下面，可以左右滑 */
.m-nav { display: none; }
@media (max-width: 860px) {
  :root { --header-h: 109px; }
  .m-nav { display: flex; gap: 6px; height: 40px; align-items: center; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
  .m-nav::-webkit-scrollbar { display: none; }
  .m-nav a { flex: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: calc(15px * var(--fs)); white-space: nowrap; }
  .m-nav a.is-on { background: rgba(236, 122, 44, .1); color: var(--accent); font-weight: 600; }
  .m-nav a:hover { text-decoration: none; color: var(--text); }
}
/* 按钮文字不折行（小按钮、标题栏里的按钮） */
.btn-sm, .panel-head .btn, .nav-user .btn { white-space: nowrap; flex: none; }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero-inner, .pricing { grid-template-columns: 1fr; gap: 32px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr; }
  .phone { width: min(250px, 70vw); }
  .header-inner .nav { display: none; }
  .editor, .howto-grid { grid-template-columns: 1fr; }
  .editor-preview { position: static; order: -1; }
}
@media (max-width: 560px) {
  .tool-grid, .account-grid { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .auth-card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .ph-chat.is-live li { animation: chat-fade .4s ease-out both; } /* 减弱动态效果：只淡入，不滑动 */
}

/* ---------- 背景库 ---------- */
.filter-bar { display: grid; gap: 10px; margin: 24px 0 20px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: calc(16px * var(--fs));
}
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter.is-on { color: var(--text); border-color: var(--accent); background: rgba(236, 122, 44, .12); }

.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(180px * var(--fs)), 1fr)); gap: 16px; align-items: start; }
.bg-card { display: grid; gap: 8px; color: var(--text); border-radius: var(--radius); }
.bg-card.bg-landscape { grid-column: span 2; }
.bg-media {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); aspect-ratio: 9 / 16;
}
.bg-landscape .bg-media { aspect-ratio: 16 / 9; }
.bg-media img, .bg-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-media video { opacity: 0; transition: opacity .25s; }
.bg-card.is-playing .bg-media video { opacity: 1; }
.bg-card:hover .bg-media, .bg-card:focus-visible .bg-media { border-color: var(--accent); }
.bg-meta { display: grid; gap: 2px; padding: 0 2px; }
.bg-meta strong { font-size: calc(17px * var(--fs)); }
.empty { text-align: center; padding: 40px 20px; }

.bg-detail { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 36px; align-items: start; margin-top: 12px; }
.bg-detail-landscape { grid-template-columns: minmax(0, 1.4fr) 1fr; }
.bg-player video { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--line); background: #000; }
.bg-player p { margin-top: 8px; }
.bg-info .btn-lg { margin-top: 8px; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(120px * var(--fs)), 1fr)); gap: 10px; margin: 18px 0 22px; }
.specs div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.specs dt { font-size: calc(15px * var(--fs)); color: var(--muted); }
.specs dd { margin: 2px 0 0; font-weight: 600; }
.howto-mini { margin-top: 28px; }
.howto-mini h2 { font-size: calc(18px * var(--fs)); margin-bottom: 8px; }
.howto-mini ol { margin: 0; padding-left: 1.3em; color: var(--muted); font-size: calc(17px * var(--fs)); }
.howto-mini li { margin-bottom: 6px; }
.related-title { margin: 48px 0 16px; }

/* ---------- 管理后台 ---------- */
.admin-new summary { cursor: pointer; }
.admin-form { margin-top: 14px; }
.admin-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
.admin-row label { display: grid; gap: 6px; }
.admin-form label { display: grid; gap: 6px; }
.admin-list { display: grid; gap: 14px; }
.admin-item {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.admin-item.status-published { border-color: rgba(123, 224, 168, .45); }
.admin-item.status-failed { border-color: rgba(255, 92, 122, .45); }
.admin-media { position: relative; aspect-ratio: 9 / 16; background: var(--bg); border-radius: 10px; overflow: hidden; }
.admin-media.bg-landscape { aspect-ratio: 16 / 9; align-self: start; }
.admin-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-media:has(.admin-placeholder) { border: 1px dashed var(--line); background: repeating-linear-gradient(135deg, var(--bg) 0 10px, var(--surface) 10px 20px); }
.admin-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--muted); font-size: calc(15px * var(--fs)); text-align: center; padding: 6px; }
.admin-placeholder b { font-size: calc(15px * var(--fs)); color: var(--text); }
.status-queued .admin-placeholder { animation: cx-pulse 1.6s ease-in-out infinite; }
@keyframes cx-pulse { 50% { opacity: .55; } }
/* 文本框字数提示（data-count） */
.char-count { font-size: calc(14px * var(--fs)); color: var(--muted); justify-self: end; margin-top: -2px; }
.char-count.is-over { color: var(--danger); font-weight: 700; }
.admin-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-body p { margin: 0; }
.admin-body details p { margin: 6px 0 0; color: var(--muted); word-break: break-word; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions form { margin: 0; }
.admin-rename { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-rename input, .admin-rename select {
  height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; font-size: calc(16px * var(--fs));
}
.ok { color: var(--ok); }
.warn { color: #b7791f; }

@media (max-width: 760px) {
  .bg-grid { grid-template-columns: repeat(2, 1fr); }
  .bg-card.bg-landscape { grid-column: span 2; }
  .bg-detail, .bg-detail-landscape { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr; }
  .admin-item { grid-template-columns: 96px 1fr; gap: 12px; }
}

/* ---------- 充值 ---------- */
.balance-card {
  display: inline-flex; align-items: baseline; gap: 10px; margin: 20px 0 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 22px;
}
.balance-card strong { font-size: calc(34px * var(--fs)); color: var(--accent-2-ink); font-variant-numeric: tabular-nums; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pkg {
  display: grid; gap: 6px; align-content: start; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
}
.pkg .tag { justify-self: start; }
.pkg-best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pkg p { margin: 0; }
.pkg-credits strong { font-size: calc(32px * var(--fs)); font-variant-numeric: tabular-nums; }
.pkg-price { font-size: calc(22px * var(--fs)); font-weight: 800; color: var(--accent); }
.pkg .btn-block { margin-top: 10px; }
.pkg .btn[disabled] { opacity: .45; cursor: not-allowed; }
.pay-note { margin-top: 14px; max-width: 46em; }
.billing-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 32px; align-items: start; }
.billing-cols > .form { margin-top: 0; }   /* 左栏是 .panel.form 时，.form 自带的 margin-top 会让它比右栏低一截 */
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: calc(16px * var(--fs)); }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: calc(15px * var(--fs)); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table code { font-size: calc(15px * var(--fs)); }
@media (max-width: 760px) {
  .pkg-grid, .billing-cols { grid-template-columns: 1fr; }
  .table { font-size: calc(15px * var(--fs)); }
  /* 手机上表格放不下时在面板里左右滑动，不撑破页面；短列不折行 */
  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; }
  .table td.wrap { white-space: normal; min-width: 11em; }
}
/* 网格 / 弹性布局里的面板允许收缩，避免内容把它撑出屏幕 */
.panel { min-width: 0; }

.welcome-strip {
  margin-top: 18px; padding: 10px 14px; border-radius: 10px; font-size: calc(17px * var(--fs));
  background: #fff8e0; border: 1px solid #ffe08a; color: var(--accent-2-ink);
}
.welcome-strip strong { color: var(--accent); }

/* ---------- 说明页 ---------- */
.doc-wrap { max-width: calc(760px * var(--fs)); }
.doc h2 { font-size: calc(21px * var(--fs)); margin: 32px 0 10px; }
.doc h3 { font-size: calc(18px * var(--fs)); margin: 18px 0 6px; }
.doc p, .doc li, .doc dd { color: #3b3848; line-height: 1.8; }
.doc ol, .doc ul { padding-left: 1.4em; }
.doc-toc { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 8px; font-size: calc(16px * var(--fs)); }
.faq dt { font-weight: 600; margin-top: 14px; }
.faq dd { margin: 4px 0 0; }
.doc-foot { margin-top: 40px; }

/* ---------- 后台通用 ---------- */
.admin-nav { margin-bottom: 18px; }
.admin .panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.stat span { font-size: calc(15px * var(--fs)); color: var(--muted); }
.stat strong { font-size: calc(26px * var(--fs)); font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: calc(15px * var(--fs)); color: var(--muted); }
.admin-search { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.admin .billing-cols { margin-top: 16px; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- 二期：作品与视觉包 ---------- */
.tool-form { max-width: 860px; margin-top: 24px; gap: 14px; }
.style-pick { grid-template-columns: repeat(6, 1fr); }
.theme-swatch.style-starry  { background: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px), linear-gradient(#2a2f7a, #120a2a); }
.theme-swatch.style-sweet   { background: linear-gradient(135deg, #ffd1e3, #ff8fb8); }
.theme-swatch.style-guofeng { background: linear-gradient(135deg, #f3e3c3, #b8322a); }
.theme-swatch.style-cyber   { background: linear-gradient(135deg, #ff2bd6, #1a1240 55%, #29e7ff); }
.theme-swatch.style-forest  { background: linear-gradient(135deg, #d9f2c4, #4f9a5c); }
.theme-swatch.style-minimal { background: linear-gradient(135deg, #f4ede4, #c9b9a6); }
.theme-swatch.style-ocean   { background: linear-gradient(180deg, #8fd8ff, #23b5c8 60%, #f6e3b4); }
.theme-swatch.style-autumn  { background: linear-gradient(135deg, #ffd59a, #e2702a 60%, #8a3415); }
.theme-swatch.style-luxury  { background: linear-gradient(135deg, #0d0d0d 40%, #c9a24a 60%, #0d0d0d 80%); }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.mode-card { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.mode-card p { margin: 0; }
.mode-card .btn { margin-top: 6px; justify-self: start; }
.mode-card .btn[disabled] { opacity: .45; cursor: not-allowed; }
.recent { margin-top: 40px; }
.creation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(150px * var(--fs)), 1fr)); gap: 16px; }
.creation-card { display: grid; gap: 8px; color: var(--text); }
.creation-thumb { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.creation-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creation-card:hover .creation-thumb { border-color: var(--accent); }
.creation-state { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: calc(16px * var(--fs)); }
.creation-card.status-failed .creation-state { color: var(--danger); }
.progress-panel { max-width: 560px; }
.progress { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); margin: 10px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s; }
.delete-form { margin-top: 40px; }
.vpack-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.vp-item { margin: 0; }
.vp-item img { width: 100%; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.vp-item figcaption { margin-top: 6px; font-size: calc(16px * var(--fs)); color: var(--muted); display: flex; justify-content: space-between; }
.vp-title { margin: 36px 0 4px; }
.vp-compose { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 12px; }
.vp-fields { margin-top: 0; }
.vp-fields label { display: grid; gap: 6px; }
.vp-quick { display: flex; gap: 8px; flex-wrap: wrap; }
.vp-canvas-wrap { display: grid; gap: 10px; justify-items: start; }
.vp-canvas-wrap canvas { width: 100%; max-width: 520px; height: auto; border-radius: var(--radius); border: 1px solid var(--line);
  background: repeating-conic-gradient(#e6e8f0 0 25%, #f7f8fb 0 50%) 0 0 / 24px 24px; }
.vp-canvas-wrap canvas.vp-round { max-width: 360px; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; }
.sticker { display: block; border-radius: var(--radius); border: 1px solid var(--line); padding: 10px;
  background: repeating-conic-gradient(#e6e8f0 0 25%, #f7f8fb 0 50%) 0 0 / 20px 20px; }
.sticker img { width: 100%; display: block; }
.upsell { margin-top: 20px; display: grid; gap: 10px; justify-items: start; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(220px * var(--fs)), 1fr)); gap: 16px; }
.avatar-item { margin: 0; }
.avatar-item img { width: 100%; display: block; border-radius: var(--radius); border: 1px solid var(--line); }
.avatar-item figcaption { display: flex; gap: 8px; margin-top: 8px; }
.refine-form { max-width: 560px; margin-top: 20px; }
.refine-form label { display: grid; gap: 6px; }
.refine-head { display: flex; gap: 12px; align-items: center; }
.refine-head img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
@media (max-width: 760px) {
  .style-pick { grid-template-columns: repeat(3, 1fr); }
  .mode-row, .vpack-grid, .vp-compose { grid-template-columns: 1fr; }
  .sticker-grid { grid-template-columns: repeat(2, 1fr); }
}
.tool-form > label, .tool-form .admin-row label { display: grid; gap: 6px; }
.vp-portrait img { aspect-ratio: 9 / 16; object-fit: cover; }
.vp-landscape img { aspect-ratio: 16 / 9; object-fit: cover; }

.mode-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-pick legend { font-size: calc(16px * var(--fs)); color: var(--muted); margin-bottom: 8px; padding: 0; }
.mode-opt { position: relative; cursor: pointer; }
.mode-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-opt span { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.mode-opt em { font-style: normal; font-size: calc(15px * var(--fs)); color: var(--muted); }
.mode-opt input:checked + span { border-color: var(--accent); background: rgba(236, 122, 44, .1); }
.mode-opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.mode-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit-btn { justify-self: start; margin-top: 6px; }
@media (max-width: 760px) { .mode-pick { grid-template-columns: 1fr; } }

/* ---------- 三期：配音与切片 ---------- */
.uploader { display: grid; gap: 8px; }
.uploader label { display: grid; gap: 6px; }
.alert-text { color: var(--danger) !important; }
.tts-cols { grid-template-columns: 1.2fr 1fr; }
.tts-cols label { display: grid; gap: 6px; }
.voice-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.voice-row form { margin: 0; }
.voice-form { margin-top: 16px; }
.tts-result { display: grid; gap: 12px; max-width: 640px; }
.tts-result audio { width: 100%; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(260px * var(--fs)), 1fr)); gap: 18px; }
.clip-item { margin: 0; display: grid; gap: 8px; }
.clip-item video { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: var(--screen); border-radius: var(--radius); border: 1px solid var(--line); }
.clip-item figcaption { display: grid; gap: 6px; }
.clip-item .hero-actions { margin-top: 4px; }
@media (max-width: 760px) { .tts-cols { grid-template-columns: 1fr; } }
.tts-cols label.check { display: flex; align-items: flex-start; }
.tts-cols label.check input { margin-top: 3px; flex: none; }
.admin-row { align-items: end; }
.editor-form .chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 改图 ---------- */
.photo-preview { max-width: 220px; max-height: 220px; border-radius: 12px; border: 1px solid var(--line); object-fit: cover; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { font: inherit; font-size: calc(15px * var(--fs)); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.photo-result { display: grid; gap: 14px; max-width: 720px; }
.photo-single { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.compare { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--screen); }
.compare > img, .compare-before img { display: block; width: 100%; height: auto; }
.compare-before { position: absolute; inset: 0; }
.compare-before img { height: 100%; object-fit: cover; }
.compare input[type=range] { position: absolute; left: 0; right: 0; bottom: 12px; width: 70%; margin: 0 auto; accent-color: var(--accent); }
.compare-tag { position: absolute; top: 10px; font-size: calc(15px * var(--fs)); color: #fff; background: rgba(0,0,0,.45); padding: 2px 10px; border-radius: 999px; }
.compare-tag.left { left: 10px; } .compare-tag.right { right: 10px; }
.tool-form > label.check { display: flex; align-items: flex-start; gap: 10px; }
.tool-form > label.check input { margin-top: 4px; flex: none; }
.photo-result { max-width: 520px; }

/* 发到手机（作品页） */
.phone-panel { display: flex; gap: 22px; align-items: center; margin-bottom: 22px; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.phone-qr { flex: none; width: 168px; height: 168px; background: #fff; border-radius: 12px; padding: 4px; }
.phone-qr svg { width: 100%; height: 100%; display: block; }
.phone-text { min-width: 0; }
.phone-text .panel-title { margin: 0 0 6px; }
.phone-text p { margin: 4px 0; }
.phone-url { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.phone-url span { font: 700 1.35rem/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; color: var(--text); word-break: break-all; }
.btn-sm { padding: 4px 12px; font-size: calc(15px * var(--fs)); min-height: 0; }
.phone-actions { display: flex; gap: 18px; margin-top: 6px; font-size: calc(15px * var(--fs)); }
@media (max-width: 640px) {
  .phone-qr { display: none; }
}

/* 手机查看页 /m/{code} */
.m-page { background: var(--bg); }
.m-top { padding: 12px 16px; background: var(--surface); border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.m-main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.m-kind { margin: 0; color: var(--accent-dark); font-weight: 700; font-size: calc(15px * var(--fs)); }
.m-title { font-size: 1.4rem; margin: 2px 0 12px; }
.m-tip { background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: calc(16px * var(--fs)); }
.m-warn { background: #fff4d6; color: #7a4d00; border-radius: 12px; padding: 10px 14px; font-size: calc(16px * var(--fs)); }
.m-item { margin: 0 0 18px; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(22, 20, 29, .08); }
.m-item img, .m-item video { display: block; width: 100%; height: auto; background: #f0f0f4; }
.m-item audio { display: block; width: calc(100% - 24px); margin: 14px 12px 0; }
.m-item figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; }
.m-files { background: var(--surface); border-radius: 12px; padding: 10px 14px 10px 32px; }
.m-files li { margin: 6px 0; }
.m-foot { margin-top: 24px; text-align: center; }

/* 上传框：虚线拖放区；进度条只在上传时出现 */
.uploader { border: 2px dashed var(--line); border-radius: 16px; padding: 20px 22px; background: var(--surface); box-shadow: none; transition: border-color .15s, background .15s; }
.uploader:hover, .uploader.is-drag { border-color: var(--accent); }
.uploader.is-drag { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.uploader.is-done { border-style: solid; border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.uploader > label { font-weight: 600; color: var(--text); }
.form .uploader input[type=file], .uploader input[type=file] { width: 100%; padding: 0; border: 0; background: none; box-shadow: none; font: inherit; font-size: calc(16px * var(--fs)); color: var(--muted); cursor: pointer; }
.uploader input[type=file]::file-selector-button { font: inherit; font-weight: 700; font-size: calc(16px * var(--fs)); padding: 9px 18px; margin-right: 12px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer; }
.uploader input[type=file]::file-selector-button:hover { background: var(--accent-dark); }
.uploader .progress { display: none; margin: 2px 0; }
.uploader.is-busy .progress { display: block; }
.uploader [data-upload-status] { margin: 0; }

/* 共享合作 */
.share-review .share-audio { display: flex; flex-wrap: wrap; gap: 18px; margin: 8px 0; }
.share-review .share-audio label { display: grid; gap: 4px; }
.share-review .admin-rename { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-review .admin-rename form { display: flex; gap: 8px; align-items: center; margin: 0; }
.voice-row { flex-wrap: wrap; }
.voice-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px; }
.voice-acts { display: flex; gap: 8px; align-items: center; }
.share-tag { display: inline-block; font-size: calc(14px * var(--fs)); font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.share-tag.is-approved { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.share-tag.is-pending { background: color-mix(in srgb, var(--accent-2) 25%, transparent); color: #8a5a00; }
.share-form { flex-basis: 100%; display: grid; gap: 8px; padding: 12px; margin-top: 6px; border-radius: 12px; background: var(--bg); }
.share-form label { display: grid; gap: 4px; }
.shared-lib { margin-top: 22px; }
.shared-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(240px * var(--fs)), 1fr)); gap: 14px; }
.shared-card { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.shared-card h3 { margin: 0; font-size: calc(18px * var(--fs)); }
.shared-card audio { width: 100%; height: 36px; }
.shared-card .muted { margin: 0; }
.coop-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent-2) 18%, var(--surface)); font-size: calc(16px * var(--fs)); margin-top: 14px; }

/* 帮朋友充值 */
.balance-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.my-no { display: grid; gap: 4px; align-content: center; padding: 14px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.my-no strong { font-size: 1.5rem; letter-spacing: .04em; }
.my-no .btn-sm { justify-self: start; }
.pay-mode { margin: 22px 0 6px; display: grid; gap: 12px; }
.seg { display: inline-flex; justify-self: start; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg-btn { font: inherit; font-weight: 700; padding: 8px 20px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.seg-btn.is-on { background: var(--accent); color: #fff; }
.gift-fields { display: grid; gap: 10px; max-width: 760px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.gift-fields label { display: grid; gap: 6px; }
.gift-to { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gift-to input { max-width: 180px; }
.gift-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 12px; }
@media (max-width: 640px) { .gift-row { grid-template-columns: 1fr; } }

/* 作品页标题：长标题正常折行，不溢出 */
.page-head h1, .section-title { overflow-wrap: anywhere; }
/* 手机上作品缩略图两列，配音这类没有图的卡片矮一点 */
@media (max-width: 560px) {
  .creation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* 背景去卡顿 */
.loopfix-how { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px; }
.loopfix-how .panel-title { margin: 0 0 6px; padding-right: 64px; }
.loopfix-how .panel.is-included { position: relative; border: 2px solid var(--accent); background: #fff6ec; box-shadow: 0 6px 18px rgba(236, 122, 44, .10); }
.included-badge { position: absolute; top: 14px; right: 14px; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: calc(15px * var(--fs)); font-weight: 700; }
.loopfix-how p + p { margin-top: 6px; }
.loopfix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 10px 0 14px; }
.loopfix-grid video { aspect-ratio: auto; max-height: 70vh; }
.loopfix-grid.is-portrait { grid-template-columns: repeat(2, minmax(0, 300px)); }
@media (max-width: 640px) {
  .loopfix-how, .loopfix-grid { grid-template-columns: 1fr; }
  .loopfix-grid.is-portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* 视频加字 */
.vtext-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 24px; align-items: start; }
.vtext-left { display: grid; gap: 16px; min-width: 0; }
.vtext-right { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 8px; }
.vtext-stage { position: relative; aspect-ratio: 9 / 16; max-height: calc(100vh - var(--header-h) - 110px); margin: 0 auto; width: 100%; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, #3a3f63, #1b1d2e 60%, #4b2a4a); border: 1px solid var(--line); }
.vtext-stage.is-landscape { max-height: none; }
.vtext-stage video, .vtext-stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.vtext-stage video { object-fit: fill; }
.vtext-stage img { pointer-events: none; }
.vtext-stage img:not([src]) { display: none; }
.vtext-stage-tip { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; color: #c9cbe0; font-size: calc(15px * var(--fs)); margin: 0; }
.vtext-layer { display: grid; gap: 14px; margin: 0; }
.vtext-layer .panel-head { margin-bottom: 0; }
.vtext-layer textarea { min-height: 64px; }
.vtext-field { display: grid; gap: 8px; align-content: start; }
.vtext-label { font-size: calc(16px * var(--fs)); color: var(--muted); }
.vtext-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.btn-sm { padding: 6px 12px; font-size: calc(15px * var(--fs)); }
.font-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(150px * var(--fs)), 1fr)); gap: 8px; }
.font-opt input, .style-opt input, .seg input, .pos-grid input { position: absolute; opacity: 0; pointer-events: none; }
.font-opt span { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.font-opt img { height: 26px; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.font-opt em { font-style: normal; font-size: calc(14px * var(--fs)); color: var(--muted); }
.font-opt input:checked + span, .style-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .18); }
.style-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.style-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: calc(15px * var(--fs)); cursor: pointer; }
.sw { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; font-size: calc(20px * var(--fs)); font-weight: 900;
  background: linear-gradient(135deg, #6a7bd8, #c06bd0); paint-order: stroke fill; }
.sw-white_black { color: #fff; -webkit-text-stroke: 3px #000; }
.sw-yellow_black { color: #ffe14a; -webkit-text-stroke: 3px #111; }
.sw-black_white { color: #111; -webkit-text-stroke: 3px #fff; }
.sw-white_shadow { color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .55); }
.sw-neon_pink { color: #fff; -webkit-text-stroke: 2px #f5a742; text-shadow: 0 0 6px #f5a742; }
.sw-neon_blue { color: #fff; -webkit-text-stroke: 2px #18c8ff; text-shadow: 0 0 6px #18c8ff; }
.sw-gold { color: #ffd34d; -webkit-text-stroke: 2px #6b3d00; text-shadow: 2px 2px 0 rgba(0, 0, 0, .45); }
.sw-red_box { color: #fff; background: #ec7a2c; }
.sw-black_box { color: #fff; background: rgba(0, 0, 0, .65); }
.sw-white_box { color: #111; background: #fff; border: 1px solid var(--line); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; overflow: clip; background: var(--surface); justify-self: start; }
.seg label { position: relative; }
.seg span { display: block; padding: 7px 14px; font-size: calc(16px * var(--fs)); cursor: pointer; border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg-sm span { padding: 4px 10px; font-size: calc(15px * var(--fs)); }
.pos-grid { display: grid; grid-template-columns: repeat(3, 38px); grid-template-rows: repeat(5, 26px); gap: 4px; padding: 6px; width: max-content;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pos-grid label { position: relative; }
.pos-grid span { display: grid; place-items: center; width: 38px; height: 26px; border-radius: 6px; background: var(--bg); border: 1px dashed var(--line); cursor: pointer;
  font-size: calc(14px * var(--fs)); line-height: 1; color: var(--muted); }
.pos-grid input:checked + span { background: var(--accent); border: 1px solid var(--accent); }
.pos-grid input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 已被另一段文字占用的格子：斜纹 + 段号，不能选 */
.pos-grid input:disabled + span { background: repeating-linear-gradient(135deg, var(--bg-alt) 0 4px, var(--surface) 4px 8px); border-style: solid; cursor: not-allowed; }
.pos-grid span[data-taken]::after { content: attr(data-taken); font-weight: 700; }
.vtext-range { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.vtext-range label { display: inline-flex; align-items: center; gap: 6px; font-size: calc(16px * var(--fs)); }
.vtext-range input { width: 84px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; }
.vtext-result { display: grid; gap: 12px; max-width: 900px; }
.vtext-result video { width: 100%; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }
.vtext-result.is-portrait video { max-width: 380px; }
@media (max-width: 860px) {
  .vtext-cols { grid-template-columns: 1fr; }
  .vtext-right { position: static; order: -1; }
  .vtext-stage { max-height: 60vh; width: auto; }
  .vtext-row { grid-template-columns: 1fr; }
}
.vtext-layer > label { display: grid; gap: 6px; }

.warn-tag { background: #fff3d6; color: var(--accent-2-ink); border: 1px solid #ffe08a; }
.refund-form { margin-top: 4px; }

/* ---- 输入框统一（全站）：白底、稍深的边框、浅色占位文字，和已输入的文字一眼分得开 ---- */
:root { --field-line: #d6d9e6; --placeholder: #a5a9bb; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
.form textarea, .form select, .link-input, .admin-rename input, .admin-rename select, .vtext-range input {
  background: var(--surface);
  border-color: var(--field-line);
  color: var(--text);
}
.form input:hover:not(:focus):not([readonly]), .form textarea:hover:not(:focus), .form select:hover:not(:focus) { border-color: #c3c7d8; }
::placeholder { color: var(--placeholder); opacity: 1; }
::-webkit-input-placeholder { color: var(--placeholder); }
/* 只读的（例如复制链接）用浅灰底，表示不用填 */
.link-input[readonly], .form input[readonly] { background: var(--surface-2); color: var(--muted); }
.form input:disabled, .form textarea:disabled, .form select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):focus,
.form textarea:focus, .form select:focus, .link-input:focus, .vtext-range input:focus { border-color: var(--accent); }
.more-wrap { display: flex; justify-content: center; margin: 22px 0 4px; }
.more-wrap .btn.is-busy { opacity: .6; pointer-events: none; }

/* 大众落地页 /hi */
.lp-samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-self: center; }
.lp-sample { position: relative; display: block; aspect-ratio: 9 / 16; border-radius: var(--radius); overflow: hidden; background: var(--screen); box-shadow: 0 18px 40px -24px rgba(22, 20, 29, .55); }
.lp-sample:nth-child(2) { transform: translateY(-18px); }
.lp-sample video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-sample span { position: absolute; left: 10px; bottom: 8px; color: #fff; font-size: calc(15px * var(--fs)); font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.lp-feature { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.lp-card { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .2s, transform .2s; }
.lp-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lp-card b { font-size: calc(21px * var(--fs)); }
.lp-card span { color: var(--muted); font-size: calc(16px * var(--fs)); }
.lp-card em { font-style: normal; color: var(--accent-dark); font-weight: 700; font-size: calc(16px * var(--fs)); }
.lp-icon { display: inline-grid !important; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #fff !important; font-weight: 900; font-size: calc(21px * var(--fs)) !important;
  background: linear-gradient(135deg, var(--accent), var(--violet)); }
.lp-more-title { margin-top: 40px; }
.lp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.lp-live { margin-top: 28px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lp-live p { margin: 0; flex: 1 1 420px; }
.lp-pricing { text-align: center; display: grid; justify-items: center; gap: 6px; }
@media (max-width: 860px) {
  .lp-feature, .lp-list { grid-template-columns: 1fr; }
  .lp-samples { max-width: 420px; margin: 8px auto 0; }
}
.lp-list .tool-row { margin: 0; background: var(--surface); border: 1px solid var(--line); }
.lp-list .tool-row + .tool-row { border-top: 1px solid var(--line); }
.lp-list .tool-row:hover { border-color: var(--accent); }

/* 站内通知 */
.bell { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--muted); }
.bell:hover { color: var(--text); background: var(--bg); }
.bell.has-new { color: var(--text); }
.bell-dot { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: calc(13px * var(--fs)); font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notice-body { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 14px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); }
a.notice-body:hover { border-color: var(--accent); }
.notice-item.is-new .notice-body { border-color: #ffc2cf; background: #fff6ec; }
.notice-item.is-new b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 2px; }
.notice-text { display: grid; gap: 2px; min-width: 0; }
.notice-icon { font-size: calc(21px * var(--fs)); line-height: 1.3; }
.notice-time { white-space: nowrap; }
.wrap.narrow { max-width: calc(780px * var(--fs)); }

/* 合成背景 */
.compose-step { display: grid; gap: 12px; margin: 0; }
.compose-step > .panel-title { margin: 0; }
.compose-stage img[data-scene-img], .compose-stage video { object-fit: fill; }
.compose-stage .compose-person { position: absolute; inset: auto; width: auto; max-width: none; cursor: grab; touch-action: none; user-select: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); outline: 1px dashed rgba(255, 255, 255, .55); outline-offset: 2px; pointer-events: auto; }
.compose-stage .compose-person.is-dragging { cursor: grabbing; outline-color: var(--accent); }
.compose-libpick { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.compose-libpick img { width: 54px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; }
.compose-libpick > span { display: grid; gap: 2px; }
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(96px * var(--fs)), 1fr)); gap: 8px; }
.material-opt { position: relative; }
.material-opt input { position: absolute; opacity: 0; pointer-events: none; }
.material-opt span { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.material-opt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--bg); }
.material-opt.is-person img { object-fit: contain; background: repeating-conic-gradient(#e6e8f0 0 25%, #f7f8fb 0 50%) 0 0 / 14px 14px; }
.material-opt em { font-style: normal; font-size: calc(14px * var(--fs)); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .2); }
.people-grid:empty { display: none; }
.cutout-form { margin-top: 0; }
.compose-size { display: flex; align-items: center; gap: 10px; font-size: calc(16px * var(--fs)); color: var(--muted); }
.compose-size input { flex: 1; accent-color: var(--accent); }
.compose-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cutout-check { max-width: 420px; border-radius: var(--radius); border: 1px solid var(--line); background: repeating-conic-gradient(#e6e8f0 0 25%, #f7f8fb 0 50%) 0 0 / 20px 20px; }
.cutout-check img { width: 100%; display: block; }
.cutout-result { display: grid; gap: 12px; }
.compose-img { width: 100%; max-width: 900px; border-radius: var(--radius); border: 1px solid var(--line); }
.material-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 24px; }
.ok-tag { background: #e5f7ef; color: var(--ok); border: 1px solid #bfe9d6; }

.recreate { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.recreate p { margin: 6px 0 0; }
.cutout-check { max-width: 360px; }
.cutout-check img { max-height: 70vh; object-fit: contain; }
@media (max-width: 860px) {
  /* 手机上预览框给定高度，宽度按画面比例算（否则内容全是绝对定位，宽度会塌成 0） */
  .vtext-stage { height: min(56vh, 520px); width: auto; max-width: 100%; max-height: none; }
  .vtext-stage.is-landscape { height: auto; width: 100%; }
}

.compose-form { margin-top: 0; }
.compose-stage.is-empty { background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--bg) 14px 28px); border: 2px dashed var(--field-line, #d6d9e6); }
.compose-stage.is-empty .vtext-stage-tip { color: var(--muted); top: 50%; bottom: auto; transform: translateY(-50%); padding: 0 24px; font-size: calc(16px * var(--fs)); }
.lib-grid .material-opt img { aspect-ratio: 9 / 16; }
.lib-more { grid-column: 1 / -1; justify-self: start; }

.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card-opt { position: relative; }
.mode-card-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card-opt span { display: grid; gap: 4px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.mode-card-opt b { font-size: calc(17px * var(--fs)); }
.mode-card-opt em { font-style: normal; font-size: calc(15px * var(--fs)); color: var(--muted); }
.mode-card-opt i { font-style: normal; font-size: calc(15px * var(--fs)); font-weight: 700; color: var(--accent-dark); margin-top: auto; }
.mode-card-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .18); background: #fff6ec; }
.compose-hint { display: grid; gap: 6px; font-size: calc(16px * var(--fs)); color: var(--muted); }
.compose-hint input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--field-line, #d6d9e6); background: var(--surface); font: inherit; font-size: calc(17px * var(--fs)); }
@media (max-width: 640px) { .mode-cards { grid-template-columns: 1fr; } }

/* 作品流转 */
.next-steps { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.work-picker video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--screen); }

.vtext-source { display: grid; gap: 12px; }
.vtext-stage img[data-still] { object-fit: fill; }

/* 话术助手：长文与提词器 */
.script-mode { margin-bottom: 6px; }
.script-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.script-article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.script-article h2 { margin: 0 0 10px; font-size: calc(21px * var(--fs)); }
.script-article p { margin: 0 0 12px; line-height: 1.9; }
body.tp-open { overflow: hidden; }
.tp { position: fixed; inset: 0; z-index: 1000; background: #0b0a10; color: #f4f4f6; display: grid; grid-template-rows: 1fr auto; }
.tp-scroll { overflow-y: auto; scrollbar-width: none; padding: 40vh 8vw 60vh; cursor: pointer; }
.tp-scroll::-webkit-scrollbar { display: none; }
.tp-text { max-width: 1100px; margin: 0 auto; font-weight: 700; line-height: 1.6; letter-spacing: .02em; }
.tp-text h2 { font-size: .7em; color: #ffcf4a; margin: 0 0 .8em; }
.tp-text p { margin: 0 0 1.1em; }
.tp.is-mirror .tp-text { transform: scaleX(-1); }
.tp-guide { position: fixed; left: 0; right: 0; top: 38vh; height: 3px; background: rgba(236, 122, 44, .55); pointer-events: none; }
.tp-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 12px 16px; background: #17151f; border-top: 1px solid #2a2735; }
.tp-bar button { padding: 8px 14px; border-radius: 999px; border: 1px solid #3a3648; background: #221f2d; color: #fff; font: inherit; font-size: calc(16px * var(--fs)); cursor: pointer; }
.tp-bar button:hover { border-color: var(--accent); }
.tp-bar label { display: flex; align-items: center; gap: 8px; color: #c9c7d6; font-size: calc(16px * var(--fs)); }
.tp-bar input[type=range] { accent-color: var(--accent); width: 140px; }

.tp-keys { position: fixed; top: 14px; right: 14px; z-index: 2; color: #e9e8f0; font-size: calc(15px * var(--fs)); }
.tp-keys-toggle { padding: 6px 12px; border-radius: 999px; border: 1px solid #3a3648; background: rgba(23, 21, 31, .75); color: #e9e8f0; font: inherit; font-size: calc(15px * var(--fs)); cursor: pointer; }
.tp-keys-list { display: none; margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(23, 21, 31, .88); border: 1px solid #3a3648;
  grid-template-columns: auto auto; gap: 6px 14px; }
.tp-keys-list dt { font-weight: 800; color: #ffcf4a; white-space: nowrap; }
.tp-keys-list dd { margin: 0; white-space: nowrap; }
.tp-keys.is-open .tp-keys-desk, .tp-keys:hover .tp-keys-desk { display: grid; }
.tp-keys-touch { display: none !important; }
@media (hover: none), (pointer: coarse) {
  .tp-keys.is-open .tp-keys-desk, .tp-keys:hover .tp-keys-desk { display: none; }
  .tp-keys.is-open .tp-keys-touch { display: grid !important; }
}

/* 动态歌单 */
.pl-stage [data-bg-img], .pl-stage video { object-fit: cover; }
.pl-stage.is-landscape { aspect-ratio: 16 / 9; }
.pl-theme { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-theme-opt { position: relative; }
.pl-theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pl-theme-opt span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: calc(15px * var(--fs)); cursor: pointer; }
.pl-theme-opt i { display: inline-flex; align-items: center; justify-content: center; gap: 1px; width: 44px; height: 30px; border-radius: 8px; border: 2px solid; font-style: normal; font-size: calc(15px * var(--fs)); font-weight: 800; }
.pl-theme-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .18); }
.pl-theme-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-fields { display: grid; gap: 12px; }
.pl-fields > label { display: grid; gap: 6px; }
.pl-fields .panel-title { margin-bottom: 0; }

/* 邀请好友 */
.invite-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.invite-pitch { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; gap: 8px; justify-items: start; }
.invite-pitch p { margin: 0; }
.invite-list { list-style: none; margin: 0; padding: 0; }
.invite-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.invite-list li:last-child { border-bottom: 0; }
.rules { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); }
.invite-entry { border: 2px solid color-mix(in srgb, var(--accent-2) 55%, transparent); }
@media (max-width: 640px) { .invite-stats { grid-template-columns: 1fr 1fr 1fr; } .invite-stats .panel-value { font-size: calc(21px * var(--fs)); } .invite-panel { flex-direction: column; align-items: flex-start; } }

/* 主播赛道自测 */
.quiz-wrap { max-width: calc(760px * var(--fs)); }
.quiz-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.quiz-q { margin: 0; display: grid; gap: 12px; }
.quiz-form.is-stepper .quiz-q { display: none; }
.quiz-form.is-stepper .quiz-q.is-on { display: grid; }
.quiz-no { font-size: calc(15px * var(--fs)); color: var(--muted); padding: 0; }
.quiz-title { font-size: calc(22px * var(--fs)); margin: 0; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { position: relative; }
.quiz-opt input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-opt span { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: calc(18px * var(--fs)); cursor: pointer; }
.quiz-opt span:hover { border-color: var(--accent); }
.quiz-opt input:checked + span { border-color: var(--accent); background: rgba(236, 122, 44, .08); font-weight: 700; }
.quiz-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-end > label { display: grid; gap: 6px; }
.quiz-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 28px; align-items: start; }
.quiz-side { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; }
.quiz-card { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #2a1748; aspect-ratio: 3 / 4; }
.quiz-type { font-size: calc(44px * var(--fs)); margin: 4px 0 8px; }
.quiz-kws { margin: 0 0 16px; }
.quiz-bar { display: grid; grid-template-columns: 5em 1fr 3em; gap: 10px; align-items: center; padding: 5px 0; font-size: calc(16px * var(--fs)); color: var(--muted); }
.quiz-bar i { height: 10px; border-radius: 5px; background: var(--bg-alt); overflow: hidden; }
.quiz-bar b { display: block; height: 100%; background: #c8c2d8; border-radius: 5px; }
.quiz-bar.is-top { color: var(--text); font-weight: 700; }
.quiz-bar.is-top b { background: var(--accent); }
.quiz-bar em { font-style: normal; text-align: right; }
.quiz-tips { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 860px) { .quiz-cols { grid-template-columns: 1fr; } .quiz-side { position: static; } .quiz-type { font-size: calc(34px * var(--fs)); } }

/* 改图：换姿势 / 换衣服 */
.photo-modes { margin-bottom: 4px; }
.pose-grid { grid-template-columns: repeat(auto-fill, minmax(calc(92px * var(--fs)), 1fr)); }
.pose-grid .material-opt img { aspect-ratio: 2 / 3; object-fit: contain; background: #fff; }
.pose-own span { display: grid; place-items: center; align-content: center; min-height: 100%; aspect-ratio: auto; }
.pose-own b { font-size: calc(30px * var(--fs)); color: var(--muted); line-height: 1; }
.material-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .18); }
.photo-ref { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.photo-ref img { width: 72px; height: 96px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.photo-form .panel > label { display: grid; gap: 6px; }

/* 一键文生视频 */
.tv-step { display: grid; gap: 12px; }
.tv-step > label { display: grid; gap: 6px; }
.tv-scenes { display: grid; gap: 10px; }
.tv-scene { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.tv-scene label { display: grid; gap: 4px; }
.tv-no { font-size: calc(15px * var(--fs)); color: var(--accent); }
.tv-scene details textarea { width: 100%; margin-top: 6px; font-size: calc(15px * var(--fs)); }
.invite-email-form { margin-top: 0; }
.invite-email-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: end; }
.invite-email-row label { display: grid; gap: 6px; }
.invite-email-row .btn { height: 46px; }
.invite-sent { display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media (max-width: 760px) { .invite-email-row { grid-template-columns: 1fr; } .invite-email-row .btn { width: 100%; } }
.invite-email .notice, .invite-email .alert { margin: 0; }
.invite-email { display: grid; gap: 10px; }
.invite-email .panel-title, .invite-email p { margin: 0; }
.invite-stats .muted { white-space: nowrap; }
@media (max-width: 640px) { .invite-stats .muted { font-size: calc(15px * var(--fs)); } }
.tv-stages { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; color: var(--muted); }
.tv-stages .is-on { color: var(--accent); font-weight: 700; }
.tv-stages .is-done { color: var(--ok); }
.tv-stages .is-done::after { content: ' ✓'; }
.tv-opts { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.tv-step > .btn, .tv-step > .submit-btn { justify-self: start; }

/* 手机上的明细表：每行变成一张小卡片，不用左右滑 */
@media (max-width: 600px) {
  .table.table-cards { display: block; overflow: visible; }
  .table-cards thead { display: none; }
  .table-cards tbody { display: block; }
  .table-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; border: 0; padding: 0; white-space: normal; }
  .table-cards td[data-label]::before { content: attr(data-label) ' '; font-size: calc(14px * var(--fs)); }
  .table-cards .c-type { order: 1; font-weight: 600; }
  .table-cards .c-delta { order: 2; font-weight: 700; font-size: calc(17px * var(--fs)); }
  .table-cards .c-note { order: 3; grid-column: 1 / -1; color: var(--muted); font-size: calc(15px * var(--fs)); }
  .table-cards .c-time { order: 4; font-size: calc(15px * var(--fs)); }
  .table-cards .c-bal { order: 5; font-size: calc(15px * var(--fs)); }
  .table-cards .c-main { order: 1; }
  .table-cards .c-amount { order: 2; font-weight: 700; }
  .table-cards .c-method { order: 3; }
  .table-cards .c-status { order: 4; text-align: right; }
}

/* 藏起来的单选 / 多选框：固定在标签左上角、1 像素大小。
   否则点选后浏览器为了让获得焦点的输入框“可见”，会把外层 overflow 容器滚动一下，切换按钮就错位了（全站的分段按钮都踩过） */
.seg input, .chip input, .theme-opt input, .mode-opt input, .font-opt input, .style-opt input, .pos-grid input,
.material-opt input, .mode-card-opt input, .pl-theme-opt input, .quiz-opt input {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
}
.seg label, .chip, .theme-opt, .mode-opt, .font-opt, .style-opt, .pos-grid label, .material-opt, .mode-card-opt, .pl-theme-opt, .quiz-opt { position: relative; }
/* 分段按钮折行时，每行最后一个不要多出一条竖线 */
.seg span { height: 100%; }
/* 分段按钮：用 1px 间隙露出底色当分隔线，放不下折成两行时横竖分隔线都整齐，每行自动铺满 */
.seg { gap: 1px; padding: 0; background: var(--line); }
.seg label { flex: 1 1 auto; display: flex; }
.seg span { flex: 1; border-right: 0; background: var(--surface); text-align: center; display: flex; align-items: center; justify-content: center; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
/* 面板里上下相邻的几组选项之间留出间距（不是 grid 的面板） */
.panel > .vtext-row + .vtext-row, .panel > .vtext-field + .vtext-row, .panel > .vtext-row + .vtext-field, .panel > .vtext-field + .vtext-field { margin-top: 14px; }

/* ---------- 上下间距统一：带边框 / 底色的块不要和下一块贴在一起 ---------- */
/* 分段切换下面紧跟的内容（上传框、作品格子、说明文字） */
.seg ~ .uploader, .seg ~ [data-src-pane], .seg ~ [data-bg-pane], .seg ~ [data-ref-sub], .seg ~ [data-scene-pane],
.seg ~ [data-source-pane], .seg ~ .material-grid, .seg + p, .seg + .small { margin-top: 12px; }
/* 上传框下面的内容 */
.uploader + p, .uploader + div, .uploader + .material-grid, .uploader + input + div { margin-top: 12px; }
/* 作品页：“接着做”下面的保存期限说明 */
.next-steps { margin-bottom: 14px; }
.creation .wrap > p.muted.small { margin-top: 12px; }
/* 配音页：声音列表下面的“共享合作”横幅 */
.panel .coop-banner, .voice-row + .coop-banner { margin-top: 14px; }
/* 自测结果页左栏的几块面板 */
.quiz-cols > div > .panel + .panel, .quiz-cols > div > .panel + p { margin-top: 16px; }
/* 页面里直接上下排的面板（游戏中心、形象包等）：和上一块拉开（普通块级排版，上下外边距会合并，不会叠加） */
.wrap > .panel + .panel, .wrap > .game-grid + .panel, .wrap > .cast-hero + .game-grid { margin-top: 16px; }
[data-bg-pane] ~ p.small, [data-scene-pane] ~ p.small, [data-src-pane] ~ p.small { margin-top: 12px; }
.tv-need-voice { display: grid; gap: 8px; justify-items: start; border: 2px solid color-mix(in srgb, var(--accent-2) 55%, transparent); margin-bottom: 16px; }
.tv-need-voice p { margin: 0; }
.tv-voices { display: grid; gap: 8px; }
.tv-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tv-voice .check { margin: 0; }
.tv-voice em { font-style: normal; margin-left: 4px; }
[data-listen].is-playing { border-color: var(--accent); color: var(--accent); }
.tv-step > label.check { display: flex; align-items: center; gap: 8px; }
.tv-voice input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.tts-listen { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 浏览器提醒：开关和页内小提示 */
.notify-optin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 16px; min-height: 0; }   /* 下面留 16px，别和通知列表 / 下一块贴在一起 */
.notify-optin:empty { display: none; }
.nt-toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 10px; max-width: min(380px, calc(100vw - 40px));
  padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 16px 40px -18px rgba(22, 20, 29, .45);
  animation: nt-in .25s ease-out; transition: opacity .35s, transform .35s; }
.nt-toast:hover { text-decoration: none; border-color: var(--accent); }
.nt-toast b { font-size: calc(16px * var(--fs)); }
.nt-toast button { margin-left: auto; border: 0; background: none; font-size: calc(21px * var(--fs)); line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.nt-toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes nt-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 560px) { .nt-toast { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* Cookie 说明条：底部，不挡操作，点“知道了”后一年不再出现 */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 880px; margin: 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px; background: rgba(22, 20, 29, .94); color: #f1f0f5; box-shadow: 0 16px 40px -18px rgba(22, 20, 29, .6); }
.cookie-bar p { margin: 0; font-size: calc(15px * var(--fs)); line-height: 1.6; }
.cookie-bar a { color: #ffb3c4; }
.cookie-bar .btn { flex: none; }
@media (max-width: 560px) { .cookie-bar { flex-direction: column; align-items: stretch; } .cookie-bar .btn { width: 100%; } }

/* 变身视频 / 用原图再改一张 */
.origin-pick { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.origin-pick img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.origin-pick p { margin: 0 0 4px; }
.morph-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; max-width: 560px; }
.morph-pair figure { margin: 0; }
.morph-pair img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; }
.morph-pair figcaption { font-size: calc(15px * var(--fs)); color: var(--muted); margin-top: 4px; text-align: center; }
.morph-arrow { font-size: calc(26px * var(--fs)); color: var(--accent); }
.morph-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.morph-side { display: grid; gap: 10px; align-content: start; }
.morph-side > p { margin: 0; }
.morph-effects { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.morph-effects .mode-card-opt > span { position: relative; align-content: start; }
.morph-effects .mode-card-opt .morph-icon { font-style: normal; font-size: calc(26px * var(--fs)); line-height: 1; display: block; margin: 0 0 6px; padding: 0; border: 0; background: none; height: auto; border-radius: 0; }
.morph-tag { position: absolute; top: 8px; right: 8px; font-size: calc(13px * var(--fs)); padding: 1px 6px; border-radius: 999px; background: var(--surface-2, #f3f0f6); color: var(--muted); }
.morph-form .morph-fx-label { margin: 16px 0 8px; }
.morph-form .panel > label:not(.check) { display: grid; gap: 6px; }
.morph-form .panel > label:not(.check) input { width: 100%; }
.morph-form .panel > label.check { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.morph-result video { width: 100%; max-height: 72vh; border-radius: 14px; background: #000; display: block; }
.morph-result.is-portrait video { max-width: 420px; }
@media (max-width: 860px) { .morph-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .morph-two { grid-template-columns: 1fr; } .morph-effects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 直播互动游戏 / 形象包 */
.cast-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cast-hero > div:last-child { flex: 1; min-width: 240px; }
.cast-hero .panel-title { margin-top: 0; }
.cast-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; max-width: 100%; }
.cast-pack + .cast-pack { margin-top: 14px; }
.cast-again { font-size: calc(21px * var(--fs)); margin: 24px 0 10px; }
.cast-strip img { width: 84px; height: 108px; object-fit: contain; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.game-card { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: inherit; }
.game-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: 0 10px 30px -18px rgba(236, 122, 44, .5); }
.game-card b { font-size: calc(19px * var(--fs)); }
.game-card .btn { justify-self: start; margin-top: 6px; }
.game-card.is-soon { opacity: .7; }
.game-thumb { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 12px; display: block; margin-bottom: 4px; background: #f6f1f8; }
.game-card:hover .game-thumb { transform: translateY(-2px); transition: transform .2s; }
.game-thumb + .game-icon { display: none; }
.game-icon { font-size: calc(34px * var(--fs)); line-height: 1; }
.my-games { list-style: none; display: grid; gap: 8px; }
.my-games li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(120px * var(--fs)), 1fr)); gap: 12px; margin: 10px 0 12px; }
.cast-item { margin: 0; text-align: center; }
.cast-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; border-radius: 12px; display: block;
  background: repeating-conic-gradient(#f2eff6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--line); }
.cast-item figcaption { font-size: calc(15px * var(--fs)); color: var(--muted); margin-top: 4px; display: flex; justify-content: center; gap: 8px; align-items: center; }
.cast-item form { display: inline; }
.cast-styles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cast-pick { border: 0; padding: 0; margin: 0 0 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(92px * var(--fs)), 1fr)); gap: 8px; }
.cast-pick legend { font-weight: 600; margin-bottom: 6px; }
.cast-pick img { object-fit: contain !important; background: #fff6ec; }
.cast-new span { display: grid; place-items: center; height: 100%; min-height: 96px; border: 1px dashed var(--line); border-radius: 12px; }
.cast-new b { font-size: calc(26px * var(--fs)); color: var(--accent); }
@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cast-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .game-grid { grid-template-columns: 1fr; } .cast-strip img { width: 52px; height: 68px; } }

/* 全屏播放：不管页面里是怎么裁切显示的，全屏时都完整显示（竖屏视频左右留黑） */
video:fullscreen { object-fit: contain !important; background: #000 !important; }
video:-webkit-full-screen { object-fit: contain !important; background: #000 !important; }

/* 像素猜图：我自己的图片 */
.pix-mine { border: 0; padding: 0; margin: 0 0 4px; }
.pix-mine legend { font-weight: 600; margin-bottom: 6px; }
.pix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(96px * var(--fs)), 1fr)); gap: 8px; max-height: 360px; overflow: auto; padding: 2px; }
.pix-item { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--surface); }
.pix-item.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .15); }
.pix-item label { position: relative; display: block; cursor: pointer; }
.pix-item label input { position: absolute; top: 4px; left: 4px; z-index: 1; width: 18px; height: 18px; }
.pix-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; display: block; }
.pix-item .pix-ans { padding: 4px 6px; font-size: calc(15px * var(--fs)); min-height: 0; }

/* 动态歌单：让照片动起来 */
.pl-animate { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fffaf3; }
.pl-animate .check { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.pl-animate [data-animate-more] { margin-top: 10px; display: grid; gap: 6px; }
.pl-animate [data-animate-more] label { display: grid; gap: 6px; }

/* 空状态：还没有内容 / 结果还没出来（templates/_empty.php） */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 20px; border: 1px dashed var(--line); border-radius: 16px;
  background: linear-gradient(180deg, rgba(236, 122, 44, .035), rgba(236, 122, 44, 0) 70%), var(--surface); }
.empty-state.is-compact { padding: 22px 16px; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; font-size: calc(28px * var(--fs)); border-radius: 18px; background: #fff0f4; margin-bottom: 4px; }
.is-compact .empty-icon { width: 44px; height: 44px; font-size: calc(22px * var(--fs)); border-radius: 14px; }
.empty-title { margin: 0; font-weight: 700; font-size: calc(17px * var(--fs)); color: var(--text, #1f1f2b); }
.empty-text { margin: 0; max-width: 34em; font-size: calc(15px * var(--fs)); color: var(--muted); line-height: 1.6; }
.empty-example { margin: 6px 0 0; max-width: 32em; font-size: calc(15px * var(--fs)); color: var(--muted); padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .03); }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.panel .empty-state { border-style: dashed; }

/* 互动游戏：画面背景的色块 */
.bd-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.12); }
.bd-dot-candy { background: linear-gradient(135deg, #ffd6e7, #fff5c9); }
.bd-dot-night { background: linear-gradient(135deg, #4b2a7d, #120a26); }
.bd-dot-mint { background: linear-gradient(135deg, #c9f5e4, #fdf6d8); }
.bd-dot-sunset { background: linear-gradient(135deg, #ffcf9e, #c86dd7); }
.bd-dot-ocean { background: linear-gradient(135deg, #c2f0ff, #4a6fe3); }
.bd-dot-gold { background: linear-gradient(135deg, #3b3021, #e8b74a); }
.bd-dot-transparent { background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 6px 6px; }

/* 提交中的按钮、网络提示条 */
.btn.is-busy { opacity: .75; cursor: progress; }
.btn.is-busy::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-right: 6px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.net-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; padding: 10px 16px; border-radius: 999px; background: #2a1730; color: #fff; font-size: calc(15px * var(--fs)); box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); text-align: center; }
.net-bar.is-ok { background: #12a37f; }


/* ================= 智哥AI 专属 =================
   智哥是隔壁的大哥：亲切、实在、不吹牛。界面跟着他走——暖色、圆润、手绘描边感，说话短而实在。 */
.brand-name em { font-style: normal; color: var(--accent); margin-left: 1px; }

/* 智哥本人（templates/_zhige.php） */
.zhige { margin: 0; position: relative; display: inline-flex; flex-direction: column; align-items: center; width: var(--zg-w); max-width: 100%; flex: none; }
.zhige img { width: 100%; height: auto; display: block; }
.zhige-say {
  position: relative; margin-bottom: 10px; padding: 8px 14px; background: #fff; color: var(--text);
  border: 2.5px solid #3a2a20; border-radius: 16px; font-weight: 700; font-size: calc(16px * var(--fs)); line-height: 1.35; text-align: center;
  box-shadow: 3px 3px 0 #3a2a20; white-space: nowrap;
}
.zhige-say::after {
  content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: #fff;
  border-right: 2.5px solid #3a2a20; border-bottom: 2.5px solid #3a2a20; transform: translateX(-50%) rotate(45deg);
}

/* 首页 */
.zg-hero { background: radial-gradient(1200px 500px at 85% 20%, #ffe8d1 0, transparent 60%); }
.zg-kicker { display: inline-block; font-size: calc(15px * var(--fs)); font-weight: 700; color: var(--accent-dark); background: #ffeedd; border-radius: 999px; padding: 4px 14px; margin-bottom: 14px; }
.zg-try { color: var(--accent); white-space: nowrap; }
.zg-hero-art { display: flex; justify-content: center; }
.zg-hero-fig .zhige-say { font-size: calc(19px * var(--fs)); }
.zg-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.zg-tool {
  display: grid; gap: 6px; align-content: start; padding: 20px 20px 16px; background: var(--surface); color: var(--text);
  border: 2px solid var(--line); border-radius: var(--radius); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.zg-tool:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: 4px 4px 0 #f3c9a3; }
.zg-tool-icon { font-size: calc(30px * var(--fs)); line-height: 1; }
.zg-tool b { font-size: calc(20px * var(--fs)); }
.zg-tool-desc { font-size: calc(16px * var(--fs)); color: var(--muted); }
.zg-tool-go { margin-top: 6px; font-size: calc(16px * var(--fs)); font-weight: 700; color: var(--accent-dark); }
.zg-promise { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; }
.zg-rules { margin: 0; padding-left: 1.4em; display: grid; gap: 12px; }
.zg-rules b { color: var(--text); }

/* 工具页标题旁的智哥 */
.zg-tool-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.zg-tool-head > div:first-child { flex: 1; min-width: 0; }
.zg-side { margin-bottom: 4px; align-items: flex-end; }
.zg-side .zhige-say::after { left: auto; right: 34%; transform: rotate(45deg); }
.zg-side .zhige-say { font-size: calc(15px * var(--fs)); padding: 6px 10px; }
.zg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }

/* 空状态 / 失败：智哥出来说话 */
.zg-state { display: flex; align-items: center; gap: 20px; }
.zg-state .zhige { --zg-w: 120px; }
.zg-state p { margin: 0 0 6px; }

@media (max-width: 900px) {
  .zg-tools { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .zg-tools { grid-template-columns: 1fr; }
  .zg-promise { grid-template-columns: 1fr; justify-items: center; gap: 16px; }
  .zg-hero-fig { --zg-w: 220px !important; }
  .zg-tool-head .zg-side { display: none; }
  .zg-state { flex-direction: column; text-align: center; }
  .zhige-say { white-space: normal; }
}

/* ================= 证件照（从 ai.meiguo.com 搬来，换成智哥的配色） ================= */
.idp .row-btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.idp label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: calc(17px * var(--fs)); color: var(--muted); }
.idp label.inline select { min-height: 40px; font-size: calc(17px * var(--fs)); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.idp-privacy { margin-bottom: 16px; }
.pick { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; margin: 0 0 16px; min-width: 0; }
.pick legend { font-weight: 800; font-size: calc(20px * var(--fs)); padding: 0 6px; }
.pick-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.pick-option { position: relative; display: grid; gap: 4px; padding: 12px 14px 12px 44px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.pick-option input { position: absolute; left: 14px; top: 15px; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.pick-option:has(input:checked) { border-color: var(--accent); background: #fff4e8; }
.pick-main { font-weight: 700; line-height: 1.45; }
.pick-rule { font-size: calc(15px * var(--fs)); color: var(--muted); }
.idp-rules ul, .idp-tips { margin: 0 0 12px; padding-left: 1.2em; }
.idp-rules li, .idp-tips li { margin-bottom: 4px; }
.idp-receipt { margin: 0 0 12px; }
.idp-custom { border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.idp-custom-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.idp-custom-grid label { display: grid; gap: 4px; font-size: calc(15px * var(--fs)); color: var(--muted); }
.idp-custom-grid input { min-height: 40px; font-size: calc(17px * var(--fs)); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; width: 100%; }
.idp-bg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.idp-bg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.idp-bg-opt span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; font-size: calc(16px * var(--fs)); }
.idp-bg-opt span i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); display: inline-block; }
.idp-bg-opt input:checked + span { border-color: var(--accent); background: #fff4e8; font-weight: 700; }
.idp-file { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px; }
.idp-preview img { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 12px; }
.idp-consent { margin: 4px 0 14px; align-items: flex-start; }
.idp-h { font-size: calc(20px * var(--fs)); margin: 0 0 8px; }
.idp-editor { border-color: var(--accent); }
.idp-stage { display: flex; justify-content: center; background: repeating-conic-gradient(#efe6da 0% 25%, #fbf6ef 0% 50%) 0 0 / 20px 20px; border-radius: var(--radius); padding: 16px; margin: 8px 0 12px; }
.idp-stage canvas { width: min(100%, 340px); height: auto; box-shadow: 0 10px 28px -16px rgba(58, 42, 32, .6); touch-action: none; cursor: grab; background: #fff; }
.idp-stage canvas:active { cursor: grabbing; }
.idp-controls { display: grid; gap: 10px; margin-bottom: 10px; }
.idp-controls input[type=range] { width: 200px; accent-color: var(--accent); }
.idp-pre { line-height: 1.7; margin: 0 0 12px; }
.idp-pre .ok, .idp-check-ok { color: var(--ok); }
.idp-pre .bad, .idp-decision .bad { color: var(--danger); font-weight: 600; }
.idp-pre .warn, .idp-decision .warn { color: #a5600f; }
.idp-cam { margin: 0 0 14px; }
.idp-cam-view { position: relative; width: min(100%, 360px); aspect-ratio: 3 / 4; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.idp-cam-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.idp-cam-view video.is-mirror { transform: scaleX(-1); }
.idp-oval { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.idp-fine { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.idp-fine summary { cursor: pointer; font-size: calc(17px * var(--fs)); font-weight: 600; min-height: 30px; }
.idp-fine[open] summary { margin-bottom: 8px; }
.idp-ack { margin: 12px 0; }
.idp-ack .check { margin-top: 8px; align-items: flex-start; }
.idp-decision { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0 0; background: #fff; }
.idp-decision.is-pass { border-color: var(--ok); }
.idp-decision.is-adjust { border-color: #f1cf8f; background: #fff7e6; }
.idp-decision.is-reject { border-color: var(--danger); }
.idp-dec-head { font-size: calc(18px * var(--fs)); margin: 0 0 6px; }
.idp-decision.is-pass .idp-dec-head { color: var(--ok); }
.idp-decision.is-adjust .idp-dec-head { color: #a5600f; }
.idp-decision.is-reject .idp-dec-head { color: var(--danger); }
.idp-ai { border-top: 1px dashed #f1cf8f; margin-top: 12px; padding-top: 10px; }
.idp-ai h4 { margin: 0 0 6px; font-size: calc(17px * var(--fs)); color: #a5600f; }
.idp-ai ul { padding-left: 1.2em; margin: 6px 0 10px; }
.idp-vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 10px; }
.idp-vopt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--line); border-radius: var(--radius); padding: 8px; cursor: pointer; font-size: calc(16px * var(--fs)); }
.idp-vopt:has(input:checked) { border-color: var(--accent); }
.idp-vopt canvas { max-width: 100%; height: auto; background: #fff; }
.idp-vopt input { position: absolute; opacity: 0; pointer-events: none; }
.idp-variants { margin: 6px 0; }
.idp-fineprint { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: calc(16px * var(--fs)); color: var(--muted); }
.idp-fineprint h2 { font-size: calc(18px * var(--fs)); color: var(--text); }
.idp-fineprint ul { padding-left: 1.2em; margin: 0; }
.idp-fineprint li { margin-bottom: 6px; }
@media (max-width: 900px) { .pick-options { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .pick { padding: 14px; }
  .pick-options { grid-template-columns: 1fr; }
  .idp-custom-grid { grid-template-columns: 1fr 1fr; }
}

/* ================= DS-160 填写指引：一步一张卡 ================= */
.ds-wrap { max-width: calc(860px * var(--fs)); }
.ds-about { margin: 14px 0 0; font-size: calc(15px * var(--fs)); color: var(--muted); }
.ds-about summary { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; cursor: pointer; list-style: none; }
.ds-about summary::-webkit-details-marker { display: none; }
.ds-about summary em { font-style: normal; color: var(--accent-dark); border-bottom: 1px dashed currentColor; }
.ds-about[open] summary em { opacity: .6; }
.ds-about ul { margin: 8px 0 0; padding: 10px 14px 10px 2em; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ds-about li { margin-bottom: 4px; }

/* 步骤条 */
.ds-steps { display: flex; gap: 6px; margin: 22px 0 14px; padding: 4px 2px 8px; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--header-h); z-index: 5; background: var(--bg); }
.ds-steps:empty { display: none; }
.ds-steps::-webkit-scrollbar { display: none; }
.ds-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: calc(15px * var(--fs)); cursor: pointer; white-space: nowrap; }
.ds-chip b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-alt); color: var(--muted); font-size: calc(14px * var(--fs)); }
.ds-chip:hover { border-color: var(--accent); color: var(--text); }
.ds-chip.is-done b { background: #e3f3ec; color: var(--ok); }
.ds-chip.is-done b::before { content: "✓"; }
.ds-chip.is-done b span { display: none; }
.ds-chip.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.ds-chip.is-on b { background: #fff; color: var(--accent-dark); }

/* 每一步一张卡 */
.ds-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 16px; scroll-margin-top: calc(var(--header-h) + 60px); box-shadow: 0 6px 20px rgba(120, 72, 30, .06); }
.ds160.is-stepped .ds-step { display: none; }
.ds160.is-stepped .ds-step.is-on { display: block; animation: ds-in .25s ease; }
@keyframes ds-in { from { transform: translateY(6px); } to { transform: none; } }
.ds-step-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.ds-step-no { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: #fff; font-size: calc(21px * var(--fs)); font-weight: 800; }
.ds-step-head h2 { font-size: calc(22px * var(--fs)); margin: 0; line-height: 1.3; }
.ds-step-en { margin: 2px 0 0; font-size: calc(15px * var(--fs)); color: var(--muted); letter-spacing: .02em; }
.ds-tip { margin: 0 0 16px; padding: 10px 14px; background: #fff6e3; border-left: 4px solid var(--accent-2); border-radius: 10px; font-size: calc(16px * var(--fs)); }
.ds-points { margin: 0 0 14px; padding-left: 1.4em; }
.ds-points li { margin-bottom: 8px; }
.ds-check { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.ds-check label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.ds-check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--ok); flex: none; }
.ds-check input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }

/* 栏目：默认只露一行 */
.ds-fields { display: grid; gap: 6px; margin: 0; }
.ds-f { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ds-f summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 40px 10px 14px; cursor: pointer; list-style: none; position: relative; }
.ds-f summary::-webkit-details-marker { display: none; }
.ds-f summary::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
.ds-f[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.ds-f summary:hover { background: var(--surface-2); border-radius: 12px; }
.ds-f-zh { font-weight: 700; order: -1; }
.ds-f-en { font-size: calc(15px * var(--fs)); color: var(--muted); }
.ds-f[open] { border-color: #f0c79f; }
.ds-f-body { padding: 0 14px 12px; font-size: calc(16px * var(--fs)); }
.ds-f-body p { margin: 0 0 8px; }
.ds-f-body p:last-child { margin-bottom: 0; }
.ds160 code { background: #fff4e8; border: 1px solid #f3d6b8; border-radius: 6px; padding: 0 6px; font-size: .92em; word-break: break-word; }

/* 小工具 */
.ds-tool { margin-top: 18px; border: 2px dashed #f0c79f; border-radius: 14px; padding: 14px 16px; background: #fffaf3; }
.ds-tool h3 { font-size: calc(17px * var(--fs)); margin: 0 0 10px; }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ds-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ds-grid label, .ds-inline { display: grid; gap: 4px; font-size: calc(15px * var(--fs)); color: var(--muted); }
.ds-inline { display: inline-grid; }
.ds-tool input[type=text], .ds-tool input[type=tel], .ds-tool input[type=date] { min-height: 40px; font-size: calc(17px * var(--fs)); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; width: 100%; background: #fff; color: var(--text); }
.ds-result { margin: 12px 0 0; }
.ds-out { width: 100%; border-collapse: collapse; font-size: calc(16px * var(--fs)); background: #fff; }
.ds-out th, .ds-out td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.ds-out th { background: var(--surface-2); font-weight: 700; }
.ds-out input { width: 100%; border: 0; font-size: calc(16px * var(--fs)); background: transparent; color: var(--text); min-height: 28px; }
.ds160 [data-copy] { cursor: copy; border-bottom: 1px dashed var(--accent); }
.ds160 [data-copy].is-copied { background: #e6f6ef; }
.ds-poly { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 8px 0 0; }

.ds-photo { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 14px 16px; background: var(--surface-2); border-radius: 14px; }
.ds-photo p { margin: 0 0 8px; }
.ds-done { margin-top: 18px; }

/* 底部翻页 */
.ds-nav { display: flex; align-items: center; gap: 14px; margin: 4px 0 0; }
.ds-nav[hidden] { display: none; }
.ds-nav .btn[disabled] { opacity: .35; pointer-events: none; }
.ds-progress { flex: 1; position: relative; height: 8px; border-radius: 999px; background: var(--bg-alt); }
.ds-progress span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent); transition: width .3s; }
.ds-progress em { position: absolute; left: 0; right: 0; top: 12px; text-align: center; font-style: normal; font-size: calc(15px * var(--fs)); color: var(--muted); }
@media (max-width: 640px) {
  .ds-step { padding: 16px 14px; border-radius: 14px; }
  .ds-step-no { width: 38px; height: 38px; font-size: calc(19px * var(--fs)); border-radius: 12px; }
  .ds-step-head h2 { font-size: calc(20px * var(--fs)); }
  .ds-grid, .ds-grid-3 { grid-template-columns: 1fr; }
  .ds-out { font-size: calc(15px * var(--fs)); }
  .ds-nav { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .ds-nav .btn { padding-left: 14px; padding-right: 14px; }
}

/* ================= 分步卡片（老照片修复等新工具通用） ================= */
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 16px; box-shadow: 0 6px 20px rgba(120, 72, 30, .06); scroll-margin-top: calc(var(--header-h) + 12px); }
.step-card[hidden] { display: none; }
.step-card > :last-child { margin-bottom: 0; }
.step-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.step-head h2 { font-size: calc(21px * var(--fs)); margin: 0; }
.step-no { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; font-size: calc(19px * var(--fs)); }
.step-card .check { margin: 14px 0 12px; display: flex; gap: 10px; align-items: flex-start; }
.step-card .check input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.step-card .submit-btn { margin-bottom: 10px; }
.step-card .mode-cards { margin-bottom: 4px; }

/* ================= 老照片修复 ================= */
.op-wrap { max-width: calc(860px * var(--fs)); }
.op-drop { position: relative; border: 2px dashed #f0c79f; border-radius: 14px; background: #fffaf3; padding: 18px; text-align: center; }
.op-drop > label { display: grid; justify-items: center; gap: 4px; cursor: pointer; padding: 12px 0; }
.op-drop > label b { font-size: calc(19px * var(--fs)); color: var(--accent-dark); }
.form .op-drop input[type=file] { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.op-drop-ico { font-size: calc(40px * var(--fs)); line-height: 1; }
.op-drop.is-drag { border-color: var(--accent); background: #fff1e1; }
.op-drop.is-done > label { padding: 4px 0; }
.op-drop.is-done > label .op-drop-ico, .op-drop.is-done > label .small { display: none; }
.op-drop.is-done { border-style: dashed; }
.op-drop.is-done > label b { font-size: 0; }
.op-drop.is-done > label b::before { content: "↻ 换一张照片"; font-size: calc(16px * var(--fs)); font-weight: 600; }
.op-drop .photo-preview { display: block; max-height: 320px; max-width: 100%; margin: 6px auto 10px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.op-drop .progress { max-width: 320px; margin: 0 auto; }
.op-drop [data-upload-status]:empty { display: none; }
.op-tips, .op-extra { margin-top: 12px; font-size: calc(16px * var(--fs)); }
.op-tips summary, .op-extra summary { cursor: pointer; color: var(--accent-dark); width: fit-content; }
.op-tips ul { margin: 8px 0 0; padding: 10px 14px 10px 2em; background: var(--surface-2); border-radius: 10px; }
.op-tips li { margin-bottom: 4px; }
.op-extra input { margin-top: 8px; width: 100%; min-height: 42px; font-size: calc(17px * var(--fs)); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
.op-rec { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--accent-2); color: var(--accent-2-ink); font-size: calc(14px * var(--fs)); font-weight: 700; vertical-align: 2px; }
.op-how { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0; margin: 0 0 16px; }
.op-how li { display: flex; gap: 10px; align-items: center; padding: 12px; background: var(--surface-2); border-radius: 12px; }
.op-how b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; }
.op-redo a { margin-left: 8px; white-space: nowrap; }
@media (max-width: 640px) {
  .step-card { padding: 16px 14px; border-radius: 14px; }
  .op-how { grid-template-columns: 1fr; }
}

/* ================= 卡通头像 ================= */
.av-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.av-style { position: relative; cursor: pointer; }
.av-style input { position: absolute; opacity: 0; pointer-events: none; }
.av-style span { display: grid; justify-items: center; gap: 6px; padding: 8px 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); transition: border-color .15s, transform .15s; }
.av-style img, .av-style i { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
.av-style i { display: grid; place-items: center; font-style: normal; font-size: calc(42px * var(--fs)); background: var(--surface-2); }
.av-style b { font-size: calc(16px * var(--fs)); }
.av-style:hover span { border-color: #f0c79f; }
.av-style input:checked + span { border-color: var(--accent); background: #fff6ec; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(236, 122, 44, .18); }
.av-style input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.av-who { margin-bottom: 14px; }
.av-desc { display: grid; gap: 6px; font-size: calc(16px * var(--fs)); color: var(--muted); }
.av-desc input { min-height: 44px; font-size: calc(17px * var(--fs)); }
.avatar-page .prompt-chips { margin-top: 10px; }
.avatar-page .step-card > .chip-pick { margin-bottom: 14px; }
.av-modes { grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.mode-card-opt input:disabled + span { opacity: .45; cursor: not-allowed; }
@media (max-width: 640px) {
  .av-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .av-modes { grid-template-columns: 1fr; }
}

/* ================= 抠图换背景 ================= */
.cut-result { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cut-stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-align: center; }
.cut-stage canvas { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; cursor: grab; touch-action: none; }
.cut-stage canvas.is-drag { cursor: grabbing; }
.cut-stage canvas.is-clear { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.cut-hint { margin: 8px 0 0; }
.cut-label { font-weight: 700; margin: 0 0 10px; }
.cut-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-bottom: 16px; }
.cut-sw { position: relative; display: grid; align-items: end; height: 64px; padding: 0; border: 2px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 14px 14px; cursor: pointer; overflow: hidden; font: inherit; }
.cut-sw span { display: block; font-size: calc(14px * var(--fs)); padding: 2px 0; background: rgba(255,255,255,.85); color: var(--text); text-align: center; }
.cut-sw.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(236, 122, 44, .25); }
.cut-sw input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.cut-sw-pick { background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #c77dff, #ff6b6b); }
.cut-sw-img { background: var(--surface-2); }
.cut-sw-img::before { content: "🖼️"; position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-size: calc(22px * var(--fs)); }
.cut-size { display: grid; gap: 6px; font-size: calc(16px * var(--fs)); color: var(--muted); margin-bottom: 14px; }
.cut-size input { accent-color: var(--accent); }
@media (max-width: 760px) { .cut-result { grid-template-columns: 1fr; } }

/* ================= 微信等 App 里保存文件（save.js） ================= */
.zg-save-open, .zg-save-open body { overflow: hidden; }
.zg-save { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(31, 23, 18, .72); animation: zg-save-in .18s ease; }
@keyframes zg-save-in { from { opacity: 0; } to { opacity: 1; } }
.zg-save-box { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: 12px; justify-items: center; padding: 18px 16px 14px; background: var(--surface); border-radius: var(--radius); text-align: center; }
.zg-save-tip { margin: 0; font-size: calc(17px * var(--fs)); }
.zg-save-img { width: 100%; min-height: 160px; display: grid; place-items: center; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 12px; }
.zg-save-img img { display: block; max-width: 100%; max-height: 62vh; border-radius: 10px; -webkit-touch-callout: default; user-select: auto; }
.zg-save-wait { color: var(--muted); font-size: calc(15px * var(--fs)); }
.zg-save-steps { margin: 0; padding: 12px 16px 12px 2.2em; text-align: left; background: var(--surface-2); border-radius: 12px; width: 100%; box-sizing: border-box; }
.zg-save-steps li { margin: 4px 0; }
.zg-save-close { min-width: 120px; }

/* ================= 高清放大 ================= */
.up-scale { margin-bottom: 14px; }

/* ================= 祝福语、朋友圈文案 ================= */
.wish-occ { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(188px * var(--fs)), 1fr)); gap: 8px; }
.wish-o { position: relative; cursor: pointer; }
.wish-o input { position: absolute; opacity: 0; pointer-events: none; }
.wish-o span { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: calc(16px * var(--fs)); }
.wish-o i { font-style: normal; font-size: calc(21px * var(--fs)); }
.wish-o:hover span { border-color: #f0c79f; }
.wish-o input:checked + span { border-color: var(--accent); background: #fff6ec; font-weight: 700; }
.wish-o input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.wish-label { margin: 0 0 8px; font-size: calc(16px * var(--fs)); color: var(--muted); }
.wish-page .step-card .chip-pick { margin-bottom: 14px; }
.wish-moments { display: grid; gap: 6px; margin-bottom: 14px; font-size: calc(16px * var(--fs)); color: var(--muted); }
.wish-moments[hidden] { display: none; }
.wish-moments input, .wish-more input { min-height: 44px; font-size: calc(17px * var(--fs)); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; width: 100%; }
.wish-more { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 8px; }
.wish-more input { margin-top: 0; }
.wish-page .op-extra { margin: 0 0 14px; }
.wish-wait { align-items: center; }
.wish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: wish; }
.wish-list li { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px 12px 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; counter-increment: wish; transition: border-color .15s; }
.wish-list li::before { content: counter(wish); position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: calc(14px * var(--fs)); font-weight: 700; }
.wish-list li:hover { border-color: var(--accent); }
.wish-list p { flex: 1; margin: 0; white-space: pre-line; line-height: 1.7; }
.wish-copy { flex: none; font-size: calc(15px * var(--fs)); color: var(--accent-dark); border: 1px solid #f0c79f; border-radius: 999px; padding: 2px 10px; background: #fff; }
.wish-list li.is-copied { border-color: var(--ok); background: #eef8f3; }
.wish-list li.is-copied .wish-copy { color: var(--ok); border-color: var(--ok); font-size: 0; }
.wish-list li.is-copied .wish-copy::before { content: "✓ 已复制"; font-size: calc(15px * var(--fs)); }
@media (max-width: 640px) {
  .wish-occ { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wish-more { grid-template-columns: 1fr; }
}

/* ================= 拍照转文字 ================= */
.ocr-drop { display: grid; justify-items: center; gap: 4px; cursor: pointer; }
.ocr-drop input[type=file] { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.ocr-drop .photo-preview { display: block; max-height: 320px; max-width: 100%; margin: 10px auto 0; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.ocr-drop.is-done .op-drop-ico, .ocr-drop.is-done .small { display: none; }
.ocr-drop.is-done b { font-size: 0; }
.ocr-drop.is-done b::before { content: "↻ 换一张"; font-size: calc(16px * var(--fs)); }
.ocr-text { width: 100%; min-height: 200px; font-size: calc(17px * var(--fs)); line-height: 1.7; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); resize: vertical; font-family: inherit; }
.op-demo { margin: 0 0 16px; }
.op-demo .compare { max-width: 520px; margin: 0 auto; }
.op-demo > p { text-align: center; margin: 8px 0 0; }
.op-demo-dot { font: inherit; font-size: calc(15px * var(--fs)); margin: 0 2px; padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.op-demo-dot.is-on { border-color: var(--accent); color: var(--accent-dark); background: #fff6ec; }
.admin-side { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ================= 管理后台：块与块之间统一留白 ================= */
.admin .wrap > * + .panel, .admin .wrap > .panel + * { margin-top: 16px; }   /* 筛选按钮、搜索框和面板之间不再贴在一起 */
.admin-rename.admin-search { justify-content: flex-start; }                    /* 只有输入框 + 按钮时，按钮紧跟输入框 */
.admin .panel > p { margin: 6px 0; }
.admin .panel > .admin-rename { margin: 10px 0 4px; }
@media (max-width: 760px) {
  /* 手机上表格改成在面板里左右滑动：表格本身保持 table（铺满面板宽度），放不下时面板出横向滚动条 */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { display: table; }
}

/* ================= 看图做饭、看懂药盒（结果排版） ================= */
.vision-view { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); line-height: 1.75; }
.vision-view .v-line { margin: 0 0 4px; }
.vision-view .v-head { display: inline-block; margin-top: 8px; color: var(--accent-dark); }
.vision-view .v-line:first-child .v-head { margin-top: 0; }
.vision-warn { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3cf9a; font-size: calc(16px * var(--fs)); line-height: 1.7; }

/* ================= 首页工具分类 ================= */
.zg-cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; position: sticky; top: var(--header-h); z-index: 5; padding: 8px 0; background: var(--bg); }
.zg-cat { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: calc(16px * var(--fs)); }
.zg-cat small { color: var(--muted); font-size: calc(14px * var(--fs)); }
.zg-cat:hover { text-decoration: none; border-color: var(--accent); }
.zg-cat.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.zg-cat.is-on small { color: rgba(255,255,255,.85); }
.zg-cat-block { margin-top: 22px; scroll-margin-top: calc(var(--header-h) + 64px); }
.zg-cat-block[hidden] { display: none; }
.zg-cat-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; font-size: calc(21px * var(--fs)); }
.zg-cat-title small { font-size: calc(15px * var(--fs)); font-weight: 400; color: var(--muted); }
.zg-free { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: #e3f3ec; color: var(--ok); font-size: calc(14px * var(--fs)); font-weight: 700; vertical-align: 3px; }
@media (max-width: 640px) {
  .zg-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px; }
  .zg-cats::-webkit-scrollbar { display: none; }
  .zg-cat { flex: none; }
}

/* ===== 字号：--fs 控制整体缩放；html.fs-big 为“大字”模式（header 开关，存 localStorage） ===== */
:root { --fs: 1; }
html.fs-big { --fs: 1.15; }
html { font-size: calc(16px * var(--fs)); }
.fs-toggle { min-width: 44px; font-weight: 700; }
.fs-toggle[aria-pressed="true"] { background: var(--accent, var(--jade, #4f46e5)); color: #fff; border-color: transparent; }
/* 顶栏是“框架”，不跟着放大（否则手机上 logo 会折行、导航挤爆）；大字只作用于正文内容 */
html.fs-big .site-header { --fs: 1; }
.brand-name { white-space: nowrap; }
@media (max-width: 420px) { .fs-toggle { min-width: 0; padding-left: 9px; padding-right: 9px; } }

/* 兄弟站互推卡片（智哥 ↔ 畅秀） */
.xpromo-sec { padding: 64px 0 0; }   /* 上面是白底“老规矩”，下面紧跟同底色的收费区（它自带 64px 上边距） */
.xpromo { display: grid; gap: 6px; padding: 20px 22px; border-radius: 16px; border: 1px dashed var(--line); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.xpromo:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.xpromo-tag { justify-self: start; font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 2px 10px; border-radius: 999px; }
.xpromo-title { font-size: calc(19px * var(--fs)); }
.xpromo-desc { color: var(--muted); font-size: calc(15px * var(--fs)); }
.xpromo-go { font-weight: 700; color: var(--accent); font-size: calc(16px * var(--fs)); }
.xpromo-hint { margin-top: 18px; font-size: calc(14px * var(--fs)); color: var(--muted); }
.xpromo-hint a { font-weight: 600; }
/* 抠图作品页 → 改图（AI 换真实场景） */
.cut-ai { display: grid; gap: 4px; margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); text-decoration: none; }
.cut-ai:hover { text-decoration: none; border-color: var(--accent); }
.cut-ai b { font-size: calc(16px * var(--fs)); }
.cut-ai span { font-size: calc(14px * var(--fs)); color: var(--muted); }

/* 作品页：发朋友圈 / 抖音引导 */
.spread { margin-top: 16px; display: grid; gap: 14px; }   /* 标题、分享按钮、两个步骤框、底部那句之间统一留 14px */
.spread > * { margin: 0; }
.spread > [hidden] { display: none; }
.spread-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.spread-steps { display: grid; gap: 10px; }
.spread-steps details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--surface); }
.spread-steps summary { cursor: pointer; font-weight: 700; }
.spread-steps ol { margin: 8px 0 2px; padding-left: 1.3em; font-size: calc(15px * var(--fs)); }
.spread-steps li + li { margin-top: 4px; }
/* 趣味测算：解梦、星座、16 型人格 */
.fun-page textarea { width: 100%; font: inherit; font-size: calc(17px * var(--fs)); padding: 12px 14px; border: 1px solid var(--field-line, var(--line)); border-radius: 12px; background: var(--surface); }
.fun-note { margin-top: 8px; }
.fun-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.fun-head h2 { margin: 0; font-size: calc(22px * var(--fs)); }
.fun-block { margin: 14px 0; }
.fun-block h3, .fun-grid h3 { margin: 0 0 4px; font-size: calc(16px * var(--fs)); }
.fun-block p, .fun-grid p { margin: 0; }
.fun-sym { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fun-sym b { display: inline-block; min-width: 4em; margin-right: 8px; color: var(--accent-dark, var(--accent)); }
.fun-tip { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff6ec; }
.fun-signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(104px * var(--fs)), 1fr)); gap: 8px; margin-top: 10px; }
.fun-signs .wish-o span { flex-direction: column; gap: 0; padding: 10px 6px; text-align: center; }
.fun-signs .wish-o i { font-size: calc(26px * var(--fs)); line-height: 1.2; }
.fun-signs small { color: var(--muted); font-size: calc(13px * var(--fs)); }
.fun-birth { min-height: 38px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.fun-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(150px * var(--fs)), 1fr)); gap: 4px 16px; margin: 0 0 10px; padding: 0; list-style: none; }
.fun-stars { color: #f4a300; letter-spacing: 1px; }
.fun-stars s { color: #e2dccf; text-decoration: none; }
.fun-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(200px * var(--fs)), 1fr)); gap: 12px; margin: 14px 0; }
.fun-grid > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.fun-lucky { margin: 0 0 6px; }
.fun-yiji .yi, .fun-yiji .ji { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; margin-right: 6px; border-radius: 6px; color: #fff; font-weight: 700; font-size: calc(14px * var(--fs)); }
.fun-yiji .yi { background: #2e9c7e; } .fun-yiji .ji { background: #c9493b; }
.fun-pair { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fun-pair select { min-height: calc(46px * var(--fs)); min-width: 9em; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--surface); }
.fun-score { margin: 4px 0; } .fun-score b { font-size: calc(44px * var(--fs)); color: var(--accent); line-height: 1; } .fun-score span { color: var(--muted); margin-left: 4px; }
.fun-title { font-weight: 700; font-size: calc(18px * var(--fs)); margin: 0 0 6px; }
.mb-progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.mb-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.mb-q { font-size: calc(21px * var(--fs)); margin: 10px 0 16px; }
.mb-opts { display: grid; gap: 10px; margin-bottom: 10px; }
.mb-opt { text-align: left; padding: 16px 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; font-size: calc(17px * var(--fs)); cursor: pointer; color: var(--text); }
.mb-opt:hover, .mb-opt:focus-visible { border-color: var(--accent); background: #fff6ec; outline: none; }
.mb-type { text-align: center; margin: 6px 0 14px; }
.mb-code { display: block; font-size: calc(52px * var(--fs)); font-weight: 900; letter-spacing: .06em; color: var(--accent); line-height: 1.1; }
.mb-type b { font-size: calc(22px * var(--fs)); }
.mb-type p { margin: 4px 0 0; color: var(--muted); }
.mb-dims { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.mb-dims li { display: grid; grid-template-columns: 5em 1fr 5em; align-items: center; gap: 8px; font-size: calc(14px * var(--fs)); }
.mb-dims li span:last-of-type { text-align: right; }
.mb-dims span.is-on { font-weight: 800; color: var(--accent-dark, var(--accent)); }
.mb-dims i { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mb-dims i b { display: block; height: 100%; background: var(--accent); }
.mb-dims small { grid-column: 1 / -1; color: var(--muted); text-align: center; margin-top: -4px; }
.mb-all a { margin-right: 4px; } .mb-all a.is-on { font-weight: 800; }
/* 文书草稿 */
.ct-kinds { grid-template-columns: repeat(auto-fill, minmax(calc(240px * var(--fs)), 1fr)); }
.ct-kinds .wish-o span { align-items: flex-start; }
.ct-k { display: grid; gap: 2px; min-width: 0; }
.ct-k small { color: var(--muted); font-size: calc(13px * var(--fs)); font-weight: 400; }
.ct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(240px * var(--fs)), 1fr)); gap: 12px 16px; margin-top: 10px; }
.ct-grid label { display: grid; gap: 4px; }
.ct-grid label > span { font-weight: 600; font-size: calc(15px * var(--fs)); }
.ct-grid label em { color: var(--accent); font-style: normal; }
.ct-grid .ct-wide { grid-column: 1 / -1; }
.ct-grid input, .ct-grid textarea { width: 100%; font: inherit; font-size: calc(16px * var(--fs)); padding: 10px 12px; min-height: calc(46px * var(--fs)); border: 1px solid var(--field-line, var(--line)); border-radius: 10px; background: var(--surface); }
.ct-warn { margin-top: 14px; }
.ct-text { width: 100%; font: inherit; font-family: "Songti SC", "SimSun", "Noto Serif CJK SC", serif; font-size: calc(16px * var(--fs)); line-height: 1.8; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; margin-bottom: 12px; }
/* 自动配背景音乐 */
.bgm-pick { margin: 10px 0; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.bgm-pick .check { margin: 0; }
.bgm-moods { margin-top: 8px; }
/* 视频变清楚：前后对比图 */
.clarify-compare { margin: 12px 0; }
.clarify-compare img { width: 100%; height: auto; border-radius: 12px; display: block; }
.clarify-compare figcaption { margin-top: 4px; text-align: center; }
/* 大字模式：顶栏不放大，但版心宽度要和下面的内容对齐 */
html.fs-big .site-header .wrap { max-width: calc(1200px * 1.15); }
/* 工具页右上角的智哥：气泡宽于小人时别压到标题上——整块按气泡宽度占位，气泡可以折成两行 */
.zg-tool-head .zg-side { width: auto; min-width: var(--zg-w); max-width: 15em; }
.zg-tool-head .zg-side img { width: var(--zg-w); }
.zg-tool-head .zg-side .zhige-say { white-space: normal; }
/* 作品卡：已归档的占位分三行（图标 / 已归档 / 点开就能调取），窄卡片里不挤 */
.creation-arch { display: grid; justify-items: center; gap: 2px; text-align: center; line-height: 1.3; padding: 0 8px; }
.creation-arch i { font-style: normal; font-size: calc(28px * var(--fs)); }
.creation-arch b { color: var(--text); font-size: calc(16px * var(--fs)); }
.creation-arch small { font-size: calc(13px * var(--fs)); }
/* 选项卡片同一行等高：外层 label 被网格拉伸后，里面带边框的 span 也撑满（否则一张折两行、其他矮一截） */
.wish-o, .av-style, .font-opt, .material-opt, .mode-card-opt, .mode-opt, .quiz-opt { display: flex; flex-direction: column; }
.wish-o > span, .av-style > span, .font-opt > span, .material-opt > span, .mode-card-opt > span, .mode-opt > span, .quiz-opt > span { flex: 1 1 auto; }

/* 文生视频：给配音配画面 / 背景音乐；配音作品“接着做”；水印勾选 */
.tv-audio { width: 100%; margin: 4px 0 8px; }
.tv-fixed { margin: 0; padding: 8px 10px; background: var(--surface); border-radius: 8px; font-size: calc(15px * var(--fs)); line-height: 1.6; }
.tts-next { display: grid; gap: 8px; justify-items: start; margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px; }
.tts-next p { margin: 0; }
.wm-opt .muted { display: inline; }
[data-music-pane] { display: grid; gap: 12px; margin-top: 12px; }
[data-music-pane][hidden] { display: none; }
.tv-music { margin: 4px 0; }
.tv-music[open] { display: grid; gap: 12px; }

/* ===== 窄屏手机（2026-11）：顶栏不折行、分段选择不再一项占一整行 ===== */
.credits, .fs-toggle { white-space: nowrap; }
@media (max-width: 480px) {
  .xs-hide { display: none; }          /* 顶栏“大字”→“大”、“130 点”→“130” */
  .header-inner { gap: 10px; }
  .nav-user { gap: 8px; }
  .credits { padding: 3px 10px; }
  .nav-user .btn { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 600px) {
  /* 选项平分一行，字长的在格子里折行；放不下（每项太窄）才换行，换行后的也铺满 */
  /* 两三项：放在一行，按字数分宽度（字多的格子宽），实在挤才在格子里折行；四项以上：平分，放不下换行并铺满 */
  .seg { display: flex; flex-wrap: nowrap; width: 100%; }
  .seg label { flex: 1 1 auto; min-width: 0; }
  .seg:has(> label:nth-child(4)) { flex-wrap: wrap; }
  .seg:has(> label:nth-child(4)) label { flex: 1 1 0; min-width: 3.6em; }
  .seg span { white-space: normal; line-height: 1.3; padding: 7px 8px; }
}
/* 页脚：手机上口号换到第二行（不用中圆点） */
@media (max-width: 600px) {
  .ft-dot { display: none; }
  .ft-slogan { display: block; }
}
/* 变身视频：前后两张图的说明分两行（“变身前 / 原图”），两边一样高，图片对齐 */
.morph-pair figcaption small { display: block; font-size: calc(13px * var(--fs)); opacity: .85; }
/* 配音：三步说明、声音采样录音 */
.tts-steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 6px; padding: 0; }
.tts-steps li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tts-steps b { font-size: calc(16px * var(--fs)); }
.tts-steps span { font-size: calc(13px * var(--fs)); color: var(--muted); line-height: 1.4; }
.tts-steps-note { margin: 0 0 14px; }
.tts-cols.is-new #my-voices { order: -1; }   /* 还没有采样：先录采样 */
.tts-empty { margin: 6px 0; font-weight: 600; }
.voice-form-title { margin: 14px 0 6px; font-size: calc(17px * var(--fs)); }
.vrec { display: grid; gap: 8px; padding: 12px 14px; border: 1px dashed var(--accent); border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); margin-bottom: 10px; }
.vrec p { margin: 0; }
.vrec-script { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: calc(18px * var(--fs)); line-height: 1.7; }
.vrec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vrec-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.vrec .is-rec { background: #d93a3a; border-color: #d93a3a; animation: vrec-pulse 1.2s ease-in-out infinite; }
@keyframes vrec-pulse { 50% { box-shadow: 0 0 0 6px rgba(217, 58, 58, .18); } }
.vrec audio { width: 100%; }
@media (max-width: 560px) { .tts-steps { grid-template-columns: 1fr; } .tts-steps li { grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; } }
/* 手机上的分段选择（画风、风格、时长…）：4 个排成 2×2，5 个以上每行最多 3 个，最后一行自动撑满；3 个以内不变 */
@media (max-width: 600px) {
  .seg:has(> label:nth-child(4)) { display: flex; width: 100%; }
  .seg:has(> label:nth-child(4)) > label { flex: 1 1 calc(33.334% - 1px); }
  .seg:has(> label:nth-child(4):last-child) > label { flex-basis: calc(50% - 1px); }
  .seg:has(> label:nth-child(4)) span { text-align: center; padding-left: 8px; padding-right: 8px; }
}
/* 配音：声音采样安全说明 */
.voice-safe { margin: 8px 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.voice-safe summary { cursor: pointer; font-weight: 700; }
.voice-safe ul { margin: 8px 0 6px; padding-left: 1.2em; display: grid; gap: 6px; font-size: calc(15px * var(--fs)); }
.voice-safe p { margin: 0; }
/* 配音：采样“保存 / 只用一次” */
.voice-keep { border: 0; padding: 0; margin: 10px 0 6px; display: grid; gap: 8px; min-width: 0; }
.voice-keep legend { font-weight: 600; font-size: calc(15px * var(--fs)); margin-bottom: 4px; padding: 0; }
.voice-keep .keep-opt { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.voice-keep .keep-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.voice-keep .keep-opt input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); }
.keep-txt { display: grid; gap: 2px; line-height: 1.45; }
.keep-txt b { font-size: calc(16px * var(--fs)); }
.keep-txt small { color: var(--muted); font-size: calc(14px * var(--fs)); }
.voice-once { background: #fff3e0; color: #b45309; }

/* AI 唱歌 */
.song-tabs { margin-bottom: 16px; }
.song-page .panel > label:not(.check) { display: grid; gap: 6px; margin-top: 12px; }
.song-page .panel > label:not(.check) input, .song-page .panel > label:not(.check) textarea { width: 100%; }
.song-page .panel > .btn { margin-top: 10px; }
.song-page .vtext-field + .vtext-field { margin-top: 12px; }
/* 风格：小卡片（图标在左、名字在右），手机一行三个 */
.song-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.song-styles .mode-card-opt > span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; }
.song-styles .mode-card-opt .morph-icon { display: inline; padding: 0; border: 0; background: none; height: auto; border-radius: 0; font-style: normal; font-size: calc(18px * var(--fs)); line-height: 1; }
.song-styles b { font-size: calc(15px * var(--fs)); white-space: nowrap; }
.song-lyrics { line-height: 1.9; white-space: normal; }
.song-result audio + p { margin-top: 10px; }
/* 配音页：从别的功能过来录采样，录好后“回到 xx 继续” */
.return-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 12px 0 16px; padding: 14px 18px; border-radius: 14px; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.return-bar span { font-weight: 600; flex: 1 1 260px; }
.return-bar .btn { flex: none; }
@media (max-width: 560px) { .return-bar .btn { width: 100%; } }
/* 配音：声音采样体检结果 */
.vcheck { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.vcheck b { display: block; margin-bottom: 4px; }
.vcheck ul { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 3px; font-size: calc(15px * var(--fs)); }
.vcheck li.ok { color: #2e7d5b; }
.vcheck li.warn { color: #b45309; }
.vcheck p { margin: 0; }
.vcheck.is-ok { border-color: #9fd3bb; background: #f2fbf6; }
.vcheck.is-warn { border-color: #f3c98b; background: #fff8ec; }
.vcheck.is-bad { border-color: #e9a3a3; background: #fff1f1; }
.vcheck.is-bad li.warn { color: #c0392b; }

/* 带背景音乐的视频：静音自动播放，画面上给个“点开声音” */
.vwrap { position: relative; }
.morph-result.is-portrait .vwrap { max-width: 420px; }
.vtext-result.is-portrait .vwrap { max-width: 380px; }
.unmute-btn { position: absolute; top: 10px; left: 10px; z-index: 2; border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .95em; color: #fff; background: rgba(0,0,0,.62); cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); animation: unmute-pulse 1.8s ease-in-out infinite; }
.unmute-btn:hover { background: rgba(0,0,0,.8); }
@keyframes unmute-pulse { 50% { transform: scale(1.06); } }

/* 已归档但有缓存小图的作品卡片 */
.creation-thumb { position: relative; }
.creation-arch-tag { position: absolute; left: 6px; top: 6px; z-index: 1; font-size: .78em; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }

/* 节日限时选项（Season） */
.season-tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-style: normal; font-size: .72em; line-height: 1.5; font-weight: 600; color: #fff; background: linear-gradient(135deg, #e53935, #f4a62a); vertical-align: 1px; }
.theme-swatch.style-xmas_eve { background: radial-gradient(circle at 25% 30%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 70% 65%, #ffd36b 0 2px, transparent 3px), linear-gradient(135deg, #0f3b26, #8e1420); }
.theme-swatch.style-ny_party { background: radial-gradient(circle at 30% 40%, #ffd55a 0 2px, transparent 4px), radial-gradient(circle at 72% 30%, #ff7ab8 0 2px, transparent 4px), linear-gradient(#0d1550, #1e2a7a); }
.theme-swatch.style-cny_red  { background: radial-gradient(circle at 30% 45%, #ffd24a 0 3px, transparent 4px), radial-gradient(circle at 70% 45%, #ffd24a 0 3px, transparent 4px), linear-gradient(135deg, #b3141a, #6e0a0a); }
.theme-opt-xmas_night   .theme-swatch { background: radial-gradient(circle at 25% 35%, #fff 0 1.5px, transparent 2.5px), radial-gradient(circle at 70% 60%, #ff5a5a 0 2px, transparent 3.5px), radial-gradient(circle at 50% 30%, #6dff9b 0 2px, transparent 3.5px), linear-gradient(#0f2a1c, #3a1016); }
.theme-opt-ny_fireworks .theme-swatch { background: radial-gradient(circle at 30% 40%, #ffd55a 0 2px, transparent 5px), radial-gradient(circle at 70% 35%, #8fd0ff 0 2px, transparent 5px), linear-gradient(#060a2a, #1a1f55); }
.theme-opt-cny_red      .theme-swatch { background: radial-gradient(circle at 30% 40%, #ffd24a 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, #ffd24a 0 2px, transparent 3px), linear-gradient(#c0161c, #6e0a0a); }
.season-sec { padding-top: 8px; padding-bottom: 8px; }
.season-box { border-radius: 16px; padding: 16px 18px; color: #fff; }
.season-box + .season-box { margin-top: 12px; }
.season-xmas { background: linear-gradient(135deg, #0f5132 0%, #1b6b45 45%, #a3171f 100%); }
.season-ny   { background: linear-gradient(135deg, #10175a 0%, #2a2f8f 60%, #b8860b 100%); }
.season-cny  { background: linear-gradient(135deg, #b3141a 0%, #d22f27 55%, #e8a317 100%); }
.season-title { margin: 0 0 10px; font-size: calc(20px * var(--fs)); color: #fff; }
.season-links { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.season-link { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.season-link:hover { background: rgba(255,255,255,.24); }
.season-link b { font-size: calc(16px * var(--fs)); }
.season-link span { font-size: calc(13px * var(--fs)); opacity: .88; }

/* 变身视频：中间再加几张 */
.morph-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.morph-side-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.morph-ops { display: inline-flex; gap: 10px; }
.morph-ops .link-btn { font-size: calc(14px * var(--fs)); }

/* AI 画图 */
[data-draw-form] textarea { width: 100%; }
.draw-ratios { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.draw-ratios .mode-card-opt > span { justify-items: center; text-align: center; align-content: start; }
.mode-card-opt .draw-ratio-icon { display: block; padding: 0; background: none; border: 2px solid currentColor; border-radius: 4px; opacity: .65; box-sizing: border-box; }
.mode-card-opt .draw-ratio-icon.is-portrait { width: 20px; height: 34px; }
.mode-card-opt .draw-ratio-icon.is-landscape { width: 36px; height: 20px; margin: 7px 0; }
.mode-card-opt .draw-ratio-icon.is-square { width: 28px; height: 28px; margin: 3px 0; }
.mode-card-opt input:checked + span .draw-ratio-icon { opacity: 1; color: var(--accent); }
.draw-styles { margin-bottom: 14px; }
.draw-ideas-more[hidden] { display: none; }
.draw-result { display: grid; gap: 14px; }
.draw-result.is-portrait .draw-grid { grid-template-columns: repeat(auto-fill, minmax(calc(170px * var(--fs)), 1fr)); }
.draw-grid figcaption { flex-wrap: wrap; }
@media (max-width: 480px) { .draw-ratios .mode-card-opt em { display: none; } }

/* 右下角“进行中”小圆球（partials/_task_dock.php）：有正在做的长任务时出现，圆环是进度；等你确认时闪一下 */
.task-dock { position: fixed; right: 20px; bottom: 20px; z-index: 45; --p: 0; }
.task-dock-btn { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -12px rgba(22, 20, 29, .45); display: grid; place-items: center; transition: transform .15s, background .15s; }
.task-dock-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .96); }
.task-dock-ring { position: absolute; inset: 4px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(22, 20, 29, .1) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.task-dock.is-spin .task-dock-ring { animation: dock-spin 1.4s linear infinite; }
.task-dock-n { position: relative; font-size: calc(13px * var(--fs)); font-weight: 700; color: var(--text); }
.task-dock.is-wait .task-dock-btn { animation: dock-pulse 1.8s ease-in-out infinite; }
.task-dock.is-wait .task-dock-n { color: var(--accent); font-size: calc(20px * var(--fs)); }
@keyframes dock-spin { to { transform: rotate(360deg); } }
@keyframes dock-pulse { 0%, 100% { box-shadow: 0 10px 30px -12px rgba(22, 20, 29, .45), 0 0 0 0 rgba(236, 122, 44, .45); } 50% { box-shadow: 0 10px 30px -12px rgba(22, 20, 29, .45), 0 0 0 10px rgba(236, 122, 44, 0); } }
.task-dock-list { display: none; position: absolute; right: 0; bottom: 66px; width: min(300px, calc(100vw - 40px)); padding: 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -18px rgba(22, 20, 29, .45); }
.task-dock.is-open .task-dock-list { display: block; }
@media (hover: hover) { .task-dock:hover .task-dock-list { display: block; } }
.task-dock-head, .task-dock-foot { margin: 2px 4px 8px; font-size: calc(13px * var(--fs)); color: var(--muted); }
.task-dock-foot { margin: 8px 4px 2px; }
.task-dock-row { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-radius: 10px; color: var(--text); overflow: hidden; }
.task-dock-row:hover { background: var(--surface-2); text-decoration: none; }
.task-dock-row b { font-size: calc(15px * var(--fs)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-dock-row span { font-size: calc(13px * var(--fs)); color: var(--muted); }
.task-dock-row.is-wait span { color: var(--accent); font-weight: 600; }
.task-dock-row i { position: absolute; left: 10px; right: 10px; bottom: 4px; height: 3px; border-radius: 3px; background: rgba(22, 20, 29, .08); }
.task-dock-row i::after { content: ''; position: absolute; inset: 0; width: calc(var(--p) * 1%); border-radius: 3px; background: var(--accent); }
@media (max-width: 560px) { .task-dock { right: 14px; bottom: 14px; } .task-dock-btn { width: 50px; height: 50px; } }
@media (max-width: 560px) { body:has([data-cookie-bar]) .task-dock { bottom: 196px; } }

/* ================================================================ 一键出片（从畅秀 app.css 的“故事工坊”几段拷来，src/Story 同一份） */
.story-h2 { margin: 24px 0 12px; }
.story-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.story-card { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; min-width: 0; }
.story-card:hover { border-color: var(--accent); }
.story-card-cover { flex: 0 0 64px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--bg-alt); display: grid; place-items: center; font-size: calc(28px * var(--fs)); }
.story-card-cover.is-land { flex-basis: 112px; height: 64px; }
.story-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.story-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 0; }
.story-card-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-badge { align-self: flex-start; font-size: calc(13px * var(--fs)); padding: 2px 8px; border-radius: 999px; background: var(--bg-alt); color: var(--muted); white-space: nowrap; }
.story-badge.is-done { background: #e3f6ef; color: var(--ok); }
.story-badge.is-failed { background: #fde8eb; color: var(--danger); }
.story-badge.is-script_review, .story-badge.is-cast_review { background: #fff4d6; color: var(--accent-2-ink); }
.story-styles { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.story-lengths label span, .story-voices label span { white-space: nowrap; }
.story-auto { border-color: var(--violet); }
.story-form textarea[name=source], .story-page textarea { width: 100%; box-sizing: border-box; }
.story-block { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.story-block input { width: 100%; box-sizing: border-box; }

.story-steps { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 16px; overflow-x: auto; }
.story-steps li { flex: 1 1 0; min-width: 70px; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: calc(15px * var(--fs)); white-space: nowrap; }
.story-steps li span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-alt); font-size: calc(13px * var(--fs)); flex: none; }
.story-steps li.is-on { border-color: var(--accent); color: var(--text); font-weight: 600; }
.story-steps li.is-on span { background: var(--accent); color: var(--accent-ink); }
.story-steps li.is-done span { background: var(--ok); color: #fff; }

.story-chars-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.story-char-edit { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.story-char-thumb { width: 64px; border-radius: 8px; float: right; margin-left: 8px; }
.story-parts-edit { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.story-parts-edit > li { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.story-parts-edit > li > div { flex: 1; min-width: 0; }
.story-part-no { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: calc(14px * var(--fs)); font-weight: 700; }
.story-part-chars { align-items: center; margin-top: 6px; }
.story-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.story-secondary { margin-top: 8px; }

.story-cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.story-char { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.story-char-img { aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-alt); display: grid; place-items: center; }
.story-char-img img { width: 100%; height: 100%; object-fit: cover; }
.story-char figcaption { display: flex; flex-direction: column; gap: 2px; }
.story-redraw textarea { width: 100%; }
.story-wait { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: story-spin 1s linear infinite; }
@keyframes story-spin { to { transform: rotate(360deg); } }
[data-status="failed"] .story-wait { border-top-color: var(--accent-2); }

.story-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.story-shots.is-land { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.story-shot { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.story-shot-img { position: relative; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--bg-alt); display: grid; place-items: center; }
.story-shots.is-land .story-shot-img { aspect-ratio: 16 / 9; }
.story-shot-img img { width: 100%; height: 100%; object-fit: cover; }
.story-shot-no { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(0, 0, 0, .55); color: #fff; font-size: calc(12px * var(--fs)); display: grid; place-items: center; }
.story-shot-motion { position: absolute; right: 6px; top: 6px; font-size: calc(14px * var(--fs)); }
[data-clip="queued"] .story-shot-motion, [data-clip="pending"] .story-shot-motion { animation: story-pulse 1.2s ease-in-out infinite; }
@keyframes story-pulse { 50% { opacity: .35; } }
.story-card-body a { color: inherit; text-decoration: none; }
.story-card-body > a { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.story-card-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.story-kinds { margin-bottom: 4px; }
.story-variants { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.story-variants .story-actions { margin-top: 8px; gap: 8px; }
.story-inherit p { margin: 4px 0; }
.story-shot figcaption { color: var(--muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.story-ep-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.story-ep-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.story-ep-list li.is-on a { font-weight: 700; }
.story-cancel { margin-top: 20px; text-align: center; }
.story-page .panel + .panel, .story-page .panel + form, .story-page form + .panel, .story-page .progress-panel { margin-top: 12px; }
@media (max-width: 560px) {
  .story-steps li { min-width: 0; padding: 6px 8px; font-size: calc(13px * var(--fs)); }
  .story-steps li span { width: 18px; height: 18px; }
  .story-parts-edit > li { padding: 10px 8px; gap: 8px; }
  .story-shots { grid-template-columns: repeat(3, 1fr); }
  .story-shots.is-land { grid-template-columns: repeat(2, 1fr); }
  .story-cast { grid-template-columns: repeat(2, 1fr); }
}

/* 故事工坊连载：下一集表单里的老角色小头像 */
.story-cast-mini { list-style: none; padding: 0; margin: 8px 0 4px; display: flex; flex-wrap: wrap; gap: 10px; }
.story-cast-mini li { display: grid; justify-items: center; gap: 2px; width: 64px; font-size: calc(13px * var(--fs)); }
.story-cast-mini img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--line); }
.story-cast-mini span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 故事工坊合集 */
.story-series { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.story-chapters { margin-top: 12px; }
.story-chapters textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: calc(14px * var(--fs)); margin: 6px 0; }

/* 故事工坊封面 */
.story-cover { margin-top: 12px; }
.story-cover-grid { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; align-items: start; }
.story-cover-grid.is-land { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
.story-cover-img img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--line); }
.story-cover-form { display: grid; gap: 8px; min-width: 0; }
.story-cover-form.form { margin-top: 0; }
.story-cover-form input[type=text] { width: 100%; }
.story-cover-parts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.story-cover-parts label { flex: 0 0 auto; cursor: pointer; }
.story-cover-parts img { width: 56px; height: 76px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; display: block; }
.story-cover-parts input:checked + img { border-color: var(--accent); }
@media (max-width: 640px) { .story-cover-grid, .story-cover-grid.is-land { grid-template-columns: 1fr; } .story-cover-grid:not(.is-land) .story-cover-img { max-width: 220px; } }

/* 故事工坊 AI 审稿 */
.story-audit { margin-bottom: 12px; }
.story-audit.is-hold { border-color: #ffb020; }
.story-audit-issues { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.story-lang-variant { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.story-lang-variant .btn { white-space: normal; text-align: left; }   /* 英文按钮字长：窄屏折行，不撑出横向滚动条 */
.story-lang-variant select { height: calc(34px * var(--fs)); border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 0 8px; }

/* 故事工坊三期：短剧剧本（景别 + 一句句台词）、定妆时选声音 */
.story-shot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.story-shot-head span { white-space: nowrap; }
.story-shot-head select { width: auto; flex: none; }
.story-shot-head select, .story-line select, .story-voice-pick select { height: calc(34px * var(--fs)); border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 0 6px; min-width: 0; }
.story-lines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.story-line { display: grid; grid-template-columns: minmax(80px, 120px) minmax(64px, 84px) 1fr; gap: 6px; }
.story-line input { min-width: 0; height: calc(34px * var(--fs)); }
.story-line.is-empty { opacity: .7; }
.story-voice-pick { display: flex; flex-direction: column; gap: 2px; }
.story-voice-row { display: flex; gap: 6px; align-items: center; }
.story-voice-row select { flex: 1; width: auto; }
@media (max-width: 560px) {
  .story-line { grid-template-columns: 1fr 1fr; }
  .story-line input { grid-column: 1 / -1; }
}

.story-cover-parts input { position: absolute; opacity: 0; pointer-events: none; }
.story-cover-parts label { position: relative; }
.inline-form { display: inline; margin: 0; }
.story-tag { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 10px; border-radius: 999px; background: var(--accent-2); color: var(--accent-2-ink); font-size: calc(14px * var(--fs)); font-weight: 700; }
.story-how { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; padding: 0; margin: 4px 0 18px; color: var(--muted); }
.story-how li { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.story-how li + li::before { content: '→'; margin-right: 6px; color: var(--line); }

/* 两站互相引流的卡片：按“对方网站”的样子画（和 DragonParking 停放页横幅一个思路，一眼认出是另一个站）。
   颜色写死成对方的品牌色，不用本站变量；畅秀、智哥AI 两边 app.css 里这一段完全一样，改了两边一起改。 */
.xpromo.xp-zhige, .xpromo.xp-changxiu { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-radius: 18px; text-decoration: none; transition: transform .15s; }
.xpromo.xp-zhige:hover, .xpromo.xp-changxiu:hover { transform: translateY(-1px); text-decoration: none; }
.xpromo.xp-zhige:hover { border-color: #3a2a20; }
.xpromo.xp-changxiu:hover { border-color: #ffb3c3; }
.xp-body { flex: 1; min-width: 0; display: grid; gap: 5px; }
.xp-logo { flex: none; width: 56px; height: 54px; display: block; }
.xp-cta { flex: none; padding: 10px 20px; border-radius: 999px; font-weight: 800; font-size: calc(16px * var(--fs)); color: #fff; white-space: nowrap; transition: background .2s; }
.xp-new { justify-self: start; font-size: calc(14px * var(--fs)); font-weight: 700; padding: 3px 10px; border-radius: 8px; }
/* 智哥AI 的样子：奶油底、深棕粗边、错位投影、智哥橙 */
.xp-zhige { background: linear-gradient(100deg, #fffaf3 50%, #ffe8d1 100%); border: 2px solid #3a2a20; box-shadow: 4px 4px 0 #3a2a20; color: #33261d; }
.xp-zhige .xpromo-tag { color: #c35f18; background: #ffe2c6; }
.xp-zhige .xpromo-title { color: #33261d; }
.xp-zhige .xpromo-desc { color: #7d6b5c; }
.xp-zhige .xp-new { color: #8a5a00; background: #ffe9a8; }
.xp-zhige .xp-cta { background: #ec7a2c; }
.xp-zhige:hover .xp-cta { background: #c35f18; }
/* 畅秀的样子：白底渐粉、细粉边、红色柔光、直播红 + “开播”圆点标 */
.xp-changxiu { background: linear-gradient(100deg, #ffffff 55%, #fff1f4 100%); border: 1px solid #ffd0da; box-shadow: 0 10px 28px -16px rgba(255, 45, 85, .55); color: #16141d; }
.xp-changxiu .xp-logo { width: 48px; height: 48px; border-radius: 14px; background: radial-gradient(circle at 50% 50%, #fff 0 7px, rgba(255, 255, 255, .45) 8px 11px, #ff2d55 12px); }
.xp-changxiu .xpromo-tag { color: #d81e45; background: #ffe3e9; }
.xp-changxiu .xpromo-title { color: #16141d; letter-spacing: -.01em; }
.xp-changxiu .xpromo-desc { color: #5d6172; }
.xp-changxiu .xp-new { color: #6b4dff; background: #eeeaff; }
.xp-changxiu .xp-cta { background: #ff2d55; }
.xp-changxiu:hover .xp-cta { background: #d81e45; }
@media (max-width: 600px) {
  .xpromo.xp-zhige, .xpromo.xp-changxiu { flex-wrap: wrap; gap: 10px 12px; padding: 16px; }
  .xp-logo { width: 44px; height: 42px; align-self: flex-start; }
  .xp-changxiu .xp-logo { width: 40px; height: 40px; }
  .xp-body { flex-basis: calc(100% - 60px); }
  .xp-cta { width: 100%; text-align: center; }
}

/* 在线精修（templates/story/_refine.php） */
.story-refine { margin-top: 12px; }
.story-refine > summary { list-style: none; display: inline-flex; cursor: pointer; }
.story-refine > summary::-webkit-details-marker { display: none; }
.story-refine-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.story-refine-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.story-refine-thumb { position: relative; width: 96px; aspect-ratio: 9 / 16; border-radius: 8px; overflow: hidden; background: var(--line); }
.story-refine-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-refine-no { position: absolute; left: 4px; top: 4px; min-width: 20px; padding: 0 5px; border-radius: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: calc(12px * var(--fs)); text-align: center; }
.story-refine-body { display: grid; gap: 6px; min-width: 0; }
.story-refine-body textarea, .story-refine-body input:not([type=checkbox]) { width: 100%; min-width: 0; }
.story-refine-line { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
.story-refine-line span { white-space: nowrap; color: var(--muted); }
.story-refine-tools { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) {
  .story-refine-item { grid-template-columns: 64px 1fr; }
  .story-refine-thumb { width: 64px; }
  .story-refine-tools { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
.story-refine-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.story-refine-global { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; }
.story-refine-global label { display: inline-flex; align-items: center; gap: 6px; }
.story-refine-global select { height: calc(34px * var(--fs)); border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 0 8px; }

/* 歌曲简谱 */
.song-score { margin: 12px 0; }
.song-score .score-head { font-weight: 600; margin: 6px 0 4px; font-family: ui-monospace, Menlo, monospace; }
.song-score .score-sheet { display: flex; flex-wrap: wrap; row-gap: 10px; padding: 10px 4px; background: var(--panel-2, rgba(127,127,127,.06)); border-radius: 8px; max-height: 460px; overflow: auto; }
.song-score .score-bar { display: inline-flex; align-items: flex-start; padding: 0 6px; border-right: 1px solid currentColor; }
.song-score .score-bar:last-child { border-right-width: 3px; }
.song-score .score-n { display: inline-flex; flex-direction: column; align-items: center; min-width: 1.35em; position: relative; }
.song-score .score-n b { font: 600 17px/1.1 ui-monospace, Menlo, monospace; padding: 0 2px 4px; white-space: nowrap; }
.song-score .score-n b sup { font-size: 10px; }
.song-score .score-n b em { font-style: normal; }
.song-score .score-n.u1 b { border-bottom: 1.5px solid currentColor; }
.song-score .score-n.u2 b { border-bottom: 1.5px solid currentColor; box-shadow: 0 3px 0 -1.5px currentColor; }
.song-score .score-n i { font-style: normal; font-size: 9px; line-height: 9px; height: 9px; letter-spacing: -1px; }
.song-score .score-n .oct-lo { margin-top: 2px; }
.song-score .score-n .ly { font-size: 13px; margin-top: 2px; }
.song-score .score-n.tie::after { content: '⌒'; position: absolute; top: -6px; left: 60%; font-size: 14px; }
