/* ============================================================
   灵镜 LINGJING · 数字人平台 · 设计系统 v3
   "Silent Precision Instrument" — 静默的精密器械
   纯黑哑光 · 白底黑字 · 真人卡片 · 精密排版
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700;900&family=Manrope:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
  /* —— 黑阶(哑光,非死黑) —— */
  --void: #060607;
  --bg: #0A0A0B;
  --bg-soft: #0E0E10;
  --card: #161618;
  --card-hi: #1C1C1F;
  --card-2: #242428;
  --field: #121214;
  --modal: #161618;

  /* —— 描边 —— */
  --line: #232327;
  --line-soft: #1A1A1D;
  --line-hi: #34343A;
  --hairline: rgba(255,255,255,.06);

  /* —— 文字 —— */
  --t1: #F6F6F8;
  --t2: #ABABB2;
  --t3: #717179;
  --t4: #4A4A51;
  --t5: #34343A;

  /* —— 强调(极少用) —— */
  --blue: #4D8DFF;
  --blue-bg: rgba(77,141,255,.13);
  --green: #34C759;
  --amber: #FFB23E;
  --red: #FF5247;

  /* —— 暖金强调(购买/转化路径专用:套餐·充值·确认支付) —— */
  --gold: #F5C451;
  --gold-deep: #E0A03A;
  --gold-grad: linear-gradient(135deg, #F7CE63 0%, #E5A53C 100%);
  --gold-bg: rgba(245,196,81,.08);
  --gold-line: rgba(245,196,81,.45);
  --gold-glow: 0 6px 22px -8px rgba(245,196,81,.5);

  --r-sm: 11px;
  --r: 15px;
  --r-lg: 22px;
  --r-pill: 999px;

  --f: 'Noto Sans SC', sans-serif;
  --f-en: 'Manrope', sans-serif;
  --f-mono: 'Space Mono', monospace;

  /* —— 阴影(分层) —— */
  --sh-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --sh-pop: 0 1px 0 rgba(255,255,255,.05) inset, 0 32px 80px -24px rgba(0,0,0,.85);
  --sh-white-btn: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 22px -8px rgba(255,255,255,.18);

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
}
/* 顶部环境光 + 极细噪点氛围 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -280px, rgba(255,255,255,.045), transparent 70%),
    radial-gradient(900px 500px at 85% -120px, rgba(77,141,255,.05), transparent 65%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: rgba(255,255,255,.15); color: #fff; }
a { color: inherit; text-decoration: none; }
img { display: block; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--card-2); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-hi); }
::-webkit-scrollbar-track { background: transparent; }

/* —— 字阶 —— */
.t-display { font-size: 34px; font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
.t-h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; }
.num { font-family: var(--f-en); font-feature-settings: "tnum"; }
.mono { font-family: var(--f-mono); }

/* ============ 顶栏 ============ */
.nav-top {
  position: sticky; top: 0; z-index: 60; height: 66px;
  display: flex; align-items: center; gap: 22px; padding: 0 clamp(20px,4vw,48px);
  background: rgba(10,10,11,.72); backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--hairline);
}
.logo { display: flex; align-items: center; gap: 11px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--t1);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 4px 14px -4px rgba(255,255,255,.3);
}
.logo-mark svg { width: 17px; height: 17px; }
.logo-name { font-family: var(--f-en); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.logo-cjk { font-weight: 700; font-size: 17px; letter-spacing: .04em; margin-left: -3px; }
.nav-links { display: flex; gap: 2px; margin-left: 14px; }
.nav-link { padding: 8px 15px; border-radius: var(--r-pill); font-size: 14px; color: var(--t3); font-weight: 500; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--t2); }
.nav-link.active { color: var(--t1); background: var(--card); box-shadow: 0 1px 0 var(--hairline) inset; }
.nav-spacer { flex: 1; }

