/* ============================================================
   飞飞AI版本开发 — 四引擎脚本参考站
   视觉取向：技术工具，不是产品官网。密排、硬边、少装饰。
   ============================================================ */

:root {
  /* 字号三档：所有 font-size 都写成 calc(Npx * var(--fs-scale))，
     改这一个值就能整体缩放，布局尺寸不受影响 */
  --fs-scale: 1.28;

  /* 固定高度：顶栏 + 引擎条（跟着字号一起缩放，否则大字号会撑破） */
  --topbar-h:  calc(46px * var(--fs-scale));
  --engbar-h:  calc(62px * var(--fs-scale));

  /* 底：默认「青瓷」——墨蓝底 + 冷白字。对着满屏脚本调错时，暗底不会像
     白底那样整片反光；青灰主色又比纯灰多一层色温，看久了不发闷。
     叫 gold 是历史原因，实际含义是「强调色」，不要按字面理解 */
  --bg:        #070a0e;
  --bg-2:      #0a0e14;
  --panel:     #0d1219;
  --panel-2:   #11181f;
  --panel-3:   #161e27;

  --line:      #1d2733;
  --line-soft: #161d26;
  --line-hard: #28343f;

  --text:      #d3dae2;
  --text-2:    #a2adb9;
  --muted:     #77838f;
  --muted-2:   #586470;

  --gold:      #5b9bb5;
  --gold-2:    #7cb9d1;
  --gold-dim:  rgba(91, 155, 181, .12);
  --gold-line: rgba(91, 155, 181, .30);
  --on-gold:   #06141b;

  --red:       #b8503c;
  --green:     #5f9163;
  --cyan:      #4f7d92;
  --blue:      #4f7d92;

  /* 引擎色标 */
  --e-gom42:   #c9a227;
  --e-lf:      #5f9163;
  --e-996:     #4f7d92;
  --e-gomc:    #8a6b4a;

  /* 代码语法高亮：暗底专用，浅色系 */
  --tok-kw:    #c8a24a;
  --tok-cmd:   #8fb3c9;
  --tok-str:   #8fae83;
  --tok-num:   #c98b6b;
  --tok-var:   #b98fb3;

  /* 2px：硬边。4px 以上就开始有「卡片 App」的软味道，
     这套界面要的是印刷品的直角感，圆角只用来防止 1px 边框糊角 */
  --radius: 2px;
  --r: 2px;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 字号三档。data-fs 由页面脚本写在 <html> 上。
   三档在上一轮基础上整体上调一档：用户反馈「全站再加大」，
   基准值不动光调倍率没用——13.5px × 1.14 仍然只有 15.4px。
   现在紧凑档 1.08 也比过去的默认档大，观感更接近常见中文工具站 */
html[data-fs="s"] { --fs-scale: 1.14; }
html[data-fs="m"] { --fs-scale: 1.28; }
html[data-fs="l"] { --fs-scale: 1.46; }

/* ============================================================
   配色四套。布局、字号、间距全都不变，只换底色与色温。
   站点默认是极光（页面脚本总会写 data-theme）；:root 保留青瓷作为
   CSS 兜底——脚本没跑起来时至少是浅色可读，不会一片死黑。
   四个色点就是这四套。
   ============================================================ */

/* 素白：纸墨调，白纸黑字。白天室内、打印校对、投屏时用 */
html[data-theme="paper"] {
  --bg:        #f4f2ec;
  --bg-2:      #eeece5;
  --panel:     #fbfaf5;
  --panel-2:   #f0eee7;
  --panel-3:   #e5e3da;

  --line:      #e2e0d7;
  --line-soft: #ecebe3;
  --line-hard: #c9c6bb;

  --text:      #2b2d2a;
  --text-2:    #4d4f48;
  --muted:     #7a7c72;
  --muted-2:   #8a8c81;

  /* 素白档的强调色是「墨」：按钮黑底白字，不引入第二种彩度 */
  --gold:      #23262a;
  --gold-2:    #000000;
  --gold-dim:  rgba(35, 38, 42, .055);
  --gold-line: rgba(35, 38, 42, .16);
  --on-gold:   #faf9f5;

  /* 语义色降饱和成矿物色，荧光红绿在纸面上太刺 */
  --red:       #a8442f;
  --green:     #4a6b48;
  --cyan:      #35606e;
  --blue:      #35606e;

  --e-gom42:   #8a6d1f;
  --e-lf:      #4a6b48;
  --e-996:     #35606e;
  --e-gomc:    #7a6047;

  /* 白底上必须用深色高亮才读得清 */
  --tok-kw:    #7a5c12;
  --tok-cmd:   #2f5f6e;
  --tok-str:   #3f6b46;
  --tok-num:   #94502a;
  --tok-var:   #6b4a6e;
}

/* 赭石：陶土红调。往红里推了一档，三套才是「蓝 / 白 / 红陶」三个方向 */
html[data-theme="clay"] {
  --bg:        #0b0807;
  --bg-2:      #0f0b09;
  --panel:     #13100c;
  --panel-2:   #181411;
  --panel-3:   #1e1915;

  --line:      #2a221c;
  --line-soft: #201a15;
  --line-hard: #362b23;

  --text:      #ded8d2;
  --text-2:    #b0a8a1;
  --muted:     #867d76;
  --muted-2:   #645c56;

  --gold:      #bd6b4a;
  --gold-2:    #d4886a;
  --gold-dim:  rgba(189, 107, 74, .12);
  --gold-line: rgba(189, 107, 74, .30);
  --on-gold:   #180b05;
}

/* 极光：第四套，也是唯一一套「有装饰」的。
   前三套都靠排版和横线立住，极光往现代代码站的语汇靠一档：深空紫黑底、
   紫青双色强调、玻璃顶栏、渐变标题、卡片内高光。布局尺寸一个不动，
   换过去只是换色温和装饰层，密排的骨架还在。
   紫是主强调（--gold 这个变量名是历史包袱），青只做渐变里的第二色。 */
html[data-theme="aurora"] {
  --bg:        #08070f;
  --bg-2:      #0b0913;
  --panel:     #100d1a;
  --panel-2:   #151122;
  --panel-3:   #1c1730;

  --line:      #241f3a;
  --line-soft: #1a162b;
  --line-hard: #332c4f;

  --text:      #e4e3f2;
  --text-2:    #b0aec9;
  --muted:     #837fa3;
  --muted-2:   #635f80;

  --gold:      #8b7cff;
  --gold-2:    #a396ff;
  --gold-dim:  rgba(139, 124, 255, .13);
  --gold-line: rgba(139, 124, 255, .34);
  --on-gold:   #0a0716;

  /* 语义色提亮一档：紫底会把红绿压灰，不提亮就看不出涨跌与成败 */
  --red:       #d9647a;
  --green:     #3fbf9b;
  --cyan:      #37d6c0;
  --blue:      #6d8bff;

  --e-gom42:   #d8b94a;
  --e-lf:      #3fbf9b;
  --e-996:     #5f8bff;
  --e-gomc:    #b0835e;

  /* 代码高亮换成冷色霓虹：暗紫底上暖色容易糊成一团 */
  --tok-kw:    #c4a6ff;
  --tok-cmd:   #7fd8e8;
  --tok-str:   #7ee0b0;
  --tok-num:   #ffb27a;
  --tok-var:   #f0a0d0;
}

/* 顶栏里的字号切换：三个小方块，当前档高亮 */
.fs-ctrl {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; flex-shrink: 0;
}
.fs-ctrl button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); padding: 0 7px;
  font-family: var(--mono); line-height: 1;
  height: calc(22px * var(--fs-scale));
  font-size: calc(11px * var(--fs-scale));
  transition: color .12s, background .12s;
}
.fs-ctrl button + button { border-left: 1px solid var(--line-soft); }
.fs-ctrl button:hover { color: var(--text); background: var(--panel-3); }
.fs-ctrl button[aria-pressed="true"] { color: var(--on-gold); background: var(--gold); font-weight: 700; }
.fs-ctrl .lbl { font-size: calc(9.5px * var(--fs-scale)); letter-spacing: .04em; }
.fs-ctrl .big { font-size: calc(13.5px * var(--fs-scale)); }

/* 配色：三个色点并排，点一下直接换，不用先展开再选。
   色点是图形不是文字，尺寸固定 px——跟着字号放大只会把顶栏挤爆。
   容器用直角分区而不是胶囊：胶囊圆角是「消费级 App」的语汇，这里是工具。 */
