:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f0f3f8;
  --ink: #172033;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e8f0;
  --primary: #5b58d6;
  --primary-dark: #4542b7;
  --primary-soft: #eeedff;
  --cyan: #2bb7c9;
  --cyan-soft: #e4f8fb;
  --orange: #f28b58;
  --orange-soft: #fff0e8;
  --success: #27a56c;
  --success-soft: #e8f8f0;
  --danger: #d65461;
  --danger-soft: #fff0f1;
  --dark: #1d2435;
  --shadow: 0 12px 30px rgba(32, 45, 79, .07);
  --radius: 8px;
}

* { box-sizing: border-box; letter-spacing: 0; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font: 15px/1.6 "Inter", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden], .is-hidden { display: none !important; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.site-shell { min-height: 100vh; }
.site-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 190px; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 7px); align-items: end; gap: 3px; width: 34px; height: 34px; padding: 5px; border-radius: 9px; background: var(--dark); }
.brand-mark span { display: block; height: 10px; border-radius: 2px; background: #9fe7e8; }
.brand-mark span:nth-child(2) { height: 17px; background: #8c88f5; }
.brand-mark span:nth-child(3) { height: 23px; background: #ffb27d; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; }
.brand small { display: block; margin-top: 3px; color: var(--subtle); font-size: 12px; line-height: 1.15; letter-spacing: .06em; }
.top-nav { display: flex; align-items: center; gap: 28px; margin-left: auto; margin-right: 30px; }
.top-nav a { color: var(--muted); font-size: 14px; }
.top-nav a:hover, .top-nav a.is-active { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-link { padding: 7px 0; color: var(--muted); font-size: 14px; }
.header-link:hover { color: var(--ink); }
.account-link { display: inline-flex; align-items: center; gap: 8px; padding: 5px 8px 5px 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.account-link:hover { border-color: #c4c1f6; }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.account-text strong, .account-text small { display: block; line-height: 1.25; }
.account-text strong { font-size: 14px; }
.account-text small { color: var(--muted); font-size: 13px; }
.mobile-menu { display: none; }

.site-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.side-rail { display: flex; flex-direction: column; padding: 29px 16px 20px; border-right: 1px solid var(--line); background: #fbfcfe; }
.rail-title { margin: 0 10px 12px; color: var(--subtle); font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.rail-nav { display: grid; gap: 3px; }
.rail-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 11px; border-radius: 7px; color: var(--muted); font-size: 14px; }
.rail-link:hover { background: var(--surface-soft); color: var(--ink); }
.rail-link.is-active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.rail-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--surface-soft); color: currentColor; font-size: 15px; font-weight: 800; }
.rail-link.is-active .rail-icon { background: var(--surface); }
.rail-link span:last-child { flex: 1; }
.rail-tag { color: var(--subtle); font-size: 12px; }
.rail-divider { height: 1px; margin: 24px 10px 22px; background: var(--line); }
.rail-bottom { margin-top: auto; }
.health { display: flex; align-items: center; gap: 8px; margin: 0 10px 13px; color: var(--muted); font-size: 14px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }

.main-content { min-width: 0; padding: 36px 38px 72px; }
.content-wrap { width: min(1280px, 100%); margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head-copy { min-width: 0; }
/* §528 页头右侧的动作按钮组（退出登录 / 刷新…）：横向排，窄屏换行不挤标题 */
.page-head-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { display: block; color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.page-head h1 { margin: 7px 0 0; color: var(--ink); font-size: 35px; font-weight: 750; line-height: 1.18; }
.page-head p { max-width: 680px; margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 48px 0 18px; }
.section-head h2 { margin: 5px 0 0; font-size: 24px; line-height: 1.25; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.link-button { padding: 4px 0; background: transparent; color: var(--primary-dark); font-size: 14px; font-weight: 700; }
.link-button:hover { color: var(--primary); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 17px; border-radius: 7px; font-size: 14px; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 17px rgba(91, 88, 214, .2); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.button-secondary:hover { border-color: #c4c1f6; color: var(--primary-dark); }
.button-dark { background: var(--dark); color: #fff; }
.button-dark:hover { background: #2b3550; }
.button-light { border: 1px solid #d3d1ff; background: var(--primary-soft); color: var(--primary-dark); }
.button-light:hover { background: #e5e3ff; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: 18px; }
.icon-button:hover { border-color: #c4c1f6; color: var(--primary); }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 26px; min-height: 374px; overflow: hidden; padding: 48px; border-radius: 10px; background: var(--dark); color: #fff; }
.hero::before { position: absolute; top: -92px; right: -72px; width: 360px; height: 360px; border: 1px solid rgba(159, 231, 232, .12); border-radius: 50%; content: ""; }
.hero::after { position: absolute; top: 42px; right: 115px; width: 210px; height: 210px; border: 1px solid rgba(255, 178, 125, .14); border-radius: 50%; content: ""; }
.hero-copy, .hero-demo { position: relative; z-index: 1; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #9fe7e8; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.hero-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.hero h1 { max-width: 650px; margin: 23px 0 16px; font-size: clamp(36px, 4vw, 60px); font-weight: 750; letter-spacing: -.06em; line-height: 1.08; }
.hero h1 em { color: #9fe7e8; font-style: normal; }
.hero-copy > p { max-width: 575px; margin: 0; color: #c2cad9; font-size: 16px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 29px; }
.hero .button-secondary { border-color: #505b75; background: transparent; color: #fff; }
.hero .button-secondary:hover { border-color: #9fe7e8; color: #9fe7e8; }
.hero-demo { align-self: center; padding: 18px; border: 1px solid rgba(255,255,255,.17); border-radius: 8px; background: #252d42; box-shadow: 0 18px 45px rgba(0,0,0,.18); }
.demo-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 13px; border-bottom: 1px solid rgba(255,255,255,.11); color: #c9d2e3; font-size: 13px; }
.demo-status { color: #9fe7e8; font-size: 12px; }
.demo-body { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding-top: 16px; }
.demo-side { display: grid; align-content: start; gap: 6px; color: #8995ae; font-size: 12px; }
.demo-side strong { margin-bottom: 7px; color: #fff; font-size: 14px; }
.demo-side span { padding: 7px 8px; border-radius: 5px; }
.demo-side span:first-of-type { background: rgba(159, 231, 232, .12); color: #9fe7e8; }
.demo-main { min-width: 0; }
.demo-tabs { display: flex; gap: 7px; color: #8995ae; font-size: 12px; }
.demo-tabs span:first-child { color: #fff; }
.demo-prompt { margin: 36px 0 24px; text-align: center; }
.demo-orbit { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 11px; border: 1px solid rgba(159, 231, 232, .35); border-radius: 50%; color: #9fe7e8; font-size: 19px; }
.demo-prompt strong, .demo-prompt small { display: block; }
.demo-prompt strong { font-size: 15px; }
.demo-prompt small { margin-top: 5px; color: #9ba7bb; font-size: 12px; }
.demo-message { display: flex; gap: 8px; padding: 11px; border: 1px solid rgba(255,255,255,.11); border-radius: 6px; background: rgba(255,255,255,.045); }
.demo-avatar { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 5px; background: #9fe7e8; color: var(--dark); font-weight: 800; }
.demo-message strong, .demo-message small { display: block; }
.demo-message strong { font-size: 12px; }
.demo-message small { margin-top: 3px; color: #9ba7bb; font-size: 11px; }
.demo-input { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 6px; color: #8995ae; font-size: 12px; }
.demo-input b { color: #9fe7e8; font-size: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric { min-height: 145px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric.dark { border-color: var(--dark); background: var(--dark); color: #fff; }
.metric.accent { border-color: #f7cfb7; background: var(--orange-soft); }
.metric-label { color: var(--muted); font-size: 14px; }
.metric.dark .metric-label { color: #b7c1d3; }
.metric strong { display: block; margin-top: 12px; font-size: 31px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.metric strong small { font-size: 18px; }
.metric-note { display: block; margin-top: 13px; color: var(--muted); font-size: 13px; }
.metric.dark .metric-note { color: #9fe7e8; }
.metric .positive { color: var(--success); }
.metric.dark .positive { color: #9fe7e8; }

.model-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.model-card { display: flex; min-width: 0; flex-direction: column; min-height: 256px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: .18s ease; }
.model-card:hover { border-color: #c4c1f6; box-shadow: var(--shadow); transform: translateY(-2px); }
.model-card.featured { border-color: #c7c5ff; background: #fbfaff; }
.model-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.model-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 18px; font-weight: 850; }
.model-logo.image { background: var(--orange-soft); color: var(--orange); }
.model-logo.compatible { background: var(--cyan-soft); color: #168a98; }
.model-badge { padding: 5px 8px; border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 13px; font-weight: 700; }
.model-card h3 { margin: 19px 0 2px; font-size: 18px; line-height: 1.25; }
.model-id { color: var(--subtle); font: 13px/1.4 "SFMono-Regular", Consolas, monospace; }
.model-summary { min-height: 48px; margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.model-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.model-tag, .tag { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 4px; background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.model-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.model-action { padding: 0; background: transparent; color: var(--primary-dark); font-size: 14px; font-weight: 750; }
.model-action:hover { color: var(--primary); }
.model-price { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ink); font-size: 13px; font-weight: 650; }
.model-price span { white-space: nowrap; }
.model-price-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.model-price-head b { color: var(--primary-dark); font-size: 10px; font-weight: 750; }
.model-price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; width: 100%; }
.model-price-row { display: grid; gap: 3px; min-width: 0; }
.model-price-row small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.model-price-row strong { display: inline-flex; align-items: baseline; gap: 3px; color: var(--ink); font-size: 13px; }
.model-price-row strong small { color: var(--subtle); font-size: 10px; font-weight: 650; }
.model-price-row strong > span { display: inline-flex; align-items: baseline; gap: 3px; }
.model-price-row strong > span + span { color: var(--primary-dark); }
.model-price-row i { margin-right: 2px; color: var(--subtle); font-size: 9px; font-style: normal; font-weight: 650; }
/* §267 生成类价格：元后面并排给出积分（1 元 = 100 积分），避免「2.8 积分」被读成 2.8 元。 */
.model-price-points { color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; }

.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.promo { display: flex; align-items: end; justify-content: space-between; min-height: 170px; padding: 24px; border-radius: 8px; }
.promo.tutorial { background: #fff0c4; }
.promo.canvas { background: #e4f8fb; }
.promo h3 { max-width: 430px; margin: 8px 0 5px; font-size: 22px; line-height: 1.3; }
.promo p { max-width: 465px; margin: 0; color: rgba(23, 32, 51, .68); font-size: 14px; }
.round-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid rgba(23,32,51,.24); border-radius: 50%; background: transparent; color: var(--ink); font-size: 19px; }
.round-button:hover { background: var(--ink); color: #fff; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.toolbar-left { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.segmented { display: inline-flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.segmented button { min-height: 35px; padding: 7px 15px; border-radius: 5px; background: transparent; color: var(--muted); font-size: 14px; }
.segmented button.is-active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 1px 4px rgba(32,45,79,.08); font-weight: 750; }
.search-box { display: flex; align-items: center; gap: 9px; min-width: 270px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.catalog-aside { display: grid; align-content: start; gap: 14px; }
.aside-card { padding: 21px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.aside-card.dark { border-color: var(--dark); background: var(--dark); color: #fff; }
.aside-card h3 { margin: 11px 0 8px; font-size: 20px; line-height: 1.3; }
.aside-card p { margin: 0 0 21px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.aside-card.dark p { color: #bac3d3; }
.aside-list { display: grid; gap: 14px; margin-top: 15px; }
.aside-row { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.aside-row:last-child { padding-bottom: 0; border-bottom: 0; }
.aside-row-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.aside-row-dot.orange { background: var(--orange); }
.aside-row div { flex: 1; }
.aside-row strong, .aside-row small { display: block; }
.aside-row strong { font-size: 14px; }
.aside-row small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.aside-row b { color: var(--success); font-size: 13px; font-weight: 700; }

.studio { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 650px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.studio-side { display: flex; flex-direction: column; padding: 19px 13px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.studio-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 14px; color: var(--muted); font-size: 14px; }
.conversation { display: flex; align-items: center; gap: 9px; width: 100%; padding: 12px 9px; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
.conversation:hover, .conversation.is-active { background: var(--surface); }
.conversation-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.conversation-icon.image { background: var(--orange-soft); color: var(--orange); }
.conversation div { flex: 1; min-width: 0; }
.conversation strong, .conversation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation strong { font-size: 14px; }
.conversation small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.conversation b { color: var(--subtle); font-size: 13px; }
.quick-prompts { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.quick-prompts .eyebrow { color: var(--muted); font-size: 13px; }
.prompt-chip { display: block; width: 100%; margin-top: 8px; padding: 8px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.prompt-chip:hover { border-color: #c4c1f6; color: var(--primary-dark); }
.chat { display: flex; min-width: 0; flex-direction: column; background: #fcfdff; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.mode-tabs { display: flex; gap: 4px; }
.mode-tabs button { padding: 8px 13px; border-radius: 5px; background: transparent; color: var(--muted); font-size: 14px; }
.mode-tabs button.is-active { background: var(--dark); color: #fff; font-weight: 700; }
.chat-tools { display: flex; align-items: center; gap: 12px; }
.model-select { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.model-select select, .image-options select { min-height: 33px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: var(--surface); color: var(--ink); font-size: 13px; }
.chat-stream { display: flex; flex: 1; flex-direction: column; gap: 17px; min-height: 470px; max-height: 580px; padding: 38px clamp(22px, 6vw, 86px); overflow: auto; }
.welcome { margin: auto 0; text-align: center; }
.welcome-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 15px; border: 1px solid #c3c1ff; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 22px; }
.welcome h2 { margin: 8px 0 6px; font-size: 25px; line-height: 1.25; }
.welcome p { margin: 0; color: var(--muted); font-size: 15px; }
.starter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 700px; margin: 27px auto 0; }
.starter-grid button { min-height: 105px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: left; }
.starter-grid button:hover { border-color: #c4c1f6; box-shadow: var(--shadow); }
.starter-grid span, .starter-grid strong, .starter-grid small { display: block; }
.starter-grid span { color: var(--primary); font-size: 13px; font-weight: 800; }
.starter-grid strong { margin-top: 9px; font-size: 14px; }
.starter-grid small { margin-top: 4px; color: var(--muted); font-size: 13px; }
.message { display: flex; gap: 10px; max-width: 850px; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.message.user .message-avatar { background: var(--orange); color: var(--ink); }
.message-meta { margin-bottom: 5px; color: var(--muted); font-size: 13px; }
.message-body { padding: 12px 15px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: #344054; font-size: 15px; line-height: 1.75; }
.message.user .message-body { border-color: #f7cfb7; background: #fff7f2; }
.message-body pre { padding: 12px; overflow: auto; background: var(--surface-soft); font-size: 13px; }
.message-body img { display: block; max-width: 100%; margin-top: 8px; border-radius: 6px; }
.image-options { display: flex; flex-wrap: wrap; gap: 22px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.image-options label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.composer { margin: 0 18px 18px; padding: 11px 12px 9px; border: 1px solid #cbd3e1; border-radius: 8px; background: var(--surface); }
.composer:focus-within { border-color: #aaa7f1; box-shadow: 0 0 0 3px rgba(91,88,214,.1); }
.composer textarea { display: block; width: 100%; min-height: 33px; max-height: 130px; resize: none; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.65; }
.composer textarea::placeholder { color: var(--subtle); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.composer-hints { display: flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 13px; }
.key-hint { padding: 2px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 12px; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--primary); color: #fff; font-size: 18px; }
.send-button:hover { background: var(--primary-dark); }
.send-button:disabled { opacity: .5; cursor: wait; }

.tutorial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tutorial-card { min-height: 245px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tutorial-card.wide { grid-column: 1 / -1; min-height: 285px; background: #f5f4ff; }
.tutorial-number { color: var(--primary); font-size: 13px; font-weight: 800; }
.tutorial-card h2 { margin: 8px 0 8px; font-size: 22px; line-height: 1.3; }
.tutorial-card p { max-width: 760px; margin: 0; color: var(--muted); font-size: 15px; }
.tutorial-card pre { max-width: 760px; margin: 19px 0 0; padding: 16px; overflow: auto; border-radius: 6px; background: var(--dark); color: #e5e9f1; font-size: 13px; line-height: 1.75; }
.steps { display: grid; gap: 10px; margin-top: 22px; }
.steps span { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.steps b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #ffe3a0; font-size: 12px; }
.code-line { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.code-line strong { flex: 1; overflow: auto; color: var(--ink); font-size: 13px; white-space: nowrap; }
.copy-button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--primary-dark); font-size: 13px; font-weight: 700; }
.copy-button:hover { border-color: #c4c1f6; }

.console-tabs { display: flex; gap: 26px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.console-tabs a { position: relative; padding: 0 0 13px; color: var(--muted); font-size: 14px; }
.console-tabs a:hover, .console-tabs a.is-active { color: var(--primary-dark); }
.console-tabs a.is-active { font-weight: 750; }
.console-tabs a.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--primary); content: ""; }
.console-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.kpi span, .kpi small { display: block; color: var(--muted); font-size: 14px; }
.kpi strong { display: block; margin: 13px 0 5px; font-size: 29px; line-height: 1; }
.console-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; }
.data-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.data-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.data-card h2 { margin: 5px 0 0; font-size: 20px; line-height: 1.25; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--primary); }
.legend i.orange { background: var(--orange); }
.chart { display: flex; height: 270px; margin-top: 21px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; padding: 0 11px 28px 0; color: var(--subtle); font-size: 12px; }
.chart-stage { position: relative; flex: 1; min-width: 0; }
.chart-grid { position: absolute; inset: 0 0 30px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid i { border-top: 1px dashed var(--line); }
.chart svg { position: absolute; inset: 0 0 30px; width: 100%; height: calc(100% - 30px); }
.chart-area { fill: rgba(91,88,214,.12); }
.chart-line { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-width: 3; }
.chart-line.orange { stroke: var(--orange); stroke-width: 2.5; }
.chart-x { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; color: var(--subtle); font-size: 12px; }
.distribution { display: grid; gap: 25px; margin-top: 27px; }
.distribution-empty { display: grid; min-height: 150px; place-items: center; color: var(--muted); font-size: 14px; text-align: center; }
.distribution-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 42px; gap: 11px; align-items: center; }
.distribution-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.distribution-icon.orange { background: var(--orange-soft); color: var(--orange); }
.distribution-row strong, .distribution-row small { display: block; }
.distribution-row strong { font-size: 14px; }
.distribution-row small { margin-top: 3px; color: var(--muted); font-size: 13px; }
.distribution-row b { color: var(--muted); font-size: 13px; text-align: right; }
.distribution-bar { grid-column: 2 / -1; height: 6px; margin-top: -13px; border-radius: 6px; background: var(--surface-soft); }
.distribution-bar em { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.distribution-bar em.orange { background: var(--orange); }
.note { margin-top: 28px; padding: 12px; border-left: 3px solid #f0c85d; background: #fff9e4; color: #756628; font-size: 13px; }
.table-card { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; text-align: left; }
.data-table th { padding: 12px 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 750; }
.data-table td { padding: 14px 9px; border-bottom: 1px solid #edf0f5; color: var(--muted); font-size: 13px; }
.data-table td strong { color: var(--ink); font-weight: 750; }
.data-table tr:last-child td { border-bottom: 0; }
/* 使用日志：Token 拆分说明与高峰标记（对话按 token 计价时用来核对「原积分 × 倍率」） */
.log-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; opacity: 0.85; }
.log-peak { display: inline-flex; margin-left: 5px; padding: 1px 5px; border-radius: 4px; background: #3a2a1c; color: #ffb27d; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 4px; font-size: 13px; font-weight: 700; }
.status.success { background: var(--success-soft); color: var(--success); }
.status.error { background: var(--danger-soft); color: var(--danger); }
.table-action { padding: 4px 0; background: transparent; color: var(--danger); font-size: 13px; font-weight: 700; }
.table-action:hover { text-decoration: underline; }
.console-subhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.console-subhead h2 { margin: 7px 0 4px; font-size: 24px; line-height: 1.25; }
.console-subhead p { margin: 0; color: var(--muted); font-size: 14px; }
.notice { display: flex; gap: 11px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #cbe9df; border-radius: 7px; background: var(--success-soft); color: #367c61; }
.notice > b { color: var(--success); }
.notice strong, .notice p { display: block; }
.notice strong { font-size: 14px; }
.notice p { margin: 3px 0 0; font-size: 13px; }
.filters { display: flex; align-items: center; gap: 10px; }
.filters select { height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: var(--surface); color: var(--ink); font-size: 13px; }
.wallet-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.wallet-card { min-height: 160px; padding: 21px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wallet-card.balance { border-color: var(--dark); background: var(--dark); color: #fff; }
.wallet-card .eyebrow { color: var(--primary); }
.wallet-card.balance .eyebrow { color: #9fe7e8; }
.wallet-card strong { display: block; margin-top: 21px; font-size: 35px; line-height: 1; }
.wallet-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }
.wallet-card.balance small { color: #b7c1d3; }
.wallet-line { height: 4px; margin-top: 20px; overflow: hidden; border-radius: 4px; background: #313a52; }
.wallet-line span { display: block; width: 67%; height: 100%; background: var(--orange); }

.canvas { position: relative; min-height: 630px; overflow: hidden; border: 1px solid #cde7ea; border-radius: 8px; background: #edf9fa; }
.canvas::before { position: absolute; inset: 0; opacity: .45; background-image: linear-gradient(#cde7ea 1px, transparent 1px), linear-gradient(90deg, #cde7ea 1px, transparent 1px); background-size: 32px 32px; content: ""; }
.canvas-copy { position: relative; z-index: 1; width: min(510px, 72%); padding: 78px 0 0 70px; }
.canvas-symbol { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 21px; border: 1px solid #9ad2d8; border-radius: 50%; background: #dff4f6; color: #168a98; font-size: 22px; font-weight: 800; }
.canvas-copy h2 { margin: 10px 0; font-size: 42px; line-height: 1.08; letter-spacing: -.05em; }
.canvas-copy p { color: #5f7a80; font-size: 15px; line-height: 1.8; }
.canvas-node { position: absolute; z-index: 1; display: grid; grid-template-columns: 30px 1fr; column-gap: 9px; min-width: 170px; padding: 13px; border: 1px solid rgba(22,138,152,.2); border-radius: 7px; background: rgba(255,255,255,.82); box-shadow: 0 15px 30px rgba(46,111,121,.1); }
.canvas-node span { grid-row: 1 / 3; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.canvas-node strong { font-size: 13px; }
.canvas-node small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.node-a { top: 120px; right: 33%; }
.node-b { top: 280px; right: 15%; }
.node-c { top: 454px; right: 8%; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: var(--dark); }
.auth-shell { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(380px, 450px); width: min(1000px, 100%); overflow: hidden; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; background: #252d42; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.auth-intro { display: flex; flex-direction: column; justify-content: center; padding: 52px; color: #fff; }
.auth-intro h1 { margin: 30px 0 15px; font-size: 46px; line-height: 1.08; letter-spacing: -.05em; }
.auth-intro p { max-width: 450px; color: #b8c2d3; font-size: 16px; line-height: 1.8; }
.auth-points { display: grid; gap: 12px; margin-top: 27px; color: #d7deea; font-size: 14px; }
.auth-points span::before { display: inline-block; width: 19px; height: 19px; margin-right: 8px; border-radius: 50%; background: rgba(159,231,232,.16); color: #9fe7e8; content: "✓"; text-align: center; }
.auth-form { padding: 48px 42px; background: var(--surface); }
.auth-form h2 { margin: 8px 0 7px; font-size: 26px; }
.auth-form > p { margin: 0 0 25px; color: var(--muted); font-size: 14px; }
.field { display: block; margin-top: 17px; color: var(--ink); font-size: 14px; font-weight: 700; }
.field input, .field select { display: block; width: 100%; height: 45px; margin-top: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; outline: none; background: var(--surface); color: var(--ink); font-size: 15px; }
.field input:focus, .field select:focus { border-color: #aaa7f1; box-shadow: 0 0 0 3px rgba(91,88,214,.1); }
.auth-submit { width: 100%; margin-top: 24px; }
.auth-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 19px; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--primary-dark); font-weight: 700; }
.auth-message { min-height: 22px; margin-top: 12px; color: var(--danger); font-size: 13px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(23,32,51,.52); }
.modal { width: min(500px, 100%); padding: 25px; border-radius: 8px; background: var(--surface); box-shadow: 0 25px 70px rgba(0,0,0,.22); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal h2 { margin: 6px 0 0; font-size: 24px; }
.modal-lead { margin: 16px 0 20px; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.created-token { margin-top: 18px; padding: 15px; border: 1px solid #f7cfb7; border-radius: 7px; background: #fff7f2; }
.created-token p { margin: 7px 0 11px; color: #95674e; font-size: 13px; }
.token-copy-row { display: flex; align-items: center; gap: 8px; }
.token-copy-row code { flex: 1; min-width: 0; padding: 10px; overflow: auto; border: 1px solid #f0d2c0; background: var(--surface); color: var(--ink); font-size: 13px; white-space: nowrap; }
.toast-stack { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: grid; gap: 9px; }
.toast { max-width: 360px; padding: 13px 16px; border: 1px solid #b9e6d4; border-radius: 7px; background: var(--success-soft); color: #367c61; box-shadow: var(--shadow); font-size: 14px; }
.toast.error { border-color: #f0c1c6; background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1100px) {
  .site-header { padding: 0 22px; }
  .top-nav { gap: 17px; margin-right: 18px; }
  .main-content { padding: 30px 24px 60px; }
  .hero { grid-template-columns: 1fr; padding: 37px; }
  .hero-demo { max-width: 600px; }
  .model-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .site-header { min-height: 64px; padding: 0 16px; }
  .brand { min-width: 0; }
  .brand small { display: none; }
  .top-nav { display: none; }
  .mobile-menu { display: inline-grid; }
  .header-link { display: none; }
  .site-layout { display: block; }
  .side-rail { position: fixed; z-index: 40; top: 64px; bottom: 0; left: -260px; width: 250px; transition: left .2s ease; box-shadow: 12px 0 35px rgba(32,45,79,.12); }
  .side-rail.is-open { left: 0; }
  .side-overlay { position: fixed; z-index: 35; inset: 64px 0 0; background: rgba(23,32,51,.4); }
  .main-content { padding: 25px 16px 48px; }
  .page-head, .toolbar, .console-subhead { align-items: flex-start; flex-direction: column; }
  .page-head h1 { font-size: 31px; }
  .page-head .button { width: 100%; }
  .metric-grid, .console-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promo-grid, .tutorial-grid, .catalog-aside, .wallet-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .search-box { width: 100%; min-width: 0; }
  .toolbar-left { width: 100%; }
  .studio { display: block; }
  .studio-side { display: none; }
  .chat-stream { min-height: 500px; padding: 30px 18px; }
  .starter-grid { grid-template-columns: 1fr; }
  .console-tabs { gap: 20px; overflow-x: auto; }
  .console-tabs a { flex: 0 0 auto; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { display: none; }
  .auth-form { padding: 38px 27px; }
  .canvas-copy { width: 85%; padding: 53px 0 0 28px; }
  .canvas-copy h2 { font-size: 35px; }
  .node-a { top: 240px; right: 18px; }
  .node-b { top: 380px; right: 18px; }
  .node-c { top: 520px; right: 18px; }
}

/* Token reveal controls */
.token-list-secret {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 420px;
  gap: 6px;
}

.token-secret-toggle,
.token-copy-icon {
  min-height: 34px;
  border: 1px solid #bfe5d0;
  border-radius: 6px;
  background: #effaf4;
  color: #287653;
  cursor: pointer;
}

.token-secret-toggle {
  max-width: 350px;
  padding: 7px 10px;
  text-align: left;
}

.token-secret-toggle code {
  display: block;
  overflow: hidden;
  color: #287653;
  font: 13px/1.35 "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-secret-toggle[data-revealed="true"] {
  max-width: none;
}

.token-secret-toggle[data-revealed="true"] code {
  overflow: visible;
  text-overflow: clip;
}

.token-copy-icon {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
  place-items: center;
  font-size: 17px;
}

.token-secret-toggle:hover,
.token-copy-icon:hover {
  border-color: #8fcea9;
  background: #e2f6eb;
  color: #196440;
}

.token-secret-toggle[data-revealed="true"] {
  border-color: #8fcea9;
  background: #e5f7ed;
}

/* AIGC workshop */
body[data-page="chat"].is-public-page {
  background: #fafaff;
}

body[data-page="chat"].is-public-page .main-content {
  padding: 0 20px 56px;
  background: #fafaff;
}

body[data-page="chat"].is-public-page .content-wrap {
  width: min(1180px, 100%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workshop-page {
  min-height: calc(100vh - 64px);
}

body.is-public-page .workshop-page .workshop-hero {
  margin: 0;
  padding: 38px 16px 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
}

body.is-public-page .workshop-page .workshop-hero h1 {
  margin: 0;
  color: #7656de;
  font-size: 40px;
  font-weight: 430;
  line-height: 1.25;
}

body.is-public-page .workshop-page .workshop-hero h1 span {
  display: inline-block;
  margin: 0 12px;
  color: #9a73e7;
  font-size: 18px;
  vertical-align: middle;
}

body.is-public-page .workshop-page .workshop-hero > p {
  margin: 7px 0 22px;
  color: #8b8d9c;
  font-size: 16px;
}

body.is-public-page .workshop-page .workshop-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 5px;
  border: 1px solid #ecebf3;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(64, 53, 105, .08);
}

body.is-public-page .workshop-page .workshop-tabs button {
  min-width: 132px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: #777986;
  font-size: 15px;
  font-weight: 650;
  transition: color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

body.is-public-page .workshop-page .workshop-tabs button:hover:not(:disabled) {
  color: #352d50;
}

body.is-public-page .workshop-page .workshop-tabs button.is-active {
  background: #28213d;
  color: #fff;
  box-shadow: 0 7px 16px rgba(40, 33, 61, .24);
}

body.is-public-page .workshop-page .workshop-tabs button:active:not(:disabled) {
  transform: scale(.98);
}

.creator-shell {
  width: min(950px, 100%);
  margin: 0 auto;
  padding: 22px 24px 20px;
  border: 1px solid #e8e7ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(67, 54, 112, .09);
}

body.is-public-page .creator-shell .creator-composer {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.is-public-page .creator-shell .creator-composer:focus-within {
  border: 0;
  box-shadow: none;
}

body.is-public-page .creator-shell .creator-composer textarea {
  min-height: 76px;
  max-height: 150px;
  padding: 4px 3px;
  color: #292536;
  font-size: 16px;
  line-height: 1.7;
}

.prompt-assist {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: #9293a1;
  font-size: 14px;
}

.reference-upload {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px dashed #cfc9e3;
  border-radius: 7px;
  background: #fbfaff;
  color: #867da1;
  font-size: 25px;
}

.reference-upload:disabled,
.more-settings:disabled {
  cursor: not-allowed;
  opacity: .8;
}

.creator-divider {
  height: 1px;
  margin: 10px 0 14px;
  background: #eeedf3;
}

.creator-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #e6e4eb;
  border-radius: 999px;
  background: #fff;
  color: #777986;
  font-size: 14px;
}

.studio-control:focus-within {
  border-color: #a99be2;
  box-shadow: 0 0 0 3px rgba(118, 86, 222, .08);
}

body.is-public-page .creator-shell .studio-control select {
  min-height: 34px;
  max-width: 154px;
  padding: 0 18px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #3d355a;
  font-size: 14px;
  font-weight: 700;
}

.more-settings,
.clear-workshop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid #e6e4eb;
  border-radius: 999px;
  background: #fff;
  color: #777986;
  font-size: 14px;
  white-space: nowrap;
}

.creator-submit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.generation-estimate {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: #8b8d99;
  font-size: 14px;
}

.generation-estimate strong {
  color: #d39827;
  font-size: 15px;
}

.generation-estimate small {
  color: #aaaab4;
  font-size: 13px;
}

body.is-public-page .creator-shell .composer-hints {
  margin-left: auto;
  color: #a1a1ad;
  font-size: 13px;
}

body.is-public-page .creator-shell .send-button {
  display: inline-flex;
  width: auto;
  min-width: 128px;
  height: 42px;
  padding: 0 20px;
  gap: 8px;
  border-radius: 999px;
  background: #28213d;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(40, 33, 61, .22);
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

body.is-public-page .creator-shell .send-button:hover {
  background: #443668;
  box-shadow: 0 10px 22px rgba(58, 43, 94, .27);
  transform: translateY(-1px);
}

.creation-feed {
  width: min(1080px, 100%);
  margin: 42px auto 0;
}

.creation-feed-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-label {
  display: block;
  color: #8b75cf;
  font-size: 12px;
  font-weight: 800;
}

.creation-feed h2 {
  margin: 2px 0 0;
  color: #292536;
  font-size: 24px;
  line-height: 1.3;
}

.clear-workshop {
  border-radius: 7px;
  transition: border-color .18s ease, color .18s ease;
}

.clear-workshop:hover {
  border-color: #bfb4e2;
  color: #624ab6;
}

body.is-public-page .creation-feed .workshop-stream {
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.template-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e5e3eb;
  border-radius: 8px;
  background: #eeeef3;
  text-align: left;
  box-shadow: 0 7px 18px rgba(45, 39, 66, .06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.template-card::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(to bottom, rgba(22, 20, 31, 0), rgba(22, 20, 31, .78));
  content: "";
}

.template-card:hover {
  border-color: #a99be2;
  box-shadow: 0 14px 28px rgba(45, 39, 66, .15);
  transform: translateY(-4px);
}

.template-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.template-card:hover img {
  transform: scale(1.035);
}

.template-card > span {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 15px;
  left: 16px;
  color: #fff;
}

.template-card b,
.template-card small {
  display: block;
}

.template-card b {
  font-size: 17px;
}

.template-card small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
}

.creation-feed .message {
  width: min(860px, 100%);
  max-width: 100%;
  margin: 10px auto;
}

.creation-feed .message-body img {
  width: min(680px, 100%);
  border-radius: 8px;
}

.image-records {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 5px;
}

.image-records-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  min-width: 748px;
  gap: 12px;
  align-items: start;
}

.image-records-empty {
  padding: 44px 20px;
  border: 1px dashed #d9d4e7;
  border-radius: 8px;
  /* 4.91:1 on #fafaff（#8f8883 只有 3.35:1，verify-theme.js 的对比度审计会红） */
  color: #736d67;
  text-align: center;
}

.image-record-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 8px 22px rgba(36, 31, 28, .06);
}

.image-record-image {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(250px, 21vw, 360px);
  overflow: hidden;
  padding: 6px;
  background: #f5f2ef;
}

.image-record-resolution,
.image-result-resolution {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  color: #f3c969;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 2px #000, 1px 1px 0 #000, -1px -1px 0 #000;
  -webkit-text-stroke: .35px #000;
}

.image-record-caption {
  max-height: 3.6em;
  margin-top: 6px;
  overflow: hidden;
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-record-overlay {
  position: absolute;
  right: 6px;
  bottom: 6px;
  left: 6px;
  z-index: 4;
  padding: 10px;
  border-radius: 0 0 5px 5px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.image-record-card:hover .image-record-overlay,
.image-record-card:focus-within .image-record-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.image-record-image .generated-image-button,
.image-record-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

.image-record-image .generated-image-button {
  position: relative;
  z-index: 1;
}

.image-record-image .generated-image-button img {
  min-height: 0;
}

.image-record-info {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  padding: 0;
  color: #fff;
}

.image-record-info strong,
.image-record-info span,
.image-record-info small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-record-info strong {
  color: #fff;
  font-size: 12px;
}

.image-record-info span {
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
}

.image-record-card .image-result-actions {
  gap: 5px;
  margin-top: 8px;
  padding: 0;
}

.image-record-card .image-result-actions button {
  padding: 4px 7px;
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 11px;
}

.image-record-card .image-result-actions button.is-danger {
  border-color: rgba(255, 138, 128, .55);
  color: #ffbdb6;
}

.image-record-card .image-result-actions button.is-danger:hover:not(:disabled) {
  border-color: #ff8a80;
  background: rgba(255, 138, 128, .22);
  color: #fff;
}

.image-record-card .image-result-actions button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.image-result-card {
  position: relative;
  width: min(760px, 100%);
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(36, 31, 28, .08);
}

.image-records-grid > .image-result-card {
  width: auto;
  margin: 0;
  min-width: 0;
}

.image-records-grid > .image-result-card .image-result-preview {
  min-height: 150px;
}

.image-result-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-height: 260px;
  padding: 10px;
  background: #f5f2ef;
}

.image-placeholder {
  display: grid;
  place-content: center;
  min-height: 240px;
  color: #88817d;
  text-align: center;
}

.image-placeholder-mark {
  display: block;
  margin-bottom: 10px;
  color: #cb805c;
  font-size: 32px;
  animation: image-pulse 1.5s ease-in-out infinite;
}

.image-placeholder small { display: block; margin-top: 7px; color: #a49c97; }
.generated-image-button { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.generated-image-button img { display: block; width: 100%; height: 100%; min-height: 240px; object-fit: cover; border-radius: 6px; }
.image-result-info { padding: 13px 16px 8px; }
.image-result-info > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.image-result-status { color: #b87856; font-size: 12px; }
.image-result-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: #8f8883; font-size: 12px; }
.image-result-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 15px; }
.image-result-actions button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: #655d58; cursor: pointer; font-size: 12px; }
.image-result-actions button:hover:not(:disabled) { border-color: #c88767; color: #a66143; }
.image-result-actions button:disabled { cursor: not-allowed; opacity: .45; }
.image-lightbox { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 30px; background: rgba(20, 18, 17, .86); cursor: zoom-out; }
.image-lightbox img { max-width: min(1200px, 94vw); max-height: 90vh; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 70px rgba(0, 0, 0, .35); }
.image-lightbox-close { position: absolute; top: 18px; right: 22px; width: 38px; height: 38px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
@keyframes image-pulse { 50% { transform: scale(1.16); opacity: .55; } }

.asset-note {
  margin: 28px 0 0;
  color: #999aa7;
  font-size: 13px;
  text-align: center;
}

.entrance-stage {
  animation: workshop-enter .62s cubic-bezier(.22, .8, .34, 1) both;
}

.entrance-delay-1 { animation-delay: .08s; }
.entrance-delay-2 { animation-delay: .14s; }
.entrance-delay-3 { animation-delay: .24s; }

.template-card {
  animation: workshop-card-enter .52s cubic-bezier(.22, .8, .34, 1) both;
}

.template-card:nth-child(2) { animation-delay: .06s; }
.template-card:nth-child(3) { animation-delay: .12s; }
.template-card:nth-child(4) { animation-delay: .18s; }

@keyframes workshop-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes workshop-card-enter {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 980px) {
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .creator-controls { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 700px) {
  body[data-page="chat"].is-public-page .main-content { padding: 0 12px 40px; }
  body.is-public-page .workshop-page .workshop-hero { padding: 28px 4px 22px; }
  body.is-public-page .workshop-page .workshop-hero h1 { font-size: 30px; }
  body.is-public-page .workshop-page .workshop-hero h1 span { margin: 0 5px; font-size: 14px; }
  body.is-public-page .workshop-page .workshop-tabs { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  body.is-public-page .workshop-page .workshop-tabs button { min-width: 0; min-height: 40px; padding: 7px 9px; font-size: 13px; }
  .creator-shell { padding: 18px 16px 16px; }
  .control-cluster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .studio-control { justify-content: space-between; min-width: 0; border-radius: 7px; }
  body.is-public-page .creator-shell .studio-control select { min-width: 0; max-width: 112px; }
  .control-cluster > .model-select,
  .channel-control { grid-column: 1 / -1; }
  .control-cluster > .model-select select,
  .channel-control select { max-width: 210px; }
  .creator-submit-row { align-items: stretch; flex-wrap: wrap; }
  .generation-estimate { width: 100%; }
  body.is-public-page .creator-shell .composer-hints { display: none; }
  body.is-public-page .creator-shell .send-button { width: 100%; }
  .creation-feed { margin-top: 32px; }
  .image-records-grid { gap: 10px; }
  .image-record-image { height: 250px; }
  .template-grid { gap: 10px; }
  .template-card > span { right: 12px; bottom: 11px; left: 12px; }
  .template-card b { font-size: 15px; }
}

@media (max-width: 800px) {
  body.is-public-page .top-nav {
    scrollbar-width: none;
  }

  body.is-public-page .top-nav::-webkit-scrollbar {
    display: none;
  }
}

/* Token management */

.token-page-shell {
  overflow: hidden;
  border: 1px solid #e4e8ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(38, 51, 78, .07);
}

.token-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 15px 20px;
  border-bottom: 1px solid #edf0f4;
}

.token-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-title-icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  place-items: center;
  background: #eef1ff;
  color: #5a68d7;
  font-size: 18px;
  font-weight: 800;
}

.token-title h1 {
  margin: 0;
  color: #222b3a;
  font-size: 19px;
  line-height: 1.3;
}

.token-title p {
  margin: 3px 0 0;
  color: #8a94a4;
  font-size: 13px;
}

.token-compact-button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #e1e5eb;
  border-radius: 6px;
  background: #f7f8fa;
  color: #657084;
  font-size: 13px;
  cursor: pointer;
}

.token-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0 0 14px;
}

.token-toolbar-actions,
.token-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.token-toolbar .button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  box-shadow: none;
}

.token-neutral-button {
  border: 1px solid #e0e4ea;
  background: #f7f8fa;
  color: #566174;
}

.token-danger-button {
  border: 1px solid #f2c9ce;
  background: #fff0f2;
  color: #c24f5d;
}

.token-query-button {
  border: 1px solid #d9deeb;
  background: #eef1f8;
  color: #4d5970;
}

.token-search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 220px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  background: #ffffff;
  color: #9aa3b1;
}

.token-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #344054;
  font-size: 13px;
}

.token-api-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 7px;
  background: #f0f3f6;
}

.token-api-group {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.token-api-group > strong {
  padding-top: 8px;
  color: #313b4b;
  font-size: 13px;
}

.token-api-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token-api-lines > div {
  display: flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 0 7px 0 10px;
  border: 1px solid #e1e5ea;
  border-radius: 6px;
  background: #ffffff;
}

.token-api-lines span {
  margin-right: 10px;
  color: #606b7c;
  font-size: 12px;
  white-space: nowrap;
}

.token-api-lines code {
  overflow: hidden;
  color: #7e899a;
  font: 12px/1.4 "SFMono-Regular", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-api-lines button {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: 5px;
  border: 0;
  border-radius: 5px;
  place-items: center;
  background: transparent;
  color: #667386;
  cursor: pointer;
}

.token-api-lines button:hover {
  background: #eef1f8;
  color: #4f61c8;
}

.token-table-panel {
  overflow: hidden;
  border: 1px solid #e2e7ef;
  border-top: 1px solid #edf0f4;
  border-radius: 8px;
  background: #ffffff;
}

.token-table-wrap {
  min-height: 350px;
  overflow: auto;
}

.token-table {
  width: 100%;
  min-width: 1450px;
  border-collapse: collapse;
  color: #4b5565;
  font-size: 13px;
}

.token-table th,
.token-table td {
  height: 52px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf0f3;
  text-align: left;
  white-space: nowrap;
}

.token-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 42px;
  background: #f2f4f6;
  color: #5b6574;
  font-size: 12px;
  font-weight: 700;
}

.token-table th:first-child,
.token-table td:first-child {
  width: 42px;
  padding-left: 16px;
}

.token-table tbody tr:hover {
  background: #fafbfd;
}

.token-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6675e8;
}

.token-name {
  color: #354052;
  font-weight: 650;
}

.token-status,
.token-limit,
.token-group,
.token-scope-list span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  background: #ffffff;
  color: #657084;
  font-size: 12px;
}

.token-group-button {
  border-color: #d8dded;
  cursor: pointer;
}

.token-group-button:hover {
  border-color: #91a0e7;
  background: #f5f7ff;
  color: #4c5fc9;
}

.token-group-button small {
  margin-left: 5px;
  color: #7a86a0;
  font-size: 11px;
}

.token-status.is-enabled {
  border-color: #c9ead7;
  background: #eaf8f0;
  color: #33835c;
}

.token-status.is-disabled,
.token-status.is-expired {
  border-color: #f1d2d6;
  background: #fff1f2;
  color: #bd5964;
}

.token-scope-list {
  display: flex;
  gap: 5px;
}

.token-key-control {
  display: grid;
  grid-template-columns: 180px 30px 30px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #c1e6d2;
  border-radius: 6px;
  background: #effaf4;
}

.token-key-control input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #287653;
  font: 12px/1.4 "SFMono-Regular", Consolas, monospace;
  cursor: pointer;
}

.token-key-control input:hover,
.token-key-control input:focus {
  background: #e5f7ed;
}

.token-key-control button {
  display: grid;
  width: 30px;
  height: 32px;
  padding: 0;
  border: 0;
  border-left: 1px solid #cfe9da;
  place-items: center;
  background: transparent;
  color: #397d5d;
  cursor: pointer;
}

.token-key-control button:hover {
  background: #def4e8;
}

.token-row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.token-row-actions button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #e0e4e9;
  border-radius: 6px;
  background: #f7f8fa;
  color: #586375;
  font-size: 12px;
  cursor: pointer;
}

.token-row-actions button.is-danger {
  border-color: #f0cbd0;
  background: #fff1f2;
  color: #bf5360;
}

.token-table-panel.is-comfortable .token-table td {
  height: 66px;
}

.token-empty {
  height: 220px !important;
  color: #8b95a5;
  text-align: center !important;
}

.token-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 20px;
  border-top: 1px solid #edf0f4;
  color: #7b8596;
  font-size: 13px;
}

.token-editor-backdrop {
  overflow-y: auto;
  align-items: flex-start;
  padding: 30px 16px;
}

.token-editor {
  width: min(620px, 100%);
  max-height: none;
}

.token-editor-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #e4e8ef;
  border-radius: 7px;
  background: #fafbfd;
}

.token-editor-section > strong {
  color: #344054;
  font-size: 14px;
}

.token-editor-section > p {
  margin: 0;
  color: #8590a1;
  font-size: 12px;
}

.token-group-description {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dfe5f2;
  border-radius: 6px;
  background: #f7f9fd;
  color: #667085;
  font-size: 12px;
}

.token-group-description strong { color: #344054; font-size: 13px; }
.token-group-description b { color: #5267d4; white-space: nowrap; }

.token-switch,
.token-scope-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #566174;
  font-size: 13px;
}

.token-scope-options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.token-switch input,
.token-scope-options input {
  width: 17px;
  height: 17px;
  accent-color: #6675e8;
}

@media (max-width: 900px) {
  .token-toolbar { align-items: stretch; flex-direction: column; }
  .token-filters { display: grid; grid-template-columns: 1fr 1fr auto auto; }
  .token-search { width: auto; }
  .token-api-group { grid-template-columns: 1fr; gap: 5px; }
  .token-api-group > strong { padding-top: 0; }
}

@media (max-width: 600px) {
  .token-page-head { align-items: flex-start; }
  .token-title p { max-width: 210px; }
  .token-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .token-toolbar-actions .button:first-child { grid-column: 1 / -1; }
  .token-filters { grid-template-columns: 1fr 1fr; }
  .token-search { grid-column: 1 / -1; }
  .token-api-panel { margin-inline: 0; padding: 12px; }
  .token-api-lines { display: grid; }
  .token-api-lines > div { min-width: 0; }
  .token-api-lines span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .entrance-stage,
  .template-card { animation: none; }
  .template-card,
  .template-card img,
  .send-button { transition: none; }
}

.video-reference {
  margin-top: 8px;
}

.video-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.video-reference-head > span {
  color: #999aa7;
  font-size: 13px;
}

.reference-tabs {
  display: inline-flex;
  gap: 5px;
}

.reference-tabs button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid #e7e4ee;
  border-radius: 999px;
  background: #fff;
  color: #777986;
  font-size: 14px;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.reference-tabs button:hover,
.reference-tabs button.is-active {
  border-color: #33294e;
  background: #33294e;
  color: #fff;
}

.frame-slots,
.reference-grid {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.reference-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 1px dashed #cfc9e3;
  border-radius: 8px;
  background: #faf9fd;
  color: #716789;
}

.reference-slot.is-empty {
  align-content: center;
  gap: 1px;
  transition: border-color .18s ease, background .18s ease;
}

.reference-slot.is-empty:hover {
  border-color: #8c78cd;
  background: #f6f3ff;
}

.reference-slot.is-empty span {
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.reference-slot.is-empty b {
  font-size: 13px;
  font-weight: 650;
}

.reference-slot img,
.reference-slot video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reference-slot-label,
.media-kind {
  position: absolute;
  z-index: 1;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(30, 25, 43, .76);
  color: #fff;
  font-size: 11px;
}

.media-kind {
  top: 5px;
  bottom: auto;
  left: 5px;
  right: auto;
}

.reference-slot [data-remove-reference] {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: rgba(26, 22, 37, .78);
  color: #fff;
  font-size: 16px;
}

.swap-frames {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d4cce9;
  border-radius: 50%;
  background: #fff;
  color: #775ec1;
  font-size: 20px;
}

.audio-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #eee9fb;
  color: #6f51c2;
  font-size: 32px;
}

.reference-mentions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.reference-mentions::before {
  color: #9293a1;
  font-size: 13px;
  content: "插入提示词";
}

.reference-mentions button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #d9d2ed;
  border-radius: 6px;
  background: #f7f4ff;
  color: #684db5;
  font-size: 13px;
  font-weight: 700;
}

.filter-loading {
  color: #9297a5;
  font-size: 14px;
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-mode-tabs button {
  min-height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.auth-mode-tabs button.is-active {
  background: #fff;
  color: #45348a;
  box-shadow: 0 2px 8px rgba(45, 38, 72, .09);
}

.auth-intro h1 span {
  color: #9fe7e8;
}

@media (max-width: 700px) {
  .video-reference-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .reference-tabs button {
    min-width: 0;
    padding: 6px 7px;
    font-size: 13px;
  }

  .frame-slots {
    justify-content: center;
  }

  .reference-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reference-grid .reference-slot {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

@media (max-width: 500px) {
  .account-text { display: none; }
  .hero { min-height: 0; padding: 27px 22px; }
  .hero h1 { font-size: 37px; }
  .hero-copy > p { font-size: 15px; }
  .hero-demo { display: none; }
  .metric-grid { gap: 9px; }
  .metric { min-height: 132px; padding: 15px; }
  .metric strong { font-size: 25px; }
  .metric-note { font-size: 12px; }
  .model-strip { grid-template-columns: 1fr; }
  .model-card { min-height: 230px; }
  .section-head { align-items: flex-start; flex-direction: column; margin-top: 36px; }
  .section-head .link-button { margin-top: -8px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 7px 8px; }
  .console-kpis { gap: 9px; }
  .kpi { padding: 15px; }
  .kpi strong { font-size: 24px; }
  .data-card { padding: 15px; }
  .chart { height: 225px; }
  .chart-y { font-size: 12px; }
  .data-card-head { flex-direction: column; }
  .console-subhead .button { width: 100%; }
  .filters { width: 100%; }
  .filters select { flex: 1; }
  .toast-stack { right: 13px; bottom: 13px; left: 13px; }
  .toast { max-width: none; }
}

/* Reference-style dark product surface */
:root {
  --bg: #111316;
  --surface: #171a20;
  --surface-soft: #202631;
  --ink: #f0f2f4;
  --muted: #a1aabd;
  --subtle: #788398;
  --line: #2a303b;
  --primary: #6877ff;
  --primary-dark: #8290ff;
  --primary-soft: #20264a;
  --cyan: #3bc6de;
  --cyan-soft: #16353e;
  --orange: #f4ad3d;
  --orange-soft: #3b2c18;
  --success: #38c996;
  --success-soft: #17382f;
  --danger: #ef7181;
  --danger-soft: #40242a;
  --dark: #0f1a2e;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

h1, h2, h3, .hero h1, .canvas-copy h2, .metric strong { letter-spacing: 0 !important; }
body { background: var(--bg); color: var(--ink); }
.site-header { min-height: 64px; padding: 0 20px; border-color: #292e39; background: #15171c; }
.brand { min-width: 145px; color: #fff; }
.brand-mark { background: #f6f8ff; }
.brand strong { font-size: 16px; }
.brand small { color: #7c879b; }
.top-nav { gap: 6px; margin-right: 18px; }
.top-nav a { padding: 7px 14px; border-radius: 6px; color: #dce4f5; font-size: 13px; font-weight: 650; }
.top-nav a:hover, .top-nav a.is-active { background: #252b3d; color: #fff; }
.header-actions { gap: 9px; }
.header-icon, .balance-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; border: 1px solid #303542; border-radius: 17px; background: #1c2029; color: #d4dbea; }
.header-icon { width: 34px; padding: 0; }
.balance-pill { gap: 7px; padding: 5px 12px; }
.balance-pill span { color: #aeb7c9; font-size: 12px; }
.balance-pill strong { color: #f0c875; font-size: 13px; }
/* ==========================================================================
 * §264 头部余额胶囊：双货币（钻石 ◈ / 积分 ✦）
 * --------------------------------------------------------------------------
 * 数字用 color: inherit，图标用主题 token —— 这样三种底色（浅色控制台的深胶囊、
 * 浅色公开页的白胶囊、深色主题的 --surface-soft）都不必各写一条颜色规则，
 * 也就不会出现「白胶囊上的白字」这类只在某一页复发的对比度问题。
 * ========================================================================== */
.balance-pill b { color: inherit; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.balance-pill .bp-glyph { color: var(--subtle); font-style: normal; font-size: 12px; line-height: 1; }
.balance-pill .bp-glyph.is-diamond { color: var(--cyan); }
.balance-pill .bp-glyph.is-points { color: var(--orange); }
.balance-pill .bp-sep { color: var(--subtle); font-style: normal; font-size: 11px; opacity: .8; }
/* 画布（workspace）顶栏没有 .balance-pill，同一组字形要能落在 .studio-btn 里。 */
.studio-btn.is-asset span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.studio-btn.is-asset b { color: inherit; font-size: 12px; font-weight: 750; }
.studio-btn.is-asset .bp-glyph { color: var(--subtle); font-style: normal; font-size: 11px; line-height: 1; }
.studio-btn.is-asset .bp-glyph.is-diamond { color: var(--cyan); }
.studio-btn.is-asset .bp-glyph.is-points { color: var(--orange); }
.studio-btn.is-asset .bp-sep { color: var(--subtle); font-style: normal; font-size: 10px; opacity: .75; }
.account-link { border-color: #303542; border-radius: 17px; background: #1c2029; color: #e8edf6; }
.account-avatar { width: 26px; height: 26px; border-radius: 50%; background: #2b3240; color: #fff; font-size: 12px; }
.account-text strong { color: #e9edf6; font-size: 12px; }
.account-text small { color: #8792a5; font-size: 11px; }
.site-layout.is-public { display: block; }
.site-layout.is-public .side-rail { display: none; }
.site-layout.is-console { grid-template-columns: 180px minmax(0, 1fr); }
.main-content { min-height: calc(100vh - 64px); padding: 34px 36px 72px; background: var(--bg); }
.content-wrap { width: min(1400px, 100%); }
.is-console .side-rail { padding: 26px 12px 14px; border-color: #dce4f0; background: #f4f7fc; color: #68768e; }
.is-console .rail-title { margin-bottom: 11px; color: #8592a8; font-size: 12px; }
.is-console .rail-link { min-height: 40px; border-radius: 8px; color: #77849a; font-size: 13px; }
.is-console .rail-link:hover { background: #e9effa; color: #24344f; }
.is-console .rail-link.is-active { background: #dce9ff; color: #4569b2; }
.is-console .rail-icon { background: #e8edf5; }
.is-console .rail-link.is-active .rail-icon { background: #edf4ff; }
.is-console .rail-divider { margin: 21px 8px; background: #dfe6f0; }
.is-console .health { color: #728097; font-size: 12px; }
.rail-collapse { width: 100%; margin-top: 15px; padding: 7px 9px; border: 1px solid #ccdafa; border-radius: 7px; background: #dfeaff; color: #7690ce; font-size: 12px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { color: #f1f3f6; }
.page-head p, .section-head p { color: #9aa5b8; }
.eyebrow { color: #8290ff; font-size: 12px; }
.button-primary { background: #6675ff; box-shadow: 0 8px 20px rgba(102, 117, 255, .22); }
.button-secondary { border-color: #343b49; background: #1a1e25; color: #dce3ef; }
.button-secondary:hover { border-color: #6273df; color: #fff; }
.link-button { color: #91a1ff; }
.hero { border: 1px solid #2b3242; background: #121928; box-shadow: var(--shadow); }
.hero-demo { border-color: #35415b; background: #172137; }
.metric, .model-card, .promo, .tutorial-card, .data-card, .wallet-card, .aside-card, .studio { border-color: #2b313d; background: var(--surface); box-shadow: none; }
.metric.dark, .wallet-card.balance, .aside-card.dark { border-color: #243a62; background: #0f1a2e; }
.metric-label, .metric-note, .wallet-card small { color: #9ca8ba; }
.model-card.featured { border-color: #4050a3; background: #151a2c; }
.model-summary { color: #9ca8ba; }
.model-tag, .tag, .model-badge { background: #222a37; color: #b6c0d2; }
.model-foot { border-color: #2c3443; }
.model-action { color: #94a1ff; }
.promo.tutorial { background: #3b321e; }
.promo.canvas { background: #19363f; }
.promo p { color: #afbac9; }
.section-head h2, .page-head h1, .promo h3, .tutorial-card h2, .data-card h2, .console-subhead h2 { color: #f2f4f7; }
.modal { border: 1px solid #303746; background: #181c23; color: #f2f4f7; }
.modal-lead, .field { color: #a6b0c1; }
.field input, .field select { border-color: #353d4c; background: #11151b; color: #eef2f7; }
.toast { border-color: #286d58; background: #163b31; color: #8ce0c1; }

/* Model market */
.market-breadcrumb { display: flex; align-items: center; gap: 8px; min-height: 38px; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.market-breadcrumb a { color: #5870d7; }
.market-breadcrumb strong { color: #475467; font-weight: 650; }
.market-selector { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px auto 14px; }
.market-selector button { display: grid; align-content: start; gap: 10px; min-height: 180px; padding: 25px; border: 1px solid #e3e7ee; border-radius: 8px; background: #fff; color: #667085; text-align: left; cursor: pointer; }
.market-selector button:hover { border-color: #b7c2ee; background: #fafbff; }
.market-selector button.is-active { border-color: #6a7ce0; background: #f2f4ff; color: #4054bf; box-shadow: inset 3px 0 #5e72dd; }
.market-selector strong { color: #253047; font-size: 22px; }
.market-selector strong small { margin-left: 6px; padding: 3px 6px; border-radius: 4px; background: #fff0f2; color: #d45b69; font-size: 11px; vertical-align: middle; }
.market-selector span { color: #778398; font-size: 15px; }
.market-selector b { align-self: end; margin-top: auto; color: #5268d5; font-size: 13px; }
.market-selector button:last-child::after { align-self: end; margin-top: auto; color: #5268d5; font-size: 13px; font-weight: 700; content: "查看模型与价格 →"; }
.market-landing .market-breadcrumb,
.market-landing .group-panel,
.market-landing .market-toolbar,
.market-landing .market-content { display: none; }
.market-detail .market-selector { display: none; }
.market-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 17px 20px; border: 1px solid #2a303a; border-radius: 7px; background: #171a20; }
.market-title { display: flex; align-items: center; gap: 13px; }
.market-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: #202a4f; color: #91a0ff; font-size: 19px; }
.market-title h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.15; }
.market-title p { margin: 4px 0 0; color: #9aa6b9; font-size: 13px; }
.market-notice { display: grid; min-width: 250px; padding-left: 20px; border-left: 1px solid #323844; color: #f0f2f5; }
.market-notice span { font-size: 13px; font-weight: 750; }
.market-notice small { margin-top: 4px; color: #8f9aae; font-size: 12px; }
.market-toolbar { margin-bottom: 14px; }
.toolbar-row { display: flex; align-items: center; gap: 9px; }
.market-search { flex: 1; min-width: 180px; height: 40px; border-color: #303642; background: #181c23; }
.market-search input { color: #eef2f6; }
.market-toolbar .button { min-height: 40px; padding: 8px 13px; border-radius: 6px; font-size: 13px; }
.compact-toggle { min-height: 40px; padding: 0 7px; border: 1px solid #303642; border-radius: 6px; background: #181c23; }
.compact-toggle span { color: #9faabd; font-size: 12px; }
.provider-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.provider-chip, .group-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 6px 11px; border: 1px solid #303746; border-radius: 6px; background: #181c23; color: #b0bacb; font-size: 12px; }
.provider-chip b, .group-chip b { color: var(--muted); font-size: 11px; font-weight: 700; }
.group-chip small { display: none; min-width: 18px; color: #8a94a5; font-size: 10px; }
.show-multiplier .group-chip small { display: inline; }
.provider-chip:hover, .group-chip:hover { border-color: #5769bd; color: #dfe5ff; }
.provider-chip.is-active, .group-chip.is-active { border-color: #6074ff; background: #5268ed; color: #fff; }
.provider-chip.is-active b, .group-chip.is-active b { color: #e7ebff; }
.market-content { display: block; }
.group-panel { margin-bottom: 14px; padding: 16px; border: 1px solid #2a3a5b; border-radius: 7px; background: #101d35; }
.filter-label { display: block; color: #8d9bb1; font-size: 12px; }
.group-panel > strong { display: block; margin: 4px 0 12px; color: #e9edf7; font-size: 16px; }
.group-list { display: flex; flex-wrap: wrap; gap: 7px; }
.market-results { min-width: 0; }
.results-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; color: #d8deea; font-size: 13px; }
.results-head b { color: #93a2ff; }
.results-head span:last-child { color: #758299; font-size: 12px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.model-card { min-height: 285px; padding: 0; overflow: hidden; border-color: #2b3c59; border-radius: 7px; background: #0f1a2e; }
.model-card:hover { border-color: #5873c4; background: #11203a; box-shadow: 0 14px 35px rgba(0,0,0,.2); }
.model-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 14px 10px; }
.model-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.model-identity > div { min-width: 0; }
.model-identity strong, .model-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-identity strong { color: #ecf0f8; font-size: 14px; }
.model-identity small { margin-top: 4px; color: #8697b7; font-size: 12px; }
.model-logo { width: 31px; height: 31px; border-radius: 50%; background: #293351; color: #dce3ff; font-size: 15px; }
.model-logo.image { background: #423220; color: #ffc36d; }
.model-logo.compatible { background: #1e3b40; color: #75dbe3; }
.model-check { width: 16px; height: 16px; border: 1px solid #61718b; border-radius: 3px; }
.model-summary { min-height: 58px; margin: 0; padding: 0 14px; color: #a3aec0; font-size: 12px; line-height: 1.65; }
.model-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 28px; margin: 7px 14px 0; }
.model-tag, .tag { padding: 4px 6px; border-radius: 4px; background: #253047; color: #bdc8dc; font-size: 11px; }
.model-tag-more { color: #8c9bb6; }
.model-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 14px 0; color: #8798b5; font-size: 11px; }
.model-card-meta span + span::before { margin-right: 8px; color: #44536f; content: "|"; }
.model-groups { display: flex; flex-wrap: wrap; gap: 5px; min-height: 29px; padding: 0 14px 10px; }
.model-groups span { padding: 4px 7px; border: 1px solid #e1e5ed; border-radius: 5px; background: #f8f9fb; color: #677286; font-size: 11px; }
.model-pricing { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 10px 14px; border-top: 1px solid #263650; }
.pricing-mode { color: #8596b2; font-size: 11px; }
.model-price { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 12px; color: #d5ddec; font-size: 11px; }
.model-price span { white-space: nowrap; }
.model-price b { color: #f0f3f8; font-size: 12px; }
.model-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 14px 12px; border-top: 1px solid #263650; }
.model-id { min-width: 0; overflow: hidden; color: #7183a4; font: 11px/1.4 "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.model-action { flex: 0 0 auto; font-size: 12px; }
.catalog-grid.is-table { grid-template-columns: 1fr; }
.catalog-grid.is-table .model-card { min-height: 0; }
.catalog-grid.is-table .model-summary { min-height: 0; }
.empty-state { display: grid; place-items: center; grid-column: 1 / -1; min-height: 230px; padding: 24px; border: 1px dashed #35425b; border-radius: 7px; background: #151b27; text-align: center; }
.empty-state span { color: #8190ff; font-size: 30px; }
.empty-state strong { margin-top: 9px; color: #e8edf6; font-size: 16px; }
.empty-state p { margin: 5px 0 0; color: #8491a8; font-size: 13px; }

/* Console pages */
.is-console .page-head { margin-bottom: 10px; padding: 16px 18px; border: 1px solid #2a303a; border-radius: 7px; background: #171a20; }
.is-console .page-head h1 { font-size: 21px; }
.is-console .page-head p { font-size: 12px; }
.console-tabs { gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid #2a303a; border-radius: 7px; background: #171a20; }
.console-tabs a { padding: 8px 12px; border-radius: 5px; color: #909caf; font-size: 12px; }
.console-tabs a:hover, .console-tabs a.is-active { background: #2b3656; color: #dce4ff; }
.console-tabs a.is-active::after { display: none; }
.kpi, .data-card, .wallet-card { border-color: #2a303a; background: #171a20; }
.kpi span, .kpi small { color: #8e9aaf; font-size: 12px; }
.kpi strong { color: #eef2f7; font-size: 27px; }
.data-card h2 { font-size: 18px; }
.legend, .console-subhead p, .notice p { color: #919caf; font-size: 12px; }
.chart-y, .chart-x { color: #748198; font-size: 11px; }
.chart-grid i { border-color: #29313e; }
.data-table th { border-color: #2b3340; color: #8490a4; font-size: 11px; }
.data-table td { border-color: #252c37; color: #a6b0c0; font-size: 12px; }
.data-table td strong { color: #e7ecf5; }
.status { font-size: 11px; }
.notice { border-color: #285343; background: #142d27; color: #8cdabc; }
.filters select { border-color: #343c49; background: #181c23; color: #dce3ef; }

/* Super administrator workspace */
.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.admin-head-actions { display: flex; align-items: center; gap: 10px; }
.admin-navigation.is-hidden { display: none; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.admin-filter-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: min(500px, 52vw); }
.admin-status-filter { display: inline-flex; align-items: center; gap: 7px; color: #98a2b3; font-size: 12px; white-space: nowrap; }
.admin-status-filter select { min-height: 38px; padding: 0 28px 0 10px; border: 1px solid #343c49; border-radius: 6px; background: #171a20; color: #edf1f7; }
.admin-segments { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid #2a303a; border-radius: 7px; background: #171a20; }
.admin-segments button { min-height: 38px; padding: 8px 14px; border: 0; border-radius: 5px; background: transparent; color: #919caf; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-segments button.is-active { background: #2b3656; color: #e5eaff; }
.admin-segments b { display: inline-grid; min-width: 22px; min-height: 20px; margin-left: 5px; place-items: center; border-radius: 4px; background: #252b36; color: #b8c3d7; font-size: 12px; }
.admin-segments button.is-active b { background: #3a4872; color: #fff; }
.admin-search { width: min(380px, 42vw); border-color: #343c49; background: #171a20; }
.admin-search input { color: #edf1f7; }
.admin-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* §264 双货币面板：四张卡片纵向堆叠（配置 / 卡密 / 订单 / 发放），
   卡片内部还有自己的列表网格，所以需要一层纵向间距容器。 */
.admin-currency-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.admin-currency-panel .admin-card-grid { margin-top: 14px; }
.provider-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-data-card { min-width: 0; padding: 18px; border: 1px solid #2a303a; border-radius: 8px; background: #171a20; color: #eef2f7; }
.admin-data-card.is-disabled { opacity: .66; }
.admin-data-card.loading-card { display: grid; grid-column: 1 / -1; min-height: 180px; place-items: center; color: #8995a9; font-size: 14px; }
.admin-card-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 11px; align-items: center; }
.admin-card-head > div { min-width: 0; }
.admin-card-head strong, .admin-card-head code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-card-head strong { font-size: 16px; }
.admin-card-head code { margin-top: 4px; color: #8190aa; font-size: 12px; }
.admin-card-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 7px; background: #2a3452; color: #aeb9ff; font-size: 17px; font-weight: 800; }
.admin-card-icon.provider-icon { background: #173b39; color: #83ded5; }
.admin-state { padding: 5px 7px; border-radius: 4px; background: #33272b; color: #de8d99; font-size: 12px; font-weight: 750; }
.admin-state.is-online { background: #18352d; color: #78d2ad; }
.admin-data-card > p { min-height: 48px; margin: 17px 0 13px; color: #9ca7b9; font-size: 13px; line-height: 1.65; }
.admin-card-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.admin-card-tags span { padding: 5px 7px; border-radius: 4px; background: #232a36; color: #aeb9ca; font-size: 12px; }
.admin-card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #282f3a; }
.admin-card-stats span, .provider-paths span { min-width: 0; }
.admin-card-stats small, .admin-card-stats b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-card-stats small, .provider-address small, .provider-paths small { color: #77859b; font-size: 12px; }
.admin-card-stats b { margin-top: 5px; color: #d7deea; font-size: 13px; }
.admin-card-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.admin-card-actions .button { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.provider-address { margin: 18px 0 13px; padding: 11px; border-radius: 6px; background: #11151b; }
.provider-address small, .provider-address code { display: block; }
.provider-address code { margin-top: 6px; overflow-wrap: anywhere; color: #cad3e2; font-size: 12px; }
.provider-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.provider-paths span { padding: 9px; border: 1px solid #292f39; border-radius: 6px; }
.provider-paths small, .provider-paths code { display: block; }
.provider-paths code { margin-top: 5px; overflow: hidden; color: #a9b5c7; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-modal-backdrop { overflow-y: auto; align-items: start; padding-block: 30px; }
.admin-modal { width: min(780px, 100%); max-height: none; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.admin-field-wide { grid-column: 1 / -1; }
.admin-modal .field textarea { display: block; width: 100%; margin-top: 7px; padding: 11px 12px; resize: vertical; border: 1px solid #353d4c; border-radius: 6px; outline: 0; background: #11151b; color: #eef2f7; font: 13px/1.55 "SFMono-Regular", Consolas, monospace; }
.admin-modal .field textarea:focus { border-color: #777ff0; box-shadow: 0 0 0 3px rgba(102,117,255,.12); }
.admin-form-switches { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 19px; padding: 14px 0; border-block: 1px solid #2b323e; }
.admin-form-switches label { display: inline-flex; align-items: center; gap: 8px; color: #c1cad8; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-form-switches input { width: 17px; height: 17px; accent-color: #6675ff; }
.admin-card-icon.group-icon { background: #eef8f4; color: #25856a; }
.admin-group-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 14px; padding: 12px; border: 1px solid #e1e6ee; border-radius: 7px; }
.admin-group-options legend { padding: 0 6px; color: #667085; font-size: 13px; font-weight: 700; }
.admin-group-options label { display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid #e6e9ef; border-radius: 6px; background: #fafbfd; color: #344054; cursor: pointer; }
.admin-group-options input { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; accent-color: #6477df; }
.admin-group-options span { display: grid; gap: 3px; min-width: 0; }
.admin-group-options strong { font-size: 13px; }
.admin-group-options small { overflow: hidden; color: #7d8899; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
 * §265 对话 Token 计费：口径说明卡 + 模型表单里的结构化计费编辑器
 * 全部走 design token，浅色 / 深色自动跟随，不新增硬编码颜色。
 * -------------------------------------------------------------------------- */
.admin-billing-rules { margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-billing-rules strong { font-size: 13px; }
.admin-billing-rules p { margin: 6px 0 8px; color: var(--ink); font-size: 13px; }
.admin-billing-rules ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.admin-billing { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.admin-billing-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.admin-billing-head strong { font-size: 13.5px; }
.admin-billing-head span { color: var(--muted); font-size: 12px; }
.admin-billing-toolbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.admin-billing-toolbar .field { min-width: 230px; }
.admin-billing-check { display: inline-flex; align-items: center; gap: 8px; padding-bottom: 10px; color: var(--ink); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.admin-billing-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.admin-billing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-billing-preview { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.admin-billing-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.admin-billing-table { width: 100%; margin: 6px 0; border-collapse: collapse; font-size: 12.5px; }
.admin-billing-table th, .admin-billing-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-billing-table th { color: var(--muted); font-weight: 700; }
.admin-billing-table th:not(:first-child), .admin-billing-table td:not(:first-child) { text-align: right; }
/* 视频计费：分辨率价格表可以逐行增删，输入框要像表格单元格而不是表单卡片。 */
.admin-billing-price-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 2px; }
.admin-billing-price-head strong { font-size: 12.5px; }
.admin-billing-price-head .button { padding: 5px 10px; font-size: 12px; }
.admin-billing-price-table td { vertical-align: middle; }
.admin-billing-price-table input[type="text"], .admin-billing-price-table input[type="number"] { width: 100%; max-width: 140px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; text-align: right; }
.admin-billing-price-table input[type="text"] { max-width: 110px; text-align: left; }
.admin-billing-price-table td[data-video-cost] { color: var(--muted); font-variant-numeric: tabular-nums; }
.admin-billing-price-table td:last-child { width: 36px; text-align: right; }

@media (max-width: 1100px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-notice { min-width: 220px; }
  .admin-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .site-header { padding: 0 12px; }
  .site-layout.is-console { display: block; }
  .site-layout.is-public .side-rail, .site-layout.is-console .side-rail { position: fixed; z-index: 40; top: 64px; bottom: 0; left: -260px; display: flex; width: 250px; transition: left .2s ease; box-shadow: 12px 0 35px rgba(0,0,0,.24); }
  .site-layout.is-public .side-rail.is-open, .site-layout.is-console .side-rail.is-open { left: 0; }
  .site-layout.is-public .side-rail { background: #171a20; color: #aab4c5; }
  .site-layout.is-public .rail-title { color: #7f8ba1; }
  .site-layout.is-public .rail-link { color: #aab4c5; }
  .site-layout.is-public .rail-link.is-active { background: #2b3656; color: #dce4ff; }
  .main-content { padding: 22px 14px 50px; }
  .market-head { align-items: flex-start; flex-direction: column; gap: 15px; }
  .market-notice { width: 100%; min-width: 0; padding: 12px 0 0; border-top: 1px solid #323844; border-left: 0; }
  .toolbar-row { flex-wrap: wrap; }
  .market-search { flex-basis: 100%; }
  .market-toolbar .button { flex: 1; }
  .compact-toggle { flex: 0 0 auto; }
  .catalog-grid { grid-template-columns: 1fr; }
  .is-console .page-head { padding: 14px; }
  .is-console .page-head .model-badge { display: none; }
  .admin-page-head, .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-head-actions { justify-content: space-between; }
  .admin-search { width: 100%; }
  .admin-card-grid, .provider-admin-grid { grid-template-columns: 1fr; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-billing-grid { grid-template-columns: 1fr; }
  .market-selector { grid-template-columns: 1fr; }
  .admin-group-options { grid-template-columns: 1fr; }
  .admin-field-wide { grid-column: auto; }
}

@media (max-width: 500px) {
  .brand { min-width: 0; }
  .brand small { display: none; }
  .balance-pill { padding: 5px 9px; }
  .balance-pill span { display: none; }
  .account-text { display: none; }
  .market-title h1 { font-size: 21px; }
  .provider-chips, .group-list { gap: 6px; }
  .provider-chip, .group-chip { font-size: 11px; }
  .model-card { min-height: 278px; }
}

/* Public pages follow the reference site's white top-navigation shell. */
body.is-public-page {
  background: #ffffff;
  color: #1f2937;
}

body.is-public-page .site-header .mobile-menu {
  display: none;
}

body.is-public-page .site-header {
  border-color: #edf0f5;
  background: #ffffff;
  color: #1f2937;
}

body.is-public-page .brand,
body.is-public-page .brand strong {
  color: #1f2937;
}

body.is-public-page .brand-mark {
  background: #1f2533;
}

body.is-public-page .top-nav a {
  color: #536174;
}

body.is-public-page .top-nav a:hover,
body.is-public-page .top-nav a.is-active {
  background: #f1f4fb;
  color: #435fd0;
}

body.is-public-page .header-icon,
body.is-public-page .balance-pill,
body.is-public-page .account-link {
  border-color: #e5eaf2;
  background: #ffffff;
  color: #536174;
}

body.is-public-page .balance-pill span,
body.is-public-page .account-text small {
  color: var(--muted);
}

body.is-public-page .balance-pill strong,
body.is-public-page .account-text strong {
  color: #344054;
}

body.is-public-page .account-avatar {
  background: #eef1ff;
  color: #5967d8;
}

body.is-public-page .main-content {
  background: #ffffff;
}

body.is-public-page .main-content {
  padding: 30px 24px 64px;
}

body.is-public-page .content-wrap {
  width: min(1240px, 100%);
}

body.is-public-page .page-head h1,
body.is-public-page .section-head h2,
body.is-public-page .promo h3,
body.is-public-page .tutorial-card h2,
body.is-public-page .data-card h2 {
  color: #1f2937;
}

body.is-public-page .page-head p,
body.is-public-page .section-head p {
  color: #697689;
}

body.is-public-page .metric,
body.is-public-page .model-card,
body.is-public-page .promo,
body.is-public-page .tutorial-card,
body.is-public-page .data-card,
body.is-public-page .wallet-card,
body.is-public-page .studio {
  border-color: #e5eaf2;
  background: #ffffff;
  color: #1f2937;
}

body.is-public-page .metric.dark,
body.is-public-page .hero {
  color: #ffffff;
}

body.is-public-page .model-card {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(33, 46, 79, .06);
}

body.is-public-page .catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.is-public-page .model-card:hover {
  border-color: #bfc9f7;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(65, 78, 155, .12);
}

body.is-public-page .model-card.featured {
  border-color: #cbd2ff;
  background: #fbfbff;
}

body.is-public-page .model-identity strong,
body.is-public-page .model-card-meta,
body.is-public-page .model-price b {
  color: #26344c;
}

body.is-public-page .model-price-head { color: #667085; }
body.is-public-page .model-price-head b { color: #5267d4; }
body.is-public-page .model-price-row strong { color: #26344c; }
body.is-public-page .model-price-row strong small { color: #7a879b; }
body.is-public-page .model-price-row strong > span + span { color: #5267d4; }
body.is-public-page .model-price-row i { color: #98a2b3; }

body.is-public-page .model-identity small,
body.is-public-page .model-summary,
body.is-public-page .pricing-mode,
body.is-public-page .model-id {
  color: #7a879b;
}

body.is-public-page .model-tag,
body.is-public-page .tag,
body.is-public-page .model-badge {
  background: #f1f4f9;
  color: #647187;
}

body.is-public-page .model-pricing,
body.is-public-page .model-foot {
  border-color: #edf0f5;
}

body.is-public-page .market-head,
body.is-public-page .market-toolbar,
body.is-public-page .results-head {
  color: #27364e;
}

body.is-public-page .market-head,
body.is-public-page .market-search,
body.is-public-page .compact-toggle,
body.is-public-page .provider-chip,
body.is-public-page .group-chip {
  border-color: #e5eaf2;
  background: #ffffff;
}

body.is-public-page .market-title h1,
body.is-public-page .market-title p,
body.is-public-page .market-notice,
body.is-public-page .market-notice span,
body.is-public-page .group-panel > strong,
body.is-public-page .results-head {
  color: #26344c;
}

body.is-public-page .market-title p,
body.is-public-page .market-notice small,
body.is-public-page .filter-label,
body.is-public-page .results-head span:last-child {
  color: var(--muted);
}

body.is-public-page .market-notice {
  border-color: #edf0f5;
}

body.is-public-page .group-panel {
  border-color: #e2e7f1;
  background: #ffffff;
}

body.is-public-page .market-selector button {
  border-color: #e3e7ee;
  background: #ffffff;
  color: #667085;
}

body.is-public-page .market-selector button.is-active {
  border-color: #6a7ce0;
  background: #f2f4ff;
  color: #4054bf;
}

body.is-public-page .model-groups span {
  border-color: #e3e7ed;
  background: #f8f9fb;
  color: #667085;
}

body.is-public-page .provider-chip,
body.is-public-page .group-chip {
  color: #657288;
}

body.is-public-page .provider-chip.is-active,
body.is-public-page .group-chip.is-active {
  border-color: #6175ea;
  background: #6677ed;
  color: #ffffff;
}

body.is-public-page .empty-state {
  border-color: #dbe2ee;
  background: #fbfcfe;
}

body.is-public-page .model-logo {
  background: #eef1ff;
  color: #5f6fe2;
}

body.is-public-page .model-logo.image {
  background: #fff2e8;
  color: #e18a41;
}

body.is-public-page .model-logo.compatible {
  background: #e8f7f8;
  color: #168a98;
}

@media (max-width: 800px) {
  body.is-console-page .site-header .mobile-menu {
    display: inline-grid;
  }

  body.is-public-page .site-header {
    box-shadow: 0 1px 8px rgba(31, 43, 68, .04);
  }

  body.is-public-page .market-head {
    border-radius: 8px;
  }

  body.is-public-page .catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* Public shell alignment: the reference site keeps all public pages flat,
   white, and top-navigation-first. The only sidebar belongs to the console. */
body.is-public-page .site-header {
  justify-content: flex-start;
  min-height: 64px;
  padding: 0 16px;
}

body.is-public-page .brand {
  flex: 0 0 auto;
  min-width: 78px;
}

body.is-public-page .brand-mark {
  width: 29px;
  height: 29px;
  padding: 4px;
  border-radius: 7px;
}

body.is-public-page .brand-mark span {
  width: 5px;
}

body.is-public-page .brand > span:last-child strong {
  display: block;
  color: #1f2937;
  font-size: 16px;
}

body.is-public-page .brand > span:last-child small {
  display: none;
}

body.is-public-page .top-nav {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 2px;
  margin: 0 auto 0 16px;
}

body.is-public-page .top-nav a {
  padding: 8px 14px;
  border-radius: 6px;
  color: #273247;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

body.is-public-page .header-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

body.is-public-page .hero {
  min-height: 500px;
  padding: 42px 34px 54px;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: #111827;
}

body.is-public-page .hero::before,
body.is-public-page .hero::after {
  display: none;
}

body.is-public-page .hero-kicker {
  color: #6862c9;
  font-size: 13px;
}

body.is-public-page .hero-kicker i {
  background: #7565d6;
}

body.is-public-page .hero h1 {
  max-width: 620px;
  margin-top: 27px;
  color: #101828;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.08;
}

body.is-public-page .hero h1 em {
  color: #101828;
}

body.is-public-page .hero-copy > p {
  max-width: 610px;
  color: #667085;
  font-size: 17px;
}

body.is-public-page .hero .button-secondary {
  border-color: #e2e6ee;
  background: #fff;
  color: #344054;
}

body.is-public-page .hero-demo {
  align-self: center;
  min-height: 360px;
  padding: 18px;
  border-color: #eef1f5;
  border-radius: 13px;
  background: #f8fafc;
  box-shadow: 0 20px 50px rgba(57, 70, 102, .08);
}

body.is-public-page .demo-head {
  border-color: #e6eaf1;
  color: #344054;
}

body.is-public-page .demo-status {
  color: #4c9c87;
}

body.is-public-page .demo-side {
  color: #8490a3;
}

body.is-public-page .demo-side strong {
  color: #1f2937;
}

body.is-public-page .demo-side span:first-of-type {
  background: #e9efff;
  color: #526ad6;
}

body.is-public-page .demo-tabs,
body.is-public-page .demo-tabs span:first-child {
  color: #667085;
}

body.is-public-page .demo-prompt strong {
  color: #1f2937;
}

body.is-public-page .demo-prompt small,
body.is-public-page .demo-message small {
  color: #8490a3;
}

body.is-public-page .demo-orbit {
  border-color: #cfd6fb;
  color: #6975dc;
}

body.is-public-page .demo-message {
  border-color: #e5e9f1;
  background: #fff;
}

body.is-public-page .demo-message strong {
  color: #344054;
}

body.is-public-page .demo-avatar {
  background: #dfe6ff;
  color: #5c6bd5;
}

body.is-public-page .demo-input {
  border-color: #e3e8f0;
  color: #98a2b3;
}

body.is-public-page .demo-input b {
  color: #6975dc;
}

body.is-public-page .metric.dark {
  border-color: #e3e7ef;
  background: #f5f7ff;
  color: #1f2937;
}

body.is-public-page .metric.dark .metric-label,
body.is-public-page .metric.dark .metric-note {
  color: #667085;
}

body.is-public-page .metric.dark .positive {
  color: #4c9c87;
}

body.is-public-page .main-content {
  padding: 16px 16px 64px;
}

body.is-public-page .content-wrap {
  width: min(1280px, 100%);
}

body.is-public-page .page-head {
  margin-bottom: 20px;
}

body.is-public-page .page-head h1 {
  font-size: 32px;
}

body.is-public-page .page-head p {
  font-size: 16px;
}

body.is-public-page .studio {
  grid-template-columns: 1fr;
  min-height: 650px;
  border-color: #e8ebf2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(58, 71, 111, .07);
}

body.is-public-page .studio-side {
  display: none;
}

body.is-public-page .chat {
  background: #fff;
}

body.is-public-page .workshop-hero {
  margin: 0 auto 18px;
  padding: 34px 20px 12px;
  border: 1px solid #edf0f6;
  border-radius: 12px;
  background: #fbfbff;
  text-align: center;
}

body.is-public-page .workshop-kicker {
  color: #9a7be7;
  font-size: 34px;
  font-weight: 350;
  line-height: 1.2;
}

body.is-public-page .workshop-hero > p {
  margin: 8px 0 20px;
  color: #a4a9b8;
  font-size: 15px;
}

body.is-public-page .workshop-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f0eef8;
}

body.is-public-page .workshop-tabs button {
  min-width: 112px;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: #9da1b1;
  font-size: 14px;
  font-weight: 700;
}

body.is-public-page .workshop-tabs button.is-active {
  background: #8f8da2;
  color: #fff;
  box-shadow: 0 5px 14px rgba(74, 68, 105, .18);
}

body.is-public-page .workshop-tabs button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

body.is-public-page .workshop-studio {
  min-height: 560px;
}

body.is-public-page .workshop-studio .chat-head {
  justify-content: flex-end;
  background: #fff;
}

body.is-public-page .workshop-studio .chat-stream {
  min-height: 340px;
  max-height: none;
  padding: 44px clamp(22px, 7vw, 100px);
}

body.is-public-page .workshop-studio .welcome h2 {
  font-size: 27px;
}

body.is-public-page .workshop-studio .welcome p {
  font-size: 16px;
}

body.is-public-page .workshop-studio .starter-grid button {
  background: #fff;
}

body.is-public-page .market-head {
  min-height: 86px;
  padding: 15px 16px;
  border-color: #e6eaf1;
  border-radius: 8px;
  background: #fff;
}

body.is-public-page .market-title h1 {
  font-size: 24px;
}

body.is-public-page .market-title p,
body.is-public-page .market-notice small {
  font-size: 14px;
}

body.is-public-page .group-panel {
  margin-bottom: 12px;
  padding: 15px 16px;
  border-color: #e6eaf1;
  border-radius: 8px;
  background: #fff;
}

body.is-public-page .group-panel > strong {
  margin-bottom: 10px;
  font-size: 18px;
}

body.is-public-page .group-list,
body.is-public-page .provider-chips {
  gap: 7px;
}

body.is-public-page .group-chip,
body.is-public-page .provider-chip {
  min-height: 34px;
  padding: 7px 11px;
  border-color: #e5e8ee;
  border-radius: 7px;
  color: #5e6879;
  font-size: 13px;
}

body.is-public-page .market-toolbar {
  margin-bottom: 14px;
}

body.is-public-page .market-search {
  height: 42px;
}

body.is-public-page .market-search input {
  font-size: 15px;
}

body.is-public-page .provider-chip.is-active,
body.is-public-page .group-chip.is-active {
  background: #4166d8;
}

body.is-public-page .results-head {
  margin-bottom: 12px;
  font-size: 14px;
}

body.is-public-page .model-card {
  min-height: 306px;
  border-color: #e3e7ee;
  box-shadow: 0 4px 14px rgba(43, 58, 98, .04);
}

body.is-public-page .model-card-header {
  padding: 15px 14px 11px;
}

body.is-public-page .model-identity strong {
  font-size: 16px;
}

body.is-public-page .model-identity small {
  margin-top: 4px;
  font-size: 13px;
}

body.is-public-page .model-summary {
  min-height: 64px;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1.65;
}

body.is-public-page .model-tag {
  padding: 5px 7px;
  font-size: 12px;
}

body.is-public-page .model-card-meta {
  font-size: 12px;
}

body.is-public-page .model-pricing {
  margin-top: 13px;
  padding: 11px 14px;
}

body.is-public-page .pricing-mode,
body.is-public-page .model-price {
  font-size: 12px;
}

body.is-public-page .model-price b {
  font-size: 13px;
}

body.is-public-page .model-foot {
  padding: 10px 14px 13px;
}

body.is-public-page .model-action {
  font-size: 13px;
}

@media (max-width: 800px) {
  body.is-public-page .model-price-grid { grid-template-columns: 1fr; }

  body.is-public-page .site-header {
    padding: 0 10px;
  }

  body.is-public-page .top-nav {
    min-width: 0;
    overflow-x: auto;
    margin-left: 8px;
  }

  body.is-public-page .top-nav a {
    padding: 8px 9px;
    font-size: 13px;
  }

  body.is-public-page .header-icon:first-child {
    display: none;
  }

  body.is-public-page .balance-pill {
    display: none;
  }

  body.is-public-page .main-content {
    padding: 12px 10px 48px;
  }

  body.is-public-page .workshop-kicker {
    font-size: 28px;
  }

  body.is-public-page .workshop-tabs button {
    min-width: 92px;
    padding: 8px 12px;
  }
}

/* Authentication and console stay light. */
.auth-page {
  background: #f5f7fb;
  color: #1f2937;
}

.auth-shell {
  border-color: #e2e7f0;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(52, 64, 94, .12);
}

.auth-intro {
  border-right: 1px solid #e7ebf3;
  background: #f7f8ff;
  color: #1f2937;
}

.auth-intro .brand,
.auth-intro .brand strong,
.auth-intro h1 {
  color: #1f2937;
}

.auth-intro .brand small,
.auth-intro p,
.auth-points {
  color: #667085;
}

.auth-intro h1 span {
  color: #5d68d8;
}

.auth-points span::before {
  background: #e8f6f2;
  color: #29906f;
}

.auth-form,
.auth-mode-tabs button.is-active {
  background: #ffffff;
}

.auth-mode-tabs {
  border-color: #e2e7f0;
  background: #f3f5f9;
}

.auth-form .field,
.auth-form > p,
.auth-foot {
  color: #667085;
}

.auth-form .field input {
  border-color: #d9e0eb;
  background: #ffffff;
  color: #1f2937;
}

.auth-form .field input:focus {
  border-color: #7784e8;
  box-shadow: 0 0 0 3px rgba(102, 117, 255, .12);
}

body.is-console-page {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f3f5f8;
  --ink: #1f2937;
  --muted: #667085;
  --subtle: #8a94a6;
  --line: #e2e7ef;
  --primary-dark: #4e60d4;
  --primary-soft: #edf0ff;
  --cyan-soft: #e9f8fa;
  --orange-soft: #fff3e9;
  --success-soft: #eaf8f2;
  --danger-soft: #fff0f2;
  --shadow: 0 8px 24px rgba(35, 48, 79, .06);
  background: #f7f8fb;
  color: #1f2937;
}

body.is-console-page .site-header {
  border-color: #e6eaf1;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 1px 8px rgba(31, 43, 68, .04);
}

body.is-console-page .brand,
body.is-console-page .brand strong,
body.is-console-page .account-text strong {
  color: #1f2937;
}

body.is-console-page .brand-mark {
  background: #1f2533;
}

body.is-console-page .brand small,
body.is-console-page .account-text small,
body.is-console-page .balance-pill span {
  color: #7b8799;
}

body.is-console-page .top-nav a {
  color: #536174;
}

body.is-console-page .top-nav {
  flex: 0 1 auto;
  margin: 0 auto 0 16px;
}

body.is-console-page .top-nav a:hover,
body.is-console-page .top-nav a.is-active {
  background: #f1f4fb;
  color: #435fd0;
}

body.is-console-page .header-icon,
body.is-console-page .balance-pill,
body.is-console-page .account-link {
  border-color: #e2e7ef;
  background: #ffffff;
  color: #536174;
}

body.is-console-page .balance-pill strong {
  color: #9a721c;
}

body.is-console-page .account-avatar {
  background: #edf0ff;
  color: #5565d5;
}

body.is-console-page .site-layout.is-console {
  background: #f7f8fb;
}

body.is-console-page .main-content {
  background: #f7f8fb;
}

body.is-console-page .is-console .side-rail {
  border-color: #e2e7ef;
  background: #ffffff;
  color: #667085;
}

body.is-console-page .is-console .rail-title,
body.is-console-page .is-console .health {
  color: #8490a3;
}

body.is-console-page .is-console .rail-link {
  color: #667085;
}

body.is-console-page .is-console .rail-link:hover {
  background: #f3f5f9;
  color: #27364e;
}

body.is-console-page .is-console .rail-link.is-active {
  background: #edf1ff;
  color: #4d61cf;
}

body.is-console-page .is-console .rail-icon,
body.is-console-page .is-console .rail-link.is-active .rail-icon {
  background: #f1f3f7;
}

body.is-console-page .is-console .rail-link.is-active .rail-icon {
  background: #ffffff;
}

body.is-console-page .is-console .rail-divider {
  background: #e7ebf2;
}


body.is-console-page .rail-collapse {
  border-color: #dce3f4;
  background: #f2f5fc;
  color: #6173ad;
}

body.is-console-page .is-console .page-head,
body.is-console-page .console-tabs,
body.is-console-page .kpi,
body.is-console-page .data-card,
body.is-console-page .wallet-card,
body.is-console-page .admin-data-card,
body.is-console-page .admin-segments,
body.is-console-page .admin-search {
  border-color: #e2e7ef;
  background: #ffffff;
  color: #1f2937;
  box-shadow: none;
}

body.is-console-page .admin-status-filter { color: #667085; }
body.is-console-page .admin-status-filter select { border-color: #e2e7ef; background: #fff; color: #344054; }

body.is-console-page .is-console .page-head h1,
body.is-console-page .section-head h2,
body.is-console-page .data-card h2,
body.is-console-page .console-subhead h2,
body.is-console-page .admin-card-head strong {
  color: #1f2937;
}

body.is-console-page .is-console .page-head p,
body.is-console-page .legend,
body.is-console-page .console-subhead p,
body.is-console-page .admin-data-card > p {
  color: #667085;
}

body.is-console-page .console-tabs a {
  color: #667085;
}

body.is-console-page .console-tabs a:hover,
body.is-console-page .console-tabs a.is-active,
body.is-console-page .admin-segments button.is-active {
  background: #edf1ff;
  color: #4d61cf;
}

body.is-console-page .kpi span,
body.is-console-page .kpi small,
body.is-console-page .admin-card-head code,
body.is-console-page .admin-card-stats small,
body.is-console-page .provider-address small,
body.is-console-page .provider-paths small {
  color: #7b8799;
}

body.is-console-page .kpi strong,
body.is-console-page .admin-card-stats b {
  color: #1f2937;
}

body.is-console-page .chart-grid i,
body.is-console-page .admin-card-stats,
body.is-console-page .admin-form-switches {
  border-color: #e6eaf1;
}

body.is-console-page .data-table th {
  border-color: #e6eaf1;
  color: #697689;
}

body.is-console-page .data-table td {
  border-color: #edf0f4;
  color: #536174;
}

body.is-console-page .data-table td strong {
  color: #1f2937;
}

body.is-console-page .filters select,
body.is-console-page .field input,
body.is-console-page .field select,
body.is-console-page .admin-modal .field textarea {
  border-color: #d9e0eb;
  background: #ffffff;
  color: #1f2937;
}

body.is-console-page .button-secondary {
  border-color: #dce2eb;
  background: #ffffff;
  color: #344054;
}

body.is-console-page .button-secondary:hover {
  border-color: #aeb9ef;
  background: #f7f8ff;
  color: #4d61cf;
}

body.is-console-page .button-dark,
body.is-console-page .button-dark:hover {
  border: 1px solid #dce2eb;
  background: #f5f7fb;
  color: #536174;
  box-shadow: none;
}

body.is-console-page .admin-segments button {
  color: #667085;
}

body.is-console-page .admin-segments b,
body.is-console-page .admin-card-tags span {
  background: #f1f3f7;
  color: #657288;
}

body.is-console-page .model-badge {
  background: #f1f3f7;
  color: #657288;
}

body.is-console-page .admin-segments button.is-active b {
  background: #ffffff;
  color: #4d61cf;
}

body.is-console-page .admin-card-icon {
  background: #edf0ff;
  color: #5d6cdf;
}

body.is-console-page .admin-card-icon.provider-icon {
  background: #e8f7f5;
  color: #258d84;
}

body.is-console-page .admin-state {
  background: #fff0f2;
  color: #c45362;
}

body.is-console-page .admin-state.is-online {
  background: #eaf8f2;
  color: #27805f;
}

body.is-console-page .provider-address {
  background: #f7f8fb;
}

body.is-console-page .provider-address code,
body.is-console-page .provider-paths code {
  color: #536174;
}

body.is-console-page .provider-paths span {
  border-color: #e2e7ef;
}

body.is-console-page .modal-backdrop {
  background: rgba(39, 50, 72, .32);
}

body.is-console-page .modal {
  border-color: #e0e5ed;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 24px 60px rgba(39, 50, 72, .16);
}

body.is-console-page .modal-lead,
body.is-console-page .modal .field,
body.is-console-page .admin-form-switches label {
  color: #667085;
}

body.is-console-page .notice {
  border-color: #cfe9df;
  background: #effaf6;
  color: #357a60;
}

@media (max-width: 800px) {
  body.is-console-page .site-layout.is-console .side-rail {
    background: #ffffff;
    box-shadow: 12px 0 32px rgba(39, 50, 72, .12);
  }
}

/* Developer documentation */
.docs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 22px 0 24px;
  border-bottom: 1px solid #e7ebf2;
}

.docs-head h1 {
  margin: 3px 0 4px;
  color: #172033;
  font-size: 30px;
  line-height: 1.25;
}

.docs-head p {
  margin: 0;
  color: #697689;
  font-size: 15px;
}

.docs-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(340px, 40vw);
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid #dfe4ec;
  border-radius: 7px;
  background: #ffffff;
  color: #8a94a6;
}

.docs-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #26344c;
  font-size: 14px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 180px;
  gap: 34px;
  align-items: start;
  padding-top: 26px;
}

.docs-sidebar,
.docs-outline {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 10px;
  background: #ffffff;
}

.docs-sidebar > p,
.docs-outline > p {
  margin: 0 0 16px;
  color: #8993a4;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-nav-group {
  display: grid;
  margin-bottom: 22px;
}

.docs-nav-group strong {
  margin-bottom: 7px;
  color: #1f2937;
  font-size: 13px;
}

.docs-nav-group a,
.docs-outline a {
  display: block;
  padding: 5px 8px;
  border-left: 2px solid transparent;
  color: #657288;
  font-size: 13px;
  line-height: 1.45;
}

.docs-nav-group a:hover,
.docs-outline a:hover {
  border-left-color: #7b86e9;
  background: #f6f7ff;
  color: #4e60d4;
}

.docs-nav-group a.is-third {
  padding-left: 20px;
  color: #8490a3;
  font-size: 12px;
}

.docs-outline nav {
  display: grid;
}

.docs-outline a.level-3 {
  padding-left: 17px;
  color: #8490a3;
  font-size: 12px;
}

.docs-content {
  min-width: 0;
  padding-bottom: 80px;
}

.docs-section-group {
  margin-bottom: 58px;
}

.docs-section-group > header {
  margin-bottom: 25px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7ebf2;
}

.docs-section-group > header span {
  color: #5d6bd9;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.docs-section-group > header p {
  margin: 4px 0 0;
  color: #778398;
  font-size: 14px;
}

.docs-article {
  scroll-margin-top: 88px;
  margin-bottom: 52px;
}

.docs-article h2 {
  margin: 0 0 8px;
  color: #172033;
  font-size: 27px;
  line-height: 1.3;
}

.docs-subsection {
  scroll-margin-top: 88px;
  margin-top: 35px;
  padding-top: 2px;
}

.docs-subsection h3,
.docs-markdown h3,
.docs-markdown h4 {
  margin: 0 0 9px;
  color: #26344c;
  font-size: 20px;
}

.docs-summary {
  margin: 0 0 18px;
  color: #657288;
  font-size: 16px;
}

.docs-markdown {
  color: #46546a;
  font-size: 15px;
  line-height: 1.82;
}

.docs-markdown p {
  margin: 12px 0;
}

.docs-markdown ul {
  margin: 12px 0;
  padding-left: 22px;
}

.docs-markdown li {
  margin: 6px 0;
}

.docs-markdown code:not(.docs-code code) {
  padding: 2px 5px;
  border: 1px solid #e2e5f3;
  border-radius: 4px;
  background: #f5f6fb;
  color: #594fb1;
  font: 13px/1.5 "SFMono-Regular", Consolas, monospace;
}

.docs-code {
  margin: 17px 0;
  overflow: hidden;
  border: 1px solid #293142;
  border-radius: 7px;
  background: #171b24;
}

.docs-code > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #2b3342;
  color: #8f9aae;
  font-size: 12px;
}

.docs-code button {
  border: 0;
  background: transparent;
  color: #c4cbda;
  font-size: 12px;
  cursor: pointer;
}

.docs-code pre {
  margin: 0;
  padding: 15px;
  overflow-x: auto;
  color: #e5e9f1;
  font: 13px/1.75 "SFMono-Regular", Consolas, monospace;
}

.docs-loading {
  min-height: 260px;
  padding: 60px 24px;
  border: 1px dashed #dbe1eb;
  border-radius: 8px;
  background: #fbfcfe;
  color: #7c8799;
  text-align: center;
}

.is-filtered {
  display: none !important;
}

/* Documentation administration */
.document-admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-card-icon.document-icon {
  background: #f1efff;
  color: #6859c7;
}

.document-admin-modal {
  width: min(860px, 100%);
}

.admin-card-actions {
  gap: 8px;
}

.button-danger {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #efcbd0;
  border-radius: 6px;
  background: #fff7f8;
  color: #bd4f5d;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.button-danger:hover {
  border-color: #df9ca6;
  background: #fff0f2;
}

/* Infinite canvas projects */
.projects-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.projects-head h1 { margin: 5px 0 7px; font-size: 38px; line-height: 1.08; }
.projects-head p { margin: 0; color: #778398; font-size: 14px; }
.project-create-button { min-height: 44px; padding: 10px 17px; white-space: nowrap; }
.project-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.project-stats article { display: flex; align-items: center; gap: 13px; min-height: 92px; padding: 17px 18px; border: 1px solid #2a303a; border-radius: 8px; background: #171a20; }
.project-stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 7px; background: #26324f; color: #aebcff; font-size: 18px; }
.project-stat-icon.warm { background: #3b2e32; color: #ef98a7; }
.project-stat-icon.mint { background: #213a39; color: #85cbbf; }
.project-stat-icon.gold { background: #3d3020; color: #f3c969; }
.project-stats small { display: block; color: #8490a4; font-size: 12px; }
.project-stats strong { display: block; margin-top: 5px; color: #edf1f8; font-size: 25px; }
.project-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.project-control-label { display: block; margin-bottom: 8px; color: #76839a; font-size: 12px; font-weight: 700; }
.project-categories { display: flex; flex-wrap: wrap; gap: 7px; }
.project-categories button { min-height: 36px; padding: 7px 13px; border: 1px solid #303746; border-radius: 6px; background: #181c23; color: #a0aabb; font-size: 12px; font-weight: 700; cursor: pointer; }
.project-categories button:hover { border-color: #4a5572; color: #d8deea; }
.project-categories button.is-active { border-color: #7185ed; background: #2b3656; color: #f0f3ff; }
.project-search { width: min(350px, 34vw); height: 40px; border-color: #303642; background: #181c23; }
.project-search input { color: #eef2f6; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.project-card { position: relative; overflow: visible; border: 1px solid #2a303a; border-radius: 8px; background: #171a20; box-shadow: 0 12px 28px rgba(0, 0, 0, .14); }
.project-card-menu-wrap { position: absolute; z-index: 5; top: 11px; right: 11px; }
.project-menu-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px; background: rgba(15, 18, 24, .82); color: #dbe1eb; font-size: 20px; line-height: 1; cursor: pointer; }
.project-menu { position: absolute; top: 40px; right: 0; display: grid; min-width: 156px; padding: 6px; border: 1px solid #343b49; border-radius: 7px; background: #20242b; box-shadow: 0 18px 42px rgba(0, 0, 0, .32); }
.project-menu button { padding: 9px 10px; border: 0; border-radius: 5px; background: transparent; color: #b8c2d2; font-size: 12px; text-align: left; cursor: pointer; }
.project-menu button:hover { background: #2a313d; color: #f0f3f8; }
.project-menu button.danger { color: #e18a98; }
.project-cover { position: relative; display: grid; place-items: center; width: calc(100% - 16px); aspect-ratio: 16 / 9; margin: 8px; overflow: hidden; padding: 0; border: 1px solid #2b3340; border-radius: 6px; background: #11151b; cursor: pointer; }
.project-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project-cover-placeholder { display: grid; place-items: center; gap: 8px; color: #667187; }
.project-cover-placeholder i { font-size: 30px; font-style: normal; }
.project-cover-placeholder small { font-size: 11px; }
.project-status { position: absolute; top: 10px; left: 10px; padding: 4px 7px; border-radius: 4px; background: rgba(16, 20, 27, .84); color: #9fd7cb; font-size: 11px; font-weight: 750; }

/* --- §110 封面（图片 / 视频节点 → 项目卡片） -------------------------------
   容器是必须的：封面按钮的兄弟节点上还挂着「进入创作」浮层按钮，
   而 <button> 里不能再套 <button>（非法结构，浏览器会把内层挤出去）。 */
.project-cover-wrap { position: relative; display: block; }
.project-cover-media { display: block; width: 100%; height: 100%; object-fit: cover; background: #11151b; }
/* 左下角提示条（§287 封面本体不再写文字，这里只留给「封面已失效」等兜底场景，别再把说明文字塞回封面） */
.project-cover-kind,
.project-cover-hint { position: absolute; bottom: 10px; left: 10px; padding: 4px 7px; border-radius: 4px; background: rgba(16, 20, 27, .84); color: #d5e2ff; font-size: 11px; font-weight: 750; pointer-events: none; }
.project-cover-hint { opacity: 0; transition: opacity .16s ease; }
.project-card:hover .project-cover-hint { opacity: 1; }
/* 悬停出现的「进入创作」：封面点击改成放大之后，进项目必须仍然一眼可见 */
.project-cover-enter { position: absolute; right: 10px; bottom: 10px; padding: 7px 12px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 6px; background: rgba(16, 20, 27, .86); color: #eef2ff; font-size: 12px; font-weight: 750; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.project-card:hover .project-cover-enter,
.project-cover-enter:focus-visible { opacity: 1; pointer-events: auto; }
/* §286 封面左下角常驻的「点击放大」按钮：卡片上唯一的查看器入口，必须一眼能看见。
   它和封面按钮是兄弟节点（button 不能嵌套），z-index 抬到封面之上才有得点。 */
.project-cover-zoom { position: absolute; z-index: 2; left: 10px; bottom: 10px; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, .26); border-radius: 5px; background: rgba(16, 20, 27, .86); color: #d5e2ff; font-size: 11.5px; font-weight: 750; line-height: 1.2; cursor: zoom-in; transition: background .16s ease, color .16s ease; }
.project-cover-zoom:hover { background: rgba(38, 50, 79, .96); color: #fff; }
.project-cover-zoom:focus-visible { outline: 2px solid var(--primary, #5687ff); outline-offset: 2px; }
/* §287 没图可放大时，同一个位置换成「上传封面」：仍是按钮，只是改成手型光标 + 虚线描边，
   一眼能分清「看」和「传」。 */
.project-cover-zoom.is-upload { cursor: pointer; border-style: dashed; color: #c9d6ef; }
.project-cover-zoom.is-upload:hover { border-style: solid; }
/* 整张卡都是「进项目」的点击区（放大只认上面那个按钮），所以卡片本体也给手型光标 */
.project-card { cursor: pointer; }
.project-card-copy { padding: 6px 15px 15px; }
.project-card-copy h2 { margin: 0; overflow: hidden; color: #edf1f8; font-size: 19px; text-overflow: ellipsis; white-space: nowrap; }
.project-card-copy p { min-height: 38px; margin: 7px 0 10px; color: #8995a9; font-size: 12px; line-height: 1.6; }
.project-card-category { display: inline-flex; padding: 4px 7px; border-radius: 4px; background: #26324f; color: #afbcff; font-size: 11px; font-weight: 700; }
.project-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 15px 0 0; padding: 12px 0; border-top: 1px solid #282f3a; border-bottom: 1px solid #282f3a; }
.project-card-stats div { min-width: 0; }
.project-card-stats dt { color: #76839a; font-size: 11px; }
.project-card-stats dd { margin: 5px 0 0; color: #e3e8f0; font-size: 18px; font-weight: 750; }
.project-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.project-card-foot span { color: #738096; font-size: 11px; }
.project-card-foot button { padding: 0; border: 0; background: transparent; color: #91a0ff; font-size: 12px; font-weight: 750; cursor: pointer; }
/* --- 创建 / 重命名项目 弹窗（§198）---
   分类卡片从「白底文字卡」改成「图片卡」：标题 / slogan / 标签 /「开始创作」都在图里，
   所以卡片上**不叠任何文字**（叠上去就是重影），选中态靠「描边 + 右上角对勾」表达。
   取色一律走 token（--line / --surface / --surface-soft / --primary / --shadow），
   浅色主题下由文件末尾的 light 作用域重定向 —— 原先这套用死了 #fbfcfe / #e1e6ee，
   结果深色弹窗里浮着四张白卡，正是「主题是白、弹窗是黑」的一半原因。 */
.project-modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.project-category-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding: 0; border: 0; }
.project-category-picker legend { grid-column: 1 / -1; margin-bottom: 2px; color: var(--muted); font-size: 13px; font-weight: 700; }
.project-category-card { position: relative; display: block; cursor: pointer; }
.project-category-card input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.project-category-media {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  transition: border-color .24s ease, box-shadow .3s ease, transform .28s cubic-bezier(.2, .8, .3, 1);
}
.project-category-media img {
  display: block;
  width: 100%;
  /* height:auto 不能省：<img> 上的 height/width 属性会变成「展示型提示」（presentational
     hint，优先级低于任何作者声明，但高于 height:auto 的初始值）。只写 width:100% +
     aspect-ratio 的话高度仍被 height="419" 钉死 —— 实测卡片被撑到 421px 高，
     整排图片被 object-fit:cover 裁掉中间大半，弹窗也随之超出屏幕。 */
  height: auto;
  aspect-ratio: 802 / 421;
  object-fit: cover;
  transform: scale(1);
  transition: transform .5s cubic-bezier(.2, .8, .3, 1);
}
.project-category-card:hover .project-category-media { border-color: #7d88ff; transform: translateY(-2px); box-shadow: var(--shadow); }
.project-category-card:hover .project-category-media img { transform: scale(1.035); }
/* 按下就缩一下：「点到了」这件事必须在抬手之前就看得见 */
.project-category-card:active .project-category-media { transform: scale(.972); transition-duration: .1s; }
.project-category-card input:checked ~ .project-category-media { border-color: #7b86ff; box-shadow: 0 0 0 2px rgba(110, 122, 255, .34), 0 18px 38px rgba(48, 58, 150, .26); }
.project-category-card input:focus-visible ~ .project-category-media { outline: 2px solid var(--primary); outline-offset: 3px; }
.project-category-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6675ff;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: scale(.55);
  transition: opacity .18s ease, transform .26s cubic-bezier(.2, .9, .3, 1.5);
}
.project-category-card input:checked ~ .project-category-check { opacity: 1; transform: scale(1); animation: mcw-pick-pop .34s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes mcw-pick-pop {
  0% { opacity: 0; transform: scale(.5); }
  62% { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}
.canvas-workspace-page { min-height: 680px; }
.canvas-workspace-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin-bottom: 16px; }
.canvas-workspace-head h1 { margin: 6px 0 2px; font-size: 28px; }
.canvas-workspace-head p { margin: 0; color: #778398; font-size: 13px; }
.infinite-canvas { position: relative; min-height: 650px; overflow: auto; border: 1px solid #2a303a; border-radius: 8px; background: #11151b; }
.infinite-canvas-grid { position: absolute; inset: 0; min-width: 1400px; min-height: 1000px; opacity: .55; background-image: linear-gradient(#242b36 1px, transparent 1px), linear-gradient(90deg, #242b36 1px, transparent 1px); background-size: 28px 28px; }
.canvas-project-node { position: absolute; z-index: 2; display: grid; grid-template-columns: 31px minmax(0, 1fr); column-gap: 9px; width: 220px; padding: 13px; border: 1px solid #394252; border-radius: 7px; background: #1d222b; box-shadow: 0 18px 36px rgba(0, 0, 0, .25); cursor: grab; user-select: none; transform-origin: top left; }
.canvas-project-node:active { cursor: grabbing; }
.canvas-project-node > span { grid-row: 1 / 3; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 6px; background: #2b3656; color: #aebcff; font-weight: 800; }
.canvas-project-node strong { overflow: hidden; color: #edf1f8; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.canvas-project-node small { margin-top: 4px; color: #8d99ad; font-size: 11px; line-height: 1.45; }
.canvas-zoom { position: sticky; z-index: 4; top: 12px; left: calc(100% - 132px); display: inline-flex; align-items: center; gap: 8px; width: max-content; margin: 12px 12px 0 auto; padding: 5px; border: 1px solid #303746; border-radius: 6px; background: rgba(23, 26, 32, .92); }
.canvas-zoom button { width: 28px; height: 28px; border: 0; border-radius: 4px; background: #293142; color: #e8edf6; cursor: pointer; }
.canvas-zoom span { min-width: 40px; color: #9ba7ba; font-size: 11px; text-align: center; }

body.is-public-page .project-stats article,
body.is-public-page .project-card {
  border-color: #e5eaf2;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 8px 24px rgba(33, 46, 79, .06);
}

body.is-public-page .project-stats small,
body.is-public-page .project-card-copy p,
body.is-public-page .project-card-foot span {
  color: #7a879b;
}

body.is-public-page .project-stats strong,
body.is-public-page .project-card-copy h2,
body.is-public-page .project-card-stats dd {
  color: #26344c;
}

body.is-public-page .project-stat-icon {
  background: #eef0ff;
  color: #5b58d6;
}

body.is-public-page .project-stat-icon.warm {
  background: #fff0e8;
  color: #e27c49;
}

body.is-public-page .project-stat-icon.mint {
  background: #e4f8fb;
  color: #218d9d;
}

body.is-public-page .project-stat-icon.gold {
  background: #fff6df;
  color: #bd8527;
}

body.is-public-page .project-categories button,
body.is-public-page .project-search {
  border-color: #e2e7f1;
  background: #fff;
  color: #667085;
}

body.is-public-page .project-search input {
  color: #253047;
}

body.is-public-page .project-categories button.is-active {
  border-color: #8c88e8;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

body.is-public-page .project-menu-button {
  border-color: #d9dfeb;
  background: rgba(255, 255, 255, .92);
  color: #59657a;
}

body.is-public-page .project-menu {
  border-color: #e1e6ef;
  background: #fff;
  box-shadow: 0 16px 34px rgba(31, 44, 75, .14);
}

body.is-public-page .project-menu button {
  color: #5c687b;
}

body.is-public-page .project-menu button:hover {
  background: #f3f5fa;
  color: #26344c;
}

body.is-public-page .project-cover {
  border-color: #e3e8f0;
  background: #f2f5f9;
}

body.is-public-page .project-cover-placeholder {
  color: #9aa5b7;
}

body.is-public-page .project-status {
  background: rgba(255, 255, 255, .92);
  color: #208260;
}

/* §110 封面提示：与 .project-status 同一口径 —— 白底深字，压在照片上也读得清 */
body.is-public-page .project-cover-media {
  background: #f2f5f9;
}

body.is-public-page .project-cover-kind,
body.is-public-page .project-cover-hint {
  background: rgba(255, 255, 255, .92);
  color: #26344c;
}

body.is-public-page .project-cover-enter {
  border-color: #dfe5f2;
  background: rgba(255, 255, 255, .94);
  color: var(--primary-dark);
}

body.is-public-page .project-cover-zoom {
  border-color: #dfe5f2;
  background: rgba(255, 255, 255, .94);
  color: var(--primary-dark);
}

body.is-public-page .project-card-category {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

body.is-public-page .project-card-stats {
  border-color: #edf0f5;
}

body.is-public-page .project-card-stats dt {
  color: #8a96a8;
}

body.is-public-page .project-card-foot button {
  color: var(--primary);
}

body.is-public-page .infinite-canvas {
  border-color: #e1e7f0;
  background: #f8fafe;
}

body.is-public-page .infinite-canvas-grid {
  opacity: .75;
  background-image: linear-gradient(#dfe6f1 1px, transparent 1px), linear-gradient(90deg, #dfe6f1 1px, transparent 1px);
}

body.is-public-page .canvas-project-node {
  border-color: #dde4ef;
  background: #fff;
  box-shadow: 0 16px 34px rgba(42, 58, 99, .12);
}

body.is-public-page .canvas-project-node > span {
  background: var(--primary-soft);
  color: var(--primary);
}

body.is-public-page .canvas-project-node strong {
  color: #253047;
}

body.is-public-page .canvas-project-node small {
  color: #79869a;
}

body.is-public-page .canvas-zoom {
  border-color: #dfe5ef;
  background: rgba(255, 255, 255, .94);
}

body.is-public-page .canvas-zoom button {
  background: #eef1f8;
  color: #40506b;
}

body.is-public-page .canvas-zoom span {
  color: #718096;
}

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .projects-head { align-items: stretch; flex-direction: column; }
  .project-create-button { width: 100%; }
  .project-controls { align-items: stretch; flex-direction: column; }
  .project-search { width: 100%; }
  .project-grid { grid-template-columns: 1fr; }
  .project-stats { grid-template-columns: 1fr; }
  .project-category-picker { grid-template-columns: 1fr; }
  .canvas-workspace-head { grid-template-columns: 1fr; }
  .canvas-workspace-head .button { width: 100%; }
  .infinite-canvas { min-height: 560px; }
}

/* AI history */
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.history-filters { display: flex; align-items: center; gap: 6px; padding: 4px; border: 1px solid #2a303a; border-radius: 7px; background: #171a20; }
.history-filters button { min-height: 34px; padding: 7px 13px; border: 0; border-radius: 5px; background: transparent; color: #919caf; font-size: 13px; font-weight: 700; cursor: pointer; }
.history-filters button:hover,
.history-filters button.is-active { background: #2b3656; color: #ecf1ff; }
.history-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.history-search { width: min(320px, 34vw); height: 38px; border-color: #303642; background: #181c23; }
.history-search input { color: #eef2f6; }
.history-select-all { display: inline-flex; align-items: center; gap: 7px; color: #9ca7b9; font-size: 13px; white-space: nowrap; cursor: pointer; }
.history-select-all input { accent-color: #7185ed; }
.history-selection { margin-bottom: 12px; color: #8591a6; font-size: 12px; }
.history-list { display: grid; gap: 12px; }
.history-card { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 16px; border: 1px solid #2a303a; border-radius: 8px; background: #171a20; transition: border-color .16s ease, background .16s ease; }
.history-card.is-selected { border-color: #6579dd; background: #1b2235; }
.history-card:hover { border-color: #3a465f; }
.history-check { display: grid; place-items: start center; padding-top: 2px; }
.history-check input { width: 17px; height: 17px; accent-color: #7185ed; cursor: pointer; }
.history-card-main { min-width: 0; }
.history-card-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.history-card-head strong { min-width: 0; overflow: hidden; color: #edf1f8; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.history-type { flex: 0 0 auto; padding: 4px 7px; border-radius: 4px; background: #26324f; color: #aebcff; font-size: 11px; font-weight: 750; }
.history-type.image { background: #3d3020; color: #f3c969; }
.history-type.video { background: #243b39; color: #8ed0c4; }
.history-status { margin-left: auto; color: #8f9aae; font-size: 11px; text-transform: uppercase; }
.history-status.error { color: #e18a98; }
.history-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 8px; color: #7f8ca3; font-size: 12px; }
.history-prompt { margin: 12px 0 0; color: #cbd3e1; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.history-response { margin: 8px 0 0; color: #909caf; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.history-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.history-images a { display: block; overflow: hidden; border: 1px solid #303746; border-radius: 6px; background: #11151b; }
.history-images img { display: block; width: 100%; height: 130px; object-fit: cover; }

@media (max-width: 980px) {
  .history-toolbar { align-items: stretch; flex-direction: column; }
  .history-actions { justify-content: flex-start; flex-wrap: wrap; }
  .history-search { width: 100%; flex: 1 1 240px; }
}

@media (max-width: 700px) {
  .history-card { grid-template-columns: 26px minmax(0, 1fr); padding: 13px; }
  .history-card-head { align-items: flex-start; flex-wrap: wrap; }
  .history-status { margin-left: 0; }
}

@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .docs-outline {
    display: none;
  }

  .document-admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .docs-head {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .docs-head h1 {
    font-size: 26px;
  }

  .docs-search {
    width: 100%;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 18px;
  }

  .docs-sidebar {
    position: static;
    max-height: 240px;
    padding: 15px;
    border: 1px solid #e3e7ee;
    border-radius: 7px;
  }

  .docs-article h2 {
    font-size: 23px;
  }

  .document-admin-grid {
    grid-template-columns: 1fr;
  }
}

/* Full-screen canvas workspace */
body.canvas-workspace-open {
  overflow: hidden;
}

.canvas-workspace-page {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr);
  min-width: 320px;
  min-height: 100vh;
  overflow: hidden;
  background: #0b0e11;
  color: #eef1f5;
}

.canvas-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  background: #0b0e11;
}

.canvas-topbar-left,
.canvas-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.canvas-topbar-left > strong {
  max-width: min(38vw, 420px);
  overflow: hidden;
  color: #f5f6f8;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-brand {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 7px;
  background: #d7f35a;
  color: #101408;
  font-size: 11px;
  font-weight: 900;
}

.canvas-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #30343b;
  border-radius: 6px;
  background: #171a1f;
  color: #d8dde5;
  cursor: pointer;
}

.canvas-icon-button:hover {
  border-color: #505762;
  background: #20242a;
}

.canvas-icon-button.compact {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.canvas-category-pill {
  padding: 4px 7px;
  border-radius: 4px;
  background: #20242a;
  color: #9ca7b7;
  font-size: 11px;
}

.canvas-topbar-actions button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #30343b;
  border-radius: 6px;
  background: #171a1f;
  color: #cbd2dc;
  font-size: 12px;
  cursor: pointer;
}

.canvas-topbar-actions button:hover {
  border-color: #58606c;
  color: #fff;
}

.canvas-node-total {
  padding: 4px 8px;
  color: #87909e;
  font-size: 11px;
}

.canvas-node-total b {
  color: #d7f35a;
}

.canvas-workarea {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  background: #0d1013;
}

.canvas-workarea.is-assets-collapsed {
  display: block;
}

.canvas-side-panel {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  min-width: 0;
  overflow: hidden;
  background: #151a1f;
  color: #d8dde5;
  transition: transform .2s ease, opacity .2s ease;
}

.canvas-assets-panel {
  left: 0;
  width: 230px;
  border-right: 1px solid #22252b;
  box-shadow: 18px 0 36px rgba(0, 0, 0, .32);
}

.canvas-assets-panel.is-collapsed {
  display: none;
}

.canvas-assistant-panel {
  right: 0;
  display: grid;
  width: 286px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  border-left: 1px solid #22252b;
  box-shadow: -18px 0 36px rgba(0, 0, 0, .32);
}

.canvas-assistant-panel.is-collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
}

.canvas-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #202329;
}

.canvas-panel-head small,
.canvas-panel-head strong {
  display: block;
}

.canvas-panel-head small {
  color: #6f7784;
  font-size: 10px;
}

.canvas-panel-head strong {
  margin-top: 3px;
  color: #eef1f5;
  font-size: 14px;
}

.canvas-panel-head button {
  border: 0;
  background: transparent;
  color: #7f8896;
  cursor: pointer;
}

.canvas-assets-list {
  display: grid;
  align-content: start;
  gap: 6px;
  height: calc(100% - 110px);
  padding: 10px;
  overflow-y: auto;
}

.canvas-assets-list button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #bfc7d2;
  text-align: left;
  cursor: pointer;
}

.canvas-assets-list button:hover {
  border-color: #2d333b;
  background: #171a1f;
}

.canvas-assets-list button > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #20252c;
  color: #d7f35a;
}

.canvas-assets-list strong,
.canvas-assets-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-assets-list strong {
  font-size: 12px;
}

.canvas-assets-list small {
  margin-top: 2px;
  color: #737c89;
  font-size: 10px;
}

.canvas-panel-action {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  min-height: 36px;
  border: 1px solid #3a414a;
  border-radius: 6px;
  background: #191d22;
  color: #d9dfe7;
  cursor: pointer;
}

.canvas-assistant-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.assistant-message {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.assistant-message > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #d7f35a;
  color: #11140b;
}

.assistant-message p {
  margin: 3px 0 0;
  color: #aeb7c3;
  font-size: 12px;
  line-height: 1.6;
}

.canvas-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}

.canvas-prompt-actions button {
  padding: 5px 7px;
  border: 1px solid #30353d;
  border-radius: 5px;
  background: #171a1f;
  color: #9ea8b5;
  font-size: 11px;
  cursor: pointer;
}

.canvas-assistant-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 7px;
  padding: 12px;
  border-top: 1px solid #202329;
}

.canvas-assistant-input textarea {
  min-height: 70px;
  padding: 9px;
  resize: none;
  border: 1px solid #30353d;
  border-radius: 6px;
  outline: 0;
  background: #15181d;
  color: #e9edf2;
  font: 12px/1.5 inherit;
}

.canvas-assistant-input button {
  align-self: end;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #d7f35a;
  color: #11140b;
  font-weight: 900;
  cursor: pointer;
}

.canvas-bottom-toolbar {
  position: fixed;
  z-index: 20;
  bottom: 16px;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  max-width: calc(100vw - 28px);
  height: 48px;
  padding: 0 6px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  background: #202322;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .32);
  margin: 0 auto;
  transform: none;
}

.canvas-toolbar-side {
  position: fixed;
  bottom: 16px;
  z-index: 21;
}

.canvas-toolbar-side:first-child {
  left: 14px;
}

.canvas-toolbar-side:last-child {
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-save-state {
  color: #7d8794;
  font-size: 11px;
}

.canvas-toolbar-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.canvas-toolbar-tools button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  border-radius: 6px;
  background: transparent;
  color: #a9b3ba;
  cursor: pointer;
}

.canvas-toolbar-tools button:hover,
.canvas-toolbar-tools button.is-active {
  background: #293139;
  color: #f3f5f7;
}

.canvas-toolbar-tools strong {
  min-width: 42px;
  color: #aeb7c3;
  font-size: 11px;
  text-align: center;
}

.canvas-toolbar-side button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #30343b;
  border-radius: 6px;
  background: #171a1f;
  color: #c8cfd8;
  font-size: 12px;
  cursor: pointer;
}

.infinite-canvas.is-hand-tool,
.infinite-canvas.is-hand-tool .canvas-project-node {
  cursor: grab;
}

.canvas-workspace-page .infinite-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: #0d1013 !important;
}

.canvas-workspace-page .infinite-canvas-grid {
  opacity: 1;
  background: #0d1013 !important;
  background-color: #0d1013 !important;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .08) 0 1px, transparent 1.25px) !important;
  background-size: 34px 34px !important;
}

.canvas-connections {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  overflow: visible;
  pointer-events: none;
}

.canvas-connections path {
  fill: none;
  stroke: #9ba4b1;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: canvas-link-draw .7s ease forwards;
}

.canvas-connections path.is-related {
  opacity: 1;
  stroke: #5687ff;
  stroke-width: 2;
  stroke-dasharray: 8 7;
  stroke-dashoffset: 0;
  animation: canvas-link-flow .8s linear infinite;
}

.canvas-connections path.is-dimmed {
  opacity: 1;
  stroke: #9ba4b1;
}

@keyframes canvas-link-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes canvas-link-flow {
  to { stroke-dashoffset: -30; }
}

.canvas-workspace-page .canvas-project-node {
  z-index: 2;
  display: block;
  width: 439px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eef1f5;
  box-shadow: none;
}

.canvas-workspace-page .canvas-project-node:hover {
  transform: translateY(-1px);
}

.canvas-workspace-page .canvas-project-node.is-selected {
  box-shadow: none;
}

.canvas-workspace-page .canvas-project-node.is-related:not(.is-selected) {
  border-color: #5687ff;
  filter: drop-shadow(0 0 7px rgba(86, 135, 255, .28));
  animation: canvas-related-pulse 1.25s ease-in-out infinite;
}

.canvas-workspace-page .canvas-project-node.is-related:not(.is-selected) .canvas-node-media,
.canvas-workspace-page .canvas-project-node.is-related:not(.is-selected) .canvas-text-node-icon {
  border-color: #5687ff;
}

.canvas-workspace-page .canvas-project-node.is-dimmed {
  opacity: 1;
}

@keyframes canvas-related-pulse {
  50% { filter: drop-shadow(0 0 12px rgba(86, 135, 255, .48)); }
}

.canvas-workspace-page .canvas-project-node.is-editing {
  z-index: 6;
}

.canvas-workspace-page .canvas-project-node.is-text-node {
  width: 439px;
  min-height: 354px;
  padding: 26px;
  border: 1px solid #303536;
  border-radius: 15px;
  background: #202322;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

.canvas-workspace-page .canvas-project-node.is-text-node.is-selected {
  border-color: #b9ed4e;
  box-shadow: 0 0 0 1px #b9ed4e, 0 22px 48px rgba(0, 0, 0, .38);
}

.canvas-text-node-head {
  display: grid;
  grid-template-columns: 18px 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.canvas-node-drag {
  color: #5d646d;
  font-size: 14px;
  line-height: 1;
  writing-mode: vertical-rl;
}

.canvas-text-node-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #b9ed4e;
  border-radius: 8px;
  color: #b9ed4e;
  font-size: 18px;
  font-weight: 800;
}

.canvas-text-node-head small,
.canvas-text-node-head strong {
  display: block;
}

.canvas-text-node-head small {
  color: #858b92;
  font-size: 11px;
  text-transform: uppercase;
}

.canvas-text-node-head strong {
  margin-top: 3px;
  color: #f0f2f4;
  font-size: 19px;
}

.canvas-text-node-head em {
  align-self: start;
  color: #b9ed4e;
  font-size: 11px;
  font-style: normal;
}

.canvas-text-node-description {
  margin: 16px 0 0 28px;
  color: #a5adb6;
  font-size: 13px;
  line-height: 1.6;
}

.canvas-project-node.is-text-node .canvas-inline-editor {
  width: 100%;
  margin-top: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.canvas-project-node.is-text-node .canvas-inline-editor textarea {
  min-height: 220px;
  padding: 16px;
  border-color: #2b3742;
  border-radius: 9px;
  background: #0c1116;
  color: #eef2f6;
  font-size: 14px;
  line-height: 1.8;
}

.canvas-project-node.is-text-node .canvas-inline-actions {
  justify-content: flex-end;
}

.canvas-project-node.is-text-node .canvas-inline-actions button {
  min-height: 36px;
  padding: 7px 13px;
  border-color: #3a4048;
  background: #292d31;
  color: #e2e6ea;
}

.canvas-project-node.is-text-node .canvas-inline-actions button.primary {
  border-color: #b9ed4e;
  background: #b9ed4e;
  color: #10130b;
}

.canvas-node-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 439px;
  min-height: 26px;
  padding: 0 3px 8px;
}

.canvas-node-title strong {
  min-width: 0;
  overflow: hidden;
  color: #f2f4f7;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-node-title em {
  flex: 0 0 auto;
  color: #b9ed4e;
  font-size: 10px;
  font-style: normal;
}

.canvas-node-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 439px;
  height: 300px;
  overflow: hidden;
  border: 1px solid #3d434c;
  border-radius: 15px;
  background: #f4f5f6;
}

.canvas-node-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-node-glyph {
  color: #6e7784;
  font-size: 34px;
}

.canvas-project-node.is-selected .canvas-node-media {
  border-color: #b9ed4e;
  box-shadow: 0 0 0 1px #b9ed4e, 0 18px 42px rgba(0, 0, 0, .38);
}

.canvas-node-media.is-text {
  place-content: center;
  justify-items: start;
  gap: 8px;
  padding: 30px;
  width: 439px;
  height: 354px;
  border-color: transparent;
  border-radius: 15px;
  background: #202322;
}

.canvas-node-media.is-text .canvas-node-glyph {
  color: var(--node-accent, #b9ed4e);
  font-size: 28px;
}

.canvas-node-media.is-text small {
  color: #858d98;
  font-size: 10px;
  text-transform: uppercase;
}

.canvas-node-media.is-text strong {
  color: #f1f3f6;
  font-size: 19px;
}

.canvas-node-media.is-text p {
  max-width: 360px;
  margin: 0;
  color: #9aa3af;
  font-size: 12px;
  line-height: 1.6;
}

.canvas-node-status {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #b9ed4e;
  font-size: 10px;
  font-style: normal;
}

.canvas-inline-editor {
  display: grid;
  gap: 9px;
  width: 439px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #3b414a;
  border-radius: 15px;
  background: #202322;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .34);
}

.canvas-inline-editor label {
  display: grid;
  gap: 5px;
  color: #8c96a3;
  font-size: 10px;
}

.canvas-inline-editor input,
.canvas-inline-editor textarea {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #383d45;
  border-radius: 6px;
  outline: 0;
  background: #111317;
  color: #edf0f4;
  font: 12px/1.5 inherit;
  resize: vertical;
}

.canvas-inline-editor input:focus,
.canvas-inline-editor textarea:focus {
  border-color: #849542;
}

.canvas-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.canvas-inline-actions button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #3a4048;
  border-radius: 5px;
  background: #22252a;
  color: #c9d0d9;
  font-size: 11px;
  cursor: pointer;
}

.canvas-inline-actions button:hover {
  border-color: #667245;
  color: #fff;
}

.canvas-inline-actions button.primary {
  border-color: #899a45;
  background: #d7f35a;
  color: #11140b;
  font-weight: 800;
}

.canvas-inline-actions button.danger {
  border-color: #78444b;
  color: #f2a2ad;
}

.canvas-node-properties {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.canvas-node-properties label {
  display: grid;
  gap: 5px;
  color: #8c96a3;
  font-size: 10px;
}

.canvas-node-properties select {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #383d45;
  border-radius: 6px;
  outline: 0;
  background: #111317;
  color: #edf0f4;
  font-size: 11px;
}

body[data-page="canvas"] .modal-backdrop {
  z-index: 1500;
}

.canvas-node-modal-backdrop {
  background: rgba(0, 0, 0, .58);
}

.canvas-node-modal {
  width: min(560px, 100%);
  max-height: min(760px, 92vh);
  overflow-y: auto;
  border-color: #303238;
  background: #1b1c1f;
  color: #f2f3f5;
}

.canvas-node-modal .modal-head h2 {
  color: #f5f6f7;
}

.canvas-node-modal .modal-head .icon-button {
  border-color: #393b40;
  background: transparent;
  color: #b7bcc4;
}

.canvas-node-group {
  margin-top: 20px;
}

.canvas-node-group > span {
  display: block;
  margin-bottom: 9px;
  color: #8e949e;
  font-size: 13px;
}

.canvas-node-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.canvas-node-type-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid #33353a;
  border-radius: 8px;
  background: #242529;
  color: #eceef1;
  text-align: left;
  cursor: pointer;
}

.canvas-node-type-grid button:hover,
.canvas-node-type-grid button:focus-visible {
  border-color: #6d7e45;
  background: #292b27;
  outline: 0;
}

.canvas-node-type-grid b {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #45484e;
  border-radius: 6px;
  color: #b7bdc5;
  font-size: 14px;
}

.canvas-node-type-grid button:hover b {
  border-color: #b9d451;
  color: #d7f35a;
}

.canvas-node-type-grid strong {
  font-size: 13px;
  font-weight: 650;
}

.canvas-custom-node-toggle {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 1px dashed #474a50;
  border-radius: 8px;
  background: transparent;
  color: #aeb4bd;
  cursor: pointer;
}

.canvas-custom-node-toggle:hover {
  border-color: #8b9b53;
  color: #d7f35a;
}

.canvas-custom-node-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #303238;
}

.canvas-custom-node-form .field {
  color: #aeb4bd;
}

.canvas-custom-node-form .field input,
.canvas-custom-node-form .field textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid #383a40;
  border-radius: 6px;
  outline: 0;
  background: #141518;
  color: #f1f2f4;
  resize: vertical;
}

.canvas-node-colors {
  display: flex;
  gap: 9px;
}

.canvas-node-colors label {
  cursor: pointer;
}

.canvas-node-colors input {
  position: absolute;
  opacity: 0;
}

.canvas-node-colors span {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--node-color);
}

.canvas-node-colors input:checked + span {
  border-color: #fff;
  box-shadow: 0 0 0 2px #1b1c1f;
}

.canvas-settings-backdrop {
  z-index: 1600 !important;
  background: rgba(0, 0, 0, .62);
}

.canvas-settings-modal {
  width: min(820px, 100%);
  max-height: min(900px, 94vh);
  overflow-y: auto;
  border: 1px solid #34383e;
  border-radius: 14px;
  background: #202322;
  color: #eef1f3;
}

.canvas-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #35383a;
}

.canvas-settings-head small,
.canvas-settings-head h2 {
  display: block;
}

.canvas-settings-head small {
  color: #8e979c;
  font-size: 11px;
}

.canvas-settings-head h2 {
  margin: 5px 0 0;
  color: #f5f6f7;
  font-size: 24px;
}

.canvas-settings-head button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #41454a;
  border-radius: 8px;
  background: transparent;
  color: #cbd0d5;
  font-size: 20px;
  cursor: pointer;
}

.canvas-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 24px;
  padding-top: 20px;
}

.canvas-settings-grid label {
  display: grid;
  gap: 7px;
  color: #8f979c;
  font-size: 12px;
}

.canvas-settings-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #41464c;
  border-radius: 8px;
  outline: 0;
  background: #171a1e;
  color: #e7eaee;
  font-size: 13px;
}

.canvas-setting-switch {
  position: relative;
  display: grid !important;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  min-height: 44px;
  padding: 0 12px !important;
  border: 1px solid #899a45;
  border-radius: 8px;
  background: #202b17;
  color: #d7f35a !important;
}

.canvas-setting-switch input {
  position: absolute;
  opacity: 0;
}

.canvas-setting-switch i {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #4a5045;
}

.canvas-setting-switch i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform .16s ease;
}

.canvas-setting-switch input:checked + i {
  background: #d7f35a;
}

.canvas-setting-switch input:checked + i::after {
  transform: translateX(18px);
}

.canvas-setting-switch b {
  margin-left: 9px;
  font-size: 12px;
}

.canvas-settings-style {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid #383c40;
  border-radius: 9px;
}

.canvas-settings-style small,
.canvas-settings-style strong {
  display: block;
}

.canvas-settings-style small {
  color: #899299;
  font-size: 11px;
}

.canvas-settings-style strong {
  margin-top: 4px;
  color: #f0f2f4;
  font-size: 14px;
}

.canvas-settings-style button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #41464c;
  border-radius: 7px;
  background: #292d31;
  color: #d8dde2;
  cursor: pointer;
}

.canvas-duration-settings {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid #383c40;
  border-radius: 9px;
}

.canvas-duration-settings legend {
  padding: 0 5px;
  color: #f0f2f4;
  font-size: 14px;
  font-weight: 700;
}

.canvas-duration-tabs {
  display: flex;
  gap: 7px;
}

.canvas-duration-tabs button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #41464c;
  border-radius: 7px;
  background: #292d31;
  color: #aeb6bf;
  cursor: pointer;
}

.canvas-duration-tabs button.is-active {
  border-color: #b9ed4e;
  color: #d7f35a;
}

.canvas-duration-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.canvas-duration-range input {
  width: 100%;
  accent-color: #b9ed4e;
}

.canvas-duration-range output {
  padding: 9px;
  border: 1px solid #41464c;
  border-radius: 7px;
  color: #eef1f3;
  text-align: center;
}

.canvas-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #35383a;
}

.canvas-settings-actions button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid #41464c;
  border-radius: 8px;
  background: #292d31;
  color: #d8dde2;
  cursor: pointer;
}

.canvas-settings-actions button:last-child {
  border-color: #b9ed4e;
  background: #b9ed4e;
  color: #10130b;
  font-weight: 800;
}

@media (max-width: 700px) {
  .canvas-settings-grid {
    grid-template-columns: 1fr;
  }

  .canvas-settings-style {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Visual style center */
.visual-style-page {
  margin: -30px -24px -64px;
  min-height: calc(100vh - 64px);
  padding: 34px;
  background: #0d1013;
  color: #edf0f3;
}

.visual-style-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.visual-style-back {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid #343940;
  border-radius: 7px;
  background: #171b1f;
  color: #b8c0c8;
  font-size: 12px;
}

.visual-style-head h1 {
  margin: 18px 0 7px;
  color: #f4f6f7;
  font-size: 34px;
}

.visual-style-head h1 em {
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #30372d;
  color: #b9ed4e;
  font-size: 11px;
  font-style: normal;
  vertical-align: middle;
}

.visual-style-head p {
  margin: 0;
  color: #8f989f;
  font-size: 13px;
}

.visual-style-head > div > span {
  display: block;
  margin-top: 11px;
  color: #76828d;
  font-size: 12px;
}

.visual-style-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  /* §393 窗口收窄时按钮自动换行，不会把「应用风格」挤出屏幕右侧 */
  flex-wrap: wrap;
  justify-content: flex-end;
}

.visual-style-head-actions button {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #353a41;
  border-radius: 8px;
  background: #1d2125;
  color: #d9dee3;
  cursor: pointer;
}

.visual-style-head-actions button.primary {
  border-color: #b9ed4e;
  background: #b9ed4e;
  color: #11140c;
  font-weight: 800;
}

.visual-style-tabs {
  display: flex;
  gap: 7px;
  margin-top: 32px;
}

.visual-style-tabs button {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #343940;
  border-radius: 7px;
  background: #1a1e22;
  color: #aab3bc;
  cursor: pointer;
}

/*
 * §498 脚本页「类型」选中态改成蓝色实心。
 * 用户原话：「脚本选择，两个类型，选中类型给我改成蓝色，不然都看不清」——
 * 原来选中只是换成荧黄绿字（#d7f35a）+ 淡绿边，深色底上跟未选中的灰字差别极小。
 * 「两个类型」指的就是这两组：上面一组范围（全部脚本/通用/我的…）、下面一组分类
 * （小说转剧本/资产提取脚本…）。两组必须同一个蓝，否则又变成三套配色。
 */
.visual-style-tabs button.is-active {
  border-color: #4c7dff;
  background: #2b57e8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(76, 125, 255, .55), 0 0 12px rgba(76, 125, 255, .22);
}
.visual-style-tabs button.is-active:hover {
  border-color: #6f97ff;
  background: #3562f0;
  color: #fff;
}

.visual-style-tabs b {
  margin-left: 4px;
}

.visual-style-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 18px;
}

.visual-style-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.visual-style-categories button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #343940;
  border-radius: 7px;
  background: #1a1e22;
  color: #aab3bc;
  cursor: pointer;
}

.visual-style-categories button.is-active {
  border-color: #4c7dff;
  background: #2b57e8;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(76, 125, 255, .55), 0 0 12px rgba(76, 125, 255, .22);
}
.visual-style-categories button.is-active:hover {
  border-color: #6f97ff;
  background: #3562f0;
  color: #fff;
}

.visual-style-search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: min(360px, 40vw);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #343940;
  border-radius: 8px;
  background: #1a1e22;
  color: #7f8993;
}

.visual-style-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #edf0f3;
}

.visual-style-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 18px;
  align-items: start;
}

.visual-style-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.visual-style-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #181c20;
  color: #edf0f3;
  text-align: left;
  cursor: pointer;
}

.visual-style-card:hover,
.visual-style-card.is-selected {
  border-color: #b9ed4e;
  box-shadow: 0 0 0 1px #b9ed4e;
}

/*
 * §187 脚本管理页（scripts.html）的「选中高光」。
 *   scripts.html **只加载 site.css**（不加载 canvas-studio.css），所以画布那边的规则
 *   到不了这里，必须在本文件里再写一份，两边保持一致。
 *   同样三个坑：用 --primary 而不是 --accent（后者在卡片上下文是空值，
 *   含 var() 的声明会在 computed-value time 失效、把属性重置成 initial）；
 *   带 !important 压 theme-dark.css 的锁；选择器提到 (0,3,1) 压 is-public-page 那条 (0,3,0)。
 *   权重再加一级（.visual-style-page）是为了压过本文件后面那条
 *   `body[data-page="scripts"] .visual-style-card { ... !important }`——它把边框/底色锁成浅色常态。
 */
body[data-page="scripts"] button.visual-style-card.is-selected,
body[data-page="scripts"] .visual-style-page button.visual-style-card.is-selected {
  border-color: var(--primary, #6877ff) !important;
  background: color-mix(in srgb, var(--primary, #6877ff) 16%, transparent) !important;
  box-shadow: 0 0 0 2px var(--primary, #6877ff), 0 0 20px color-mix(in srgb, var(--primary, #6877ff) 45%, transparent) !important;
  /* 边框/底色在浅色常态下被上面那条 !important 拽回去，outline 没人管 → 用它兜住边框强调 */
  outline: 2px solid var(--primary, #6877ff);
  outline-offset: -2px;
}
body[data-page="scripts"] button.visual-style-card.is-selected em,
body[data-page="scripts"] .visual-style-page button.visual-style-card.is-selected em {
  background: var(--primary, #6877ff) !important;
  color: #fff !important;
}

.visual-style-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.visual-style-card > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
}

.visual-style-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visual-style-card small {
  flex: 0 0 auto;
  color: #89939e;
  font-size: 10px;
}

.visual-style-card em {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #b9ed4e;
  color: #11140c;
  font-style: normal;
  font-weight: 900;
}

/*
 * §393 详情面板 = 三段结构「顶部信息 + 操作栏（固定）/ 封面 + 正文（可滚动）」。
 * 之前只有一句 sticky + overflow:hidden：面板高度跟着内容长（实测 1007px > 900px 视口），
 * 正文一多，编辑 / 复制 / 下架这些按钮就被顶到首屏之外，用户以为「没有操作按钮」。
 * 现在：面板锁在视口高度内，操作按钮钉在面板顶部固定区，正文区自己滚。
 */
.visual-style-detail {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 104px);
  overflow: hidden;
  border: 1px solid #30363d;
  border-radius: 8px;
  background: #181c20;
}

/* ── 面板顶部固定区：分类/名称/作者 + 操作按钮，永远第一眼可见 ── */
.visual-style-detail-head {
  flex: 0 0 auto;
  padding: 14px 15px 13px;
  border-bottom: 1px solid #2a3036;
}

.visual-style-detail-kicker {
  display: block;
  color: #b9ed4e;
  font-size: 10px;
  text-transform: uppercase;
}

.visual-style-detail-head h2 {
  margin: 5px 0 4px;
  color: #f3f5f6;
  font-size: 19px;
  line-height: 1.3;
}

.visual-style-detail-meta {
  margin: 0;
  color: #9da6af;
  font-size: 12px;
  line-height: 1.6;
}

/* 操作按钮：横排两列，主操作（应用这个风格）独占一行 */
.visual-style-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

.visual-style-detail-actions .button {
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.visual-style-detail-actions .button-primary,
.visual-style-detail-actions .button:only-child {
  grid-column: 1 / -1;
}

/* ── 面板可滚动区：封面 + 描述 / 提示词 ── */
.visual-style-detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.visual-style-detail-scroll > img,
.visual-style-detail-scroll > video.visual-style-detail-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/*
 * §204 详情封面（图片）的外层：放大按钮要盖在图上，所以必须有一个定位上下文。
 * 它替代了原来「直接点 <img> 就弹窗」的写法 —— 图片现在纯粹是展示，放大走按钮。
 */
.visual-style-detail-media {
  position: relative;
}

.visual-style-detail-media > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.visual-style-detail-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 20, 28, .62);
  box-shadow: 0 6px 18px rgba(12, 16, 24, .28);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.visual-style-detail-zoom svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/*
 * §393 放大按钮压过「风格/脚本页所有按钮一律白底」那条规则（特异性 (0,4,2)）。
 * 不压的话浅色下按钮底被刷成 #fff，而图标描边也是 #fff —— 整颗按钮等于消失，
 * 只剩一块白圆。这里 html + body + :not(.primary) 凑到 (0,4,3) 才能赢，
 * 光加 .visual-style-detail-zoom 只有 (0,3,3)，还是输。
 */
html body[data-page="styles"] .visual-style-page button:not(.primary).visual-style-detail-zoom,
html body[data-page="scripts"] .visual-style-page button:not(.primary).visual-style-detail-zoom {
  border: 0 !important;
  background: rgba(16, 20, 28, .62) !important;
  color: #fff !important;
}

.visual-style-detail-copy {
  padding: 15px;
}

.visual-style-detail-copy > span {
  color: #b9ed4e;
  font-size: 10px;
  text-transform: uppercase;
}

.visual-style-detail-copy h2 {
  margin: 5px 0 7px;
  color: #f3f5f6;
  font-size: 20px;
}

.visual-style-detail-copy p,
.visual-style-detail-copy > div {
  color: #9da6af;
  font-size: 12px;
  line-height: 1.7;
}

.visual-style-detail-copy h3 {
  margin: 15px 0 5px;
  color: #e8ecef;
  font-size: 12px;
}

/* 正文里零散出现的按钮（脚本详情的说明段落等）；成组的按钮统一走 .visual-style-detail-actions */
.visual-style-detail-copy .button {
  width: 100%;
  margin-top: 12px;
}

.visual-style-detail-empty {
  padding: 40px 24px;
  color: #7f8993;
  text-align: center;
}

.visual-style-modal-backdrop {
  z-index: 1700;
}

.visual-style-modal {
  width: min(680px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  border-color: #353a41;
  background: #202322;
  color: #edf0f3;
}

@media (max-width: 1100px) {
  .visual-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 850px) {
  .visual-style-page {
    margin: -25px -16px -48px;
    padding: 24px 16px;
  }

  .visual-style-head,
  .visual-style-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .visual-style-head-actions {
    flex-wrap: wrap;
  }

  .visual-style-search {
    width: 100%;
  }

  .visual-style-layout {
    grid-template-columns: 1fr;
  }

  .visual-style-detail {
    position: static;
    /* §393 窄屏下详情面板跟在卡片后面自然铺开，不再锁高，免得变成一个小滚动框 */
    max-height: none;
  }
}

/* Style center follows the main public-site white theme. */
body.is-public-page .visual-style-page {
  margin: -30px -24px -64px;
  min-height: calc(100vh - 64px);
  padding: 34px;
  background: var(--bg);
  color: var(--ink);
}

body.is-public-page .visual-style-back,
body.is-public-page .visual-style-head-actions button,
body.is-public-page .visual-style-tabs button,
body.is-public-page .visual-style-categories button,
body.is-public-page .visual-style-search {
  border-color: #e2e7ef;
  background: #fff;
  color: #5e6879;
}

body.is-public-page .visual-style-back:hover,
body.is-public-page .visual-style-head-actions button:hover,
body.is-public-page .visual-style-tabs button:hover,
body.is-public-page .visual-style-categories button:hover {
  border-color: #b9c2f1;
  color: var(--primary-dark);
}

body.is-public-page .visual-style-head h1 {
  color: #1f2937;
}

body.is-public-page .visual-style-head h1 em {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

body.is-public-page .visual-style-head p {
  color: var(--muted);
}

body.is-public-page .visual-style-head > div > span {
  color: #7a879b;
}

body.is-public-page .visual-style-head-actions button.primary,
body.is-public-page .visual-style-detail-copy .button.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

body.is-public-page .visual-style-tabs button.is-active,
body.is-public-page .visual-style-categories button.is-active {
  border-color: #a7aff0;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

body.is-public-page .visual-style-search {
  color: #9aa3b1;
}

body.is-public-page .visual-style-search input {
  color: #344054;
}

body.is-public-page .visual-style-card,
body.is-public-page .visual-style-detail {
  border-color: #e3e7ee;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 4px 14px rgba(43, 58, 98, .04);
}

body.is-public-page .visual-style-card:hover,
body.is-public-page .visual-style-card.is-selected {
  border-color: #4166d8;
  box-shadow: 0 0 0 1px #4166d8, 0 8px 22px rgba(65, 102, 216, .14);
}

body.is-public-page .visual-style-card > span {
  background: #fff;
}

body.is-public-page .visual-style-card strong,
body.is-public-page .visual-style-detail-copy h2,
body.is-public-page .visual-style-detail-head h2,
body.is-public-page .visual-style-detail-copy h3 {
  color: #253047;
}

body.is-public-page .visual-style-card small,
body.is-public-page .visual-style-detail-meta,
body.is-public-page .visual-style-detail-copy p,
body.is-public-page .visual-style-detail-copy > div,
body.is-public-page .visual-style-detail-empty {
  color: #7a879b;
}

body.is-public-page .visual-style-card em {
  background: #4166d8;
  color: #fff;
}

body.is-public-page .visual-style-detail-kicker,
body.is-public-page .visual-style-detail-copy > span {
  color: var(--primary-dark);
}

body.is-public-page .visual-style-modal-backdrop {
  background: rgba(28, 35, 52, .42);
}

body.is-public-page .visual-style-modal {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

/* Hard theme lock for the style center: outside canvas is always light. */
body[data-page="styles"] .visual-style-page,
body[data-page="scripts"] .visual-style-page {
  background: #f6f8fc !important;
  color: #172033 !important;
}

body[data-page="styles"] .visual-style-page article,
body[data-page="scripts"] .visual-style-page article,
body[data-page="styles"] .visual-style-page aside,
body[data-page="scripts"] .visual-style-page aside,
body[data-page="styles"] .visual-style-card,
body[data-page="scripts"] .visual-style-card,
body[data-page="styles"] .visual-style-detail,
body[data-page="scripts"] .visual-style-detail {
  border-color: #e3e7ee !important;
  background: #fff !important;
  color: #253047 !important;
  box-shadow: 0 4px 14px rgba(43, 58, 98, .05) !important;
}

/* §393 面板顶部固定区的分隔线在浅色下要淡一点 */
body[data-page="styles"] .visual-style-detail-head,
body[data-page="scripts"] .visual-style-detail-head,
body.is-public-page .visual-style-detail-head {
  border-bottom-color: #e3e7ee !important;
}

body[data-page="styles"] .visual-style-page button:not(.primary):not(.button-primary),
body[data-page="scripts"] .visual-style-page button:not(.primary):not(.button-primary),
body[data-page="styles"] .visual-style-search,
body[data-page="scripts"] .visual-style-search {
  border-color: #e2e7ef !important;
  background: #fff !important;
  color: #5e6879 !important;
}

body[data-page="styles"] .visual-style-head h1,
body[data-page="scripts"] .visual-style-head h1,
body[data-page="styles"] .visual-style-card strong,
body[data-page="scripts"] .visual-style-card strong,
body[data-page="styles"] .visual-style-detail-copy h2,
body[data-page="scripts"] .visual-style-detail-copy h2,
body[data-page="styles"] .visual-style-detail-head h2,
body[data-page="scripts"] .visual-style-detail-head h2,
body[data-page="styles"] .visual-style-detail-copy h3,
body[data-page="scripts"] .visual-style-detail-copy h3 {
  color: #253047 !important;
}

body[data-page="styles"] .visual-style-head p,
body[data-page="scripts"] .visual-style-head p,
body[data-page="styles"] .visual-style-head > div > span,
body[data-page="scripts"] .visual-style-head > div > span,
body[data-page="styles"] .visual-style-card small,
body[data-page="scripts"] .visual-style-card small,
body[data-page="styles"] .visual-style-detail-meta,
body[data-page="scripts"] .visual-style-detail-meta,
body[data-page="styles"] .visual-style-detail-copy p,
body[data-page="scripts"] .visual-style-detail-copy p,
body[data-page="styles"] .visual-style-detail-copy > div,
body[data-page="scripts"] .visual-style-detail-copy > div {
  color: #7a879b !important;
}

/* 顶部固定区的小标签（分类 · 归属 · 审核态）：浅色页里用主色，别留在亮绿的暗色值上 */
body[data-page="styles"] .visual-style-detail-kicker,
body[data-page="scripts"] .visual-style-detail-kicker,
body[data-page="styles"] .visual-style-detail-copy > span,
body[data-page="scripts"] .visual-style-detail-copy > span {
  color: #4166d8 !important;
}

body[data-page="styles"] .visual-style-tabs button.is-active,
body[data-page="scripts"] .visual-style-tabs button.is-active,
body[data-page="styles"] .visual-style-categories button.is-active,
body[data-page="scripts"] .visual-style-categories button.is-active {
  border-color: #4166d8 !important;
  background: #4166d8 !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(65, 102, 216, .2);
}

/*
 * 风格页「分类按钮组」选中态：直接纯蓝实心（用户反馈：渐变高光都看不清）。
 *
 * 上面那条规则同时管页签和分类按钮，所以不改它，只在其后追加一条更窄的选择器：
 * 页签保持原样、脚本页也不受影响。
 * 只换配色不改布局（padding / 尺寸 / 圆角都不动），避免把排序按钮挤到下一行。
 *
 * 注意：深色主题下这条会被 theme-dark.css 第 21 节的「通用按钮压深」规则盖掉，
 * 真正生效的是 theme-dark.css 第 30 节的同款纯蓝规则（特异性更高）。
 */
body[data-page="styles"] .visual-style-categories button.is-active {
  border-color: #2f6bff !important;
  background: #2f6bff !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .32) !important;
}

body[data-page="styles"] .visual-style-head-actions button.primary,
body[data-page="scripts"] .visual-style-head-actions button.primary {
  border-color: #5b58d6 !important;
  background: #5b58d6 !important;
  color: #fff !important;
}

body[data-page="styles"] .visual-style-modal,
body[data-page="scripts"] .visual-style-modal {
  width: min(690px, 100%);
  padding: 24px;
  border: 1px solid #e2e7ef !important;
  border-radius: 13px;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: 0 24px 70px rgba(31, 43, 68, .18);
}

body[data-page="styles"] .visual-style-modal .modal-head h2,
body[data-page="scripts"] .visual-style-modal .modal-head h2 {
  color: #1f2937 !important;
  font-size: 25px;
}

body[data-page="styles"] .visual-style-modal .modal-head .eyebrow,
body[data-page="scripts"] .visual-style-modal .modal-head .eyebrow {
  color: #7f8cff;
  font-size: 13px;
}

body[data-page="styles"] .visual-style-modal .modal-head .icon-button,
body[data-page="scripts"] .visual-style-modal .modal-head .icon-button {
  width: 52px;
  height: 52px;
  border: 1px solid #e2e7ef;
  border-radius: 9px;
  background: #fff;
  color: #536174;
  font-size: 22px;
}

.style-custom-fields {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.style-custom-fields > input,
.style-custom-fields > select,
.style-custom-fields > textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #253047;
  font-size: 14px;
  resize: vertical;
}

.style-custom-fields > textarea {
  line-height: 1.6;
}

.style-custom-fields > input:focus,
.style-custom-fields > select:focus,
.style-custom-fields > textarea:focus {
  border-color: #8c88e8;
  box-shadow: 0 0 0 3px rgba(91, 88, 214, .08);
}

/*
 * §192 「默认多项结果」勾选行（上传 / 编辑脚本弹窗共用）。
 * 不能套 .style-file-field —— 那条规则会把 input 整个藏掉（1px + opacity:0），
 * 勾选框藏了就等于这个字段不存在。
 */
.scripts-default-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #536174;
  font-size: 13px;
  cursor: pointer;
}
.scripts-default-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #5b58d6;
}
.scripts-default-check span { font-weight: 700; color: #344054; }
.scripts-default-check em {
  flex-basis: 100%;
  margin-left: 24px;
  color: #7a879c;
  font-style: normal;
  font-size: 12px;
  line-height: 1.6;
}

.style-file-field {
  display: grid;
  grid-template-columns: 104px auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #536174;
  font-size: 13px;
}

.style-file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.style-file-field em {
  padding: 9px 18px;
  border-radius: 7px;
  border: 1px solid #dfe4ec;
  background: #f7f8fa;
  color: #344054;
  font-style: normal;
  font-weight: 700;
  cursor: pointer;
}

.style-file-field small {
  min-width: 0;
  overflow: hidden;
  color: #667085;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* §155 附加提示词：与脚本正文同构，但独立成块，后面跟「填入推荐 / 清空」两个小按钮 */
.style-file-field textarea {
  grid-column: 2 / -1;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #253047;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.style-file-field textarea:focus {
  border-color: #8c88e8;
  box-shadow: 0 0 0 3px rgba(91, 88, 214, .08);
}

.style-extra-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.style-extra-actions button {
  padding: 8px 14px;
  border: 1px solid #dfe4ec;
  border-radius: 7px;
  background: #f7f8fa;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.style-extra-actions button:hover {
  border-color: #8c88e8;
  color: #5b58d6;
}

.style-public-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  background: #f9fafc;
  cursor: pointer;
}

.style-public-switch input {
  width: 17px;
  height: 17px;
  accent-color: #5b58d6;
}

.style-public-switch strong,
.style-public-switch small {
  display: block;
}

.style-public-switch strong {
  color: #344054;
  font-size: 13px;
}

.style-public-switch small {
  margin-top: 2px;
  color: #7a879b;
  font-size: 11px;
}

.style-file-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border: 1px dashed #d7dde7;
  border-radius: 8px;
  background: #f7f8fa;
  color: #8a96a8;
  font-size: 13px;
}

.style-file-preview img,
/* 演示视频的预览框与图片预览同一口径：不给它定尺寸的话 <video> 会按默认 300×150 挤在中间 */
.style-file-preview video {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #f1f3f7;
}

.style-file-preview.is-empty img,
.style-file-preview.is-empty video,
.style-file-preview:not(.is-empty) > span,
.style-file-preview.is-empty > button {
  display: none;
}

.style-file-preview button {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 9px;
  border: 1px solid #d7dde7;
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
  color: #667085;
  cursor: pointer;
}

.style-upload-hint {
  margin: 0;
  color: #7a879b;
  font-size: 13px;
}

/*
 * §352 风格弹窗里的「默认脚本」三个下拉。
 * 不复用 .style-file-field：那条规则会把 input 绝对定位藏掉（1px + opacity:0），
 * 而这里要的是**看得见、能选**的原生 select。
 */
.style-script-binds {
  display: grid;
  gap: 10px;
  padding: 12px;
  /*
   * 写浅色而不是 var(--surface-soft)：本文件 2016 行那套 "Reference-style dark"
   * 的 :root 把 --surface-soft 换成了 #202631，而 html[data-theme="light"] 只复位
   * 文字色，没复位面板色 —— 白弹窗里会凹进一块黑框。深色主题由 theme-dark.css 覆盖。
   */
  border: 1px solid #e2e7ef;
  border-radius: 10px;
  background: #f7f9fc;
}
.style-script-binds .style-upload-hint { line-height: 1.6; }
.style-script-bind {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #536174;
  font-size: 13px;
}
.style-script-bind select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: #253047;
  font-size: 13px;
}
.style-script-bind select:focus {
  border-color: #8c88e8;
  box-shadow: 0 0 0 3px rgba(91, 88, 214, .08);
}

.style-save-button {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
  border: 1px solid #5b58d6;
  border-radius: 8px;
  background: #5b58d6;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.style-save-button:hover {
  border-color: #4542b7;
  background: #4542b7;
  color: #fff;
}

/* ─────────────────── §351 弹窗底部固定保存按钮 ───────────────────
 * 用户要求：「新增和编辑的保存脚本按钮固定在弹窗底部」「风格中心的自定义风格也固定」。
 *
 * 做法不是 sticky —— 弹窗本身是滚动容器（.visual-style-modal overflow-y:auto），
 * sticky 会跟着 padding 走、滚动时上下留缝。这里把 form 变成 flex 列：
 *   modal-head 固定、.style-custom-fields 自己滚、footer 常驻底部。
 * 这样按钮永远在同一位置，字段再多也只是中间那块滚动。
 */
body[data-page="scripts"] .visual-style-modal,
body[data-page="styles"] .visual-style-modal {
  overflow: hidden;
}

body[data-page="scripts"] .visual-style-modal form,
body[data-page="styles"] .visual-style-modal form {
  display: flex;
  flex-direction: column;
  max-height: calc(92vh - 48px);
  min-height: 0;
}

body[data-page="scripts"] .visual-style-modal form > .modal-head,
body[data-page="styles"] .visual-style-modal form > .modal-head {
  flex: 0 0 auto;
}

body[data-page="scripts"] .visual-style-modal .style-custom-fields,
body[data-page="styles"] .visual-style-modal .style-custom-fields {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}

/* §351 提示词正文：多行输入框，标签与框顶对齐（三列 grid 默认居中，框一高标签就飘到中间） */
.scripts-prompt-field {
  align-items: start;
}

.scripts-prompt-field > span {
  padding-top: 12px;
}

.style-modal-footer {
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 14px;
  /* 跟随弹窗自身背景（深色主题 #202322 / 浅色 #fff 都对）；写死 #fff 会在深色下漏一条白边 */
  background: inherit;
  border-top: 1px solid rgba(128, 128, 128, .3);
}

.style-modal-footer .style-save-button {
  margin-top: 0;
}

@media (max-width: 600px) {
  .style-file-field {
    grid-template-columns: 1fr;
  }

  .style-file-field input {
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: auto;
  }

  .style-file-field em {
    display: none;
  }
}

.canvas-workspace-page .infinite-canvas,
.canvas-workspace-page .infinite-canvas::-webkit-scrollbar {
  scrollbar-width: none;
}

.canvas-workspace-page .infinite-canvas::-webkit-scrollbar {
  display: none;
}

@media (max-width: 980px) {
  .canvas-workarea {
    grid-template-columns: 190px minmax(0, 1fr) 230px;
  }

  .canvas-workarea.is-assets-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) 230px;
  }

  .canvas-topbar-actions button {
    padding-inline: 8px;
  }
}

@media (max-width: 760px) {
  .canvas-workspace-page {
    grid-template-rows: 54px minmax(0, 1fr) 60px;
  }

  .canvas-workarea {
    grid-template-columns: minmax(0, 1fr);
  }

  .canvas-workarea.is-assets-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .canvas-assets-panel,
  .canvas-assistant-panel {
    display: none;
  }

  .canvas-topbar-actions .canvas-node-total,
  .canvas-topbar-actions button:first-child {
    display: none;
  }

  .canvas-topbar-left > strong {
    max-width: 34vw;
  }

  .canvas-bottom-toolbar {
    grid-template-columns: 1fr auto;
    padding: 0 8px;
  }

  .canvas-toolbar-side:first-child {
    display: none;
  }

  .canvas-toolbar-tools {
    grid-column: 1 / -1;
    justify-content: center;
    overflow-x: auto;
  }

  .canvas-toolbar-side:last-child {
    display: none;
  }
}

/* ───────────────────────── 脚本管理页（scripts.html）亮色收尾 ───────────────────────── */
/*
 * 脚本页与风格页共用 .visual-style-* 版式，但版式本体是按深色写的（.visual-style-page 背景 #0d1013）：
 * 风格页靠「Hard theme lock」那组规则压成亮色，脚本页当初没被覆盖到，
 * 于是出现「深色页面 + 白卡片 + 深色卡片缩略块」的混搭（用户反馈：颜色不对，没使用主题白色）。
 * 现在两页共用同一把锁，这里只补脚本页特有的一处。
 *
 * 注：原来的 .script-card-thumb（固定 88px 的 emoji 缩略块）已删除 ——
 * 脚本卡片现在与风格卡片同构，缩略区改成 4:3 的 .card-cover 大图（见文件末尾那一节）。
 */
body[data-page="scripts"] .visual-style-modal .modal-head h2 em {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-style: normal;
}

body[data-page="scripts"] .visual-style-detail-copy .button + .button {
  margin-top: 8px;
}

/* ==========================================================================
 * 顶部导航一致性：控制台（is-console-page）对齐公共页（is-public-page）
 * --------------------------------------------------------------------------
 * 背景：公共页在 2589 行做过一次 "Public shell alignment"（padding 16px、
 *   justify-content:flex-start、品牌标记 29×29、导航 14px/700、gap 2px），
 *   但那段注释明确写了 "The only sidebar belongs to the console"，
 *   控制台因此被排除在外，一直停留在旧参数（padding 20px、品牌标记 34×34、
 *   导航 13px/650、gap 6px），实测桌面端两者头部差 8 项。
 *   最明显的是 ☰ 按钮：base `.mobile-menu{display:none}`（57 行）会被后面
 *   106 行的 `.icon-button{display:inline-grid}`（同优先级、靠后者胜）覆盖，
 *   公共页靠 2332 行补了隐藏规则才没露出来，控制台没补 —— 所以桌面端也显示 ☰。
 *
 * 本段只对齐「顶部导航条」的布局与尺寸；控制台的左侧边栏（side-rail）原样不动。
 * 颜色由主题层负责（浅色在本文件，深色在 theme-dark.css），本段只管结构。
 * ========================================================================== */
body.is-console-page .site-header {
  justify-content: flex-start;
  min-height: 64px;
  padding: 0 16px;
  border-color: #edf0f5;
  box-shadow: none;
}

/* 桌面端隐藏 ☰（与公共页一致）；≤800px 仍按原设计显示，用于唤出侧边栏。
   必须用 min-width 包起来：2570 行那条 @media(max-width:800px) 与本条同特异性，
   否则后加载的这条会把窄屏的「显示」规则一起压掉。 */
@media (min-width: 801px) {
  body.is-console-page .site-header .mobile-menu { display: none; }
}

body.is-console-page .brand { flex: 0 0 auto; min-width: 78px; }
body.is-console-page .brand-mark { width: 29px; height: 29px; padding: 4px; border-radius: 7px; }
body.is-console-page .brand-mark span { width: 5px; }
body.is-console-page .brand > span:last-child strong { display: block; color: #1f2937; font-size: 16px; }
body.is-console-page .brand > span:last-child small { display: none; }

body.is-console-page .top-nav { display: flex; flex: 0 1 auto; align-items: center; gap: 2px; margin: 0 auto 0 16px; }
body.is-console-page .top-nav a { padding: 8px 14px; border-radius: 6px; color: #273247; font-size: 14px; font-weight: 700; white-space: nowrap; }
body.is-console-page .header-actions { flex: 0 0 auto; margin-left: auto; }

/* ==========================================================================
 * 浅色主题 token 复位（修复「深色 token 泄漏到白主题」）
 * --------------------------------------------------------------------------
 * 现象：白主题里有一批文字「和背景一个色看不清」—— 例如状态徽标「成功」
 *   只有 1.93:1、模型卡上的「1K」只有 1.41:1、钱包页的 "Available balance"
 *   只有 1.39:1（实测，非估算）。
 * 根因：本文件 2016 行有一套 "Reference-style dark product surface" 的 :root，
 *   它把 --muted/--subtle/--primary/--primary-dark/--cyan/--orange/--success/
 *   --danger 全换成了**深色底专用的亮色**（--success:#38c996、--orange:#f4ad3d、
 *   --primary:#6877ff …）。它写在顶层、位置又靠后，于是白主题也一直在用这套亮色
 *   —— 亮字压浅底，越看越淡。
 *
 * 做法：用 html[data-theme="light"]（theme-boot.js 给非画布页打上的标记，比裸
 *   :root 高一级）把这几个 token 拉回**浅色语义**；--muted / --primary /
 *   --primary-dark 用的就是本文件开头 :root 里的原始浅色取值（不是新配色），
 *   只有确实达不到 AA 的 --subtle 与四个状态色做了加深。
 *
 * 边界：无限画布页面（projects / workspace / canvas）不加载 theme-boot.js、
 *   没有 data-theme，因此**完全不受本段影响** —— 与「无限画布别动」一致。
 * ========================================================================== */
html[data-theme="light"] {
  --muted: #636d81;          /* 白底 5.20:1；#edf0f5 上 4.56:1（原 #667085 在 #f1f3f7 上只有 4.48:1） */
  --subtle: #646f7e;         /* 白底 5.15:1；#f1f3f7 上 4.59:1（原 #6a7686 在 #f7f8fb 上 4.35:1） */
  --primary: #5b58d6;        /* 原始浅色取值，白底 5.51:1（此前被顶成 #6877ff 3.7:1） */
  --primary-dark: #4542b7;   /* 原始浅色取值，白底 7.74:1 */
  --primary-soft: #eeedff;
  --cyan: #0f6b78;           /* 原始 #2bb7c9 白底 2.4:1，压在 --cyan-soft 上更差 */
  --cyan-soft: #e4f8fb;
  --orange: #a85a1c;         /* 原始 #f28b58 白底 2.6:1（曾被顶成 #f4ad3d 1.77:1） */
  --orange-soft: #fff0e8;
  --success: #1a7a4f;        /* 原始 #27a56c 在 --success-soft 上 3.0:1 */
  --success-soft: #e8f8f0;
  --danger: #ab2436;         /* 原始 #d65461 在 --danger-soft 上 3.4:1 */
  --danger-soft: #fff0f1;
  color-scheme: light;
}

/* 使用日志的高峰标记：基准是深色取值（#3a2a1c/#ffb27d），浅色主题改成浅橙底深橙字 */
html[data-theme="light"] .log-peak { background: var(--orange-soft); color: var(--orange); }

/* --------------------------------------------------------------------------
 * 浅色主题：把「压在浅底上几乎看不见」的硬编码取色提到可读
 * --------------------------------------------------------------------------
 * 实测这些规则把次要文字写成了固定浅灰/亮色：#7a879b(3.53:1)、#7b8799(3.64:1)、
 * #8490a3(3.23:1)、#98a2b3(2.58:1)、#8290ff(2.84:1)、#aaaab4(2.30:1)、
 * #f3c969(1.41:1)、#e18a41(2.42:1)、#9fe7e8(1.39:1)…… 在深色底上没问题，
 * 但在白底上就是「和背景一个色看不清」。
 *
 * 这里**不改原规则**（它们仍服务于深色主题与深色卡片），只在
 * html[data-theme="light"] 作用域内重定向到本主题的 token：
 *   弱文字 → var(--muted) / var(--subtle)，品牌紫 → var(--primary)。
 * 注意刻意排除的两类：.metric.dark / .project-stat-icon.gold 等**深色卡片内部**
 * 的取色，以及品牌 logo 的色条 —— 它们本来就该亮。
 * -------------------------------------------------------------------------- */
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .link-button,
html[data-theme="light"] .model-action,
html[data-theme="light"] .results-head b,
html[data-theme="light"] .compact-toggle span {
  color: var(--primary);
}

/* 保留原有的强调色语义：hero 的高亮词与状态点仍是青色，模型卡上的「图片」标志仍是橙色 */
html[data-theme="light"] .hero-kicker,
html[data-theme="light"] .hero h1 em,
html[data-theme="light"] .demo-status,
html[data-theme="light"] .wallet-card.balance .eyebrow {
  color: var(--cyan);
}

html[data-theme="light"] .model-logo.image {
  color: var(--orange);
}

html[data-theme="light"] .metric-label,
html[data-theme="light"] .metric-note,
html[data-theme="light"] .wallet-card small,
html[data-theme="light"] .wallet-card.balance small,
html[data-theme="light"] .model-summary,
html[data-theme="light"] .model-id,
html[data-theme="light"] .pricing-mode,
html[data-theme="light"] .model-identity small,
html[data-theme="light"] .model-price-row i,
html[data-theme="light"] .generation-estimate small,
html[data-theme="light"] .image-record-resolution,
html[data-theme="light"] .image-result-resolution,
html[data-theme="light"] .history-select-all,
html[data-theme="light"] .admin-data-card > p,
html[data-theme="light"] .admin-status-filter,
html[data-theme="light"] .demo-input,
html[data-theme="light"] .demo-side,
html[data-theme="light"] .demo-prompt small,
html[data-theme="light"] .demo-message small,
html[data-theme="light"] .project-stats small,
html[data-theme="light"] .project-card-copy p,
html[data-theme="light"] .project-card-foot span,
html[data-theme="light"] .visual-style-head > div > span,
html[data-theme="light"] .visual-style-card small,
html[data-theme="light"] .visual-style-detail-copy p,
html[data-theme="light"] .visual-style-detail-copy > div,
html[data-theme="light"] .visual-style-detail-empty,
html[data-theme="light"] .style-public-switch small,
html[data-theme="light"] .docs-nav-group a.is-third,
html[data-theme="light"] .docs-outline a.level-3 {
  color: var(--muted);
}

/* 控制台（is-console-page）里的同款浅灰 */
html[data-theme="light"] body.is-console-page .brand small,
html[data-theme="light"] body.is-console-page .account-text small,
html[data-theme="light"] body.is-console-page .balance-pill span,
html[data-theme="light"] body.is-console-page .kpi span,
html[data-theme="light"] body.is-console-page .kpi small,
html[data-theme="light"] body.is-console-page .admin-card-head code,
html[data-theme="light"] body.is-console-page .admin-card-stats small,
html[data-theme="light"] body.is-console-page .provider-address small,
html[data-theme="light"] body.is-console-page .provider-paths small,
html[data-theme="light"] body.is-console-page .is-console .rail-title,
html[data-theme="light"] body.is-console-page .is-console .health {
  color: var(--muted);
}

/* 风格中心 / 脚本中心的 .visual-style-* 版式在 site.css 里是带 !important 的亮色收尾，
   要压过它必须同样用 !important（作用域已限定在浅色主题内，不会影响深色）。 */
html[data-theme="light"] body[data-page="styles"] .visual-style-head p,
html[data-theme="light"] body[data-page="scripts"] .visual-style-head p,
html[data-theme="light"] body[data-page="styles"] .visual-style-head > div > span,
html[data-theme="light"] body[data-page="scripts"] .visual-style-head > div > span,
html[data-theme="light"] body[data-page="styles"] .visual-style-card small,
html[data-theme="light"] body[data-page="scripts"] .visual-style-card small,
html[data-theme="light"] body[data-page="styles"] .visual-style-detail-copy p,
html[data-theme="light"] body[data-page="scripts"] .visual-style-detail-copy p,
html[data-theme="light"] body[data-page="styles"] .visual-style-detail-copy > div,
html[data-theme="light"] body[data-page="scripts"] .visual-style-detail-copy > div {
  color: var(--muted) !important;
}

/* ==========================================================================
 * 浅色主题对比度收敛 · 第二轮（实测驱动）
 * --------------------------------------------------------------------------
 * 探针：scripts/probe-light-why.js —— 它会把每条低对比文字的 color 回溯到
 * 「真正胜出的那条规则」，再按「胜出规则 + 前景 + 背景」聚合。第一轮收敛后
 * 剩 248 处 / 46 条胜出规则，本段逐条处理。
 *
 * 两个必须讲清楚的机制（否则规则写了也不生效）：
 *
 * ① CSS 变量是**按继承**解析的，不是按样式表顺序。
 *    site.css 3125 行 `body.is-console-page` 在 **body 上**重定义了
 *    --muted:#667085 / --subtle:#8a94a6；而浅色 reset 只写在 `html` 上。
 *    body 离内容更近，所以控制台页拿到的一直是旧值 —— 必须在 body 作用域
 *    再覆盖一层（见下面 0 节）。
 *
 * ② 「白字压亮色按钮」问题不在文字，在**按钮底色**。
 *    .button-primary 的底色是 site.css 2081 行的固定值 #6675ff，白字只有
 *    3.78:1；把底色换成浅色主题的主色 var(--primary) 即可（白字 5.51:1）。
 *
 * 作用域：全部限定在 html[data-theme="light"] 内 ——
 *   深色主题不加载本段，无限画布页（projects / workspace / canvas）没有
 *   data-theme，同样完全不受影响。
 * ========================================================================== */

/* --- 0. 控制台作用域：把被 body 重定义的灰阶拉回本主题取值 ---------------- */
html[data-theme="light"] body.is-console-page {
  --muted: #636d81;
  --subtle: #646f7e;
  --primary-dark: #4542b7;
  --line: #e6eaf1;
}

/* --- 1. 次级灰字：全部重定向到本主题的 --muted（白底 ≥5.1:1，浅灰卡 ≥4.5:1） */
/* 侧栏链接是「继承」型：.rail-icon 用的是 `color: currentColor`，它的颜色来自
   site.css 3226 行 `body.is-console-page .is-console .rail-link { color:#667085 }`，
   落在 #f1f3f7 的图标底上只有 4.48:1。排除激活态（#4d61cf 保留）与 hover。 */
html[data-theme="light"] .is-console .rail-link:not(.is-active),
html[data-theme="light"] .is-console .rail-link:not(.is-active) .rail-icon,
html[data-theme="light"] .token-search,
html[data-theme="light"] .token-api-lines code,
html[data-theme="light"] .token-group-button small,
html[data-theme="light"] .token-table-footer,
html[data-theme="light"] .docs-search,
html[data-theme="light"] .docs-sidebar > p,
html[data-theme="light"] .docs-outline > p,
html[data-theme="light"] .docs-section-group > header p,
html[data-theme="light"] .chart-y,
html[data-theme="light"] .chart-x,
html[data-theme="light"] .asset-note,
html[data-theme="light"] .video-reference-head > span,
html[data-theme="light"] .prompt-assist,
html[data-theme="light"] .reference-mentions,
html[data-theme="light"] .generation-estimate,
html[data-theme="light"] .history-selection,
html[data-theme="light"] .creator-shell .composer-hints,
html[data-theme="light"] .workshop-page .workshop-hero > p,
html[data-theme="light"] .workshop-tabs button:not(.is-active),
html[data-theme="light"] .more-settings,
html[data-theme="light"] .clear-workshop,
html[data-theme="light"] .studio-control,
html[data-theme="light"] .market-selector span,
html[data-theme="light"] .model-id,
html[data-theme="light"] .model-badge,
html[data-theme="light"] .model-tag,
html[data-theme="light"] .rail-collapse,
html[data-theme="light"] .group-chip:not(.is-active),
html[data-theme="light"] .model-price-row strong small,
html[data-theme="light"] .project-card-foot span,
html[data-theme="light"] .visual-style-search,
html[data-theme="light"] .admin-card-tags span,
html[data-theme="light"] .admin-segments b {
  color: var(--muted) !important;
}
/* 注意：不包含 .tag —— site.css 2169 行给 .tag 配的是**深色底**
   (#253047) 的浅字，属于「深色芯片」设计，把它的文字改成深灰会变成
   深字压深底（实测 1.06:1）。同理 .model-tag 在公共页上是浅底，
   在别处是深底，所以这里用 :not() 排除激活态芯片，避免压掉白字。 */
html[data-theme="light"] .tag {
  color: #bdc8dc !important;      /* 深色芯片内保持浅字（#253047 上 7.2:1） */
}
/* 侧栏链接的 hover 反馈要补回来：上面那条带 !important，会盖住 site.css 的
   `:hover { color:#27364e }`（后者没有 !important）。 */
html[data-theme="light"] .is-console .rail-link:not(.is-active):hover {
  color: var(--ink) !important;
}

/* --- 2. 品牌紫文字（原为一批固定紫，白底仅 2.8~4.4:1） ------------------ */
html[data-theme="light"] .workshop-page .workshop-hero h1 span,
html[data-theme="light"] .section-label,
html[data-theme="light"] .model-logo:not(.image),
html[data-theme="light"] .account-avatar,
html[data-theme="light"] .admin-card-icon,
html[data-theme="light"] .market-breadcrumb a {
  color: var(--primary) !important;
}

/* --- 3. 琥珀 / 橙（余额与费用估算，原 #d39827 白底 2.53:1） -------------- */
html[data-theme="light"] .generation-estimate strong,
html[data-theme="light"] .balance-pill strong {
  color: var(--orange) !important;
}
/* 余额里的 <b> 是同一个语义，跟着走 */
html[data-theme="light"] .balance-pill strong b {
  color: inherit !important;
}

/* --- 4. 状态色：浅底上的「已启用」原本只有 4.2~4.4:1 -------------------- */
html[data-theme="light"] .token-status.is-enabled,
html[data-theme="light"] .admin-state.is-online {
  color: var(--success) !important;
}

/* --- 5. 危险色：撤销 / 删除类按钮 ---------------------------------------- */
html[data-theme="light"] .token-danger-button,
html[data-theme="light"] .token-row-actions button.is-danger,
html[data-theme="light"] .button-danger {
  color: var(--danger) !important;
}
html[data-theme="light"] .token-danger-button:hover,
html[data-theme="light"] .token-row-actions button.is-danger:hover,
html[data-theme="light"] .button-danger:hover {
  color: #8d1a2a !important;      /* 白底 8.1:1，hover 反而更清楚 */
}

/* --- 6. 白字压亮色底：问题在底色，不在文字 ------------------------------ */
/* 主按钮：底色 #6675ff → 浅色主题主色（白字 3.78:1 → 5.51:1） */
html[data-theme="light"] .button-primary {
  background: var(--primary) !important;
  box-shadow: 0 8px 20px rgba(91, 88, 214, .22) !important;
}
/* 激活态的分组/提供方芯片：底色 #4166d8（其中的白字只有 4.31:1） */
html[data-theme="light"] .provider-chip.is-active,
html[data-theme="light"] .group-chip.is-active {
  background: var(--primary) !important;
}

/* --- 7. 浅色页里遗留的深色底组件 ---------------------------------------- */
/* site.css 3980 行给 .history-search 写了 background:#181c23（深色底），
   但里面的图标文字用的是 var(--muted)，实测 3.43:1「深字压深底」。
   浅色主题下把搜索框改回浅底，让灰字落在白底上。 */
html[data-theme="light"] .history-search {
  border-color: #dde3ee;
  background: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   我的项目页：创建新作品旁的「风格中心 / 脚本中心」入口
   ──────────────────────────────────────────────────────────────────────────
   只在 body[data-page="projects"] 作用域内生效，不碰其它页面。
   两个次级入口 + 一个主按钮合成一组；窄屏时整组换行，主按钮提到最上面占满一行，
   两个次级入口等宽平分下一行。
   ══════════════════════════════════════════════════════════════════════════ */
body[data-page="projects"] .projects-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
body[data-page="projects"] .projects-center-link {
  min-height: 44px;
  padding: 10px 15px;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 760px) {
  body[data-page="projects"] .projects-head-actions { width: 100%; }
  body[data-page="projects"] .projects-head-actions .project-create-button { order: -1; }
  body[data-page="projects"] .projects-center-link { flex: 1 1 0; }
}

/* ==========================================================================
 * 风格中心 / 脚本中心：封面大图 + 演示视频 + 放大播放器
 * --------------------------------------------------------------------------
 * 目的：让两个页面成为**同一套设计语言**。
 *   脚本卡片原来是一个固定 88px 的 emoji 色块（.script-card-thumb），比风格卡片
 *   矮一大截，网格里看着又小又碎 —— 这就是「脚本列表单项太小」的根因。
 *   现在两边共用 .visual-style-card / .card-cover / .card-video，缩略区一律 4:3。
 *
 * 主题分层：本文件只写**浅色默认值**；深色覆盖在 theme-dark.css 末尾
 * （它是动态注入到 head 末端的终局层，带 !important，写在这里会被压掉）。
 * ========================================================================== */

/* --- 封面：与风格卡片同一个 4:3 尺寸体系 --- */
.visual-style-card .card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/*
 * 无封面时的占位底。
 * 占位图本身是**透明线稿** SVG，渐变由 CSS 给 —— 深色主题只需要换一个渐变，
 * 不必为两套主题各维护一份 base64 图片，也不会在深色底上突然冒出一块白。
 */
.visual-style-card .card-cover.is-placeholder,
.visual-style-detail > img.is-placeholder,
.visual-style-detail-scroll > img.is-placeholder {
  background: linear-gradient(135deg, #eef2fb, #e4eaf7);
}

/* --- 卡片里的演示视频：盖在封面上，高度正好等于封面（两者都是 4:3） --- */
.visual-style-card .card-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  /* 点击与悬停一律落在卡片本体上，不受视频解码状态影响 */
  pointer-events: none;
}

/* --- 播放 / 放大角标：铺满整个封面区再居中，位置不受文字条高度影响 --- */
.visual-style-card .card-media-play,
.visual-style-card .card-zoom {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  pointer-events: none;
}

/* 放大标记只在悬停 / 选中时出现：常驻会压住封面，看起来像「这张图上有东西」 */
.visual-style-card .card-zoom {
  opacity: 0;
  /*
   * §204 可点区域收回到**图标本身**。
   *
   * 原来这条是 pointer-events:auto，而 .card-zoom 铺满整个封面区
   *（width:100% + aspect-ratio:4/3），所以「点封面任意位置 = 放大」。
   * §204 已经把「点卡片弹大图」去掉了，这里若不收窄，两者视觉上分不出边界，
   * 用户扫一眼卡片就会误触弹窗 —— 正是「别任意点击都放大」要解决的问题。
   *
   * 现在：外层继续铺满（负责居中定位）但不吃事件，真正可点是里面的
   * <svg>（40×40 圆钮），命中区域与图标完全一致。
   */
  pointer-events: none;
  transition: opacity .16s ease;
}

/* 只有图标本体可点：命中区域就是那个 40×40 的圆钮 */
.visual-style-card .card-zoom svg {
  pointer-events: auto;
  cursor: zoom-in;
}

.visual-style-card:hover .card-zoom,
.visual-style-card.is-selected .card-zoom {
  opacity: 1;
}

/*
 * §204 触屏设备没有 hover：放大标记若只在悬停时出现，手机上就永远等不到它出现 ——
 * 而它现在是**唯一**的放大入口（点卡片不再弹窗）。这类设备上一律常驻显示。
 */
@media (hover: none) {
  .visual-style-card .card-zoom { opacity: 1; }
}

.visual-style-card .card-media-play svg,
.visual-style-card .card-zoom svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 50%;
  background: rgba(16, 20, 28, .62);
  box-shadow: 0 6px 18px rgba(12, 16, 24, .28);
  fill: #fff;
}

.visual-style-card .card-zoom svg {
  fill: none;
  stroke: #fff;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- 「已下架」灰标：卡片上贴在封面左上角，详情里跟在分类行下面 --- */
.mcw-flag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: #eceff4;
  color: #475467;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

/* §493 卡片左上角现在固定是标签区（类型 / 状态 / 作者昵称），「已下架」让到右上角，
 * 否则两处都写 top:9px left:9px，标签会压在灰标上面，字叠字看不清。 */
.visual-style-card > i.mcw-flag {
  position: absolute;
  top: 9px;
  left: auto;
  right: 9px;
  z-index: 3;
}

.visual-style-detail-copy > i.mcw-flag,
.visual-style-detail-head > i.mcw-flag {
  margin: 3px 0 2px;
}

/* --- 详情区媒体：与卡片同一口径，脚本详情不再是一小块 emoji --- */
.visual-style-detail > video.visual-style-detail-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #10131a;
}

/* --- 放大播放器（window.McwMediaViewer） --- */
.mcw-media-viewer {
  position: fixed;
  /* 必须高过站点头部（.site-header z-index:20）与风格编辑弹窗（1700） */
  z-index: 1900;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 58px 78px;
  background: rgba(10, 13, 19, .93);
}

/*
 * ⚠️ 舞台必须是 **flex 居中**，不能是 grid（grid 版本踩过坑）：
 * 作为 grid item 时，图片的 `max-height:100%` 解析的是「grid 轨道高度」，而轨道是
 * auto 的、会被图片自身撑高 → 百分比退化成 none → 图片按原始比例溢出舞台
 * （实测 1366×768 下图片高 681px、舞台只有 652px，竖构图会直接被裁掉看不全）。
 * flex 容器的高度是确定的（舞台 height:100%），百分比才解析得出来。
 */
.mcw-media-viewer-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  height: 100%;
}

/*
 * 默认「适应屏幕」：等比缩放到完整可见，且不放大到超过原图（放大只会糊）。
 * object-fit: contain 再兜一层，避免任何残留的拉伸。
 */
.mcw-media-viewer-media {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .55);
}

.mcw-media-viewer-close {
  position: absolute;
  top: 18px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 50%;
  background: rgba(22, 26, 36, .82);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.mcw-media-viewer-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 52px;
  height: 68px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(22, 26, 36, .74);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  transform: translateY(-50%);
}

.mcw-media-viewer-nav.is-prev { left: 18px; }

.mcw-media-viewer-nav.is-next { right: 18px; }

.mcw-media-viewer-foot {
  position: absolute;
  right: 0;
  bottom: 18px;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #e9edf4;
  text-align: center;
}

.mcw-media-viewer-foot [data-media-viewer-caption] {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.mcw-media-viewer-foot small {
  color: #a9b3c3;
  font-size: 12px;
}

.mcw-media-viewer-foot span {
  color: #8c98ab;
  font-size: 12px;
  letter-spacing: .08em;
}

@media (max-width: 700px) {
  .mcw-media-viewer {
    padding: 52px 14px;
  }

  .mcw-media-viewer-nav {
    top: auto;
    bottom: 74px;
    width: 46px;
    height: 46px;
    transform: none;
  }
}

/* ==========================================================================
 * 站点设置（平台管理 · 站点名称 / Logo / Favicon）
 * 只补这几条：面板与表单本体全部复用既有设计系统（.admin-data-card / .field / .button），
 * 这里只有「图片预览框」和「品牌区自定义 Logo 的盒子」两个新形状，
 * 不新造按钮、不改上面任何既有规则。
 * ========================================================================== */
.admin-site-panel { max-width: 900px; }
.admin-site-panel > p { min-height: 0; }

/* 上传/保存的即时状态放按钮左侧，比一闪而过的 toast 更容易看清失败原因。 */
.admin-site-hint { margin-right: auto; color: var(--subtle); font-size: 13px; }

.admin-asset-row { display: flex; align-items: center; gap: 14px; margin-top: 7px; }
.admin-asset-preview {
  display: grid;
  flex: none;
  width: 74px;
  height: 74px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--subtle);
  font-size: 12px;
}
.admin-asset-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.admin-asset-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.admin-asset-actions .button { min-height: 36px; padding: 8px 12px; font-size: 13px; }

/* 自定义站点 Logo：仍然套 .brand-mark 这个尺寸类（公共页 29×29、控制台 34×34），
   只把里面的三条柱状图形换成一张 <img>，头部高度与窄屏布局因此不会被撑变。
   背景置透明是因为那块深色小方块本是给柱状图形垫的底，套在真实 Logo 上会变成一个难看的框。 */
.brand-mark.has-logo,
body.is-public-page .brand-mark.has-logo,
body.is-console-page .brand-mark.has-logo {
  display: block;
  padding: 0;
  overflow: hidden;
  background: transparent;
}
.brand-mark.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* 这张 Logo 的四边自带透明留白，按实际盒子的尺寸放进去主体只有六成高，
   深色头部下几乎看不清是莲花标。公共页从 29×29 提到 32×32，并把图形本身
   撑到 116%（溢出部分被 overflow:hidden 裁掉，只是去掉留白，不动排版）。 */
body.is-public-page .brand-mark.has-logo {
  width: 32px;
  height: 32px;
}
.brand-mark.has-logo img { transform: scale(1.16); }

/* ==========================================================================
 * §111 成就感体系：项目页「我的数据」聚合卡 + 卡片统计栏
 * --------------------------------------------------------------------------
 * 基础样式走深色（与 .project-stats 同源），浅色由 body.is-public-page 覆盖。
 * 项目页属于公共页（有主题），所以必须同时给两套主题写颜色。
 * ========================================================================== */

/* ---- 我的数据聚合卡 ---- */
.my-content-stats {
  margin: 0 0 28px;
  padding: 18px 20px;
  border: 1px solid #2a303a;
  border-radius: 10px;
  background: linear-gradient(135deg, #171a20 0%, #1a1d2e 100%);
}
.my-content-stats.is-hidden { display: none; }
.my-content-stats-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.my-content-stats-title { color: #edf1f8; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.my-content-stats-sub { color: #8490a4; font-size: 12px; }
.my-content-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.my-content-stats-grid article { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #262d39; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.mc-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 7px; font-size: 16px; }
.mc-icon.view { background: #26324f; }
.mc-icon.like { background: #3b2e32; }
.mc-icon.favorite { background: #3d3020; }
.mc-icon.use { background: #213a39; }
.my-content-stats-grid small { display: block; color: #8490a4; font-size: 12px; }
.my-content-stats-grid strong { display: block; margin-top: 4px; color: #edf1f8; font-size: 22px; font-variant-numeric: tabular-nums; }

/* ---- 卡片右下角统计栏 ---- */
.project-content-stats { margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid #282f3a; }
.project-content-stats .content-stats { gap: 16px; }
.project-content-stats .content-stat { color: #8995a9; font-size: 12px; }
.project-content-stats .content-stat.is-active i { color: #f3c969; }

/* ---- 浅色（公共页）覆盖 ---- */
body.is-public-page .my-content-stats {
  border-color: #e5eaf2;
  background: linear-gradient(135deg, #fbfcff 0%, #f3f5ff 100%);
  box-shadow: 0 8px 24px rgba(33, 46, 79, .06);
}
body.is-public-page .my-content-stats-title { color: #26344c; }
body.is-public-page .my-content-stats-sub { color: #7a879b; }
body.is-public-page .my-content-stats-grid article { border-color: #eef0f5; background: #fff; }
body.is-public-page .mc-icon.view { background: #eef0ff; }
body.is-public-page .mc-icon.like { background: #fff0e8; }
body.is-public-page .mc-icon.favorite { background: #fff6df; }
body.is-public-page .mc-icon.use { background: #e4f8fb; }
body.is-public-page .my-content-stats-grid small { color: #7a879b; }
body.is-public-page .my-content-stats-grid strong { color: #26344c; }
body.is-public-page .project-content-stats { border-color: #edf0f5; }
body.is-public-page .project-content-stats .content-stat { color: #7a879b; }

/* 窄屏：聚合卡 2 列 */
@media (max-width: 767px) {
  .my-content-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
 * §198 弹窗跟随主题 + 入场动画
 * --------------------------------------------------------------------------
 * 背景：site.css 的 :root 默认取的是「深色产品面」（--surface:#171a20），浅色主题
 *   只在 html[data-theme="light"] 里重定向了 --muted/--primary 等少数 token，**没有**
 *   拉回 --bg/--surface/--ink/--line。于是 .modal 那条写死的 `background:#181c23`
 *   在白色页面里原地留了一块黑 —— 用户看到的就是「主题是白、创建弹窗是黑」。
 * 做法：不改深色（theme-dark.css 已经处理），只在 light 作用域内把弹窗拉回浅色语义。
 *   硬编码浅色值而不是复用 token，是因为这三个 token 在浅色下本来就是深色值。
 * 边界：无限画布页（canvas / workspace）不加载 theme-boot.js、没有 data-theme，
 *   完全不受影响；其余页面只有弹窗这一块被改到。
 * ========================================================================== */
html[data-theme="light"] .modal {
  border-color: #e4e8f0;
  background: #ffffff;
  color: #172033;
}
html[data-theme="light"] .modal-head h2 { color: #172033; }
html[data-theme="light"] .modal-lead { color: #636d81; }
html[data-theme="light"] .modal .field { color: #4a5568; }
html[data-theme="light"] .modal .field input,
html[data-theme="light"] .modal .field select,
html[data-theme="light"] .modal .field textarea {
  border-color: #dfe4ee;
  background: #ffffff;
  color: #172033;
}
html[data-theme="light"] .modal .field input::placeholder,
html[data-theme="light"] .modal .field textarea::placeholder { color: #97a2b3; }
html[data-theme="light"] .modal .icon-button { border-color: #e4e8f0; background: #ffffff; color: #636d81; }
/* 弹窗内的「取消」也要跟着主题走：.button-secondary 的基础取色是深色产品面
   （#1a1e25），白弹窗里挂一颗黑按钮正是「主题是白、显示的是黑」。
   只改弹窗作用域，页面右上角那两个次级按钮维持原样 —— 不做没被要求的全站变更。 */
html[data-theme="light"] .modal .button-secondary { border-color: #dfe4ee; background: #f4f6fa; color: #334155; }
html[data-theme="light"] .modal .button-secondary:hover { border-color: #b9c2f0; background: #eef1fa; color: #1c2740; }
html[data-theme="light"] .modal-backdrop { background: rgba(23, 32, 51, .46); }
html[data-theme="light"] .project-category-media { border-color: #e4e8f0; background: #f2f4f8; }
html[data-theme="light"] .project-category-card:hover .project-category-media { border-color: #7d88ff; }

/* 入场动画：只在项目页生效 —— 其它页面的弹窗保持原样，不做全站行为变更。
   is-hidden 用的是 display:none，元素重新渲染时动画会自动重放，不需要 JS 挂钩子。 */
@keyframes mcw-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mcw-modal-rise {
  from { opacity: 0; transform: translateY(22px) scale(.965); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
body[data-page="projects"] .modal-backdrop:not(.is-hidden) { animation: mcw-modal-fade .22s ease both; }
body[data-page="projects"] .modal-backdrop:not(.is-hidden) > .modal {
  animation: mcw-modal-rise .38s cubic-bezier(.16, .9, .28, 1.06) both;
}
body[data-page="projects"] .project-modal .button { transition: transform .18s ease, background .24s ease, box-shadow .24s ease; }
body[data-page="projects"] .project-modal .button:active { transform: scale(.972); }

@media (prefers-reduced-motion: reduce) {
  body[data-page="projects"] .modal-backdrop:not(.is-hidden),
  body[data-page="projects"] .modal-backdrop:not(.is-hidden) > .modal,
  .project-category-card input:checked ~ .project-category-check { animation: none !important; }
  .project-category-card:hover .project-category-media img { transform: none; }
}

/* ==========================================================================
 * §207 风格中心（styles.html）：风格卡片列表改成 16:9
 * --------------------------------------------------------------------------
 * 只作用于 `body[data-page="styles"]` —— 脚本中心（scripts.html）与本文件共用
 * .visual-style-card，那边仍是 4:3，不受影响。
 * 必须四处一起改：封面图 / 演示视频 / 播放角标 / 放大角标。后两者是「铺满封面区
 * 再居中」的定位层，比例一旦与封面不一致，按钮就会偏离图心。
 * 右侧详情大图不在本次改动范围内，保持 4:3。
 * ========================================================================== */
body[data-page="styles"] .visual-style-card img,
body[data-page="styles"] .visual-style-card .card-cover,
body[data-page="styles"] .visual-style-card .card-video,
body[data-page="styles"] .visual-style-card .card-media-play,
body[data-page="styles"] .visual-style-card .card-zoom {
  aspect-ratio: 16 / 9;
}

/* ==========================================================================
 * §220 语境总线 Context Bus（项目输入面板最下方）
 * --------------------------------------------------------------------------
 * 一条线一张小卡：开关 + 名称 + 用量 / 作用 / 作用脚本 / 内容摘要。
 * 面板只有 300px 宽，所以用纵向卡片而不是表格 —— 四列硬塞会全挤成竖排。
 * 颜色一律走主题变量，深浅两套主题自动跟随。
 * ========================================================================== */
.bus-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11.5px;
}
.bus-summary > span:first-child {
  color: var(--ink);
  font-weight: 700;
}
.bus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.bus-line {
  position: relative;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.bus-line.is-off {
  opacity: .5;
}
.bus-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bus-line-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.bus-line-name input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.bus-usage {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bus-usage.is-used {
  background: rgba(91, 88, 214, .12);
  color: var(--primary);
  font-weight: 700;
}
.bus-line-role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}
.bus-line-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.bus-line-targets i {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 10.5px;
  font-style: normal;
  white-space: nowrap;
}
.bus-line-targets i.is-empty,
.bus-line-body .is-empty {
  color: var(--muted);
  font-style: normal;
}
.bus-line-body {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  word-break: break-all;
}
.bus-line-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}
.bus-line-remove:hover {
  color: #e5484d;
}
/* §229 语境总线精简版（脚本页签）：一行一条 = 开关 + 名称，不再堆数据卡 */
.bus-list.is-compact {
  gap: 4px;
  margin-bottom: 8px;
}
.bus-line.is-compact {
  padding: 5px 8px;
}
.bus-line.is-compact .bus-line-name {
  font-weight: 600;
  font-size: 12px;
}
.bus-line.is-compact .bus-line-remove {
  position: static;
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 6px;
}
/* §227 功能总控：参数输入（分镜密度 / 每章镜数上限） */
.master-param {
  flex: 0 0 auto;
  width: 62px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.master-param:disabled {
  opacity: .45;
}
.master-param:focus {
  outline: none;
  border-color: var(--primary);
}

/* ── §243 嵌入模式（画布 iframe 引用风格库 / 脚本库） ──────────────────────
 *
 * 画布里的「选择风格」直接把 /ai/styles.html 放进 iframe，而不是重画一份风格库。
 * 但页面本身带着站点头部、侧栏和「← 返回创作」—— 放进 iframe 会变成
 * 一个「画中画中画」，还把有限的弹层高度吃掉一截。
 *
 * body.is-embed 由 common.js 按 ?embed=1 打上；不带这个参数时以下规则全不生效，
 * 站内单独打开仍是完整页面。只收「外壳」，页面功能区（筛选、详情、应用）一个不动。
 */
body.is-embed .site-header,
body.is-embed .side-rail,
body.is-embed .rail-collapse,
body.is-embed .side-overlay { display: none !important; }
body.is-embed .site-layout { grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
body.is-embed .main-content { min-height: 100vh; padding: 0 !important; }
body.is-embed .content-wrap { width: 100%; max-width: none; }
body.is-embed .visual-style-page {
  margin: 0;
  min-height: 100vh;
  padding: 16px 20px 22px;
}
body.is-embed .visual-style-back { display: none !important; }
body.is-embed .visual-style-head h1 { margin: 0 0 6px; font-size: 22px; }
body.is-embed .visual-style-head p { display: none; }
body.is-embed .visual-style-head-actions { flex-wrap: wrap; justify-content: flex-end; }
/* 嵌入模式下页面会整体滚动（iframe 高度有限），把「应用风格」那一行钉在顶部，
   否则滚到下面挑风格时，应用按钮已经滚出可视区。 */
body.is-embed .visual-style-head {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 0;
  /* 用主题变量，不能写死深色：浅色主题下深色块会像一条断掉的黑边 */
  background: var(--bg);
}

/* ══════════════════ §3xx 脚本卡片改版：16:9 封面 + 左上角有色标签 ══════════════════
 * 卡片结构与风格卡同构（.visual-style-card），但脚本卡挂 is-script-card：
 * 封面从 4:3 改 16:9；左上角 .script-card-tags 是浮在封面上的有色标签（类型 / 公开状态）。
 * 脚本管理页与画布脚本库共用同一份（common.js · scriptCardHtml），两边天然一致。
 */
.visual-style-card.is-script-card img.card-cover {
  aspect-ratio: 16 / 9;
}

.visual-style-card.is-script-card video.card-video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.script-card-tags {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  /* 右侧留出「已下架」灰标的宽度（§493 它已挪到右上角），否则窄卡片上会叠在一起 */
  max-width: calc(100% - 80px);
  pointer-events: none;
  z-index: 2;
}

/*
 * §493 标签行必须**左对齐**。
 *
 * .script-card-tags 是 .visual-style-card 的直接 span 子元素，而底部那条名字栏正是
 * `.visual-style-card > span { display:flex; justify-content: space-between }` —— 那个
 * space-between 是给名字栏把 ✓ 顶到右边用的，标签行搭车继承下来会变成「第一个标签贴左、
 * 第二个贴右」，加进第三个（作者昵称）后第二个还会被挤到第二行最右侧，看起来像排版坏了。
 * 这里用 (0,2,0) 的选择器把它压回来（父级 > span 是 (0,1,1)）。
 */
.visual-style-card > span.script-card-tags {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 4px;
  /*
   * §494 padding 必须清零：父级那条 `.visual-style-card > span` 带着 10px/11px 内边距，
   * 是给底部名字栏用的。标签行是**绝对定位**在左上角的，继承这份 padding 会让整块
   * 命中区右移、下移各 10px，标签看起来「没贴住角」，还会把 max-width 的计算挤乱。
   */
  padding: 0;
}

.script-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.6;
  color: #fff;
  background: #4166d8;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  white-space: nowrap;
}

/*
 * 有色标签色板（§3xx 用户定）：
 *   状态 —— 已公开 = 绿，未公开（含待审核 / 驳回）= 红；
 *   类型 —— 每个分类各一种颜色，见下面 tone-type-1~6。
 */
.script-tag.tone-cat { background: #4166d8; }
.script-tag.tone-public { background: #2e9e5b; }
.script-tag.tone-private { background: #d64545; }
/* 兼容旧调用：待审核 / 驳回 / 已下架仍按红色走，不再单独上琥珀色 */
.script-tag.tone-pending,
.script-tag.tone-rejected,
.script-tag.tone-danger { background: #d64545; }
.script-tag.tone-system { background: #7a4fd6; }
.script-tag.tone-scope { background: #2b7fa8; }

/* 类型色板：小说转剧本 / 剧本转分镜 / 资产提取 / 高燃打斗 / 游戏创作 / 未分类 */
.script-tag.tone-type-1 { background: #3f6fd8; }
.script-tag.tone-type-2 { background: #2196a8; }
.script-tag.tone-type-3 { background: #8a5cd6; }
.script-tag.tone-type-4 { background: #d9743a; }
.script-tag.tone-type-5 { background: #c2437f; }
.script-tag.tone-type-6 { background: #5c6b80; }

/*
 * §493 作者昵称标签（用户定：脚本和风格都要能一眼看出「这是谁上传的」，并能按昵称搜）。
 *
 * 刻意用**中性深色 + 细白边**，不占上面那套分类色板里的任何一种颜色 ——
 * 昵称不是「第 7 种类型」，混进色板里用户会当成又一个分类；深底白边压在任何封面上都读得清。
 * 它是卡片上唯一的可点标签（.is-filterable），其余标签仍保持 pointer-events:none，
 * 免得「点封面变成点标签」把卡片点击手感弄坏。
 */
.script-tag.tone-author {
  background: rgba(16, 19, 26, .82);
  border: 1px solid rgba(255, 255, 255, .34);
  font-weight: 600;
  letter-spacing: 0;
  max-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.script-tag.is-filterable {
  pointer-events: auto;
  cursor: pointer;
}

.script-tag.is-filterable:hover {
  background: #2f6bff;
  border-color: #2f6bff;
}

/* 详情面板里的作者名：点它等于点卡片昵称标签（只看 TA） */
.author-filter-chip {
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.author-filter-chip:hover {
  color: #2f6bff;
}

html[data-theme="light"] .script-tag { box-shadow: 0 1px 4px rgba(43, 58, 98, .25); }

/* ══════════════════ §3xx 项目卡副标题：最多 3 行，多余省略号 ══════════════════ */
.project-card-copy .project-subtitle {
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--ink-soft, #9aa4b2);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ══════════════════ §3xx 编辑项目弹窗（项目页 / 画布项目设置公用） ══════════════════ */
.mcw-project-edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 10, 14, .62);
  backdrop-filter: blur(3px);
}

.mcw-project-edit {
  width: min(520px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid var(--line, #30363d);
  border-radius: 14px;
  background: var(--panel, #181c20);
  color: var(--ink, #edf0f3);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}

.mcw-project-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line, #30363d);
}

.mcw-project-edit-head .eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--ink-soft, #89939e);
  font-size: 10px;
  letter-spacing: .14em;
}

.mcw-project-edit-head h2 { margin: 0; font-size: 17px; }

.mcw-project-edit-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.mcw-project-edit-close:hover { background: rgba(128, 138, 152, .16); }

.mcw-project-edit-body { padding: 14px 20px 6px; }

.mcw-project-edit-field { margin-bottom: 14px; }

.mcw-project-edit-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #edf0f3);
}

.mcw-project-edit-field .mcw-pe-hint {
  margin-left: 6px;
  color: var(--ink-soft, #89939e);
  font-size: 11px;
  font-weight: 400;
}

.mcw-project-edit-field input[type="text"],
.mcw-project-edit-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--line, #30363d);
  border-radius: 9px;
  background: var(--bg, #14171b);
  color: var(--ink, #edf0f3);
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}

.mcw-project-edit-field input:focus,
.mcw-project-edit-field textarea:focus {
  outline: none;
  border-color: var(--primary, #6877ff);
}

.mcw-project-edit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 8px;
}

/* 标签 chip：画布页有 canvas-studio.css 的 .studio-chip，项目页没有，
   所以在弹窗作用域内自备一套，保证两个入口观感一致。 */
.mcw-project-edit .studio-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, #30363d);
  background: transparent;
  color: var(--muted, #8a929c);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.mcw-project-edit .studio-chip:hover {
  border-color: var(--primary, #5b58d6);
  color: var(--ink, #172033);
}
.mcw-project-edit .studio-chip.is-accent {
  border-color: var(--primary, #5b58d6);
  background: var(--primary-soft, #eeedff);
  color: var(--primary, #5b58d6);
}

.mcw-project-edit-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 18px;
}

.mcw-project-edit-foot button {
  padding: 8px 18px;
  border-radius: 9px;
  border: 1px solid var(--line, #30363d);
  background: transparent;
  color: var(--ink, #edf0f3);
  font-size: 13px;
  cursor: pointer;
}

.mcw-project-edit-foot button.mcw-pe-save {
  border-color: var(--primary, #6877ff);
  background: var(--primary, #6877ff);
  color: #fff;
  font-weight: 700;
}

.mcw-project-edit-foot button:disabled { opacity: .6; cursor: default; }

.mcw-project-edit-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink, #edf0f3);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.65;
  cursor: pointer;
}

.mcw-project-edit-check input { margin-top: 3px; }


/* ==========================================================================
   §3xx 个人中心 · 资料卡（昵称 / 头像）
   console.html（普通用户）与 myworks.html（我的信息）共用 assets/profile-card.js
   ========================================================================== */
.profile-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 30px;
  font-weight: 750;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-main { flex: 1; min-width: 0; }
.profile-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12.5px;
}
.profile-field input {
  width: 220px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}
.profile-field input:focus { border-color: var(--primary); outline: none; }
.profile-meta { margin: 10px 0 4px; color: var(--subtle); font-size: 12.5px; }
.profile-hint { margin: 0; color: var(--subtle); font-size: 12px; }
.profile-hint[data-tone="error"] { color: var(--danger); }
.profile-card.is-loading { opacity: .75; }
.account-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

@media (max-width: 640px) {
  .profile-card { flex-direction: column; align-items: stretch; }
  .profile-field input { width: 100%; }
}


/* ==========================================================================
   §3xx 个人中心（普通用户版的 console.html）
   ========================================================================== */
.pc-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.pc-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.pc-link:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.pc-link-icon { color: var(--primary); font-size: 16px; }
.pc-link strong { color: var(--ink); font-size: 14.5px; }
.pc-link small { color: var(--muted); font-size: 12.5px; }
.pc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.pc-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.pc-stat span { color: var(--muted); font-size: 12.5px; }
.pc-stat strong { color: var(--ink); font-size: 22px; font-weight: 780; }

/* --------------------------------------------------------------------------
   §3xx 控制台小导航：桌面隐藏（左侧栏已经有一份同样的入口），只在手机上出现。
   规则写在文件末尾，靠「后写覆盖」压过第 300 行的 .console-tabs { display:flex }。
   -------------------------------------------------------------------------- */
body.is-console-page .console-tabs { display: none; }
@media (max-width: 720px) {
  body.is-console-page .console-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    overflow-x: auto;
  }
}


/* ==========================================================================
   §3xx 系统管理（/ai/admin/）：文件夹内的二级导航、总览卡片、开关行
   ========================================================================== */
.admin-page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.admin-page-nav a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
.admin-page-nav a:hover { background: var(--surface-soft); color: var(--ink); }
.admin-page-nav a.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }

.admin-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.admin-hub-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.admin-hub-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.admin-hub-icon { color: var(--primary); font-size: 18px; }
.admin-hub-card strong { color: var(--ink); font-size: 15px; }
.admin-hub-card small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* 工具条只剩搜索 + 状态筛选时的排版（分页后没有分段切换按钮了） */
.admin-toolbar-slim { justify-content: flex-end; }

/* 站点设置里的两个隐藏开关 */
.admin-toggle-grid { margin-top: 12px; }
.admin-toggle { display: flex; align-items: center; gap: 9px; margin-top: 8px; color: var(--ink); font-size: 13.5px; }
.admin-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ==========================================================================
   §3xx 系统管理铺在左侧主菜单之后：九条并排会让侧栏超出一屏，允许纵向滚动；
   管理项字号略小、行高略紧，和上面的控制台项区分开。
   ========================================================================== */
.side-rail { overflow-y: auto; }
.rail-nav-admin .rail-link { min-height: 38px; padding: 7px 11px; font-size: 13.5px; }
.rail-nav-admin .rail-icon { width: 20px; height: 20px; font-size: 13px; }

/* §3xx 普通用户的 console.html 是个人中心：首帧脚本给 <html> 加 is-personal-console，
   先把看板骨架藏掉，等 console.js 渲染完个人中心再彻底替换，避免闪一屏「数据看板」。 */
.is-personal-console [data-dashboard-only] { display: none; }

/* §392 风格中心 / 脚本中心的排序切换（最新 / 热度）。
   外观完全继承 .visual-style-categories 的按钮（含浅色主题覆盖），这里只管位置：
   搜索框与排序按钮合成「右侧工具组」，否则工具栏三个块平分空间时，
   脚本页分类多、会把排序按钮挤到下一行（实测「最新」和「热度」上下分开）。 */
.visual-style-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: nowrap;
}

/* 工具组内部不换行：脚本页分类项多，原来的搜索框（min(360px,40vw)）会把排序按钮挤到第二行 */
.visual-style-tools .visual-style-search {
  width: min(280px, 28vw);
}

.visual-style-sort {
  flex-shrink: 0;
}

/* §404 「显示已下架」复选框：跟排序按钮同一行、更轻一点。
   用主题变量而不是写死颜色，浅色 / 深色两套主题自动适配。 */
.visual-style-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.visual-style-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.visual-style-toggle:hover { color: var(--ink); }

/* 勾选态给个正反馈：说明当前列表里混着下架项，不是看错 */
.visual-style-toggle:has(input:checked) { color: var(--primary); }

@media (max-width: 900px) {
  .visual-style-toolbar {
    flex-wrap: wrap;
  }

  .visual-style-tools {
    margin-left: 0;
    width: 100%;
    flex-wrap: wrap;
  }
}
/* ==========================================================================
   拖入本地文件（图片 / 视频 / 音频 / txt）
   监听挂在 document 上，所以提示条是 fixed：拖到画布外的侧栏、工具栏时同样可见。
   整页只加一层 pointer-events:none 的虚边框，不参与命中测试，不影响任何交互。
   ========================================================================== */
body.is-file-drag::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  border: 2px dashed var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.studio-file-drop {
  position: fixed;
  z-index: 91;
  top: 84px;
  left: 50%;
  display: grid;
  gap: 2px;
  padding: 12px 22px;
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
  text-align: center;
  transform: translateX(-50%);
}
.studio-file-drop strong { color: var(--primary); font-size: 14px; font-weight: 700; }
.studio-file-drop small { color: var(--muted); font-size: 12px; }

/* ══════════════════════════════════════════════════════════════════════
 * 白主题：风格中心 / 脚本中心「选中的筛选按钮」必须是纯蓝（2026-11-18）
 * ----------------------------------------------------------------------
 * 根因：上面 6159 行
 *   body[data-page="styles"] .visual-style-page button:not(.primary):not(.button-primary)
 * 是「通用按钮一律压白底」的锁色规则，特异性 (0,4,2) 且带 !important，
 * 把页签 / 分类 / 排序按钮的 .is-active 蓝色一并刷成白底灰字
 * （6224 那条蓝色只有 (0,3,2)，输给它）——表现就是「选中了却看不出来」。
 * 深色主题早先已在 theme-dark.css 用 (0,5,2) 的规则修过同款问题，白主题一直没修。
 * 这里对齐：把 .visual-style-page 算进选择器、特异性抬到 (0,5,2)，
 * 并放在文件最末尾，稳定压过刷白规则。只改配色，不动布局 / 尺寸。
 * ══════════════════════════════════════════════════════════════════════ */
body[data-page="styles"] .visual-style-page .visual-style-tabs button.is-active,
body[data-page="scripts"] .visual-style-page .visual-style-tabs button.is-active,
body[data-page="styles"] .visual-style-page .visual-style-categories button.is-active,
body[data-page="scripts"] .visual-style-page .visual-style-categories button.is-active {
  border-color: #2f6bff !important;
  background: #2f6bff !important;
  background-image: none !important;
  color: #fff !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  box-shadow: 0 4px 14px rgba(47, 107, 255, .45) !important;
}

/* ══════════════════════════════════════════════════════════════════════
 * 风格 / 脚本中心卡片「@昵称」标签不要白框（2026-11-18 修订）
 * ----------------------------------------------------------------------
 * .script-tag.tone-author 原本是「深色底 + 细白边」，这圈白边在深色封面上
 * 很清楚，但这两个页面本身就是 hard-coded 强制浅色外观（见 6131 行
 * "outside canvas is always light"），卡片是白底，白边 + 7869 行的 box-shadow
 * 就显成一个多余的白色描边框。
 *
 * 修订：不要用 html[data-theme="light"] 做条件——这两页强制浅色，跟用户当前
 * 主题无关，用 html 主题属性会漏掉「用户在深色主题下打开这两页」的情况
 * （这正是用户截图里白框还在的原因）。直接用 body[data-page] 锁定这两页。
 * 用 border:0（而非 border-color:transparent）确保彻底干掉简写里的白边。
 *
 * § 二次修订（2026-11-18）：只改标签自身的 border 没用——用户看到的白框真正的
 * 来源是**父容器 .script-card-tags**：它是方形（radius:0）、白底（.visual-style-card
 * > span 在浅色卡片下 computed background:#fff），而里面的 @昵称标签是圆角胶囊
 * （radius:999px）。容器和标签尺寸完全一致，于是胶囊的四个圆角外侧就透出方形
 * 白底的四个直角，形成「@神尊 标签后面有个白色框」。把容器背景设为透明即可，
 * 这样圆角外直接露出封面图。CDP 实测：透明化后四角白底完全消失。
 * ══════════════════════════════════════════════════════════════════════ */
body[data-page="styles"] .script-tag.tone-author,
body[data-page="scripts"] .script-tag.tone-author {
  border: 0 !important;
  box-shadow: none !important;
}

/* 昵称标签容器的方形白底 = 圆角四角「白框」的根因，置透明让封面透出 */
body[data-page="styles"] .visual-style-card > span.script-card-tags,
body[data-page="scripts"] .visual-style-card > span.script-card-tags {
  background: transparent !important;
}

/* ══════════════════════════════════════════════════════════════════════
   §520 首屏骨架屏 / 加载动画 / 页面过渡
   ----------------------------------------------------------------------
   目标：任何一次「打开页面 / 切页签」都不出现空白、不出现内容跳位。
     · 外壳外壳（顶栏 / 侧栏 / 正文）在脚本接管前由 theme-boot.js 的引导层盖住；
     · 脚本接管后立刻摆出与真实结构同形的骨架（.skel-*），数据到了再换成真内容；
     · 骨架配色走 --skel-* 变量，浅色 / 深色两套主题自动适配。
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --skel-base: rgba(23, 32, 51, .075);
  --skel-hi: rgba(23, 32, 51, .14);
}
html[data-theme="dark"] {
  --skel-base: rgba(255, 255, 255, .06);
  --skel-hi: rgba(255, 255, 255, .14);
}

/* 基础色块 + 扫光 */
.skel {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--skel-base);
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent);
  animation: skel-sweep 1.35s ease-in-out infinite;
}
@keyframes skel-sweep {
  0%   { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* 形状 */
.skel-line { height: 12px; border-radius: 999px; }
.skel-line.is-title { height: 26px; border-radius: 8px; }
.skel-thumb { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; }
.skel-circle { width: 36px; height: 36px; border-radius: 50%; }

/* 卡片骨架：外框保持与真卡片一致的圆角/描边，避免出现后跳位 */
.skel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.skel-card .skel:last-child { margin-top: 2px; }

/* 容器 */
.skel-page { display: flex; flex-direction: column; gap: 22px; }
.skel-head { display: flex; flex-direction: column; gap: 12px; }
.skel-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.skel-kpis {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.skel-kpi {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.skel-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.skel-chart { width: 100%; height: 210px; border-radius: 10px; }
.skel-rows { display: flex; flex-direction: column; gap: 12px; }

/* 表格骨架：整行一个 placeholder，不破坏 colgroup 对齐 */
tr[data-skel-item] > td {
  padding: 10px 12px;
  border: 0;
}
tr[data-skel-item] .skel { height: 12px; }

/* 骨架在「减弱动效」下不扫光，只留静态色块 */
@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; opacity: .35; }
}

/* ---------- 页面进场：外壳淡入，避免「一帧空白 → 内容突然出现」 ----------
 * §530 **这里绝对不能动 transform**（血泪）：
 * fill-mode: both 会把动画停在最后一帧，只要末尾写了 transform（哪怕值是 none，
 * 计算值也是 matrix(1,0,0,1,0,0)），`.site-shell` 就永久成为 fixed 后代的包含块。
 * 后果：`.modal-backdrop{position:fixed;inset:0}` 不再是「视口那么大」，而是「整页
 * 那么高」（项目页有 18000px），`place-items:center` 把弹窗摆到文档正中间 → 打开
 * 「创建新作品」时 `input.focus()` 把页面滚到几千像素外（用户看到的就是「滑到最底」）。
 * 同一个坑还会让 `.toast-stack` 之类的 fixed 元素沉到页面底部。
 * 所以进场只做 opacity：淡入效果一样，且不留任何包含块副作用。
 */
.site-shell { animation: mcw-shell-in .26s cubic-bezier(.22, .8, .3, 1) both; }
@keyframes mcw-shell-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* 骨架 → 真内容 的替换不做整块位移，只做一次极短的透明度过渡 */
.content-wrap.mcw-swap { animation: mcw-swap-in .22s ease both; }
@keyframes mcw-swap-in {
  from { opacity: .3; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .site-shell, .content-wrap.mcw-swap { animation: none; }
}

/* ---------- 顶部切页进度条：点链接到新页面画出第一帧之间的那点等待 ---------- */
.mcw-progress {
  position: fixed;
  z-index: 2147482000;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #6f6bfa, #4ee0d0);
  box-shadow: 0 0 10px rgba(111, 107, 250, .55);
  transition: opacity .18s ease, transform .2s ease;
}
.mcw-progress.is-on {
  opacity: 1;
  transform: scaleX(.82);
  transition: opacity .12s ease, transform 2.4s cubic-bezier(.08, .7, .2, 1);
}
.mcw-progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: opacity .2s ease .08s, transform .12s ease;
}