.credits {
  display: flex; align-items: center; gap: 9px; padding: 8px 8px 8px 15px;
  border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line-soft);
  font-size: 13px; color: var(--t2);
}
.credits .gem { width: 15px; height: 15px; color: var(--t2); }
.credits .gem svg { width: 100%; height: 100%; }
.credits b { font-family: var(--f-en); font-weight: 700; color: var(--t1); }
.credits .topup { font-size: 12px; font-weight: 700; color: #0A0A0B; background: var(--t1); padding: 4px 11px; border-radius: var(--r-pill); }
.avatar-btn {
  width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; cursor: pointer; color: var(--t1);
  background: linear-gradient(150deg, #2C2C32, #161618); border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--hairline) inset;
}

/* ============ 容器 ============ */
.wrap { position: relative; z-index: 1; max-width: 1380px; margin: 0 auto; padding: clamp(28px,5vw,52px) clamp(20px,4vw,48px) 80px; }

.sec-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 20px; }
.sec-title { font-size: 16px; font-weight: 700; color: var(--t2); letter-spacing: .01em; }
.sec-count { font-family: var(--f-mono); font-size: 12px; color: var(--t4); }
.sec-gap { margin-top: 54px; }

/* ============ 按钮 ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; font-family: var(--f); font-weight: 700; transition: transform .15s var(--ease), background .2s, box-shadow .2s, color .2s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(.97); }
.btn-white { background: var(--t1); color: #0A0A0B; border-radius: var(--r-pill); padding: 12px 22px; font-size: 14px; box-shadow: var(--sh-white-btn); }
.btn-white:hover { background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 10px 28px -8px rgba(255,255,255,.28); }
.btn-dark { background: var(--card); color: var(--t2); border-radius: var(--r-pill); padding: 11px 17px; font-size: 13px; border: 1px solid var(--line); font-weight: 600; box-shadow: 0 1px 0 var(--hairline) inset; }
.btn-dark:hover { background: var(--card-hi); color: var(--t1); border-color: var(--line-hi); }
.btn-ghost { background: transparent; color: var(--t3); border-radius: var(--r-pill); padding: 10px 15px; font-size: 13px; font-weight: 600; }
.btn-ghost:hover { color: var(--t1); background: var(--card); }

/* ============ 首页:虚拟人网格 ============ */
.grid-av { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 18px; }
.grid-av.tight { gap: 15px; }

.av {
  position: relative; aspect-ratio: 3/4.05; border-radius: var(--r-lg); overflow: hidden;
  background: var(--card); border: 1px solid var(--line-soft); cursor: pointer;
  box-shadow: var(--sh-card);
  transition: transform .45s var(--ease-out), border-color .3s, box-shadow .35s;
  opacity: 0; animation: rise .7s var(--ease-out) forwards;
}
.av:hover { transform: translateY(-6px); border-color: var(--line-hi); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 30px 60px -22px rgba(0,0,0,.75); }
.av-img { position: absolute; inset: 0; background-size: cover; background-position: center 18%; transition: transform 1.1s var(--ease-out); filter: saturate(1.02); }
.av:hover .av-img { transform: scale(1.055); }
.av-img.ph { background: radial-gradient(circle at 50% 35%, #2A2A30, #141416); }
.av-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,6,7,.4) 0%, transparent 26%, transparent 52%, rgba(6,6,7,.55) 78%, rgba(6,6,7,.92) 100%); }
.av-name { position: absolute; top: 15px; left: 17px; font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .01em; text-shadow: 0 1px 6px rgba(0,0,0,.5); transition: transform .45s var(--ease-out); }
.av:hover .av-name { transform: translateY(-2px); }
.av-tag { position: absolute; top: 16px; right: 16px; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: rgba(8,8,10,.5); backdrop-filter: blur(8px); color: #fff; }
.av-more { position: absolute; top: 13px; right: 13px; width: 28px; height: 28px; border-radius: 50%; background: rgba(8,8,10,.5); backdrop-filter: blur(10px); display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .25s; }
.av:hover .av-more { opacity: 1; }
.av-more svg { width: 15px; height: 15px; }
.av-cta {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  background: var(--t1); color: #0A0A0B; border-radius: var(--r-pill);
  padding: 11px 0; text-align: center; font-weight: 700; font-size: 14px;
  box-shadow: var(--sh-white-btn);
  opacity: 0; transform: translateY(12px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out);
}
.av:hover .av-cta, .av.pinned .av-cta { opacity: 1; transform: translateY(0); }
.av-cta:hover { background: #fff; }

/* 当前选中态:蓝边框 + 右上勾选徽章,一眼可辨"在用哪个" */
.av.selected { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue), var(--sh-card); }
.av.selected .av-cta { opacity: 1; transform: translateY(0); background: var(--blue); color: #fff; }
.av-check { position: absolute; top: 13px; right: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); z-index: 2; }
.av-check svg { width: 15px; height: 15px; }

/* 创建卡 */
.av.new { background: transparent; border: 1.5px dashed var(--line-hi); display: grid; place-items: center; box-shadow: none; }
.av.new:hover { border-color: var(--t3); background: var(--card); transform: translateY(-6px); }
.av-new-in { display: flex; flex-direction: column; align-items: center; gap: 15px; color: var(--t3); transition: color .25s; }
.av.new:hover .av-new-in { color: var(--t1); }
.av-new-in svg { width: 30px; height: 30px; }
.av-new-in span { font-size: 14px; font-weight: 500; }

@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 筛选条 ============ */
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.chip { padding: 8px 17px; border-radius: var(--r-pill); font-size: 14px; color: var(--t3); background: transparent; border: none; cursor: pointer; font-family: var(--f); font-weight: 500; transition: color .2s, background .2s; }
.chip:hover { color: var(--t2); }
.chip.active { color: var(--t1); background: var(--card); box-shadow: 0 1px 0 var(--hairline) inset; }
.filters-sp { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--t2); cursor: pointer; font-weight: 600;
  box-shadow: 0 1px 0 var(--hairline) inset; transition: border-color .2s, color .2s;
}
.pill:hover { border-color: var(--line-hi); color: var(--t1); }
.pill svg { width: 14px; height: 14px; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; box-shadow: 0 1px 0 var(--hairline) inset; }
.seg button { padding: 6px 17px; border-radius: var(--r-pill); border: none; background: none; color: var(--t3); font-size: 13px; cursor: pointer; font-family: var(--f); font-weight: 600; transition: color .2s; }
.seg button.active { background: var(--t1); color: #0A0A0B; }

/* ============ 创建影片:双栏 ============ */
.studio { position: relative; z-index: 1; display: grid; grid-template-columns: 432px 1fr; gap: 22px; padding: 26px 32px 56px; align-items: start; }
.back {
  position: fixed; top: 80px; left: clamp(16px,2vw,26px); z-index: 40; width: 40px; height: 40px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center;
  cursor: pointer; color: var(--t2); box-shadow: 0 1px 0 var(--hairline) inset; transition: .2s;
}
.back:hover { background: var(--card-hi); color: var(--t1); }
.back svg { width: 18px; height: 18px; }

/* 左输入区 sticky 置顶;高超一屏时自身内部滚动(max-height 锁视口),底部提交按钮始终可达,不联动右侧记录 */
.cfg { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 13px; position: sticky; top: 90px; max-height: calc(100vh - 114px); overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--sh-card); animation: rise .6s var(--ease-out) both; }
/* 子项不收缩:否则在 max-height + overflow 的 flex 列里会被压扁而非溢出滚动(.cfg-sp 仍靠 flex:1 占位) */
.cfg > * { flex-shrink: 0; }
.cfg-h { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 5px; display: flex; align-items: center; gap: 9px; }
.cfg-h .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t1); box-shadow: 0 0 10px rgba(255,255,255,.4); }

.selr { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .2s, background .2s; }
.selr:hover { border-color: var(--line-hi); background: var(--card-hi); }
.selr-th { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; background-size: cover; background-position: center; background-color: var(--card-2); display: grid; place-items: center; box-shadow: 0 1px 0 var(--hairline) inset; }
.selr-th svg { width: 22px; height: 22px; color: var(--t3); }
.selr-b { flex: 1; min-width: 0; }
.selr-b h5 { font-size: 15px; font-weight: 700; }
.selr-b p { font-size: 12.5px; color: var(--t3); margin-top: 2px; }
.selr-b p u { color: var(--t2); text-decoration-color: var(--t4); text-underline-offset: 3px; }
.selr-ar { color: var(--t4); transition: transform .2s, color .2s; }
.selr:hover .selr-ar { color: var(--t2); transform: translateX(2px); }
.selr-ar svg { width: 18px; height: 18px; }