.theme-ctrl {
  display: inline-flex; align-items: stretch; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.theme-dot {
  appearance: none; cursor: pointer; padding: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: transparent; border: 0;
}
.theme-dot + .theme-dot { border-left: 1px solid var(--line-soft); }
.theme-dot i {
  width: 11px; height: 11px;
  border-radius: 50%; display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .3) inset;
}
.theme-dot:hover { background: var(--panel-3); }
.theme-dot[data-theme-pick="paper"] i { background: #fdfcfa; box-shadow: 0 0 0 1px #b5b1a5 inset; }
.theme-dot[data-theme-pick="jade"] i { background: #5b9bb5; }
.theme-dot[data-theme-pick="clay"] i { background: #bd6b4a; }
/* 极光是双色，色点也做成双色：单色圆点看不出它和赭石/青瓷的区别 */
.theme-dot[data-theme-pick="aurora"] i { background: conic-gradient(from 210deg, #8b7cff, #37d6c0, #8b7cff); }
/* 选中态靠底色块，不靠再叠一层描边——三个点本身就有颜色，加光环只会糊成一片 */
.theme-dot[aria-pressed="true"] { background: var(--panel-3); }
.theme-dot:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* 动效开关：一个波形图标，关掉时压一条斜杠。
   和色点同高同宽，用同一层细边框包起来——顶栏里不该出现第二个尺寸体系。
   尺寸写死 px 不跟字号缩放，理由和色点一样：跟着放大会挤爆顶栏。 */
.motion-ctrl {
  display: inline-flex; align-items: stretch; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.motion-btn {
  appearance: none; cursor: pointer; padding: 0;
  width: 24px; height: 20px; border: 0; background: transparent;
  display: grid; place-items: center; color: var(--muted);
  position: relative; transition: color .15s, background .15s;
}
.motion-btn:hover { background: var(--panel-3); color: var(--text); }
.motion-btn[aria-pressed="true"] { color: var(--gold); }
.motion-btn svg { display: block; stroke: currentColor; fill: none; stroke-width: 1.35; stroke-linecap: round; }
.motion-btn::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 50%;
  height: 1px; background: currentColor;
  transform: rotate(-45deg); opacity: 0; transition: opacity .15s;
}
html[data-motion="off"] .motion-btn { color: var(--muted-2); }
html[data-motion="off"] .motion-btn::after { opacity: .9; }
.motion-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.only-mobile { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: calc(13.5px * var(--fs-scale));
  /* 400：正文用常规字重。之前写 500，Windows 上英文数字会落到
     Segoe UI Semibold，整站看着像加粗；中文没有 500 档只会用常规，
     结果中英混排粗细还不一致。
     另外这里曾有一条 -webkit-text-stroke-width: .1px 给所有字形描边加粗，
     在 1.25/1.5 倍缩放的屏幕上会被取整成整像素，观感更接近 bold，已去掉。 */
  font-weight: 400;
  /* 1.72：中文字号放大后行距要跟着放，否则换行处会「粘」在一起，
     这是长时间阅读最先累的地方，比颜色更影响疲劳度 */
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }

/* 正文里的链接用下划线识别，不把颜色当唯一线索 —— 这是技术文档的惯例，
   也让「墨色主题下链接几乎和正文同色」这件事不再是问题 */
.msg-ai .body a,
.prose a,
.bill-note a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line-hard);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.msg-ai .body a:hover,
.prose a:hover,
.bill-note a:hover { color: var(--gold); text-decoration-color: var(--gold); }
/* 中文标题不加负字距：那是英文字体的排法，汉字会被挤得笔画粘连 */
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: 0; line-height: 1.35; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
/* 滚动条跟着主题走：白底上用深色滑块，暗色主题上靠 --line-hard 自动变浅 */
::-webkit-scrollbar-thumb { background: var(--muted-2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

::selection { background: var(--gold-line); }

/* ============================ 顶栏 ============================ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);   /* 必须跟着字号走，否则大字号下文字会被裁 */
  display: flex; align-items: center; gap: 20px;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-size: calc(14px * var(--fs-scale)); font-weight: 700; letter-spacing: .02em;
  color: var(--text);
}
.brand .logo {
  width: 22px; height: 22px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--gold); color: var(--on-gold);
  font-family: var(--sans); font-size: calc(13px * var(--fs-scale)); font-weight: 700;
  border-radius: var(--r);
}
/* 站名 8 个字，任何时候都不允许折行 */
.brand .brand-name { white-space: nowrap; }
.brand em {
  font-style: normal; font-size: calc(9.5px * var(--fs-scale)); font-weight: 700;
  letter-spacing: .1em; color: var(--muted);
  border: 1px solid var(--line-hard); border-radius: 2px;
  padding: 1px 4px; margin-left: 2px;
}

.topnav { display: flex; gap: 2px; margin-left: 8px; }
.topnav a { white-space: nowrap;
  font-size: calc(12.5px * var(--fs-scale)); color: var(--muted);
  padding: 5px 10px; border-radius: var(--r);
}
.topnav a:hover { color: var(--text); background: var(--panel-2); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: calc(32px * var(--fs-scale)); padding: 0 calc(13px * var(--fs-scale));
  font-family: inherit; font-size: calc(12.5px * var(--fs-scale)); font-weight: 600;
  color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--line-hard);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--line-hard); color: var(--text); }
.btn:active { background: var(--line-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
  background: var(--gold); border-color: var(--gold);
  color: var(--on-gold); font-weight: 700;
}
.btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); color: var(--on-gold); }
.btn.primary:active { background: var(--gold-2); border-color: var(--gold-2); }

.btn.ghost { background: transparent; border-color: var(--line-hard); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: calc(27px * var(--fs-scale)); padding: 0 calc(9px * var(--fs-scale)); font-size: calc(12px * var(--fs-scale)); }
.btn.block { display: flex; width: 100%; }
.btn.danger { color: var(--red); border-color: rgba(176, 58, 44, .35); }
.btn.danger:hover { background: rgba(176, 58, 44, .08); border-color: rgba(176, 58, 44, .55); color: var(--red); }

/* ============================ 引擎条 ============================ */
.engbar {
  display: flex; align-items: stretch; gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.engbar::-webkit-scrollbar { display: none; }

.engtab {
  position: relative;
  display: flex; flex-direction: column; gap: 1px;
  flex: none;            /* 引擎条本身可横向滚动，别让卡片被挤到换行 */
  padding: 9px 18px;
  border: 0; border-right: 1px solid var(--line-soft);
  background: transparent; cursor: pointer;
  text-align: left; font-family: inherit;
  min-width: 150px;
  transition: background .12s;
}
.engtab::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: transparent;
}
.engtab:hover { background: var(--panel); }
.engtab.on { background: var(--panel); }
.engtab.on::before { background: var(--ec, var(--gold)); }

.engtab .n {
  font-size: calc(12.5px * var(--fs-scale)); font-weight: 700; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.engtab.on .n { color: var(--text); }
.engtab .v {
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
  letter-spacing: .01em; white-space: nowrap;
}
.engtab .c {
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale)); color: var(--muted-2);
  white-space: nowrap;
}
.engbar-hint {
  margin-left: auto; display: flex; align-items: center; gap: 4px;
  padding: 0 18px; font-size: calc(11.5px * var(--fs-scale)); color: var(--muted-2);
  white-space: nowrap; border-left: 1px solid var(--line-soft);
}
.engbar-hint b { color: var(--text-2); font-weight: 700; }
.engtab .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ec, var(--gold)); flex: none;
}

/* ============================ 布局 ============================ */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.section { padding: 30px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

/* 章节编号：像手册那样给每一节一个号。全是同字号的 17px 标题时，
   读者翻下来分不清自己在第几节；一枚等宽小号数字就能提供定位感 */
#landing { counter-reset: sec; }
#landing > .section:not(#engines) { counter-increment: sec; }
#landing .section-head h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale));
  font-weight: 400; letter-spacing: .06em; color: var(--muted-2);
  margin-right: 9px; vertical-align: 3px;
}

.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: calc(17px * var(--fs-scale)); font-weight: 700; color: var(--text); }
.section-head p { margin: 5px 0 0; font-size: calc(12.8px * var(--fs-scale)); color: var(--muted); max-width: 720px; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale)); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line-hard); border-radius: 2px;
  padding: 2px 6px; margin-bottom: 14px;
}

/* ============================ 首屏 ============================ */
.hero { padding: 34px 0 30px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: 40px; align-items: start;
}

.hero h1 {
  font-size: calc(26px * var(--fs-scale)); font-weight: 700; line-height: 1.42;
  /* 中文字距不能像英文那样收：-.01em 会让笔画挤在一起，标题越大越明显 */
  letter-spacing: 0; margin: 0 0 15px;
  color: var(--text);
}
/* 标题不做渐变字、不做下划线高亮。技术手册的标题靠排版立住，
   任何「强调处理」都会把它推向营销页 */
.hero h1 .grad, .hero h1 .hl { color: inherit; }
.hero .lead {
  font-size: calc(13.5px * var(--fs-scale)); line-height: 1.8; color: var(--text-2);
  margin: 0 0 20px; max-width: 520px;
}
.hero .lead b { color: var(--text); font-weight: 700; }

.hero-cta { display: flex; gap: 9px; align-items: center; margin-bottom: 12px; }
.hero-cta .btn { height: calc(36px * var(--fs-scale)); padding: 0 calc(16px * var(--fs-scale)); font-size: calc(13px * var(--fs-scale)); }

