:root {
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --card2: #22223a;
  --primary: #6c5ce7;
  --primary2: #a29bfe;
  --accent: #fd79a8;
  --gold: #ffd166;
  --text: #f1f2f6;
  --text2: #8a8fa3;
  --ok: #2ecc71;
  --danger: #ff6b6b;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: none; cursor: pointer; color: var(--text); }
input::placeholder, textarea::placeholder { color: #6a6f85; opacity: 1; }
input, textarea, select { font-family: inherit; }

#app { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; position: relative; }

/* ---- 页面 ---- */
#pages { flex: 1; overflow: hidden; position: relative; }
.page {
  position: absolute; inset: 0; overflow-y: auto; padding: 16px 16px calc(70px + var(--safe-b));
  opacity: 0; pointer-events: none; transform: translateY(8px); transition: all .25s ease;
}
.page.active { opacity: 1; pointer-events: auto; transform: none; }

/* ---- 顶栏 ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.logo em { font-style: normal; background: linear-gradient(90deg, var(--primary2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.credit-pill {
  display: flex; align-items: center; gap: 5px; background: var(--card); border: 1px solid #2f2f4a;
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--gold);
}
.credit-pill .plus { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; margin-left: 2px; }

/* ---- 卡片 ---- */
.card { background: var(--card); border: 1px solid #26263f; border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.sec-title { font-size: 16px; font-weight: 700; margin: 4px 0 12px; }
.sec-title small { color: var(--text2); font-weight: 400; font-size: 12px; margin-left: 6px; }

/* ---- 首页 hero ---- */
.hero {
  border-radius: 20px; padding: 20px 18px; margin-bottom: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #3d2c8d 0%, #6c5ce7 55%, #b5348f 100%);
}
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.09); }
.hero h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.hero p { font-size: 13px; opacity: .85; }

/* ---- 表单 ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.field textarea, .field input, .field select {
  width: 100%; background: var(--card2); border: 1px solid #31314e; color: var(--text);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; outline: none; resize: none;
}
.field textarea:focus, .field input:focus { border-color: var(--primary2); }
.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px 0; border-radius: 9px; background: transparent; color: var(--text2); font-size: 14px; font-weight: 600; }
.seg button.on { background: var(--primary); color: #fff; }

.btn-main {
  width: 100%; padding: 15px; border-radius: 14px; font-size: 16px; font-weight: 800; color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 6px 20px rgba(108,92,231,.4); transition: transform .1s;
}
.btn-main:active { transform: scale(.97); }
.btn-main[disabled] { opacity: .5; box-shadow: none; }

/* ---- 模板网格 ---- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl {
  background: var(--card2); border: 1px solid #2c2c48; border-radius: 14px; padding: 13px 6px 11px;
  text-align: center; transition: all .15s; position: relative;
}
.tpl .ico { font-size: 26px; display: block; margin-bottom: 6px; }
.tpl .nm { font-size: 13px; font-weight: 700; }
.tpl .tg { font-size: 10px; color: var(--text2); margin-top: 3px; }
.tpl.on { border-color: var(--primary2); background: rgba(108,92,231,.18); box-shadow: 0 0 0 1px var(--primary2); }
.tpl.on::after { content: "✓"; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }

/* ---- 上传框 ---- */
.upload-box {
  border: 1.5px dashed #3d3d5c; border-radius: 14px; padding: 22px 12px; text-align: center;
  color: var(--text2); font-size: 13px; background: var(--card2); position: relative;
}
.upload-box img { max-height: 140px; border-radius: 10px; margin-bottom: 8px; }
.upload-box.has { border-style: solid; border-color: var(--primary2); color: var(--text); }

/* ---- 生成中 ---- */
.gen-wrap { text-align: center; padding: 30px 20px 20px; }
.spinner { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 4px solid #2d2d4a; border-top-color: var(--primary2); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gen-wrap h3 { font-size: 17px; margin-bottom: 8px; }
.gen-wrap .hint { color: var(--text2); font-size: 13px; margin-bottom: 18px; }
.bar { height: 8px; background: #2d2d4a; border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary2), var(--accent)); border-radius: 99px; transition: width .5s ease; }
.pct { font-size: 13px; color: var(--gold); font-weight: 700; }

/* ---- 作品瀑布（一行 5 个 · 紧凑卡片） ---- */
.works { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.work { background: var(--card2); border-radius: 8px; overflow: hidden; position: relative; }
.work video, .work img, .work .ph { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background: #141426; }
.work .ph { display: flex; align-items: center; justify-content: center; font-size: 16px; }
.work .meta { padding: 4px 4px 5px; font-size: 8.5px; color: var(--text2); line-height: 1.35; letter-spacing: -.2px; }
.work .meta b { display: block; color: var(--text); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work .meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work .meta .wdate { color: var(--text2); opacity: .78; }
.work .badge { position: absolute; top: 3px; left: 3px; background: rgba(0,0,0,.6); font-size: 7px; padding: 1px 4px; border-radius: 99px; }
.work .badge.ok { color: var(--ok); } .work .badge.fail { color: var(--danger); } .work .badge.run { color: var(--gold); }
/* 刚生成的结果保留大图，方便查看 */
#img-works { grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ---- 爆款复刻 ---- */
.beat { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #2c2c48; }
.beat:last-child { border-bottom: none; }
.beat .n { width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.beat .t b { font-size: 14px; display: block; }
.beat .t span { font-size: 12px; color: var(--text2); }
.tips li { font-size: 13px; color: var(--text2); margin: 7px 0 0 16px; }

/* ---- 充值 ---- */
.pack { display: flex; align-items: center; justify-content: space-between; background: var(--card2); border: 1.5px solid #2c2c48; border-radius: 14px; padding: 15px 16px; margin-bottom: 11px; position: relative; }
.pack.on { border-color: var(--gold); background: rgba(255,209,102,.07); }
.pack .l b { font-size: 17px; }
.pack .l b em { font-style: normal; color: var(--gold); font-size: 14px; margin-left: 4px; }
.pack .l span { display: block; font-size: 12px; color: var(--text2); margin-top: 3px; }
.pack .r { text-align: right; }
.pack .r .price { font-size: 19px; font-weight: 800; color: var(--accent); }
.pack .r .price small { font-size: 12px; }
.pack .hot { position: absolute; top: -1px; right: 14px; background: linear-gradient(90deg, var(--accent), var(--primary)); font-size: 10px; padding: 3px 10px; border-radius: 0 0 8px 8px; }

/* ---- 记录 ---- */
.record { display: flex; justify-content: space-between; align-items: center; padding: 13px 2px; border-bottom: 1px solid #23233c; font-size: 14px; }
.record:last-child { border: none; }
.record .t2 { color: var(--text2); font-size: 12px; margin-top: 3px; }
.record .amt { font-weight: 800; }
.record .amt.plus { color: var(--ok); } .record .amt.minus { color: var(--text2); }

/* ---- 底部导航 ---- */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: calc(60px + var(--safe-b));
  padding-bottom: var(--safe-b); background: rgba(20,20,38,.92); backdrop-filter: blur(14px);
  border-top: 1px solid #26263f; display: flex; z-index: 50;
}
.tab { flex: 1; background: none; color: var(--text2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; }
.tab .tab-ico { font-size: 21px; filter: grayscale(1) opacity(.6); }
.tab.active { color: var(--primary2); }
.tab.active .tab-ico { filter: none; }

/* ---- 弹窗 / toast ---- */
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px); background: rgba(30,30,55,.95); border: 1px solid #3a3a5c; padding: 11px 20px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 99; max-width: 80vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 22px 18px calc(24px + var(--safe-b)); max-height: 82vh; overflow-y: auto; animation: up .25s ease; }
@keyframes up { from { transform: translateY(60px); opacity: .5; } }
.sheet h3 { text-align: center; font-size: 17px; margin-bottom: 16px; }
.sheet-x {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; background: var(--card2); color: var(--text2);
  font-size: 15px; display: flex; align-items: center; justify-content: center;
}
.sheet { position: relative; }

/* 分享页 */
.share-page { min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.share-page video { width: 100%; max-width: 340px; border-radius: 18px; background: #000; }
.share-page .who { margin-top: 16px; color: var(--text2); font-size: 14px; }
.share-cta { margin-top: 18px; width: 100%; max-width: 340px; }

/* ---- 视频复刻（方案 D） ---- */
.rx-card { padding: 12px; }
.rx-duo { display: flex; gap: 10px; align-items: flex-start; }
.rx-side { width: 31%; flex: none; }
.rx-vbox {
  position: relative; width: 100%; aspect-ratio: 9/16; border-radius: 11px; overflow: hidden;
  background: var(--card2); border: 1.5px dashed #3d3d5c;
  display: flex; align-items: center; justify-content: center;
}
.rx-vbox.has { border-style: solid; border-color: #3a3a58; }
.rx-vbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-vempty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text2); font-size: 10.5px; }
.rx-vplus {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(108,92,231,.16);
  border: 1px solid rgba(162,155,254,.35); display: flex; align-items: center; justify-content: center;
  color: var(--primary2); font-size: 16px;
}
.rx-vchg, .rx-vtime {
  position: absolute; background: rgba(0,0,0,.6); font-size: 9.5px; padding: 2px 6px; border-radius: 99px;
}
.rx-vchg { right: 5px; top: 5px; }
.rx-vtime { left: 5px; bottom: 5px; }
.rx-cap { font-size: 10px; color: var(--text2); text-align: center; margin-top: 5px; }

.rx-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; min-width: 0; }
.rx-cell {
  aspect-ratio: 1; border-radius: 9px; position: relative; overflow: hidden; padding: 0;
  background-size: cover; background-position: center; background-color: var(--card2);
}
.rx-add { border: 1.5px dashed #3d3d5c; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 18px; }
.rx-empty { border: 1px dashed #2b2b45; background: rgba(34,34,58,.4); }
.rx-no { position: absolute; left: 0; top: 0; background: rgba(0,0,0,.68); font-size: 9px; font-weight: 700; padding: 2px 5px; border-bottom-right-radius: 6px; }
.rx-del { position: absolute; right: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font-size: 9px; display: flex; align-items: center; justify-content: center; }

.rx-presets { display: flex; gap: 8px; margin-bottom: 9px; }
.rx-preset {
  flex: 1; padding: 9px; border-radius: 11px; background: var(--card2); border: 1px solid #31314e;
  color: var(--text2); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rx-preset.on { border-color: var(--primary2); background: rgba(108,92,231,.16); color: #fff; }
.rx-dot { width: 6px; height: 6px; border-radius: 50%; background: #4a4a6a; }
.rx-preset.on .rx-dot { background: var(--accent); }

.rx-ta {
  width: 100%; background: var(--card2); border: 1px solid #31314e; border-radius: 12px;
  padding: 11px 44px 11px 12px; font-size: 13px; color: var(--text); line-height: 1.65; outline: none; resize: none; min-height: 150px;
}
.rx-ta:focus { border-color: var(--primary2); }
/* @素材高亮层：@视频 紫色 / @图N 蓝色（textarea 文字透明，由本层着色显示） */
.rx-hl {
  position: absolute; inset: 1px; overflow: hidden; pointer-events: none;
  color: var(--text); white-space: pre-wrap; word-break: break-word; z-index: 1;
}
.rx-hl-main { padding: 11px 44px 11px 12px; font-size: 13px; line-height: 1.65; }
.rx-hl-big { padding: 12px; font-size: 14px; line-height: 1.7; }
/* textarea 改块级，消除底部基线空隙，保证高亮层与输入框完全等高对齐 */
.rx-ta-wrap > textarea { display: block; }
.rx-masked { color: transparent !important; caret-color: var(--text); }
.hl-video { color: #a29bfe; font-weight: 700; }
.hl-img { color: #4da3ff; font-weight: 700; }
.hl-tag { color: #ff6b6b; font-weight: 700; }
.rx-warn { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); margin-top: 7px; line-height: 1.5; }
/* 「仅展示部分提示词」提示 */
.rx-part-hint {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
  font-size: 10.5px; color: var(--gold); background: rgba(255,209,102,.08);
  border: 1px solid rgba(255,209,102,.28); border-radius: 7px; padding: 2px 8px;
}
/* 输入框外左下角清空按钮（与灰色提示同一行） */
.rx-foot { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; }
.rx-foot .rx-warn { flex: 1; margin-top: 0; }
.rx-clear-btn {
  flex: none; margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text2);
  background: var(--card2); border: 1px solid #3a3a5c; border-radius: 8px; padding: 3px 11px;
  line-height: 1.5;
}
.rx-clear-btn:active { color: var(--danger); border-color: var(--danger); }
/* 白膜引用提示文字（金色） */
.hl-hint { color: var(--gold); font-weight: 700; }
.rx-ta-wrap { position: relative; }
.rx-expand-btn {
  position: absolute; right: 8px; top: 8px; width: 30px; height: 30px; border-radius: 9px;
  background: rgba(108,92,231,.2); border: 1px solid rgba(162,155,254,.35);
  color: var(--primary2); display: flex; align-items: center; justify-content: center;
}
.rx-expand-btn:active { background: rgba(108,92,231,.35); }
.rx-big-ta {
  width: 100%; min-height: 46vh; background: var(--card2); border: 1px solid #31314e; border-radius: 12px;
  padding: 12px; font-size: 14px; color: var(--text); line-height: 1.7; outline: none; resize: none; margin-bottom: 12px;
}
.rx-big-ta:focus { border-color: var(--primary2); }
.rx-vbox img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-i {
  width: 13px; height: 13px; border-radius: 50%; border: 1px solid #5b5b7d; color: #a7abc0;
  font-size: 8px; font-style: italic; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 1px;
}

.rx-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rx-pc { background: var(--card2); border: 1px solid #31314e; border-radius: 11px; padding: 8px 10px; text-align: left; }
.rx-pc .k { font-size: 10px; color: var(--text2); display: block; }
.rx-pc .v { font-size: 12.5px; font-weight: 700; margin-top: 3px; display: flex; justify-content: space-between; align-items: center; }
.rx-pc .v i { font-style: normal; font-size: 9px; color: #5f6480; }

.rx-opts { display: flex; flex-direction: column; gap: 8px; }
.rx-opt { padding: 13px; border-radius: 12px; background: var(--card2); border: 1px solid #31314e; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; }
.rx-opt.on { border-color: var(--primary2); background: rgba(108,92,231,.16); color: #fff; }

.rx-dock {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 4px 0 2px;
}
.rx-dinfo { font-size: 10.5px; color: var(--text2); flex: none; line-height: 1.4; }
.rx-dinfo b { display: block; font-size: 16px; color: var(--gold); font-weight: 800; }
.rx-dock .btn-main { flex: 1; padding: 13px; font-size: 15px; }
.rx-vplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.42);
  border: 1.5px solid rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.rx-vplay::after { content: ""; width: 0; height: 0; border-left: 9px solid #fff; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; margin-left: 3px; }
.rx-vbox.playing .rx-vplay { display: flex; }

/* 白膜预设确认弹窗 */
.rx-dialog-mask {
  position: fixed; inset: 0; z-index: 96; background: rgba(0,0,0,.66);
  display: flex; align-items: center; justify-content: center; animation: fade .18s; padding: 0 28px;
}
.rx-dialog {
  width: 100%; max-width: 320px; background: var(--card); border: 1px solid #2f2f4a;
  border-radius: 18px; padding: 22px 20px 18px; animation: up .2s ease;
}
.rx-dialog-t { text-align: center; font-size: 16px; font-weight: 800; margin-bottom: 9px; }
.rx-dialog-d { font-size: 12.5px; color: var(--text2); line-height: 1.6; text-align: center; margin-bottom: 18px; }
.rx-dialog-btns { display: flex; gap: 10px; }
.rx-dialog-btn {
  flex: 1; padding: 11px 0; border-radius: 11px; font-size: 14px; font-weight: 700;
  background: var(--card2); border: 1px solid #31314e; color: var(--text2);
}
.rx-dialog-btn.primary {
  background: linear-gradient(90deg, var(--primary), var(--accent)); border: none; color: #fff;
}
.rx-dialog-btn:active { transform: scale(.97); }
.rx-vbox.playing .rx-vplay::after {
  width: 9px; height: 11px; border: none; margin-left: 0;
  border-left: 3px solid #fff; border-right: 3px solid #fff; border-radius: 1px;
}

/* 视频删除按钮（与图片 X 一致） */
.rx-vdel {
  position: absolute; right: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(0,0,0,.62); color: #fff; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 3; cursor: pointer;
}
.rx-vchg { top: auto; bottom: 5px; }
.rx-vplay { pointer-events: auto; cursor: pointer; z-index: 2; }

/* @ 素材引用弹层 / 素材条 */
.rx-mention {
  position: absolute; left: 8px; right: 8px; bottom: 10px; z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: rgba(15,15,26,.96); border: 1px solid #3a3a5c; border-radius: 12px;
  padding: 8px 10px; box-shadow: 0 8px 22px rgba(0,0,0,.45);
  animation: fade .15s;
}
.rx-m-title { font-size: 11px; color: var(--text2); flex: none; }
.rx-m-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px 4px 4px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: rgba(108,92,231,.22); border: 1px solid rgba(162,155,254,.4); color: var(--primary2);
}
.rx-m-item:active { background: rgba(108,92,231,.4); }
/* @图N 按钮文字用蓝色，与输入框内着色一致；@视频 保持紫色 */
.rx-m-item[data-t^="图"] { color: #4da3ff; border-color: rgba(77,163,255,.45); }
.rx-m-item[data-t^="图"]:active { background: rgba(77,163,255,.18); }
.rx-m-thumb {
  width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex: none;
  background: #33334f; border: 1px solid rgba(255,255,255,.18); display: block;
}
.rx-m-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }

/* ================= 创作中心 · 功能宫格 ================= */
.tools-hero { text-align: left; }
.tool-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px;
}
.tool-card {
  position: relative; text-align: left; background: var(--card2); border: 1px solid #2c2c4a;
  border-radius: 16px; padding: 15px 14px 14px; color: var(--text);
  display: flex; flex-direction: column; gap: 3px; transition: transform .12s, border-color .12s;
}
.tool-card:active { transform: scale(.97); border-color: var(--primary2); }
.tool-card b { font-size: 15px; font-weight: 800; }
.tool-card small { font-size: 11px; color: var(--text2); line-height: 1.45; }
.tool-ico {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; font-size: 22px; margin-bottom: 9px;
}
.tool-ico.grad { background: linear-gradient(135deg, #6c5ce7, #a855f7); }
.tool-ico.blue { background: rgba(77,163,255,.16); }
.tool-ico.gold { background: rgba(255,209,102,.14); }
.tool-ico.pink { background: rgba(240,114,182,.16); }
/* HD 标识图标 */
.hd-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; letter-spacing: .5px; line-height: 1;
  color: #fff; padding: 4px 6px; border-radius: 7px;
  background: linear-gradient(135deg, #f072b6, #a855f7);
  box-shadow: 0 2px 8px rgba(240,114,182,.35);
}

/* ================= 工具页 ================= */
.tool-bar { display: flex; align-items: center; gap: 12px; padding: 4px 0 2px; }
.tool-back {
  width: 34px; height: 34px; border-radius: 10px; background: var(--card2); border: 1px solid #2c2c4a;
  color: var(--text); font-size: 22px; line-height: 1; display: flex; align-items: center;
  justify-content: center; padding-bottom: 3px; flex: none;
}
.tool-back:active { background: #2a2a48; }
.tool-name { font-size: 17px; font-weight: 800; }
.tool-sub { font-size: 11.5px; color: var(--text2); margin-top: 2px; }
.tool-tip { font-size: 11.5px; color: var(--text2); text-align: center; margin-top: 10px; line-height: 1.5; }
/* 图片生成：参考图网格 / 选择框 / 选项 */
.img-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.img-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; }
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-add { border: 1.5px dashed #3d3d5c; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 20px; }
.img-no { position: absolute; left: 0; top: 0; background: rgba(0,0,0,.68); color:#fff; font-size: 9px; font-weight: 700; padding: 2px 5px; border-bottom-right-radius: 6px; }
.img-del { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.img-chg { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.62); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { padding: 8px 14px; border-radius: 10px; background: var(--card2); color: var(--text2); font-size: 13px; font-weight: 600; }
.chips button.on { background: var(--primary); color: #fff; }
.sel-wrap { position: relative; }
.sel-wrap select { width: 100%; padding: 11px 34px 11px 12px; border-radius: 12px; background: var(--card2); color: var(--text); font-size: 14px; border: none; appearance: none; -webkit-appearance: none; }
.sel-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text2); font-style: normal; pointer-events: none; font-size: 12px; }
.img-costline { text-align: right; color: var(--text2); font-size: 12px; margin: 2px 0 10px; }
.img-costline b { color: var(--primary); }
.img-pick { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--card2); color: var(--text); font-size: 14px; font-weight: 600; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.img-pick i { font-style: normal; color: var(--text2); font-size: 12px; }
/* 图片生成页提示词高亮层对齐（与 .field textarea 的字号/内边距一致） */
#img-prompt { line-height: 1.5; }
.rx-hl-img { padding: 12px 14px; font-size: 15px; line-height: 1.5; }