.script { background: var(--field); border: 1px solid var(--line); border-radius: var(--r); padding: 15px; transition: border-color .2s; }
.script:focus-within { border-color: var(--line-hi); }
.script textarea { width: 100%; min-height: 152px; resize: none; background: none; border: none; outline: none; color: var(--t1); font-family: var(--f); font-size: 14px; line-height: 1.75; }
.script textarea::placeholder { color: var(--t3); }
.script .f { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.script .f .h { font-size: 12.5px; color: var(--t3); }
.script .f .h u { color: var(--t2); text-underline-offset: 2px; cursor: pointer; }
.script .f .c { font-family: var(--f-mono); font-size: 11.5px; color: var(--t3); }

.cfg-sp { flex: 1; min-height: 8px; }
.cfg-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }

/* 语速 / 音量 滑块组 —— 独立块,不复用 .cfg-row(那是 grid,会把两行挤成一行) */
.cfg-sliders { display: flex; flex-direction: column; gap: 12px; padding: 14px 15px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); }
.sld-row { display: flex; align-items: center; gap: 13px; }
.sld-lbl { font-size: 12.5px; color: var(--t3); width: 34px; flex: none; }
.sld-val { font-family: var(--f-mono); font-size: 12px; color: var(--t2); width: 40px; text-align: right; flex: none; }
.sld { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--card-2); outline: none; cursor: pointer; }
.sld::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--t1); border: none; box-shadow: 0 1px 4px rgba(0,0,0,.5); transition: transform .12s; }
.sld::-webkit-slider-thumb:hover { transform: scale(1.15); }
.sld::-webkit-slider-thumb:active { transform: scale(.95); }
.sld::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--t1); border: none; box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: pointer; }
.sld::-moz-range-track { height: 4px; border-radius: 2px; background: var(--card-2); }
.msel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; color: var(--t2); cursor: pointer; font-weight: 600; transition: border-color .2s; }
.msel:hover { border-color: var(--line-hi); }
.msel svg { width: 13px; height: 13px; color: var(--t4); }

/* ── 紧凑配置栏(底部一排 pill + popover,贴 DeeVid 参考) ── */
.cfgbar { display: flex; align-items: stretch; gap: 8px; }
.cfgbar .cpill { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; font-weight: 600; color: var(--t2); cursor: pointer; transition: border-color .2s, background .2s; position: relative; white-space: nowrap; overflow: hidden; }
.cfgbar .cpill .v { overflow: hidden; text-overflow: ellipsis; }
.cfgbar .cpill:hover { border-color: var(--line-hi); }
.cfgbar .cpill.open { border-color: var(--blue); color: var(--t1); }
.cfgbar .cpill svg.chev { width: 13px; height: 13px; color: var(--t4); flex-shrink: 0; transition: transform .2s; }
.cfgbar .cpill.open svg.chev { transform: rotate(180deg); }
.cfgbar .cpill.fixed { flex: 0 0 auto; width: 42px; justify-content: center; padding: 10px; }
.cfgbar .cpill.fixed svg { width: 17px; height: 17px; }

/* 向上浮层 popover(深色,贴 pill;点外关) */
.pop-anchor { position: relative; }
.pop { position: absolute; left: 0; right: auto; bottom: calc(100% + 8px); min-width: 340px; max-width: 92vw; max-height: min(56vh, 440px); overflow-y: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--line-hi); border-radius: 13px; padding: 14px; box-shadow: 0 14px 36px -10px rgba(0,0,0,.7); z-index: 60; display: none; animation: popup .18s var(--ease-out); }
/* 全站下拉/弹层滚动条隐藏(仍可滚):.pop 自身及其内部选项容器 */
.pop, .pop [id$="Opts"], .pop > div[id$="Opts"] { scrollbar-width: none; -ms-overflow-style: none; }
.pop::-webkit-scrollbar, .pop [id$="Opts"]::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* 弹框 portal 到 body 后:fixed + 顶层(逃离 .cfg overflow / 侧栏层叠上下文)。位置由 LJPlacePop 设。 */
.pop.lj-pop-portal { position: fixed; right: auto; bottom: auto; max-width: calc(100vw - 16px); z-index: 1000; }
/* 模型 popover:够宽,不受 pill 宽度限制 */
#pop-model { min-width: 320px; }
/* 设置 popover:靠右锚定 + 更宽,容 8 个比例 cell 一行 */
#pop-set { left: auto; right: 0; min-width: 420px; }
/* seed popover:窄(只一个输入框),靠右,覆盖通用 min-width */
#pop-seed { left: auto; right: 0; min-width: 0; }
.pop.show { display: block; }
@keyframes popup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pop .pop-label { font-size: 11px; color: var(--t3); margin: 0 0 7px; }
.pop .pop-label:not(:first-child) { margin-top: 13px; }
/* popover 内模型选项 */
.pop-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; cursor: pointer; transition: background .15s, border-color .15s; border: 1px solid transparent; }
.pop-opt:hover { background: var(--card-hi); }
/* 选中态:蓝色描边 + 蓝底高亮,清晰可辨(不再依赖几乎看不见的 card-hi 微差)*/
.pop-opt.on { background: var(--blue-bg); border-color: var(--blue); }
.pop-opt .nm { font-size: 13.5px; font-weight: 600; color: var(--t1); }
.pop-opt.on .nm { color: var(--blue); }
.pop-opt .tag { font-size: 10px; color: var(--t4); margin-left: auto; }
.pop-opt .ck { width: 16px; height: 16px; color: var(--blue); margin-left: auto; opacity: 0; flex-shrink: 0; }
.pop-opt.on .ck { opacity: 1; }
.pop-opt.on .tag { margin-left: 8px; }
.pop-ov { position: fixed; inset: 0; z-index: 55; display: none; }
.pop-ov.show { display: block; }