.hero-note {
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--muted-2);
  letter-spacing: .01em;
}

.stat-row {
  display: flex; gap: 0; margin-top: 26px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.stat-row > div {
  flex: 1; padding-right: 18px;
  font-size: calc(11px * var(--fs-scale)); color: var(--muted-2); line-height: 1.5;
  border-right: 1px solid var(--line-soft);
}
.stat-row > div:last-child { border-right: 0; }
.stat-row > div b {
  display: block; font-family: var(--mono); font-size: calc(17px * var(--fs-scale));
  color: var(--text); font-weight: 700; margin-bottom: 2px;
}

/* 代码窗 */
.codewin {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.codewin-bar {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
/* 用一个「示例」标签代替三个窗口圆点：macOS 红黄绿是拟物残留，
   和这套界面的其他语汇（等宽编号、表格线、方角）不是一套东西 */
.codewin-bar .tag {
  font-family: var(--mono); font-size: calc(9.5px * var(--fs-scale));
  letter-spacing: .08em; color: var(--muted);
  border: 1px solid var(--line-hard); border-radius: 2px;
  padding: 0 4px; line-height: 1.5; flex: none;
}
.codewin-bar .file {
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale));
  color: var(--muted-2); letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.codewin pre {
  margin: 0; padding: 14px 15px 16px;
  font-size: calc(11.8px * var(--fs-scale)); line-height: 1.75; color: var(--text-2);
  overflow-x: auto;
}
.codewin .price-tag {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale));
  color: var(--text-2); background: var(--panel-3);
  border: 1px solid var(--line-hard); border-radius: 2px;
  padding: 2px 7px;
}

.tok-kw  { color: var(--tok-kw); }
.tok-cmd { color: var(--tok-cmd); }
.tok-str { color: var(--tok-str); }
.tok-num { color: var(--tok-num); }
.tok-dim { color: var(--muted-2); }
.tok-var { color: var(--tok-var); }

/* ============================ 引擎详情 ============================ */
.engdetail {
  display: grid; grid-template-columns: 1fr 340px; gap: 26px;
  padding: 22px 0 6px;
}
.engdetail-main h3 {
  font-size: calc(15px * var(--fs-scale)); font-weight: 700; margin-bottom: 3px;
  display: flex; align-items: center; gap: 9px;
}
.engdetail-main h3 .tag {
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale)); font-weight: 500;
  color: var(--muted); border: 1px solid var(--line-hard);
  padding: 1px 5px; border-radius: 2px; letter-spacing: .04em;
}
.engdetail-main .ver {
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--muted-2);
  margin-bottom: 12px;
}
.engdetail-main p {
  font-size: calc(13px * var(--fs-scale)); line-height: 1.8; color: var(--text-2);
  margin: 0 0 16px; max-width: 620px;
}

.trait-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.trait {
  font-size: calc(11.5px * var(--fs-scale)); color: var(--text-2);
  border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 2px;
}

.startnote {
  border-left: 2px solid var(--line-hard);
  padding: 2px 0 2px 13px;
  font-size: calc(12.5px * var(--fs-scale)); color: var(--muted); line-height: 1.75;
}

/* 键值表不套外框：数字贴右边缘、上下用横线夹住就够了。
   加了边框和底色，它就从「规格表」变成「数据卡片」 */
.engstat {
  align-self: start;
  border-top: 1px solid var(--line);
}
.engstat .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
  font-size: calc(12px * var(--fs-scale)); color: var(--muted);
}
.engstat .row:last-child { border-bottom: 1px solid var(--line); }
.engstat .row b {
  font-family: var(--mono); font-size: calc(13px * var(--fs-scale)); color: var(--text);
  font-weight: 700;
}

/* ============================ 特性（表格化） ============================ */
/* 三列表格，不是三张卡片：去掉外框、圆角、底色，只留横线和内部竖线。
   一旦有外框 + 底色，它立刻变成「功能卡片网格」——那是落地页的语汇 */
.feat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;   /* 两行等高，不然第二行会比第一行矮一截 */
  border-top: 1px solid var(--line);
}
.feat {
  padding: 15px 22px 17px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
/* 首列与标题左边缘对齐，末列不贴右边框 */
.feat:nth-child(3n+1) { padding-left: 0; }
.feat:nth-child(3n) { padding-right: 0; border-right: 0; }
.feat:nth-last-child(-n+3) { border-bottom: 0; }
.feat .ico {
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--gold);
  margin-bottom: 9px; letter-spacing: .04em;
}
.feat h3 { font-size: calc(13px * var(--fs-scale)); font-weight: 700; margin-bottom: 6px; color: var(--text); }
.feat p { margin: 0; font-size: calc(12.2px * var(--fs-scale)); line-height: 1.75; color: var(--muted); }
/* 卡片里的「比如……」：左边一条细线，和正文拉开层次，不抢主句 */
.feat p.eg {
  margin-top: 9px; padding-left: 9px; border-left: 1px solid var(--line-hard);
  font-size: calc(11.6px * var(--fs-scale)); color: var(--muted-2);
}
.feat code {
  font-size: calc(11.3px * var(--fs-scale)); color: var(--text-2);
  background: var(--panel-3); padding: 1px 4px; border-radius: 2px;
}

/* ============================ 检索 ============================ */
.kbdemo { max-width: 860px; }
.kbdemo-box {
  display: flex; gap: 0; align-items: stretch;
  border: 1px solid var(--line-hard); border-radius: var(--r);
  background: var(--panel); overflow: hidden;
  max-width: 720px;
}
.kbdemo-box input {
  flex: 1; height: 38px; padding: 0 13px;
  background: transparent; border: 0; outline: none;
  color: var(--text); font-family: var(--mono); font-size: calc(12.5px * var(--fs-scale));
}
.kbdemo-box input::placeholder { color: var(--muted-2); }
.kbdemo-box .btn {
  border: 0; border-left: 1px solid var(--line); border-radius: 0;
  height: auto; padding: 0 18px; font-size: calc(12.5px * var(--fs-scale));
}

.kbdemo-hints { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 16px; }
.chip {
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 2px; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.chip:hover { color: var(--gold); border-color: var(--gold-line); }

.kb-results { display: flex; flex-direction: column; margin-top: 4px; }
.kb-hit {
  border: 1px solid var(--line-soft); border-radius: var(--r);
  background: var(--panel); padding: 12px 14px;
  margin-bottom: 7px;
}
.kb-hit:hover { border-color: var(--line-hard); }
.kb-hit .h {
  display: flex; align-items: baseline; gap: 9px; margin-bottom: 6px;
}
.kb-hit .h b { font-size: calc(12.8px * var(--fs-scale)); font-weight: 700; color: var(--text); }
.kb-hit .h .src {
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale)); color: var(--muted-2);
  border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px;
}
.kb-hit .txt {
  font-size: calc(12px * var(--fs-scale)); line-height: 1.75; color: var(--muted);
  white-space: pre-wrap; word-break: break-word;
  max-height: 116px; overflow: hidden;
  font-family: var(--mono);
}
.kb-hit .txt b { color: var(--text-2); font-weight: 700; font-family: var(--sans, inherit); }
.kb-hit .txt code {
  font-family: var(--mono); font-size: calc(11.5px * var(--fs-scale)); color: #c8b273;
  background: #171a1f; border: 1px solid var(--line-soft); border-radius: 2px; padding: 0 3px;
}

/* ============================ 计费 ============================ */
.price-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.price-card {
  background: var(--panel); padding: 17px 18px;
}
.price-card h4 { font-size: calc(12.5px * var(--fs-scale)); color: var(--text-2); font-weight: 700; margin-bottom: 3px; }
.price-card .p {
  font-family: var(--mono); font-size: calc(19px * var(--fs-scale)); color: var(--text);
  font-weight: 700; margin: 8px 0 3px;
}
.price-card .p small { font-size: calc(11px * var(--fs-scale)); color: var(--muted); font-weight: 400; }
.price-card ul { margin: 10px 0 0; padding: 0; list-style: none; }
.price-card li {
  font-size: calc(11.8px * var(--fs-scale)); color: var(--muted); padding: 3px 0;
  border-top: 1px solid var(--line-soft);
}
.price-card li:first-child { border-top: 0; }

/* 注释块统一成「左侧一条竖线」：和 .startnote 同一套语汇，
   比套一个边框盒子更像手册页边的批注 */
.bill-note {
  margin-top: 18px; padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line-hard);
  font-size: calc(11.8px * var(--fs-scale)); line-height: 1.85; color: var(--muted);
  font-family: var(--mono);
}
.bill-note code { color: var(--text-2); }

/* ============================ 控制台 ============================ */
.app {
  display: grid; grid-template-columns: 178px minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h) - var(--engbar-h));
}