.cbtn-wrap { position: relative; }
.cbtn-badge { position: absolute; top: -8px; right: 14px; z-index: 1; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; }
.cbtn { width: 100%; background: var(--card-2); color: var(--t3); border-radius: var(--r); padding: 16px; font-size: 15px; font-weight: 700; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; transition: background .25s, color .25s, transform .15s; box-shadow: 0 1px 0 var(--hairline) inset; }
.cbtn:active { transform: scale(.99); }
.cbtn.ready { background: var(--t1); color: #0A0A0B; border-color: var(--t1); box-shadow: var(--sh-white-btn); }
.cbtn.ready:hover { background: #fff; }
.cbtn .gem { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-en); }
.cbtn .gem svg { width: 14px; height: 14px; }

/* —— 右:对话流 —— */
.feed { min-width: 0; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 22px 26px 30px; box-shadow: var(--sh-card); animation: rise .6s .08s var(--ease-out) both; }
.feed-tabs { display: flex; gap: 2px; margin-bottom: 24px; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px; }
.ftab { padding: 8px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; color: var(--t3); background: none; border: none; cursor: pointer; font-family: var(--f); transition: color .2s, background .2s; }
.ftab:hover { color: var(--t2); }
.ftab.active { background: var(--card-2); color: var(--t1); }
.feed-list { display: flex; flex-direction: column; gap: 30px; }

.fitem { animation: rise .6s var(--ease-out) both; }
/* feed 空态:无作品时的引导 */
.feed-empty-in { text-align: center; padding: 56px 28px; border: 1px dashed var(--line); border-radius: var(--r-lg); background: var(--card); }
.feed-empty-in svg { width: 38px; height: 38px; color: var(--t4); margin-bottom: 14px; }
.feed-empty-in .t { font-size: 15px; font-weight: 700; color: var(--t2); }
.feed-empty-in .s { font-size: 12.5px; color: var(--t4); margin-top: 7px; line-height: 1.6; max-width: 320px; margin-left: auto; margin-right: auto; }
.fmeta { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--t2); margin-bottom: 13px; }
.fmeta svg { width: 16px; height: 16px; color: var(--t3); }
.fmeta b { font-weight: 600; color: var(--t1); }
.fmeta .ts { color: var(--t4); font-family: var(--f-mono); font-size: 11.5px; }
.fmeta .sp { flex: 1; }
.fmeta .st { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-family: var(--f-mono); }
.fmeta .st .led { width: 6px; height: 6px; border-radius: 50%; }
.led-ok { background: var(--green); box-shadow: 0 0 8px rgba(52,199,89,.6); }
.led-run { background: var(--amber); box-shadow: 0 0 8px rgba(255,178,62,.6); animation: blink 1.3s infinite; }
.led-err { background: var(--red); box-shadow: 0 0 8px rgba(255,82,71,.6); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.fbubble { display: flex; gap: 12px; margin-bottom: 13px; }
.fbubble .mav { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background-size: cover; background-position: center; background-color: var(--card-2); box-shadow: 0 1px 0 var(--hairline) inset; }
.fbubble .tx { font-size: 14px; color: var(--t1); padding-top: 6px; line-height: 1.6; }

.fvideo { border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 16/9; display: grid; place-items: center; position: relative; border: 1px solid var(--line-soft); }
.fvideo .por { width: 26%; aspect-ratio: 3/4; border-radius: 7px; background-size: cover; background-position: center; box-shadow: 0 8px 30px -8px rgba(0,0,0,.6); }
.fvideo .play-ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.15); opacity: 0; transition: opacity .25s; }
.fvideo:hover .play-ov { opacity: 1; }
.fvideo .play-ov .pb { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 8px 24px -6px rgba(0,0,0,.5); }
.fvideo .play-ov .pb svg { width: 20px; height: 20px; color: #0A0A0B; margin-left: 3px; }
.fvideo .tc { position: absolute; bottom: 11px; right: 13px; font-family: var(--f-mono); font-size: 11px; color: rgba(255,255,255,.75); background: rgba(0,0,0,.35); padding: 2px 7px; border-radius: 5px; }
.fvideo.proc { background: var(--bg-soft); }
.spinner { width: 34px; height: 34px; border: 2.5px solid var(--card-2); border-top-color: var(--t1); border-radius: 50%; animation: spin 1s linear infinite; }
.proc-in { display: flex; flex-direction: column; align-items: center; gap: 13px; color: var(--t3); }
.proc-in .lbl { font-size: 12.5px; font-family: var(--f-mono); }
.proc-bar { width: 180px; height: 3px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-top: 2px; }
.proc-bar i { display: block; height: 100%; width: 42%; background: var(--t2); border-radius: 3px; animation: prog 2.4s var(--ease) infinite; }
@keyframes prog { 0%{width:8%} 50%{width:62%} 100%{width:90%} }
@keyframes spin { to { transform: rotate(360deg); } }
.fvideo.err { background: var(--bg-soft); border-color: rgba(255,82,71,.2); }
.err-in { display: flex; flex-direction: column; align-items: center; gap: 11px; color: var(--t2); }
.err-in .ei { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,82,71,.12); display: grid; place-items: center; color: var(--red); }
.err-in .ei svg { width: 20px; height: 20px; }
.err-in .lbl { font-size: 12.5px; }

.factions { display: flex; gap: 9px; margin-top: 13px; }
.factions .sp { flex: 1; }

/* ============ 浮层 ============ */
.ov { position: fixed; inset: 0; background: rgba(4,4,5,.66); backdrop-filter: blur(8px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 30px; }
.ov.show { display: flex; animation: fade .3s var(--ease-out); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 全屏:选择外观 */
.sheet-full { position: fixed; inset: 0; background: var(--bg); z-index: 110; display: none; flex-direction: column; }
.sheet-full.show { display: flex; animation: fade .3s var(--ease-out); }
.sf-head { height: 72px; display: flex; align-items: center; justify-content: center; position: relative; border-bottom: 1px solid var(--hairline); }
.sf-head h3 { font-size: 18px; font-weight: 700; }
.sf-sub { position: absolute; left: clamp(20px,4vw,48px); font-size: 15px; }
.sf-sub b { font-weight: 700; } .sf-sub span { color: var(--t3); margin-left: 9px; font-size: 13px; }
.sf-close { position: absolute; right: clamp(20px,4vw,48px); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; color: var(--t2); transition: .2s; }
.sf-close:hover { background: var(--card); color: var(--t1); }
.sf-body { padding: clamp(28px,5vw,52px); overflow-y: auto; }

/* 侧滑:所有声音 */
.sheet-side { position: fixed; top: 0; right: 0; bottom: 0; width: min(64vw, 1120px); background: var(--modal); z-index: 110; box-shadow: var(--sh-pop); display: none; flex-direction: column; border-left: 1px solid var(--line); }
.sheet-side.show { display: flex; animation: slideIn .4s var(--ease-out); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.ss-head { display: flex; align-items: center; gap: 16px; padding: 26px 32px 18px; }
.ss-head h3 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.ss-head .sp { flex: 1; }
.ss-seg { display: flex; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.ss-seg button { padding: 7px 16px; border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; color: var(--t3); border: none; background: none; cursor: pointer; font-family: var(--f); transition: color .2s; }
.ss-seg button.active { background: var(--t1); color: #0A0A0B; }
.ss-filters { display: flex; gap: 10px; padding: 0 32px 18px; }
/* 音色 sheet 筛选 pill(语言/性别):.cpill 基础样式在 .cfgbar 下,这里补一份给 sheet 用,
   否则 .chev SVG 无尺寸约束会撑成大箭头。 */
.ss-filters .cpill { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 13px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; font-weight: 600; color: var(--t2); cursor: pointer; transition: border-color .2s; white-space: nowrap; overflow: hidden; }
.ss-filters .cpill .v { overflow: hidden; text-overflow: ellipsis; }
.ss-filters .cpill:hover { border-color: var(--line-hi); }
.ss-filters .cpill.open { border-color: var(--blue); color: var(--t1); }
.ss-filters .cpill svg.chev { width: 13px; height: 13px; color: var(--t4); flex-shrink: 0; transition: transform .2s; }
.ss-filters .cpill.open svg.chev { transform: rotate(180deg); }
/* 音色 sheet 搜索框(与 TTS/create 统一)*/
.ss-search { margin: 0 32px 18px; padding: 11px 14px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); color: var(--t1); font-size: 13.5px; outline: none; }
.ss-search:focus { border-color: var(--line-hi); }
.ss-body { padding: 0 32px 32px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
/* 音色 sheet 列表滚动条隐藏(仍可滚) */
.ss-body { scrollbar-width: none; -ms-overflow-style: none; }
.ss-body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.vcard { display: flex; align-items: center; gap: 14px; padding: 15px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line-soft); cursor: pointer; transition: background .2s, border-color .2s, transform .2s; box-shadow: 0 1px 0 var(--hairline) inset; }
.vcard:hover { background: var(--card-hi); border-color: var(--line); transform: translateY(-1px); }
.vc-b { flex: 1; min-width: 0; }
.vc-n { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.vc-n .flag { font-size: 15px; }
.vc-d { font-size: 12px; color: var(--t3); margin-top: 4px; }
.vc-p { width: 40px; height: 40px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; flex-shrink: 0; color: var(--t1); transition: background .2s, color .2s; }
.vcard:hover .vc-p { background: var(--t1); color: #0A0A0B; }
.vc-p svg { width: 15px; height: 15px; margin-left: 2px; }
/* 克隆卡操作行:试听 + 删除 并排(独立,不挤进圆形播放槽) */
.vc-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vc-p.vc-play { border: none; cursor: pointer; font-family: var(--f); }
.vc-actions .vc-p svg { margin-left: 0; }
.hot { font-size: 10px; font-weight: 700; color: var(--blue); background: var(--blue-bg); padding: 2px 6px; border-radius: 5px; letter-spacing: .02em; }

/* 居中弹窗:创建角色 */
.modal { width: min(560px, 100%); background: var(--modal); border-radius: var(--r-lg); border: 1px solid var(--line); max-height: 90vh; overflow-y: auto; box-shadow: var(--sh-pop); animation: pop .35s var(--ease-out); }
@keyframes pop { from { transform: scale(.96) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.mh { display: flex; align-items: center; justify-content: center; position: relative; padding: 22px; border-bottom: 1px solid var(--hairline); }
.mh h3 { font-size: 18px; font-weight: 700; }
.mc { position: absolute; right: 18px; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--t2); transition: .2s; }
.mc:hover { background: var(--card); }
.mb { padding: 24px; }
.iline { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); margin-bottom: 16px; transition: border-color .2s; }
.iline:focus-within { border-color: var(--line-hi); }
.iline label { font-size: 14px; font-weight: 700; }
.iline input { flex: 1; background: none; border: none; outline: none; color: var(--t1); font-size: 14px; font-family: var(--f); }
.iline input::placeholder { color: var(--t3); }
.uzone { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 22px; margin-bottom: 24px; }
.ubox { aspect-ratio: 16/10; border: 1.5px dashed var(--line-hi); border-radius: var(--r); display: grid; place-items: center; cursor: pointer; max-width: 244px; transition: border-color .2s, background .2s; }
.ubox:hover { border-color: var(--t3); background: rgba(255,255,255,.015); }
.ubox .u { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--t2); }
.ubox .u svg { width: 30px; height: 30px; }
/* C6 形象操作下拉(锚定 ⋯) */
.av-pop { position: absolute; z-index: 350; min-width: 168px; background: var(--modal); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--sh-pop); display: none; }
.av-pop.on { display: block; animation: rise .15s var(--ease-out) both; }
.av-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; color: var(--t2); font-family: var(--f); font-size: 13.5px; padding: 9px 11px; border-radius: 8px; cursor: pointer; transition: .12s; }
.av-pop button:hover { background: var(--card-hi); color: var(--t1); }
.av-pop button svg { width: 15px; height: 15px; color: var(--t4); }
.av-pop button:hover svg { color: var(--t2); }
.av-pop button.danger:hover { color: var(--red); }
.av-pop button.danger:hover svg { color: var(--red); }
/* 上传预览:所见即所得 */
.upreview { position: relative; max-width: 244px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-hi); cursor: pointer; }
.upreview img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--field); }
.upreview-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; background: var(--card-hi); }
.upreview-bar span { font-size: 12px; color: var(--t2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upreview-x { flex: none; background: none; border: none; color: var(--blue); font-family: var(--f); font-size: 12px; cursor: pointer; padding: 2px 4px; }
.upreview-x:hover { text-decoration: underline; }
.rtitle { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.rsub { font-size: 13px; color: var(--t3); margin-bottom: 16px; }
.samples { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 8px; }
.sample { aspect-ratio: 1; border-radius: var(--r-sm); background-size: cover; background-position: center; position: relative; border: 1px solid var(--line-soft); }
.sample .mk { position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); font-size: 17px; }
.rlist { list-style: none; margin: 36px 0 18px; display: flex; flex-direction: column; gap: 11px; }
.rlist li { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--t2); }
.rlist li::before { content:''; width: 5px; height: 5px; border-radius: 50%; background: var(--t3); flex-shrink: 0; }
.consent { display: flex; gap: 12px; font-size: 12.5px; color: var(--t3); line-height: 1.75; margin-bottom: 22px; border-radius: 10px; padding: 4px; margin-left: -4px; margin-right: -4px; transition: box-shadow .15s; }
.consent:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--blue); }   /* 键盘聚焦可见 */
/* 勾选态用明确填色,未勾是空心描边圈(不再靠 opacity 区分) */
.consent .ck { width: 22px; height: 22px; border-radius: 50%; background: transparent; border: 1.5px solid var(--line-hi); color: transparent; display: grid; place-items: center; flex-shrink: 0; transition: background .15s, border-color .15s, color .15s; }
.consent .ck.on { background: var(--t1); border-color: var(--t1); color: #0A0A0B; }
.consent .ck svg { width: 13px; height: 13px; }

@media (max-width: 1080px) {
  .studio { grid-template-columns: 1fr; }
  /* 窄屏单列堆叠:取消 sticky 内部滚动,整页自然滚(否则 cfg 被锁高度) */
  .cfg { position: static; max-height: none; overflow-y: visible; }
  .ss-body { grid-template-columns: 1fr; }
  .sheet-side { width: 100vw; }
}

/* ============================================================
   v4 增量 · SaaS 系统外壳(左侧导航)
   ============================================================ */

/* —— 整体外壳 —— */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; position: relative; z-index: 1; }
/* 侧边栏已静态内联进各页 HTML(build-sidebar.mjs)→ 首帧即有菜单,无弹出闪烁。
   shell.js 只做增强(active 高亮 / 品牌覆盖 / 余额)。不再需要 ::before 占位。 */