.rail {
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  padding: 12px 0;
  display: flex; flex-direction: column;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h) - var(--engbar-h));
}
.navitem {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 14px; font-size: calc(12.5px * var(--fs-scale)); color: var(--muted);
  cursor: pointer; border-left: 2px solid transparent;
}
/* 白底主题下 --panel 和 --bg 都是白，激活态必须换个底色才看得出来 */
.navitem:hover { color: var(--text-2); background: var(--panel-2); }
.navitem.active {
  color: var(--text); background: var(--panel-3);
  border-left-color: var(--gold);
  font-weight: 700;
}
.navitem .i {
  width: 15px; height: 15px; display: flex; align-items: center; justify-content: center;
  color: var(--muted-2); flex: none;
}
.navitem .i svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round;
}
.navitem.active .i { color: var(--gold); }
.rail .spacer { flex: 1; }
.rail-foot {
  padding: 10px 14px 0; border-top: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--muted-2);
}

.stage { min-width: 0; background: var(--bg); }
.view { padding: 24px 26px 40px; }
.view-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.view-head h2 { font-size: calc(17px * var(--fs-scale)); font-weight: 700; }
.view-head p { margin: 4px 0 0; font-size: calc(12.3px * var(--fs-scale)); color: var(--muted); }

/* 工作台三栏 */
.wb {
  display: grid; grid-template-columns: 208px minmax(0, 1fr) 268px;
  height: calc(100vh - var(--topbar-h) - var(--engbar-h));
}

.chatlist {
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; flex-direction: column; min-height: 0;
}
.chatlist-head { padding: 10px; border-bottom: 1px solid var(--line-soft); }
.chatlist-body { flex: 1; overflow-y: auto; padding: 6px; }

.chat-item {
  padding: 7px 9px; border-radius: var(--r);
  font-size: calc(12.2px * var(--fs-scale)); color: var(--muted);
  cursor: pointer; margin-bottom: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
.chat-item:hover { background: var(--panel-2); color: var(--text-2); }
.chat-item.active {
  background: var(--panel-3); color: var(--text);
  border-left-color: var(--gold);
}
.chat-item .eng-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.chat-item .t { vertical-align: middle; }
.chat-item .x {
  float: right; color: transparent; font-size: calc(10px * var(--fs-scale));
  padding: 0 2px; line-height: 1.9;
}
.chat-item:hover .x { color: var(--muted-2); }
.chat-item .x:hover { color: var(--red); }

.chatmain { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-top {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 6px 16px;
  border-bottom: 1px solid var(--line);
  flex: none; flex-wrap: wrap;
}
.chat-top .title {
  font-size: calc(12.5px * var(--fs-scale)); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 20px 8px; display: flex; flex-direction: column; }
#messages { flex: none; }

.chat-empty { width: 100%; max-width: 660px; margin: auto; }
.chat-empty .big {
  font-size: calc(17px * var(--fs-scale)); font-weight: 700; color: var(--text);
  margin-bottom: 5px;
}
.chat-empty .sub { font-size: calc(12.5px * var(--fs-scale)); color: var(--muted); margin-bottom: 22px; }

/* 起始提示做成「格子」而不是「卡片」：卡片有外框和圆角，
   一出现就在说「这是一个可点击的功能模块」。这里只是四个入口，横竖线足够 */
.prompt-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.prompt-card {
  background: var(--bg); padding: 12px 13px;
  cursor: pointer; transition: background .12s;
}
.prompt-card:hover { background: var(--panel-2); }
.prompt-card b {
  display: block; font-size: calc(12.4px * var(--fs-scale)); font-weight: 700;
  color: var(--text-2); margin-bottom: 3px;
}
.prompt-card span { font-size: calc(11.4px * var(--fs-scale)); color: var(--muted-2); line-height: 1.6; }

/* 消息 */
.msg { margin-bottom: 20px; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  max-width: 78%;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 13px;
  font-size: calc(13px * var(--fs-scale)); line-height: 1.75; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.msg-ai { max-width: 100%; }
.msg-ai .who {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
  margin-bottom: 7px; letter-spacing: .04em;
}
.msg-ai .who .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.msg-ai .who .eng {
  font-style: normal; color: var(--muted);
  border-left: 1px solid var(--line-hard); padding-left: 8px; margin-left: 2px;
}
.msg-ai .body {
  font-size: calc(13px * var(--fs-scale)); line-height: 1.85; color: var(--text-2);
  word-break: break-word;
}
.msg-ai .body p { margin: 0 0 10px; }
.msg-ai .body ul, .msg-ai .body ol { margin: 0 0 10px; padding-left: 20px; }
.msg-ai .body li { margin: 3px 0; }
.msg-ai .body strong { color: var(--text); font-weight: 700; }
.msg-ai .body h1, .msg-ai .body h2, .msg-ai .body h3 {
  font-size: calc(14px * var(--fs-scale)); margin: 16px 0 8px; color: var(--text);
}
.msg-ai .body table {
  border-collapse: collapse; margin: 10px 0; font-size: calc(12.2px * var(--fs-scale)); width: 100%;
}
.msg-ai .body th, .msg-ai .body td {
  border: 1px solid var(--line); padding: 5px 9px; text-align: left;
}
.msg-ai .body th { background: var(--panel-2); color: var(--text-2); font-weight: 700; }
.msg-ai .body code {
  font-size: calc(11.8px * var(--fs-scale)); background: var(--panel-3);
  padding: 1px 4px; border-radius: 2px; color: var(--text-2);
}
.msg-ai .body blockquote {
  margin: 10px 0; padding: 8px 12px;
  border-left: 2px solid var(--line-hard);
  background: var(--panel); color: var(--muted);
  font-size: calc(12.2px * var(--fs-scale));
}

/* 代码块 */
/* 代码块比纸面深一档：它是嵌进正文的清单，不是浮在页面上的卡片 */
.codeblock {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); margin: 11px 0; overflow: hidden;
}
.codeblock-head {
  display: flex; align-items: center; gap: 10px;
  height: 29px; padding: 0 11px;
  background: var(--panel-3); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
}
.codeblock-head .grow { flex: 1; }
.codeblock-head button {
  height: 21px; padding: 0 8px; font-size: calc(11px * var(--fs-scale));
  background: transparent; color: var(--muted);
  border: 1px solid var(--line-hard); border-radius: 2px;
  cursor: pointer; font-family: var(--sans);
}
.codeblock-head button:hover { color: var(--gold); border-color: var(--gold-line); }
.codeblock pre {
  margin: 0; padding: 12px 13px; overflow-x: auto;
  font-size: calc(11.9px * var(--fs-scale)); line-height: 1.75; color: var(--text-2);
}

/* 思维链 */
.think {
  margin: 0 0 11px; border: 1px solid var(--line-soft);
  border-radius: var(--r); background: var(--panel); overflow: hidden;
}
.think > summary {
  cursor: pointer; list-style: none; padding: 7px 11px;
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
  user-select: none;
}
.think > summary::-webkit-details-marker { display: none; }
.think > summary::before { content: '▸ '; color: var(--gold); }
.think[open] > summary::before { content: '▾ '; }
.think-body {
  padding: 9px 11px 11px; font-size: calc(12px * var(--fs-scale)); line-height: 1.75;
  color: var(--muted); white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow: auto;
  border-top: 1px solid var(--line-soft); font-family: var(--mono);
}

.cursor-blink {
  display: inline-block; width: 6px; height: 13px;
  background: var(--gold); vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 输入区 */
.composer { padding: 10px 16px 14px; border-top: 1px solid var(--line); flex: none; }
.composer-box {
  display: flex; align-items: flex-end; gap: 7px;
  border: 1px solid var(--line-hard); border-radius: var(--r);
  background: var(--panel); padding: 7px 8px;
}
.composer-box:focus-within { border-color: var(--gold-line); }
.composer-box textarea {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--text); font-family: inherit; font-size: calc(13px * var(--fs-scale)); line-height: 1.65;
  resize: none; max-height: 190px; padding: 4px 2px;
}
.composer-box textarea::placeholder { color: var(--muted-2); }

.attach-btn {
  width: 26px; height: 26px; flex: none;
  background: transparent; border: 1px solid var(--line-hard);
  border-radius: 2px; color: var(--muted); cursor: pointer;
  font-size: calc(15px * var(--fs-scale)); line-height: 1; display: grid; place-items: center;
}
.attach-btn:hover { color: var(--gold); border-color: var(--gold-line); }

.send-btn {
  width: 28px; height: 28px; flex: none;
  background: var(--gold); border: 0; border-radius: 2px;
  color: var(--on-gold); font-size: calc(14px * var(--fs-scale)); font-weight: 700;
  cursor: pointer; display: grid; place-items: center;
}
.send-btn:hover { background: var(--gold-2); }
.send-btn:disabled { opacity: .4; cursor: not-allowed; }

.composer-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 7px; font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
  font-family: var(--mono);
}

.attach-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.attach-item {
  position: relative; width: 52px; height: 52px;
  border: 1px solid var(--line-hard); border-radius: 2px;
  overflow: hidden; background: var(--panel-2);
}
.attach-item img { width: 100%; height: 100%; object-fit: cover; }
.attach-del {
  position: absolute; top: 1px; right: 1px;
  width: 15px; height: 15px; border: 0; border-radius: 2px;
  background: rgba(0,0,0,.75); color: #fff;
  font-size: calc(11px * var(--fs-scale)); line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.attach-loading {
  display: grid; place-items: center; height: 100%;
  font-size: calc(10px * var(--fs-scale)); color: var(--muted-2);
}

.bubble-imgs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; }
.bubble-img {
  width: 108px; height: 108px; object-fit: cover;
  border: 1px solid var(--line-hard); border-radius: 2px; cursor: zoom-in;
}

/* 右栏 */
.refs {
  border-left: 1px solid var(--line);
  background: var(--bg-2);
  overflow-y: auto;
}
.refs .sec { border-bottom: 1px solid var(--line-soft); padding: 13px 14px; }
.refs .sec h4 {
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale)); font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 9px;
}
.empty-hint {
  font-size: calc(11.5px * var(--fs-scale)); color: var(--muted-2); line-height: 1.8;
}