/* —— 左侧导航 —— */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--void) 100%);
  border-right: 1px solid var(--hairline);
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 16px; }
.sb-brand .logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--t1); display: grid; place-items: center; box-shadow: 0 1px 0 rgba(255,255,255,.7) inset; }
.sb-brand .logo-mark svg { width: 17px; height: 17px; }
.sb-brand .nm { font-family: var(--f-en); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.sb-brand .cjk { font-weight: 700; font-size: 16px; margin-left: -2px; }

/* 机构标识(单租户,不可切换) */
.org-static {
  margin: 0 14px 8px; padding: 11px 13px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 10px;
}
.org-ic { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(150deg,#2C2C32,#161618); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--t1); flex-shrink: 0; }
.org-meta { flex: 1; min-width: 0; }
.org-meta .l { font-size: 9px; font-family: var(--f-mono); letter-spacing: .12em; color: var(--t4); text-transform: uppercase; }
.org-meta .n { font-size: 13.5px; font-weight: 600; color: var(--t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-nav { flex: 1; overflow-y: auto; padding: 10px 12px; scrollbar-width: none; -ms-overflow-style: none; }
.sb-nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sb-group { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .18em; color: var(--t4); text-transform: uppercase; padding: 14px 11px 8px; }
.sb-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--t3); font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 2px;
  position: relative; transition: color .18s, background .18s;
}
.sb-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.sb-item:hover { color: var(--t1); background: var(--card); }
.sb-item.active { color: var(--t1); background: var(--card); box-shadow: 0 1px 0 var(--hairline) inset; }
.sb-item.active::before { content:''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 3px; height: 17px; border-radius: 0 3px 3px 0; background: var(--t1); }
.sb-item .badge-soon { margin-left: auto; font-family: var(--f-mono); font-size: 8px; color: var(--t4); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }

/* —— 创作工具徽章/角标(tools.js 描述符驱动) —— */
.sb-tool .nbadge { margin-left: auto; font-family: var(--f-en); font-size: 9.5px; font-weight: 700; color: var(--blue); background: var(--blue-bg); padding: 1px 6px; border-radius: 5px; }
.sb-tool .nano { margin-left: auto; font-family: var(--f-en); font-size: 9px; font-weight: 600; color: var(--t3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.sb-tool .soon { margin-left: auto; font-family: var(--f-mono); font-size: 8px; color: var(--t4); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; letter-spacing: .02em; }

/* —— 工具内二级 tab(如 图片转影片 的 开始图片/图片间/参考图片)—— */
.tool-subtabs { display: flex; gap: 4px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; margin-bottom: 4px; }
.tool-subtabs button { flex: 1; background: none; border: none; color: var(--t3); font-family: var(--f); font-size: 13px; padding: 8px; border-radius: 10px; cursor: pointer; transition: .15s; }
.tool-subtabs button:hover { color: var(--t1); }
.tool-subtabs button.active { background: var(--card-hi); color: var(--t1); }

/* —— 未上线工具「即将上线」占位态(tool.html / 工作区右侧)—— */
.tool-soon { display: grid; place-items: center; min-height: 60vh; text-align: center; padding: 40px; }
.tool-soon svg { width: 44px; height: 44px; color: var(--t4); margin-bottom: 18px; }
.tool-soon h3 { font-size: 19px; font-weight: 700; color: var(--t2); margin-bottom: 8px; }
.tool-soon p { font-size: 13.5px; color: var(--t4); line-height: 1.7; max-width: 360px; }
.tool-soon .soon-pill { margin-bottom: 20px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--blue); border: 1px solid var(--blue); padding: 4px 12px; border-radius: 999px; text-transform: uppercase; }

/* —— 主区(系统页内顶栏) —— */
.main-col { display: flex; flex-direction: column; min-width: 0; }
.app-bar { height: 64px; flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 0 32px; border-bottom: 1px solid var(--hairline); background: rgba(10,10,11,.7); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 50; }
.crumb { font-size: 13.5px; color: var(--t3); display: flex; align-items: center; gap: 9px; }
.crumb b { color: var(--t1); font-weight: 600; }
.crumb .s { color: var(--t5); }
.app-bar .sp { flex: 1; }
.page { padding: 32px; overflow-y: auto; flex: 1; }

/* —— 页头 —— */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; animation: rise .6s var(--ease-out) both; }
.ph .t-h1 { font-size: 26px; }
.ph .desc { color: var(--t3); font-size: 13.5px; margin-top: 8px; max-width: 640px; }

/* —— 数据卡(用量/统计) —— */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat { padding: 20px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--sh-card); animation: rise .6s var(--ease-out) both; }
.stat .lbl { font-size: 12px; color: var(--t3); display: flex; align-items: center; gap: 7px; }
.stat .lbl svg { width: 14px; height: 14px; color: var(--t4); }
.stat .val { font-family: var(--f-en); font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; }
.stat .val small { font-size: 13px; color: var(--t3); font-weight: 500; }
.stat .sub { font-size: 11.5px; color: var(--t4); margin-top: 6px; font-family: var(--f-mono); }
.stat .bar { height: 5px; border-radius: 3px; background: var(--field); margin-top: 14px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; border-radius: 3px; background: var(--t2); }

/* —— 表格(消费记录/成员/审计) —— */
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-card); animation: rise .6s var(--ease-out) both; }
.tbl thead th { text-align: left; font-size: 11px; font-family: var(--f-mono); letter-spacing: .08em; color: var(--t4); text-transform: uppercase; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-weight: 700; }
.tbl tbody td { padding: 15px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); color: var(--t2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--card-hi); }
.tbl .strong { color: var(--t1); font-weight: 600; }
.tbl .num { font-family: var(--f-en); }
.tbl .neg { color: var(--amber); }

/* ── 审计日志:表格 + 模块列 ── 时间 / 操作人(首字母头像) / 模块(分色标签) / 操作 / 来源IP */
.audit-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-hd h3 { margin: 0; }
.audit-cnt { flex: none; font-family: var(--f-en); font-size: 12px; color: var(--t4); background: var(--card-hi); border: 1px solid var(--line); border-radius: 20px; padding: 3px 11px; }
.tbl.audit { margin-top: 10px; }
.tbl.audit .t-time { font-family: var(--f-en); font-size: 12.5px; color: var(--t3); white-space: nowrap; }
.tbl.audit .t-who { display: flex; align-items: center; gap: 8px; }
.tbl.audit .t-av { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #3A6FCC; display: grid; place-items: center; font-family: var(--f-en); font-weight: 700; font-size: 11px; color: #fff; }
.tbl.audit .t-ip { font-family: var(--f-en); font-size: 11.5px; color: var(--t4); }
.af-plat { font-size: 10.5px; color: var(--amber); background: rgba(255,178,62,.14); border-radius: 5px; padding: 1px 6px; font-weight: 600; }
.af-empty { color: var(--t4); text-align: center; padding: 28px 20px; }
/* 模块分色标签:视频蓝 / 图片绿 / 语音·音乐琥珀 */
.mod { display: inline-flex; align-items: center; font-size: 12px; border-radius: 6px; padding: 2px 9px; font-weight: 500; }
.mod.video { background: rgba(77,141,255,.13); color: var(--blue); }
.mod.image { background: rgba(52,199,89,.13); color: var(--green); }
.mod.tts { background: rgba(255,178,62,.14); color: var(--amber); }
.mod.none { color: var(--t4); }
/* 窄屏:审计表格转卡片(每行一卡,不横向溢出)*/
@media (max-width: 640px) {
  .tbl.audit thead { display: none; }
  .tbl.audit, .tbl.audit tbody, .tbl.audit tr, .tbl.audit td { display: block; width: 100%; box-sizing: border-box; }
  .tbl.audit tr { margin: 0; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
  .tbl.audit td { border: none; padding: 4px 4px; }
}

/* —— 行内徽章 —— */
.bdg { font-family: var(--f-mono); font-size: 10px; padding: 3px 8px; border-radius: 6px; letter-spacing: .03em; display: inline-flex; align-items: center; gap: 5px; }
.bdg-ok { background: rgba(52,199,89,.12); color: var(--green); }
.bdg-run { background: rgba(255,178,62,.12); color: var(--amber); }
.bdg-dim { background: var(--card-2); color: var(--t3); }
.bdg-blue { background: var(--blue-bg); color: var(--blue); }
.bdg-role { background: var(--card-2); color: var(--t2); border: 1px solid var(--line); }

/* —— 设置区块 —— */
.set-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 24px; margin-bottom: 18px; box-shadow: var(--sh-card); animation: rise .6s var(--ease-out) both; }
.set-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.set-card .h-desc { font-size: 13px; color: var(--t3); margin-bottom: 18px; }

/* ── 角色权限:三角色卡 + 能力清单(权力自左向右递增) ── */
.rp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rp { position: relative; display: flex; flex-direction: column; gap: 14px; background: var(--card-hi); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.rp.admin { border-color: rgba(255,178,62,.35); }
.rp-hd { display: flex; align-items: center; gap: 11px; }
.rp-ic { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.rp-ic svg { width: 20px; height: 20px; }
.rp-viewer .rp-ic { background: rgba(77,141,255,.14); color: var(--blue); }
.rp-creator .rp-ic { background: rgba(52,199,89,.14); color: var(--green); }
.rp-admin .rp-ic { background: rgba(255,178,62,.16); color: var(--amber); }
.rp-name { color: var(--t1); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.rp-star { color: var(--amber); font-size: 12px; font-weight: 600; }
.rp-essence { color: var(--t3); font-size: 11.5px; margin-top: 2px; }
.rp-div { height: 1px; background: var(--line-soft); margin: 0 -2px; }
.rp-caps { display: flex; flex-direction: column; gap: 9px; }
.rp .cap { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.rp .cap .ck { flex: none; width: 16px; height: 16px; display: grid; place-items: center; }
.rp .cap .ck svg { width: 16px; height: 16px; }
.rp .cap.yes { color: var(--t1); }
.rp .cap.yes .ck { color: var(--green); }
.rp .cap.no { color: var(--t4); }
.rp-count { position: absolute; top: 16px; right: 16px; font-family: var(--f-en); font-size: 11px; color: var(--t4); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px; }
@media (max-width: 640px) { .rp-grid { grid-template-columns: 1fr; } }

.set-row { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line-soft); }
.set-row:first-of-type { border-top: none; }
.set-row .info { flex: 1; }
.set-row .info .k { font-size: 14px; font-weight: 600; color: var(--t1); }
.set-row .info .v { font-size: 12.5px; color: var(--t3); margin-top: 3px; }
.set-row .ctl { flex-shrink: 0; }

/* 机构名称只读身份:值 + 「平台设定」锁 chip */
.ro-name { display: flex; align-items: center; gap: 10px; }
.ro-name .ro-val { color: var(--t1); font-size: 14px; font-weight: 600; }
.ro-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--t3); background: var(--card-hi); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; }
.ro-lock svg { width: 12px; height: 12px; }

/* 开关 */
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--t2); transition: transform .2s, background .2s; }
.switch.on { background: var(--t1); border-color: var(--t1); }
.switch.on i { transform: translateX(18px); background: #0A0A0B; }

/* 段落选择(私有化/托管 等) */
.choice-seg { display: inline-flex; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.choice-seg button { padding: 7px 18px; border-radius: var(--r-pill); border: none; background: none; color: var(--t3); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--f); transition: color .2s; }
.choice-seg button.active { background: var(--t1); color: #0A0A0B; }

/* 套餐卡 */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.plan { padding: 24px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--sh-card); }
.plan.featured { border-color: var(--line-hi); background: linear-gradient(180deg,var(--card-hi),var(--card)); }
.plan .pn { font-size: 15px; font-weight: 700; }
.plan .pp { font-family: var(--f-en); font-size: 30px; font-weight: 800; margin: 12px 0 4px; letter-spacing: -.02em; }
.plan .pp small { font-size: 13px; color: var(--t3); font-weight: 500; }
.plan ul { list-style: none; margin: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.plan li { font-size: 13px; color: var(--t2); display: flex; gap: 9px; }
.plan li svg { width: 15px; height: 15px; color: var(--t1); flex-shrink: 0; }

/* 成员行头像 */
.mini-face { width: 32px; height: 32px; border-radius: 50%; background-size: cover; background-position: center; background-color: var(--card-2); }

/* 工具条 */
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; animation: rise .6s var(--ease-out) both; }
.bar .sp { flex: 1; }
.search-in { display: flex; align-items: center; gap: 8px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0 14px; max-width: 280px; flex: 1; }
.search-in svg { width: 15px; height: 15px; color: var(--t4); }
.search-in input { background: none; border: none; outline: none; color: var(--t1); font-size: 13.5px; padding: 9px 0; flex: 1; font-family: var(--f); }
.search-in input::placeholder { color: var(--t4); }

@media (max-width: 1000px) {
  .shell { grid-template-columns: 64px 1fr; }
  .sb-brand .nm, .sb-brand .cjk, .org-meta, .sb-group, .sb-item span,
  .sb-item .badge-soon, .sb-tool .nbadge, .sb-tool .nano, .sb-tool .soon { display: none; }
  /* 触点 ≥44px(D3 a11y):折叠态图标项放大到 44 高 */
  .sb-item { justify-content: center; min-height: 44px; }

  /* 折叠态 hover 飞出标签(D3):侧栏只剩图标,悬停在右侧浮出带文字的标签层。
     用 ::after 渲染 data-label,不依赖 span(span 已隐藏)。 */
  .sb-item[data-label]:hover::after {
    content: attr(data-label);
    position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
    background: var(--modal); border: 1px solid var(--line); border-radius: 9px;
    padding: 7px 12px; font-size: 13px; font-weight: 500; color: var(--t1);
    white-space: nowrap; box-shadow: var(--sh-pop); z-index: 50; pointer-events: none;
  }
}

/* —— 创作台 Demo/案例 横向条 —— */
.link-btn { color: var(--t2); cursor: pointer; transition: color .2s; }
.link-btn:hover { color: var(--t1); }
.demo-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.demo-strip::-webkit-scrollbar { display: none; }
.dchip { flex: 0 0 132px; aspect-ratio: 9/13; border-radius: var(--r); overflow: hidden; position: relative; border: 1px solid var(--line-soft); cursor: pointer; transition: .25s var(--ease-out); }
.dchip:hover { transform: translateY(-4px); border-color: var(--line-hi); }
.dchip .di { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .8s var(--ease-out); }
.dchip:hover .di { transform: scale(1.07); }
.dchip .dv { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 40%, rgba(0,0,0,.8)); }
.dchip .dt { position: absolute; left: 10px; bottom: 10px; font-size: 12px; font-weight: 600; color: #fff; }
.dchip .dp { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; opacity: 0; transition: opacity .25s; }
.dchip:hover .dp { opacity: 1; }
.dchip .dp svg { width: 15px; height: 15px; color: #0A0A0B; margin-left: 2px; }

/* 经典页码条(审计日志 / 消费明细共用)*/
.ld-pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 4px 4px; }
.ld-pginfo { font-size: 12px; color: var(--t3); }
.ld-pg { background: var(--field); border: 1px solid var(--line); color: var(--t1); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: inherit; min-height: 34px; }
.ld-pg:hover:not(:disabled) { border-color: var(--line-hi); }
.ld-pg:disabled { opacity: .4; cursor: not-allowed; }

/* 「开票信息」链接 + 详情弹层(订单页 / 发票页共用)*/
.iv-detail-link, .od-ivlink { background: none; border: none; color: var(--blue); font-size: 12px; cursor: pointer; font-family: inherit; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.ivd-ov { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.ivd-modal { background: var(--card-hi); border: 1px solid var(--line); border-radius: 16px; padding: 24px; min-width: 360px; max-width: 480px; width: 100%; }
.ivd-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.ivd-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.ivd-k { color: var(--t3); flex-shrink: 0; }
.ivd-v { color: var(--t1); font-weight: 600; text-align: right; word-break: break-all; }
.ivd-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ivd-dl { background: var(--blue); color: #fff; border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 700; text-decoration: none; }
.ivd-close { background: var(--field); border: 1px solid var(--line); color: var(--t2); border-radius: 999px; padding: 9px 18px; font-size: 13px; cursor: pointer; font-family: inherit; }

/* 回执图片预览弹层(租户订单页 / admin 后台共用;自适应竖/横图,居中)*/
.rcp-ov { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 600; padding: 24px; }
.rcp-modal { background: var(--card-hi); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(92vw, 560px); max-height: 92vh; }
.rcp-modal h3 { font-size: 16px; font-weight: 700; }
.rcp-modal img { max-width: 100%; max-height: 72vh; border-radius: 10px; border: 1px solid var(--line); object-fit: contain; }
.rcp-close { background: var(--field); border: 1px solid var(--line); color: var(--t1); border-radius: 999px; padding: 10px 28px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; min-height: 40px; }
.rcp-close:hover { border-color: var(--line-hi); }