.meter { display: flex; flex-direction: column; }
.meter .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: calc(11.5px * var(--fs-scale)); color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.meter .row:last-child { border-bottom: 0; }
.meter .row b {
  font-family: var(--mono); font-size: calc(11.8px * var(--fs-scale)); color: var(--text-2); font-weight: 500;
}
.meter .row.total b { color: var(--gold); font-size: calc(12.5px * var(--fs-scale)); }

.ref-item {
  padding: 7px 0; border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.ref-item:last-child { border-bottom: 0; }
.ref-item .t {
  font-size: calc(11.8px * var(--fs-scale)); color: var(--text-2); line-height: 1.5;
  margin-bottom: 2px;
}
.ref-item .m {
  font-family: var(--mono); font-size: calc(10px * var(--fs-scale)); color: var(--muted-2);
  display: flex; gap: 7px;
}
.ref-item:hover .t { color: var(--gold); }

/* ============================ 表格 ============================ */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r);
}
table.data { width: 100%; border-collapse: collapse; font-size: calc(12.2px * var(--fs-scale)); }
table.data th {
  text-align: left; font-weight: 700; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  font-size: calc(11.5px * var(--fs-scale)); background: var(--panel-2);
  white-space: nowrap;
}
table.data td {
  padding: 8px 12px; border-bottom: 1px solid var(--line-soft);
  color: var(--text-2); vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--panel-2); }
table.data .mono { font-family: var(--mono); font-size: calc(11.5px * var(--fs-scale)); }

/* ========================== 作品库（按引擎分组） ========================== */
.works-dir {
  margin: -4px 0 16px; padding: 9px 12px;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--r); line-height: 1.9;
}
.works-dir code {
  background: var(--panel-3); border-radius: 4px; padding: 1px 6px;
  color: var(--text-2); font-size: calc(11px * var(--fs-scale));
}
.work-group { margin-bottom: 20px; }
.work-group:last-child { margin-bottom: 0; }
.wg-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 9px; padding: 0 2px;
}
.wg-head h3 {
  margin: 0; font-size: calc(13.4px * var(--fs-scale));
  font-weight: 700; letter-spacing: .01em; color: var(--text);
}
.wg-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ec, var(--muted));
  /* 用中性灰而不是纯白：白底主题下纯白光晕直接消失 */
  box-shadow: 0 0 0 3px rgba(127, 127, 127, .16);
  flex-shrink: 0;
}
.wg-n {
  font-size: calc(11px * var(--fs-scale)); color: var(--muted-2);
  font-family: var(--mono);
}
.wg-dl { margin-left: auto; }

/* ============================ 表单 ============================ */
.field { margin-bottom: 12px; }
.field label {
  display: block; font-size: calc(11.5px * var(--fs-scale)); color: var(--muted);
  margin-bottom: 5px; letter-spacing: .01em;
}
.input, .select, .textarea {
  width: 100%; height: 33px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line-hard);
  border-radius: var(--r); color: var(--text);
  font-family: inherit; font-size: calc(12.8px * var(--fs-scale)); outline: none;
  transition: border-color .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold-line); }
.input::placeholder { color: var(--muted-2); }
.input.mono { font-family: var(--mono); font-size: calc(12.3px * var(--fs-scale)); }
.textarea { height: auto; padding: 8px 10px; resize: vertical; }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='6'%3E%3Cpath d='M0 0l4.5 6L9 0z' fill='%237c838f'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 26px;
}
.hint { font-size: calc(11px * var(--fs-scale)); color: var(--muted-2); margin-top: 4px; line-height: 1.6; }

/* ============================ 弹窗 ============================ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  /* 遮罩深度按白底站调：太黑会像切到了另一个网站 */
  background: rgba(16, 19, 24, .46);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-box {
  position: relative;
  width: 100%; max-width: 360px;
  background: var(--panel); border: 1px solid var(--line-hard);
  border-radius: var(--r); padding: 24px 22px 22px;
}
.modal-close {
  position: absolute; top: 10px; right: 12px;
  background: transparent; border: 0; color: var(--muted-2);
  font-size: calc(19px * var(--fs-scale)); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.tabs {
  display: flex; gap: 0; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1; height: 33px; background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-family: inherit; font-size: calc(13px * var(--fs-scale));
  cursor: pointer; margin-bottom: -1px;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--gold); }

/* ============================ 其他 ============================ */
.points-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--mono); font-size: calc(11.5px * var(--fs-scale)); color: var(--muted);
}
.points-chip b { color: var(--gold); font-weight: 700; }

.avatar {
  width: 27px; height: 27px; border-radius: var(--r);
  background: var(--panel-3); border: 1px solid var(--line-hard);
  color: var(--text-2); font-size: calc(12px * var(--fs-scale)); cursor: pointer;
  display: grid; place-items: center; font-family: var(--sans); font-weight: 700;
}
.avatar:hover { border-color: var(--gold-line); color: var(--gold); }

.balance-card {
  display: flex; align-items: flex-end; gap: 20px;
  padding: 18px 20px; margin-bottom: 18px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r);
}
.balance-card .lbl { font-size: calc(11.5px * var(--fs-scale)); color: var(--muted); margin-bottom: 3px; }
.balance-card .big {
  font-family: var(--mono); font-size: calc(27px * var(--fs-scale)); font-weight: 700;
  color: var(--gold); line-height: 1;
}

.charge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* 余额 + 兑换合成一张卡：左边积分、右边卡密，中间一条竖线。
   拆掉在线充值后只剩一张表单，做成两张卡会有一张明显是空的 */
.credit-top {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  padding: 0; margin-bottom: 18px; overflow: hidden;
}
.credit-balance {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 24px 26px; border-right: 1px solid var(--line-soft);
}
.credit-balance .lbl { font-size: calc(12px * var(--fs-scale)); color: var(--muted); letter-spacing: .02em; }
.credit-balance .big {
  font-family: var(--mono); font-size: calc(38px * var(--fs-scale));
  font-weight: 700; color: var(--gold); line-height: 1.05;
}
.credit-stats { font-size: calc(11.5px * var(--fs-scale)); color: var(--muted); line-height: 1.95; margin-top: 6px; }
.credit-form { padding: 20px 22px; }
.credit-form h3 { font-size: calc(13.5px * var(--fs-scale)); font-weight: 700; margin-bottom: 12px; }
@media (max-width: 900px) {
  /* minmax(0,1fr) 而不是 1fr：1fr 的下限是内容的 min-content，
     购卡条里那条 nowrap 的链接会把整列顶到 429px，卡片被撑出屏幕 */
  .credit-top { grid-template-columns: minmax(0, 1fr); }
  .credit-balance { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

/* ---- 推广页：左边链接，右边四格数字，跟卡密页同一套骨架 ---- */
.ref-top {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  padding: 0; margin-bottom: 18px; overflow: hidden;
}
.ref-link { padding: 22px 26px; border-right: 1px solid var(--line-soft); min-width: 0; }
.ref-link .lbl { font-size: calc(12px * var(--fs-scale)); color: var(--muted); letter-spacing: .02em; margin-bottom: 8px; }
.ref-url {
  font-size: calc(13px * var(--fs-scale)); color: var(--gold);
  background: var(--gold-dim); border: 1px solid var(--gold-line);
  padding: 9px 11px; border-radius: var(--r);
  word-break: break-all; line-height: 1.6;
}
.ref-actions { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.ref-stat { display: flex; flex-direction: column; gap: 9px; padding: 22px 24px; }
.ref-kv {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: calc(12px * var(--fs-scale)); color: var(--muted);
}
.ref-kv b { font-family: var(--mono); font-size: calc(15px * var(--fs-scale)); color: var(--text); }
@media (max-width: 900px) {
  .ref-top { grid-template-columns: minmax(0, 1fr); }
  .ref-link { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

/* ---- 购卡入口：卡号输入框上方的一条，左侧粗线标出来源 ---- */
.buybar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid var(--gold-line); border-left: 2px solid var(--gold);
  background: var(--gold-dim); border-radius: var(--r);
}
.buybar-main { flex: 1; min-width: 0; }
.buybar-k { font-size: calc(11.2px * var(--fs-scale)); color: var(--muted); margin-bottom: 3px; }
.buybar-url {
  display: block; font-family: var(--mono); font-size: calc(12px * var(--fs-scale));
  color: var(--gold); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.buybar-url:hover { color: var(--gold-2); text-decoration: underline; }
.buybar .btn { flex: none; height: calc(25px * var(--fs-scale)); }

/* ---- 联系方式：键值表，不用名片样式（无图标、无头像、无投影） ---- */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  border-top: 1px solid var(--line);
}
.ccell {
  padding: 13px 22px 14px; min-width: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.ccell:first-child { padding-left: 0; }
.ccell:last-child { border-right: 0; padding-right: 0; }
.ccell .ck {
  font-family: var(--mono); font-size: calc(10.5px * var(--fs-scale));
  letter-spacing: .08em; color: var(--muted-2); margin-bottom: 6px;
}
.ccell .cv {
  font-size: calc(13.5px * var(--fs-scale)); color: var(--text);
  line-height: 1.6; word-break: break-all;
}
.ccell .cv a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-line); }
.ccell .cv a:hover { color: var(--gold-2); border-bottom-color: var(--gold); }
.ccell .cbtn { margin-top: 9px; }

.clist { border-top: 1px solid var(--line-soft); }
.citem {
  display: flex; align-items: baseline; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line-soft);
}
.citem:last-child { border-bottom: 0; }
.citem .ck {
  flex: none; width: 4.9em; white-space: nowrap;
  font-family: var(--mono); font-size: calc(10.6px * var(--fs-scale));
  letter-spacing: .04em; color: var(--muted-2);
}
.citem .cv {
  flex: 1; min-width: 0;
  font-size: calc(13px * var(--fs-scale)); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.citem .cv a { color: var(--gold); text-decoration: none; }
.citem .cv a:hover { text-decoration: underline; }

.cbtn {
  flex: none; padding: 1px 8px;
  font-family: var(--mono); font-size: calc(10.6px * var(--fs-scale)); color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 2px;
  cursor: pointer; transition: color .12s, border-color .12s;
}
.cbtn:hover { color: var(--gold); border-color: var(--gold-line); }
.cbtn.done { color: var(--green); border-color: var(--green); }

/* 卡密页的「联系站长」：左标题右键值，和上面那张卡的 400px 右栏对齐 */
.contact-card {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px; align-items: start;
  margin-top: 18px; padding: 20px 22px;
}
.contact-card-head h3 { font-size: calc(13px * var(--fs-scale)); font-weight: 700; margin-bottom: 6px; }
.contact-card-head p { line-height: 1.75; }
@media (max-width: 900px) {
  .contact-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* 工作台右栏只有 268px：标签收窄，值超长省略 */
.clist.compact { border-top: 0; }
.compact .citem { padding: 6px 0; gap: 8px; }
.compact .citem .ck { width: 2.9em; min-width: 0; }
.compact .citem .cv { font-size: calc(11.6px * var(--fs-scale)); }
.compact .cbtn { padding: 0 5px; font-size: calc(9.8px * var(--fs-scale)); }

/* 空会话里的兜底提示：只在右栏被隐藏的窄屏出现，宽屏重复没必要 */
.empty-contact {
  display: none;
  margin-top: 18px; text-align: center;
  font-size: calc(11.5px * var(--fs-scale)); color: var(--muted-2); line-height: 1.9;
}
@media (max-width: 1100px) {
  .empty-contact:not([hidden]) { display: block; }
}
.empty-contact a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-line); }

.charge-panel { padding: 18px 20px; }
.charge-panel h3 { font-size: calc(13.5px * var(--fs-scale)); font-weight: 700; margin-bottom: 14px; }

.amount-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.amt-chip {
  padding: 5px 13px; font-family: var(--mono); font-size: calc(12px * var(--fs-scale));
  background: var(--panel-2); border: 1px solid var(--line-hard);
  border-radius: var(--r); color: var(--text-2); cursor: pointer;
}
.amt-chip:hover { border-color: var(--gold-line); }
.amt-chip.on { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }

.quote {
  margin-top: 12px; padding: 9px 12px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--r); font-size: calc(12px * var(--fs-scale)); color: var(--muted);
}
.quote b { font-family: var(--mono); color: var(--gold); font-size: calc(14px * var(--fs-scale)); }

.channel-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.channel-picker label {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: calc(12.3px * var(--fs-scale));
  border: 1px solid var(--line-hard); border-radius: var(--r);
  cursor: pointer; color: var(--muted);
}
.channel-picker input { accent-color: var(--gold); }
.channel-picker label:has(input:checked) { border-color: var(--gold); color: var(--text); }

.empty, .empty.tiny {
  padding: 30px 18px; text-align: center;
  color: var(--muted-2); font-size: calc(12px * var(--fs-scale));
}
.empty .i { font-size: calc(20px * var(--fs-scale)); margin-bottom: 8px; color: var(--line-hard); }

#toast {
  position: fixed; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  z-index: 300; pointer-events: none;
}
.toast {
  padding: 8px 15px; border-radius: var(--r);
  background: var(--panel-3); border: 1px solid var(--line-hard);
  color: var(--text); font-size: calc(12.3px * var(--fs-scale));
  animation: toastIn .16s ease-out;
}
.toast.ok { border-left: 2px solid var(--green); }
.toast.err { border-left: 2px solid var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

.muted { color: var(--muted); }
.tiny { font-size: calc(11.5px * var(--fs-scale)); }
.small { font-size: calc(12.3px * var(--fs-scale)); }
.gold { color: var(--gold); }
.mono-num { font-family: var(--mono); font-size: calc(12px * var(--fs-scale)); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.kpi { background: var(--panel); padding: 13px 15px; }
.kpi .l { font-size: calc(11px * var(--fs-scale)); color: var(--muted); margin-bottom: 4px; }
.kpi .v { font-family: var(--mono); font-size: calc(17px * var(--fs-scale)); color: var(--text); font-weight: 700; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 88px; padding-top: 8px; position: relative; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: calc(11.5px * var(--fs-scale)); color: var(--muted-2);
  border-top: 1px dashed var(--line-soft);
}
.chart .bar {
  flex: 1; display: flex; align-items: flex-end; gap: 1px;
  height: 100%; min-height: 2px; position: relative;
}
/* 每天两根细柱：i = 收入，s = 模型成本。二者都是行内元素，
   必须显式 display:block，否则 height 百分比不生效、柱子不可见 */
.chart .bar i, .chart .bar s {
  flex: 1; display: block; min-height: 1px;
  border-radius: 1px 1px 0 0; text-decoration: none;
}
.chart .bar i { background: var(--gold); }
.chart .bar s { background: var(--muted-2); opacity: .6; }
.chart .bar:hover i { background: var(--gold-2); }
.chart .bar:hover s { opacity: .95; }
.chart-x { display: flex; gap: 4px; margin-top: 5px; font-family: var(--mono); font-size: calc(9px * var(--fs-scale)); color: var(--muted-2); }
.chart-x span { flex: 1; text-align: center; }
/* 图表图例：不写这条，两个 span 会挨成「充值收入模型成本」一串 */
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  margin-top: 9px; font-size: calc(10.5px * var(--fs-scale)); color: var(--muted-2);
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend b { width: 9px; height: 9px; border-radius: 1px; flex: none; display: block; }

.admin-shell {
  display: grid; grid-template-columns: 178px minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}
.admin-shell > .stage { min-width: 0; }

/* 管理员锁定引擎时不渲染引擎条，高度补偿归零 */
body.engine-locked { --engbar-h: 0px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.cfg-grid .full { grid-column: 1 / -1; }

.img-viewer {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.9); display: grid; place-items: center;
  padding: 30px; cursor: zoom-out;
}
.img-viewer img { max-width: 100%; max-height: 100%; border: 1px solid var(--line-hard); }
.img-viewer-foot {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: calc(11px * var(--fs-scale)); color: var(--muted);
}

.pay-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }
.pay-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--line-hard); border-radius: var(--r); padding: 24px;
}
.pay-qr { text-align: center; padding: 14px 0; }
.pay-qr svg { width: 190px; height: 190px; background: #fff; padding: 8px; }
.pay-state { text-align: center; font-size: calc(13px * var(--fs-scale)); color: var(--muted); padding: 8px 0; }

/* ============================ 响应式 ============================ */
@media (max-width: 1100px) {
  /* 字号整体放大后，顶栏在 1080 以下塞不下 5 个导航项，直接收起来 */
  .topnav { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .engdetail { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .feat:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .feat:nth-child(2n) { border-right: 0; }
  .feat:nth-last-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .feat:nth-last-child(-n+2) { border-bottom: 0; }
  .wb { grid-template-columns: 180px minmax(0, 1fr); }
  .refs { display: none; }
}

@media (max-width: 780px) {
  .topnav { display: none; }
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: calc(22px * var(--fs-scale)); }
  .feat-grid { grid-template-columns: 1fr; }
  .feat { border-right: 0 !important; }
  .price-grid { grid-template-columns: 1fr; }
  .charge-grid { grid-template-columns: 1fr !important; }
  .app { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row;
    overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 0;
  }
  .navitem { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .navitem.active { border-left: 0; border-bottom-color: var(--gold); }
  .rail .spacer, .rail-foot { display: none; }
  .wb { grid-template-columns: 1fr; height: auto; }
  .chatlist {
    display: flex; position: fixed; z-index: 300;
    left: 0; top: 0; bottom: 0; width: 270px;
    border-right: 1px solid var(--line);
    transform: translateX(-101%); transition: transform .18s ease;
    box-shadow: 0 0 48px rgba(0, 0, 0, .18);
  }
  .chatlist.open { transform: none; }
  .chat-backdrop { position: fixed; inset: 0; z-index: 290; background: rgba(16, 19, 24, .34); }
  .only-mobile { display: inline-flex !important; }
  .chat-top { gap: 7px; }
  .chat-scroll { padding: 16px 13px 8px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { flex-wrap: wrap; }
  .stat-row > div { min-width: 0; flex: 1 1 30%; border-right: 0; margin-bottom: 10px; }
  .cfg-grid { grid-template-columns: 1fr; }
  /* 联系三格在窄屏堆成一列，去掉竖线和左右缩进，只留横线 */
  .contact-grid { grid-template-columns: 1fr; }
  .ccell { padding-left: 0; padding-right: 0; border-right: 0; }
  .ccell:last-child { border-bottom: 0; }
  .engtab { min-width: 132px; padding: 8px 13px; }
  .engbar-hint { display: none; }
  .chat-top { height: auto; flex-wrap: wrap; padding: 8px 13px; }
}

/* 窄屏顶栏：品牌 + 三档字号 + 登录注册，390px 下得同时塞进去，
   否则「飞飞AI版本开发」会被挤成两行、「四引擎」标签竖排 */
@media (max-width: 760px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand {
    font-size: calc(13px * var(--fs-scale)); gap: 6px;
    white-space: nowrap; flex-shrink: 0;
  }
  .brand em { display: none; }
  .fs-ctrl button { padding: 0 5px; }
  .topbar-right { gap: 6px; flex-shrink: 0; }
  .topnav { display: none; }
}

/* 品牌名从 4 字变 8 字，窄屏得再收一档，否则字号切到大档会把登录按钮挤出去。
   440 以下只留「飞」方标：一行要塞下品牌 + 字号三档 + 三个色点 + 登录注册，
   文字品牌在这里没有生存空间，方标足够认出是谁。 */
/* 窄屏：标题与右侧按钮挤在一行时，说明文字会被压成一条窄柱；
   堆成上下两段再让表格自己横向滚动 */
@media (max-width: 620px) {
  .view-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .view-head > div:last-child { flex-wrap: wrap; }
  /* 表格不压缩列宽，宁可让卡片横向滚动：压窄后「255 B」会折成两行 */
  .works-table { min-width: 640px; }
  .ledger-table { min-width: 520px; }
}
@media (max-width: 440px) {
  .brand { font-size: calc(11.5px * var(--fs-scale)); gap: 5px; }
  .brand .brand-name { display: none; }
  .brand .logo { width: 19px; height: 19px; font-size: calc(11px * var(--fs-scale)); }
  .topbar { gap: 8px; padding: 0 10px; }
  .fs-ctrl button { padding: 0 4px; }
  /* 三个色点也要让位：17px 格 + 9px 内圆，手指够点 */
  .theme-dot { width: 17px; height: 17px; }
  .theme-dot i { width: 9px; height: 9px; }
}

/* ============================================================
   补回重写样式表时漏掉的组件
   这些类页面一直在用，CSS 里却没有规则：徽章退化成裸文字、
   聊天正文不换行、看大图的容器会撑破屏幕。
   ============================================================ */

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px;
  border-radius: var(--r); font-size: calc(11.5px * var(--fs-scale));
  font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.badge.gold  { background: var(--gold-dim); color: var(--gold); border: 1px solid var(--gold-line); }
.badge.gray  { background: var(--panel-3); color: var(--muted); border: 1px solid var(--line); }
.badge.green { background: rgba(95, 145, 99, .14); color: var(--green); border: 1px solid rgba(95, 145, 99, .32); }
.badge.red   { background: rgba(176, 58, 44, .10); color: var(--red); border: 1px solid rgba(176, 58, 44, .30); }

.codeblock-head .acts { margin-left: auto; display: flex; gap: 4px; }

/* 附件缩略图右下角的体积标签，压在图上 */
.attach-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 5px; text-align: right;
  font-size: calc(9.5px * var(--fs-scale)); color: #cfd4dc;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 14, .85));
}

.bubble-text { white-space: pre-wrap; word-break: break-word; }

.msg-ai .body code.inline,
.msg-ai .body p code.inline {
  background: var(--gold-dim); border: 1px solid var(--gold-line);
  color: var(--gold); padding: 1px 5px; border-radius: 2px;
  font-size: calc(12.2px * var(--fs-scale));
}

table.data .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.modal-box.wide { max-width: 760px; max-height: 86vh; overflow-y: auto; }
.composer.dragging .composer-box { border-color: var(--gold); background: var(--gold-dim); }

/* 看大图：box 管尺寸上限，foot 回正常流贴在图片下方（原来是 absolute，跑到屏幕底了） */
.img-viewer .img-viewer-box {
  display: flex; flex-direction: column; cursor: default;
  max-width: min(92vw, 1100px); max-height: 90vh;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.img-viewer .img-viewer-box img { max-width: 100%; max-height: calc(90vh - 50px); object-fit: contain; }
.img-viewer .img-viewer-box .img-viewer-foot {
  position: static; transform: none; width: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-top: 1px solid var(--line-soft);
}

/* ======================= 画图（AI 生图） ======================= */
/* 左表单固定宽度、右结果自适应：窄屏直接上下堆 */
.img-top {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 18px; align-items: start;
}
.img-form { padding: 18px 20px 20px; }

/* 文生图 / 图生图：直角分区，跟全站的胶囊风格区分开 */
.img-tabs { display: flex; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.img-tabs button {
  flex: 1; height: calc(32px * var(--fs-scale));
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-family: inherit;
  font-size: calc(12.6px * var(--fs-scale)); font-weight: 500; cursor: pointer;
  transition: color .12s, border-color .12s;
}
.img-tabs button:hover { color: var(--text-2); }
.img-tabs button.on { color: var(--gold); border-bottom-color: var(--gold); font-weight: 700; }

.img-block { margin-bottom: 14px; }
.img-block-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: calc(11.5px * var(--fs-scale)); color: var(--muted);
  margin-bottom: 7px; letter-spacing: .01em;
}
.img-presets { display: flex; flex-wrap: wrap; gap: 6px; }

/* 分段选择：清晰度 / 张数 */
.seg { display: flex; gap: 0; }
.seg button {
  flex: 1; height: calc(29px * var(--fs-scale)); padding: 0 4px;
  background: var(--panel-2); border: 1px solid var(--line-hard);
  color: var(--muted); font-family: var(--mono);
  font-size: calc(11.6px * var(--fs-scale)); cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.seg button + button { border-left: 0; }
.seg button:hover { color: var(--text-2); }
.seg button.on { background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold); font-weight: 700; }
/* 原图尺寸模式下清晰度由原图决定，按钮只用来显示实际计费档位 */
.seg.locked button { opacity: .55; cursor: not-allowed; }
.seg.locked button.on { opacity: .85; }

/* 画面描述：至少 7 行。行高写死成 1.75em 再乘行数，改了字号也不会挤成 6 行半 */
.img-prompt {
  height: auto; padding: 9px 11px;
  line-height: 1.75; resize: vertical;
  min-height: calc(7 * 1.75em + 18px);
}

.img-params { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* 比例要放「原图比例 1920×1080 → 16:9」这种长文案，独占一行才够宽 */
.img-params .field.full { grid-column: 1 / -1; }

/* 参考图：虚线投放区 + 缩略图 */
.ref-drop {
  border: 1px dashed var(--line-hard); border-radius: var(--r);
  background: var(--panel-2); color: var(--muted-2);
  padding: 13px 12px; text-align: center; cursor: pointer;
  font-size: calc(12px * var(--fs-scale)); line-height: 1.6;
  transition: border-color .12s, color .12s, background .12s;
}
.ref-drop:hover, .ref-drop.over { border-color: var(--gold); color: var(--gold); background: var(--gold-dim); }
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.ref-thumb { position: relative; width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--panel-2); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb button {
  position: absolute; top: 0; right: 0; width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 14, 18, .74); color: #e6e9ee;
  border: 0; font-size: 12px; line-height: 1; cursor: pointer;
}
.ref-thumb button:hover { background: var(--red); color: #fff; }

/* 底部价签：左数字右按钮，中间用竖线分开，跟卡密页一个调子 */
.img-quote {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.img-quote-num { font-size: calc(12.5px * var(--fs-scale)); color: var(--muted); min-width: 0; }
.img-quote-num b { font-size: calc(17px * var(--fs-scale)); color: var(--gold); font-weight: 700; margin: 0 3px; }
.img-quote #btnGenerate { flex: none; }

.img-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.img-result { padding: 0; overflow: hidden; }
.img-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.img-card-head h3 { font-size: calc(12.5px * var(--fs-scale)); font-weight: 700; }
.img-head-actions { display: flex; align-items: center; gap: 10px; }

.img-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 14px 16px;
}
.img-cell {
  position: relative; border: 1px solid var(--line);
  border-radius: 2px; overflow: hidden; background: var(--panel-2);
  aspect-ratio: 1 / 1; cursor: zoom-in;
}
.img-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-cell .bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; background: linear-gradient(180deg, transparent, rgba(8, 10, 14, .82));
  opacity: 0; transition: opacity .12s;
}
.img-cell:hover .bar, .img-cell:focus-within .bar { opacity: 1; }
.img-cell .bar .meta {
  font-size: calc(10.2px * var(--fs-scale)); color: #d8dde4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-cell .bar button {
  flex: none; padding: 2px 6px; font-size: calc(10.2px * var(--fs-scale));
  background: rgba(255, 255, 255, .14); color: #eef1f5;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 2px; cursor: pointer;
}
.img-cell .bar button:hover { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.img-cell.busy { cursor: default; }
.img-cell.busy::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .1) 50%, transparent 80%);
  background-size: 220% 100%; animation: img-shimmer 1.1s linear infinite;
}
@keyframes img-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.img-empty {
  padding: 34px 18px; text-align: center; line-height: 1.9;
  color: var(--muted-2); font-size: calc(12px * var(--fs-scale));
}
.img-empty .i { font-size: calc(20px * var(--fs-scale)); margin-bottom: 8px; color: var(--line-hard); }

/* 写法说明：三栏要点 + 两组示例，不套外框，直接铺在卡片里 */
.img-guide { margin-top: 18px; padding: 20px 22px; }
.img-guide h3 { font-size: calc(13px * var(--fs-scale)); font-weight: 700; margin-bottom: 12px; }
.img-guide .g-rule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 20px; margin-bottom: 18px;
}
.img-guide .g-rule div { font-size: calc(12.2px * var(--fs-scale)); line-height: 1.85; color: var(--text-2); }
.img-guide .g-rule b { display: block; color: var(--gold); font-weight: 700; margin-bottom: 3px; font-size: calc(12px * var(--fs-scale)); }
.img-guide .g-eg { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.img-guide .g-eg h4 { font-size: calc(12px * var(--fs-scale)); font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.img-guide .g-row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px 14px; padding: 5px 0;
  font-size: calc(12px * var(--fs-scale)); line-height: 1.75;
}
.img-guide .g-row .k { color: var(--muted); }
.img-guide .g-row .v { color: var(--text-2); }
.img-guide .g-warn {
  margin-top: 14px; padding-left: 11px; border-left: 2px solid var(--gold-line);
  font-size: calc(11.8px * var(--fs-scale)); color: var(--muted); line-height: 1.85;
}

@media (max-width: 1080px) {
  .img-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .img-params { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 12px; }
  .img-guide { padding: 16px 14px; }
  .img-guide .g-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .img-quote { flex-direction: column; align-items: stretch; }
  .img-quote #btnGenerate { width: 100%; }
}

/* ============================================================
   极光主题的装饰层
   只做「加一层」，不改尺寸：玻璃顶栏、渐变标题、卡片内高光、
   细渐变分隔线。拿掉这一段，极光会退回成一套紫灰色，布局不受影响。
   动效（光斑、倾斜、进场）不在这里，在 fx.css。
   ============================================================ */

/* 顶栏：半透明 + 背景模糊。滚动时下层内容会在栏底透出一条虚影，
   正好提示「页面还在你下面」，比加阴影干净 */
html[data-theme="aurora"] .topbar {
  background: rgba(9, 7, 16, .74);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: rgba(139, 124, 255, .16);
}

html[data-theme="aurora"] .brand .logo {
  background: linear-gradient(140deg, #a99cff 0%, #7566f5 55%, #37d6c0 145%);
  color: #0a0716;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .10) inset, 0 2px 12px -4px rgba(139, 124, 255, .8);
}

/* 主按钮：斜向紫蓝渐变 + 顶部 1px 内高光。hover 只提亮，不改尺寸，
   按钮不该因为鼠标移上去就动 */
html[data-theme="aurora"] .btn.primary {
  background: linear-gradient(135deg, #8b7cff 0%, #7566f5 58%, #5f8bff 100%);
  border-color: rgba(163, 150, 255, .55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 20px -12px rgba(139, 124, 255, .95);
}
html[data-theme="aurora"] .btn.primary:hover {
  background: linear-gradient(135deg, #9a8dff 0%, #8172ff 58%, #6d97ff 100%);
  border-color: rgba(186, 176, 255, .72);
  color: var(--on-gold);
}

/* 标题里的那半句：紫→青→紫的渐变字。
   这是前三套明确拒绝的处理方式，只用在这一套里，算风格差异而不是失控 */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  html[data-theme="aurora"] .hero h1 .hl {
    background: linear-gradient(100deg, #b3a7ff 0%, #7de3d4 52%, #9d8fff 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}

html[data-theme="aurora"] .eyebrow {
  color: var(--gold);
  border-color: var(--gold-line);
  background: rgba(139, 124, 255, .06);
}

/* 代码窗：整站的主角，给它一层外部辉光和顶部内高光 */
html[data-theme="aurora"] .codewin {
  border-color: rgba(139, 124, 255, .22);
  background: linear-gradient(180deg, #131021 0%, #0d0b16 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 26px 64px -38px rgba(84, 62, 210, .95);
}
html[data-theme="aurora"] .codewin-bar {
  background: rgba(139, 124, 255, .07);
  border-bottom-color: rgba(139, 124, 255, .15);
}

/* 章节分隔线用渐变：从紫慢慢淡到青，到右侧收干净。
   1px 的线换成渐变不会多占高度，但翻页时有方向感 */
html[data-theme="aurora"] .section {
  border-top-color: transparent;
  background-image: linear-gradient(90deg, rgba(139, 124, 255, .30) 0%, rgba(55, 214, 192, .14) 38%, rgba(139, 124, 255, 0) 78%);
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left top;
  /* 线要压在 border 那 1px 上，不然会落在边框内侧、看起来多出一条缝 */
  background-origin: border-box;
}

/* 特性格子：hover 时底色从顶部往下淡出，比整块变色轻 */
html[data-theme="aurora"] .feat { transition: background .28s ease; }
html[data-theme="aurora"] .feat:hover {
  background: linear-gradient(180deg, rgba(139, 124, 255, .06) 0%, rgba(139, 124, 255, 0) 72%);
}

html[data-theme="aurora"] .engtab.on::before {
  background: linear-gradient(180deg, #8b7cff 0%, #37d6c0 100%);
}
html[data-theme="aurora"] .engtab.on { background: rgba(139, 124, 255, .06); }

html[data-theme="aurora"] .stat-row > div b {
  background: linear-gradient(180deg, #ffffff 0%, #b7b1e6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-theme="aurora"] .price-card {
  background: linear-gradient(180deg, #131021 0%, #0e0c17 100%);
}
html[data-theme="aurora"] .price-card:hover { background: #151122; }

/* 卡片统一给一条顶部内高光和一点外部辉光：暗紫底上纯色块会显得「平」 */
html[data-theme="aurora"] .card {
  border-color: rgba(139, 124, 255, .16);
  background: linear-gradient(180deg, #121020 0%, #0e0c17 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 22px 54px -44px rgba(90, 70, 200, .9);
}

html[data-theme="aurora"] .kbdemo-box {
  background: rgba(16, 13, 26, .78);
  border-color: rgba(139, 124, 255, .26);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .05);
}

html[data-theme="aurora"] .kbdemo-box:focus-within {
  border-color: var(--gold-line);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, .10);
}

html[data-theme="aurora"] .chip {
  background: rgba(139, 124, 255, .06);
  border-color: rgba(139, 124, 255, .18);
}

/* 站内链接的默认色已经是 var(--gold)，换主题自动跟着变，不用额外覆盖 */

/* 移动端：动效开关在 440 以下让位给品牌与登录，动效仍按上次的偏好生效 */
@media (max-width: 440px) {
  .motion-ctrl { display: none; }
}
