@font-face {
  font-family: "OC Fusion Pixel";
  src: url("../id-badge-generator/fonts/fusion-pixel/fusion-pixel-10px-monospaced-latin.otf.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
  unicode-range: U+0000-024F,U+2000-206F,U+20A0-20CF,U+2190-21FF,U+2500-257F,U+25A0-25FF;
}
@font-face {
  font-family: "OC Fusion Pixel";
  src: url("../id-badge-generator/fonts/fusion-pixel/fusion-pixel-10px-monospaced-zh_hans.otf.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
  unicode-range: U+3000-303F,U+4E00-9FFF,U+FF00-FFEF,U+3400-4DBF;
}

:root {
  color-scheme: light;
  --ui-accent: #6a5f7a;
  --ui-accent-dark: #423a50;
  --ui-accent-soft: #e9e5ef;
  --ui-bg: #e7e5ea;
  --ui-panel: #f7f6f9;
  --ui-card: #fcfbfd;
  --ui-line: #ccc7d2;
  --ui-line-strong: #aca6b6;
  --ui-text: #2a2830;
  --ui-muted: #6a6572;
  --topbar-height: 64px;
  --font-ui: "OC Noto Sans SC","Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
  --font-serif: "OC Noto Serif SC","Noto Serif SC","Songti SC",serif;
  --font-mono: Consolas,"Courier New",monospace;
  font-family: var(--font-ui);
}
* { box-sizing: border-box; }
html { height: 100%; overflow: hidden; }
body { width: 100%; height: 100vh; height: 100dvh; min-width: 320px; margin: 0; overflow: hidden; display: grid; grid-template-rows: var(--topbar-height) minmax(0,1fr); color: var(--ui-text); background: var(--ui-bg); }
body.is-export-busy { cursor: progress; }
body.is-export-busy button { cursor: progress; }
button,input,textarea,select { font: inherit; color: inherit; }
button,.file-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,[tabindex]:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
button:active,.file-button:active { transform: translateY(1px); }
[hidden] { display: none !important; }

/* ================= 编辑器外壳 ================= */
.topbar { height: 100%; display: flex; align-items: center; gap: 14px; padding: 0 16px; border-bottom: 1px solid var(--ui-line); background: rgba(250,249,251,.98); position: relative; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 250px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 5px; background: var(--ui-accent); color: #fff; font-family: var(--font-serif); font-size: 22px; font-weight: 800; box-shadow: 4px 4px 0 #d4cfda; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy b { font-family: var(--font-serif); font-size: 17px; line-height: 1.2; }
.brand-copy small { color: var(--ui-muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.project-field { flex: 1; max-width: 420px; display: grid; grid-template-columns: auto minmax(160px,1fr); align-items: center; gap: 8px; }
.project-field span { color: var(--ui-muted); font-size: 12px; font-weight: 700; }
.project-field input { height: 40px; min-width: 0; padding: 0 12px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.button,.preview-actions button { min-height: 38px; padding: 0 13px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 750; white-space: nowrap; }
.button:hover,.preview-actions button:hover { border-color: var(--ui-accent); }
.button.primary { border-color: var(--ui-accent); background: var(--ui-accent); color: #fff; }
.button.quiet { background: transparent; }
.button.compact { min-height: 34px; padding-inline: 10px; font-size: 12px; }
.button:disabled { opacity: .4; cursor: default; }
.file-button { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--ui-accent-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.workspace { min-height: 0; display: grid; grid-template-columns: 348px minmax(430px,1fr) 366px; }
.editor-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); background: var(--ui-panel); }
.content-panel { border-right: 1px solid var(--ui-line); }
.style-panel { border-left: 1px solid var(--ui-line); }
.panel-heading { min-height: 70px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ui-line); background: #faf9fb; }
.panel-heading > span { padding: 4px 8px; border-radius: 4px; background: var(--ui-accent-soft); color: var(--ui-accent-dark); font-size: 10px; font-weight: 850; letter-spacing: .1em; }
.panel-heading h1 { margin: 0; font-family: var(--font-serif); font-size: 17px; }
.panel-heading p { margin: 2px 0 0; color: var(--ui-muted); font-size: 11px; }
.panel-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; scrollbar-gutter: stable; }
.editor-card { margin-bottom: 14px; padding: 14px; border: 1px solid var(--ui-line); border-radius: 8px; background: var(--ui-card); box-shadow: 0 1px 0 rgba(42,40,48,.03); }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h2 { margin: 0; font-family: var(--font-serif); font-size: 15px; }
.card-title p { margin: 3px 0 0; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.card-title > span { padding: 3px 7px; border: 1px solid var(--ui-line); border-radius: 4px; color: var(--ui-muted); font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.field { min-width: 0; display: grid; gap: 5px; margin-bottom: 10px; }
.field > span { color: var(--ui-muted); font-size: 11px; font-weight: 750; }
.field input,.field textarea,.field select { min-height: 38px; min-width: 0; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; font-size: 13px; }
.field textarea { min-height: 84px; line-height: 1.6; resize: vertical; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.image-control { display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: center; gap: 12px; margin-bottom: 12px; }
.image-control:last-child { margin-bottom: 0; }
.image-control b { font-size: 12px; }
.image-control p { margin: 3px 0 6px; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.upload-preview { width: 82px; height: 82px; display: grid; place-items: center; overflow: hidden; padding: 5px; border: 1px dashed var(--ui-line-strong); border-radius: 7px; background: #efedf2; color: var(--ui-muted); font-size: 10px; }
.upload-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.inline-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.style-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.style-button { min-width: 0; min-height: 62px; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; text-align: left; cursor: pointer; }
.style-button.active { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.style-swatch { width: 30px; height: 42px; border: 1px solid rgba(0,0,0,.15); border-radius: 3px; background: linear-gradient(180deg,var(--sw-s) 0 44%,var(--sw-a) 44% 62%,var(--sw-m) 62% 74%,var(--sw-i) 74%); }
.style-button b { display: block; font-size: 11px; line-height: 1.35; }
.style-button small { display: block; margin-top: 2px; color: var(--ui-muted); font-size: 9px; line-height: 1.32; }
.segment-control { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
.segment-control > span { color: var(--ui-muted); font-size: 11px; font-weight: 750; }
.segment-switch { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); }
.segment-switch button { min-height: 38px; border: 1px solid var(--ui-line); border-right: 0; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.segment-switch button:first-child { border-radius: 6px 0 0 6px; }
.segment-switch button:last-child { border-right: 1px solid var(--ui-line); border-radius: 0 6px 6px 0; }
.segment-switch button.active { border-color: var(--ui-accent); background: var(--ui-accent); color: #fff; }
.color-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.color-field { min-width: 0; display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 7px; padding: 7px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; }
.color-field > span { font-size: 11px; font-weight: 750; }
.color-field .clr-field { width: 100%; }
.color-field input { width: 100%; min-width: 0; height: 32px; border: 0; background: transparent; }
.check-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.check-row label,.check-field { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; font-size: 12px; font-weight: 700; }
.check-field { margin-top: 8px; }
.check-row input,.check-field input { accent-color: var(--ui-accent); }
.range-row.labeled { grid-template-columns: 44px minmax(0,1fr) 52px; }
.range-row.labeled > span { color: var(--ui-muted); font-size: 11px; font-weight: 750; }
.range-row { display: grid; grid-template-columns: minmax(0,1fr) 52px; align-items: center; gap: 10px; margin-bottom: 10px; }
.range-row input[type="range"] { width: 100%; accent-color: var(--ui-accent); }
.range-row output { text-align: right; color: var(--ui-muted); font-size: 11px; font-weight: 750; }
.hint-note { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--ui-line-strong); background: #f3f1f6; color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
.empty-note { margin: 4px 0; color: var(--ui-muted); font-size: 11px; }
.export-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.export-grid .button { min-height: 42px; }

/* ---- 帧条 ---- */
.frame-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.frame-chip { position: relative; min-width: 0; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; padding: 0; border: 1px solid var(--ui-line); border-radius: 5px; background: #efedf2; cursor: grab; font-size: 11px; font-weight: 800; color: var(--ui-muted); transition: transform .16s ease, opacity .16s ease, border-color .16s ease, box-shadow .16s ease, filter .16s ease; }
.frame-chip.active { border-color: var(--ui-accent); box-shadow: inset 0 0 0 2px var(--ui-accent); color: var(--ui-accent-dark); }
.frame-chip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.frame-chip-index { position: relative; z-index: 1; min-width: 20px; padding: 2px 6px; border-radius: 3px; background: rgba(255,255,255,.88); box-shadow: 0 1px 4px rgba(30,24,42,.14); }
.frame-chip-grip { position: absolute; z-index: 2; right: 3px; bottom: 1px; color: rgba(45,37,58,.62); font: 900 9px/1 var(--font-mono); letter-spacing: -1px; text-shadow: 0 1px 2px rgba(255,255,255,.8); pointer-events: none; }
.frame-chip::before { content: ""; position: absolute; z-index: 4; top: 3px; bottom: 3px; width: 7px; border-radius: 5px; background: #2878ff; box-shadow: 0 0 0 2px #fff, 0 0 14px 4px rgba(40,120,255,.5); opacity: 0; transform: scaleY(.55); transition: opacity .1s ease, transform .1s ease; pointer-events: none; }
.frame-strip.is-reordering { padding: 4px; margin: -4px; border-radius: 8px; background: rgba(40,120,255,.08); box-shadow: inset 0 0 0 1px rgba(40,120,255,.32); }
.frame-strip.is-reordering .frame-chip:not(.is-dragging) { filter: saturate(.82); }
.frame-chip.is-dragging { opacity: .24; transform: scale(.88); border-style: dashed; border-color: #2878ff; cursor: grabbing; }
.frame-chip.drop-before,.frame-chip.drop-after { transform: translateY(-3px) scale(1.06); border-width: 2px; border-color: #2878ff; box-shadow: 0 8px 18px rgba(40,120,255,.24); filter: none !important; }
.frame-chip.drop-before::before { left: 3px; opacity: 1; transform: scaleY(1); }
.frame-chip.drop-after::before { right: 3px; opacity: 1; transform: scaleY(1); }
.frame-drag-ghost { position: fixed !important; z-index: 9999; top: -9999px; left: -9999px; opacity: .96; transform: rotate(2deg) scale(1.08); border: 2px solid #2878ff; box-shadow: 0 14px 34px rgba(28,21,38,.34); pointer-events: none; }
.frame-chip.just-moved { animation: frame-settle .5s ease both; }
@keyframes frame-settle { 0% { transform: scale(.86); box-shadow: 0 0 0 5px rgba(40,120,255,.34); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---- 立绘条目 ---- */
.sprite-list { display: grid; gap: 8px; }
.sprite-item { padding: 9px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; }
.sprite-item-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.sprite-item-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sprite-item-actions { display: flex; gap: 3px; }
.sprite-item-actions button { width: 26px; height: 26px; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; }
.sprite-thumb { width: 100%; height: 46px; margin-bottom: 8px; object-fit: contain; background: #f2f0f5; border-radius: 4px; }

/* ---- 选项框编辑 ---- */
.widget-block { padding: 10px; margin-bottom: 8px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; }
.widget-block:last-child { margin-bottom: 0; }
.widget-block .check-field { border: 0; background: transparent; padding: 0; min-height: 30px; gap: 8px; }
.widget-block .check-field b { font-size: 12px; }
.widget-block .check-field small { color: var(--ui-muted); font-size: 10px; font-weight: 600; }
.widget-block .field { margin: 8px 0 0; }
.choice-rows { display: grid; gap: 7px; margin-top: 10px; }
.choice-row { display: grid; grid-template-columns: 30px minmax(0,1fr) 26px; align-items: center; gap: 6px; }
.choice-row input[type="text"] { min-height: 38px; min-width: 0; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; font-size: 13px; }
.choice-row > label { display: grid; place-items: center; height: 38px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; }
.choice-row > label input { accent-color: var(--ui-accent); margin: 0; }
.choice-row > button { width: 26px; height: 26px; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; }

/* ---- 贴纸面板 ---- */
.preset-sticker-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 10px; }
.preset-sticker-grid button { min-height: 34px; padding: 5px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; cursor: pointer; font-size: 10px; font-weight: 800; }
.sticker-list { display: grid; gap: 6px; }
.sticker-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid var(--ui-line); border-radius: 5px; background: #fff; cursor: grab; }
.sticker-row.active { border-color: var(--ui-accent); background: var(--ui-accent-soft); }
.sticker-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sticker-row-actions { display: flex; gap: 3px; }
.sticker-row-actions button { width: 26px; height: 26px; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 11px; }
.sticker-editor { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ui-line); }
.sticker-editor-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin-top: 8px; }
.sticker-editor-actions button { min-height: 32px; border: 1px solid var(--ui-line); border-radius: 4px; background: #fff; cursor: pointer; font-size: 10px; }

/* ---- 预览区 ---- */
.preview-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 48px minmax(0,1fr); background: #d6d3da; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 11px; border-bottom: 1px solid var(--ui-line); background: #f5f4f7; }
.preview-toolbar > div { display: flex; align-items: center; gap: 9px; }
.preview-toolbar strong { font-size: 13px; }
.preview-toolbar #save-state { color: var(--ui-muted); font-size: 11px; }
.preview-actions { display: flex; gap: 5px; }
.preview-actions button { min-height: 34px; padding: 0 10px; font-size: 12px; }
.preview-actions button.active { border-color: var(--ui-accent); background: var(--ui-accent); color: #fff; }
.preview-viewport { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.preview-stage { position: relative; margin: 28px auto; }

/* ================= 画面基座 ================= */
.vn-stage {
  --vn-s: #4a4455; --vn-i: #f5f1f6; --vn-a: #d9b8c6; --vn-m: #b3a6bd; --vn-l: #c9b4c3;
  --vn-font: var(--font-ui);
  --vn-mono: var(--font-mono);
  --vn-scale: 1; --vn-line: 1.72;
  position: relative; width: 1280px; height: 720px; overflow: hidden;
  transform-origin: top left; background: #14121a; color: #fff;
  font-family: var(--vn-font); font-size: calc(16px * var(--vn-scale));
  box-shadow: 0 18px 44px rgba(30,26,40,.34);
}
.vn-stage.is-exporting { box-shadow: none; }
.vn-stage * { box-sizing: border-box; }
.vn-plate { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg,#2b2740,#181622); }
.vn-plate img.vn-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.vn-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
.vn-sprite { position: absolute; width: auto; transform: translate(-50%,-50%); pointer-events: auto; touch-action: none; cursor: move; }
.vn-sprite img { display: block; height: 100%; width: auto; max-width: none; object-fit: contain; transform: scaleX(var(--flip,1)); }
.vn-placeholder { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; color: rgba(255,255,255,.42); font-size: 22px; letter-spacing: .3em; }

/* ---- 对话框语义件（十二套共用同一套标记） ---- */
.vn-box { position: absolute; z-index: 4; pointer-events: none; }
.vn-name { font-weight: 800; }
.vn-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--vn-line); }
.vn-meta { font-family: var(--vn-mono); }
.vn-avatar { display: block; overflow: hidden; filter: var(--vn-avatar-filter, none); }
.vn-stage[data-avatar-filter="off"] .vn-avatar { filter: none; }
.vn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vn-tail { position: absolute; }
.vn-chrome { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.vn-mark { position: absolute; right: 12px; top: 12px; z-index: 8; padding: 3px 8px; border: 1px solid rgba(255,255,255,.4); background: rgba(18,14,26,.5); color: rgba(255,255,255,.82); font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; }

/* ---- 装饰性选项框 ---- */
/* top 由 layoutChoices() 在渲染时实测算出：先量出对话框及其伸出来的装饰件，
   再把选项框放进剩下的空当里。三档位置是这段空当里的比例，不是写死的像素，
   所以换版式、加到四条、正文换行都不会撞上。 */
.vn-choices { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); width: 560px; display: grid; gap: 13px; z-index: 5; }
.vn-choice { position: relative; display: block; padding: 13px 22px; font-size: 1.38em; line-height: 1.36; text-align: center; }

/* ================= 十二套版式 =================
   规则：对话框内部的装饰件一律做成 .vn-box 的子元素（.box-*），
   坐标相对对话框；只有真正贴着整块画面的装饰（黑边、扫描线、HUD、
   网格）才放进 .vn-chrome。这样对话框的几何只有一处来源，改高度
   不会漏改装饰件。                                                */
.vn-box > [class^="box-"] { position: absolute; }
.box-fill { z-index: 0; }
.vn-box > .vn-name,.vn-box > .vn-text,.vn-box > .vn-meta,.vn-box > .vn-avatar,.vn-box > .vn-tail { position: relative; z-index: 1; }

/* 01 暮樱 ADV */
.vn-stage[data-template="adv"] .vn-box { left: 44px; right: 44px; bottom: 34px; height: 208px; padding: 32px 38px 0; border: 2px solid color-mix(in srgb,var(--vn-l) 55%,transparent); background: color-mix(in srgb,var(--vn-s) 88%,transparent); box-shadow: inset 0 0 44px color-mix(in srgb,var(--vn-a) 14%,transparent); }
.vn-stage[data-template="adv"] .vn-name { position: absolute; left: -2px; top: -27px; display: flex; align-items: center; gap: 11px; height: 52px; padding: 0 24px 0 8px; background: var(--vn-a); color: color-mix(in srgb,var(--vn-s) 82%,#000); font-size: 1.38em; font-weight: 900; letter-spacing: .08em; }
.vn-stage[data-template="adv"] .vn-avatar { width: 38px; height: 38px; border: 1px solid color-mix(in srgb,var(--vn-s) 40%,transparent); }
.vn-stage[data-template="adv"] .vn-text { font-size: 1.7em; color: var(--vn-i); text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.vn-stage[data-template="adv"] .vn-meta { position: absolute; right: 66px; bottom: 22px; color: var(--vn-m); font-size: .82em; letter-spacing: .18em; }
.vn-stage[data-template="adv"] .vn-tail { position: absolute; right: 30px; bottom: 20px; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 11px solid var(--vn-m); }
.vn-stage[data-template="adv"] .vn-choice { border: 2px solid color-mix(in srgb,var(--vn-l) 55%,transparent); background: color-mix(in srgb,var(--vn-s) 82%,transparent); color: var(--vn-i); letter-spacing: .04em; }
.vn-stage[data-template="adv"] .vn-choice.is-active { background: var(--vn-a); border-color: var(--vn-a); color: color-mix(in srgb,var(--vn-s) 82%,#000); }

/* 02 黑白编辑部 */
.vn-stage[data-template="ed"] { --vn-font: var(--font-serif); }
.vn-stage[data-template="ed"] .vn-box { left: 0; right: 0; bottom: 0; height: 208px; padding: 40px 60px 0 248px; background: var(--vn-s); color: var(--vn-i); }
.vn-stage[data-template="ed"] .vn-name { padding-right: 220px; margin-bottom: 10px; font-size: 1.4em; font-weight: 900; letter-spacing: .22em; }
.vn-stage[data-template="ed"] .vn-avatar { position: absolute; left: 60px; top: 30px; width: 148px; height: 148px; border: 1px solid var(--vn-l); --vn-avatar-filter: grayscale(1) contrast(1.2); }
.vn-stage[data-template="ed"] .vn-text { font-size: 1.63em; font-weight: 500; }
.vn-stage[data-template="ed"] .vn-meta { position: absolute; right: 60px; top: 44px; color: var(--vn-m); font-size: .82em; letter-spacing: .22em; }
.vn-stage[data-template="ed"] .box-rule { left: 248px; right: 60px; top: 24px; height: 3px; background: var(--vn-a); }
.vn-stage[data-template="ed"] .vn-tail { display: none; }
.vn-stage[data-template="ed"] .vn-choices { width: 520px; gap: 10px; }
.vn-stage[data-template="ed"] .vn-choice { border: 2px solid var(--vn-l); background: var(--vn-s); color: var(--vn-i); font-weight: 700; text-align: left; }
.vn-stage[data-template="ed"] .vn-choice.is-active { background: var(--vn-i); color: var(--vn-s); }

/* 03 复古终端 */
.vn-stage[data-template="crt"] { --vn-font: "PoxiaoPixel", var(--font-mono); --vn-mono: "PoxiaoPixel", var(--font-mono); }
.vn-stage[data-template="crt"] .chrome-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg,transparent 0 2px,rgba(0,0,0,.34) 2px 4px); }
.vn-stage[data-template="crt"] .chrome-top { position: absolute; left: 28px; right: 28px; top: 24px; display: flex; justify-content: space-between; font-family: var(--vn-mono); font-size: 1.5em; letter-spacing: .18em; color: var(--vn-m); text-shadow: 0 0 8px color-mix(in srgb,var(--vn-a) 65%,transparent); }
.vn-stage[data-template="crt"] .chrome-corner { position: absolute; color: var(--vn-a); font-family: var(--vn-mono); font-size: 1.5em; opacity: .8; }
.vn-stage[data-template="crt"] .chrome-corner.tl { left: 34px; top: 62px; }
.vn-stage[data-template="crt"] .chrome-corner.tr { right: 34px; top: 62px; }
.vn-stage[data-template="crt"] .vn-box { left: 28px; right: 28px; bottom: 28px; height: 236px; padding: 24px 26px 0 186px; border: 2px solid var(--vn-l); background: color-mix(in srgb,var(--vn-s) 88%,transparent); box-shadow: 0 0 22px color-mix(in srgb,var(--vn-a) 24%,transparent), inset 0 0 30px color-mix(in srgb,var(--vn-a) 8%,transparent); }
.vn-stage[data-template="crt"] .vn-avatar { position: absolute; left: 22px; top: 22px; width: 140px; height: 140px; border: 2px solid var(--vn-l); --vn-avatar-filter: grayscale(1) sepia(1) hue-rotate(62deg) saturate(3.4) contrast(1.2); }
.vn-stage[data-template="crt"] .vn-name { position: absolute; left: 186px; top: -14px; padding: 2px 12px; background: color-mix(in srgb,var(--vn-s) 92%,#fff); color: var(--vn-m); border: 2px solid var(--vn-l); font-size: 1.5em; font-weight: 700; letter-spacing: .2em; }
.vn-stage[data-template="crt"] .vn-text { color: var(--vn-i); font-size: 1.5em; text-shadow: 0 0 7px color-mix(in srgb,var(--vn-a) 52%,transparent); }
.vn-stage[data-template="crt"] .vn-meta { position: absolute; left: 186px; bottom: 20px; color: var(--vn-m); font-size: 1.5em; letter-spacing: .18em; }
.vn-stage[data-template="crt"] .vn-tail { position: absolute; right: 30px; bottom: 24px; width: 13px; height: 22px; background: var(--vn-m); }
.vn-stage[data-template="crt"] .vn-choice { border: 2px solid var(--vn-l); background: color-mix(in srgb,var(--vn-s) 85%,transparent); color: var(--vn-i); font-size: 1.5em; text-align: left; padding-left: 52px; text-shadow: 0 0 7px color-mix(in srgb,var(--vn-a) 50%,transparent); }
.vn-stage[data-template="crt"] .vn-choice::before { content: ">"; position: absolute; left: 24px; color: var(--vn-a); }
.vn-stage[data-template="crt"] .vn-choice.is-active { background: color-mix(in srgb,var(--vn-a) 20%,transparent); }

/* 04 手记 */
.vn-stage[data-template="nv"] { --vn-font: var(--font-serif); }
.vn-stage[data-template="nv"] .vn-box { left: 70px; right: 70px; top: 47%; bottom: 40px; padding: 26px 44px 0; background: color-mix(in srgb,var(--vn-s) 95%,transparent); color: var(--vn-i); box-shadow: 0 -6px 30px rgba(30,20,12,.32); }
.vn-stage[data-template="nv"] .vn-name { display: block; padding-bottom: 10px; border-bottom: 1px solid var(--vn-l); margin-bottom: 18px; font-size: 1.13em; font-weight: 700; letter-spacing: .3em; color: color-mix(in srgb,var(--vn-a) 62%,var(--vn-m)); }
.vn-stage[data-template="nv"] .vn-avatar { position: absolute; z-index: 3; right: 40px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--vn-s); box-shadow: 0 4px 14px rgba(30,20,12,.4); --vn-avatar-filter: sepia(.5) saturate(.8); }
.vn-stage[data-template="nv"] .vn-text { font-size: 1.5em; line-height: calc(var(--vn-line) + .16); }
.vn-stage[data-template="nv"] .vn-meta { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: var(--vn-m); font-size: .82em; letter-spacing: .2em; }
.vn-stage[data-template="nv"] .vn-tail { display: none; }
.vn-stage[data-template="nv"] .vn-choices { width: 520px; gap: 9px; }
.vn-stage[data-template="nv"] .vn-choice { background: color-mix(in srgb,var(--vn-s) 92%,transparent); border-left: 5px solid var(--vn-l); color: var(--vn-i); font-family: var(--font-serif); text-align: left; }
.vn-stage[data-template="nv"] .vn-choice.is-active { border-left-color: var(--vn-a); color: var(--vn-a); font-weight: 700; }

/* 05 赛博终端 */
.vn-stage[data-template="cy"] { --vn-font: "WDXL Lubrifont SC", var(--font-ui); }
.vn-stage[data-template="cy"] .vn-box { left: 46px; right: 46px; bottom: 40px; height: 210px; padding: 26px 214px 0 40px; }
.vn-stage[data-template="cy"] .vn-box::before { content: ""; position: absolute; inset: 0; z-index: 0; background: color-mix(in srgb,var(--vn-s) 90%,transparent); border: 1px solid color-mix(in srgb,var(--vn-l) 50%,transparent); clip-path: polygon(0 0,calc(100% - 24px) 0,100% 24px,100% 100%,24px 100%,0 calc(100% - 24px)); }
.vn-stage[data-template="cy"] .box-tick { width: 20px; height: 20px; border: 1px solid var(--vn-l); }
.vn-stage[data-template="cy"] .box-tick.tl { left: 28px; top: -12px; border-right: 0; border-bottom: 0; }
.vn-stage[data-template="cy"] .box-tick.br { right: 28px; bottom: -12px; border-left: 0; border-top: 0; }
.vn-stage[data-template="cy"] .box-status { left: 40px; right: 40px; top: -32px; display: flex; justify-content: space-between; font-family: var(--vn-mono); font-size: .88em; letter-spacing: .22em; color: var(--vn-m); }
.vn-stage[data-template="cy"] .vn-name { font-family: var(--vn-font); font-size: 1.44em; font-weight: 700; letter-spacing: .26em; color: var(--vn-l); margin-bottom: 14px; }
.vn-stage[data-template="cy"] .vn-name::before { content: "// "; color: var(--vn-a); }
.vn-stage[data-template="cy"] .vn-text { font-size: 1.57em; color: var(--vn-i); }
.vn-stage[data-template="cy"] .vn-avatar { position: absolute; right: 40px; top: 26px; width: 152px; height: 152px; border: 1px solid color-mix(in srgb,var(--vn-l) 50%,transparent); --vn-avatar-filter: grayscale(.85) contrast(1.15) brightness(.9); }
.vn-stage[data-template="cy"] .vn-meta { position: absolute; left: 62px; bottom: 20px; font-size: .88em; letter-spacing: .2em; color: var(--vn-m); }
.vn-stage[data-template="cy"] .vn-tail { position: absolute; left: 40px; bottom: 22px; width: 9px; height: 9px; background: var(--vn-a); }
.vn-stage[data-template="cy"] .vn-choice { background: color-mix(in srgb,var(--vn-s) 88%,transparent); border: 1px solid color-mix(in srgb,var(--vn-l) 45%,transparent); color: var(--vn-i); font-family: var(--vn-font); font-size: 1.26em; letter-spacing: .06em; text-align: left; padding-left: 56px; clip-path: polygon(0 0,calc(100% - 14px) 0,100% 14px,100% 100%,14px 100%,0 calc(100% - 14px)); }
.vn-stage[data-template="cy"] .vn-choice::before { content: "//"; position: absolute; left: 22px; color: var(--vn-m); }
.vn-stage[data-template="cy"] .vn-choice.is-active { border-color: var(--vn-a); }
.vn-stage[data-template="cy"] .vn-choice.is-active::before { color: var(--vn-a); }

/* 06 绘本 */
.vn-stage[data-template="sb"] { --vn-font: var(--font-serif); }
.vn-stage[data-template="sb"] .vn-box { left: 132px; right: 132px; bottom: 54px; height: 190px; padding: 46px 46px 0 178px; border-radius: 30px; background: color-mix(in srgb,var(--vn-s) 95%,transparent); color: var(--vn-i); box-shadow: 0 14px 34px rgba(90,60,40,.3); }
.vn-stage[data-template="sb"] .vn-avatar { position: absolute; left: 34px; top: -34px; width: 132px; height: 132px; border-radius: 50%; border: 6px solid var(--vn-s); background: var(--vn-l); box-shadow: 0 6px 18px rgba(90,60,40,.26); }
.vn-stage[data-template="sb"] .vn-name { position: absolute; left: 182px; top: -18px; padding: 5px 20px; border-radius: 999px; background: var(--vn-a); color: var(--vn-s); font-size: 1.19em; font-weight: 700; letter-spacing: .1em; }
.vn-stage[data-template="sb"] .vn-text { font-size: 1.57em; }
.vn-stage[data-template="sb"] .vn-meta { position: absolute; left: 178px; bottom: 18px; color: var(--vn-m); font-size: .82em; letter-spacing: .2em; }
.vn-stage[data-template="sb"] .vn-tail { position: absolute; right: 40px; bottom: 22px; width: 76px; height: 14px; background: radial-gradient(circle at 12px 14px,transparent 11px,var(--vn-m) 11px 13px,transparent 13px) repeat-x; background-size: 25px 14px; }
.vn-stage[data-template="sb"] .vn-choices { width: 500px; gap: 15px; }
.vn-stage[data-template="sb"] .vn-choice { border-radius: 999px; border: 4px solid var(--vn-l); background: color-mix(in srgb,var(--vn-s) 95%,transparent); color: var(--vn-i); font-family: var(--font-serif); font-weight: 700; }
.vn-stage[data-template="sb"] .vn-choice.is-active { background: var(--vn-a); border-color: var(--vn-a); color: var(--vn-s); }

/* 07 杂志 —— 对话框整条横跨底部，左右两块都由它自己画 */
.vn-stage[data-template="mg"] .vn-box { left: 0; right: 0; bottom: 0; height: 330px; padding: 150px 56px 0 392px; color: var(--vn-i); }
.vn-stage[data-template="mg"] .box-fill.left { left: 0; bottom: 0; width: 336px; height: 330px; background: var(--vn-a); }
.vn-stage[data-template="mg"] .box-fill.right { left: 336px; right: 0; bottom: 0; height: 214px; background: var(--vn-s); }
.vn-stage[data-template="mg"] .box-rule { left: 392px; right: 56px; top: 134px; height: 1px; background: var(--vn-l); z-index: 1; }
.vn-stage[data-template="mg"] .vn-name { position: absolute; left: 26px; top: 28px; width: 284px; font-family: var(--font-serif); font-size: 2.75em; font-weight: 900; line-height: 1.14; letter-spacing: .02em; color: var(--vn-s); }
.vn-stage[data-template="mg"] .vn-avatar { position: absolute; left: 26px; bottom: 26px; width: 116px; height: 116px; border: 5px solid var(--vn-s); }
.vn-stage[data-template="mg"] .vn-text { font-family: var(--font-serif); font-size: 1.63em; }
.vn-stage[data-template="mg"] .vn-meta { position: absolute; left: 26px; top: 158px; width: 284px; color: var(--vn-s); font-size: .82em; letter-spacing: .24em; opacity: .88; }
.vn-stage[data-template="mg"] .vn-tail { position: absolute; right: 44px; bottom: 24px; width: 30px; height: 3px; background: var(--vn-a); }
.vn-stage[data-template="mg"] .vn-choices { width: 540px; gap: 8px; }
.vn-stage[data-template="mg"] .vn-choice { background: var(--vn-s); border-left: 10px solid var(--vn-a); color: var(--vn-i); font-family: var(--font-serif); text-align: left; }
.vn-stage[data-template="mg"] .vn-choice.is-active { background: var(--vn-a); border-left-color: var(--vn-i); color: var(--vn-s); }

/* 08 像素游戏 */
.vn-stage[data-template="px"] { --vn-font: "OC Fusion Pixel", var(--font-mono); --vn-mono: "OC Fusion Pixel", var(--font-mono); }
.vn-stage[data-template="px"] .chrome-hud { position: absolute; left: 34px; top: 30px; display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--vn-s); box-shadow: 0 0 0 4px var(--vn-s),0 0 0 8px var(--vn-a); font-family: var(--vn-mono); }
.vn-stage[data-template="px"] .chrome-hud b { font-size: 1.25em; letter-spacing: .18em; color: var(--vn-a); }
.vn-stage[data-template="px"] .chrome-hp { width: 190px; height: 16px; background: color-mix(in srgb,var(--vn-s) 70%,var(--vn-m)); box-shadow: 0 0 0 3px var(--vn-l); }
.vn-stage[data-template="px"] .chrome-hp i { display: block; width: 68%; height: 100%; background: var(--vn-m); }
.vn-stage[data-template="px"] .vn-box { left: 34px; right: 34px; bottom: 32px; height: 224px; padding: 30px 32px 0 190px; background: var(--vn-s); box-shadow: 0 0 0 4px var(--vn-s),0 0 0 8px var(--vn-a),0 0 0 12px var(--vn-l); }
.vn-stage[data-template="px"] .vn-avatar { position: absolute; left: 24px; top: 24px; width: 140px; height: 140px; background: color-mix(in srgb,var(--vn-s) 70%,var(--vn-m)); box-shadow: 0 0 0 4px var(--vn-m); }
.vn-stage[data-template="px"] .vn-name { position: absolute; left: 190px; top: -16px; padding: 4px 14px; background: var(--vn-a); color: var(--vn-s); font-size: 1.25em; font-weight: 700; letter-spacing: .16em; }
.vn-stage[data-template="px"] .vn-text { font-size: 1.875em; line-height: calc(var(--vn-line) + .1); color: var(--vn-i); letter-spacing: .04em; }
.vn-stage[data-template="px"] .vn-meta { position: absolute; left: 190px; bottom: 22px; color: var(--vn-m); font-size: 1.25em; letter-spacing: .16em; }
.vn-stage[data-template="px"] .vn-tail { position: absolute; right: 30px; bottom: 22px; width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 14px solid var(--vn-a); }
.vn-stage[data-template="px"] .vn-choices { width: 500px; gap: 18px; }
.vn-stage[data-template="px"] .vn-choice { background: var(--vn-s); color: var(--vn-i); font-size: 1.25em; letter-spacing: .05em; text-align: left; padding-left: 52px; box-shadow: 0 0 0 4px var(--vn-s),0 0 0 8px var(--vn-a); }
.vn-stage[data-template="px"] .vn-choice.is-active::before { content: "\25B6"; position: absolute; left: 22px; font-size: .8em; color: var(--vn-a); }

/* 09 欧风 */
.vn-stage[data-template="eu"] { --vn-font: "Xiangcui-W15", var(--font-serif); --vn-display: "Xiangcui-W40", var(--font-serif); }
.vn-stage[data-template="eu"] .vn-box { left: 62px; right: 62px; bottom: 42px; height: 216px; padding: 40px 54px 0; background: linear-gradient(color-mix(in srgb,var(--vn-s) 93%,transparent),color-mix(in srgb,var(--vn-s) 95%,#000)); border: 3px double var(--vn-l); box-shadow: 0 0 0 1px color-mix(in srgb,var(--vn-a) 40%,transparent), inset 0 0 34px color-mix(in srgb,var(--vn-a) 12%,transparent); }
.vn-stage[data-template="eu"] .box-corner { width: 16px; height: 16px; background: var(--vn-a); transform: rotate(45deg); z-index: 1; }
.vn-stage[data-template="eu"] .box-corner.tl { left: -9px; top: -9px; }
.vn-stage[data-template="eu"] .box-corner.tr { right: -9px; top: -9px; }
.vn-stage[data-template="eu"] .box-corner.bl { left: -9px; bottom: -9px; }
.vn-stage[data-template="eu"] .box-corner.br { right: -9px; bottom: -9px; }
.vn-stage[data-template="eu"] .vn-name { position: absolute; left: 0; right: 0; top: -19px; text-align: center; }
.vn-stage[data-template="eu"] .vn-name > span { font-family: var(--vn-display); display: inline-block; padding: 4px 30px; background: var(--vn-s); border-top: 1px solid var(--vn-l); border-bottom: 1px solid var(--vn-l); color: var(--vn-m); font-size: 1.32em; font-weight: 700; letter-spacing: .4em; text-indent: .4em; }
.vn-stage[data-template="eu"] .vn-text { font-size: 1.63em; color: var(--vn-i); text-align: center; }
.vn-stage[data-template="eu"] .vn-avatar { position: absolute; left: 46px; top: 50%; width: 112px; height: 138px; margin-top: -69px; border-radius: 50% / 46%; border: 3px solid var(--vn-l); box-shadow: 0 0 0 1px color-mix(in srgb,var(--vn-a) 45%,transparent), 0 6px 18px rgba(0,0,0,.45); }
.vn-stage[data-template="eu"] .vn-box.has-avatar { padding-left: 190px; padding-right: 190px; }
.vn-stage[data-template="eu"] .vn-meta { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; color: var(--vn-a); font-size: .94em; letter-spacing: .5em; text-indent: .5em; }
.vn-stage[data-template="eu"] .vn-tail { display: none; }
.vn-stage[data-template="eu"] .vn-choices { width: 520px; gap: 12px; }
.vn-stage[data-template="eu"] .vn-choice { background: color-mix(in srgb,var(--vn-s) 92%,transparent); border-top: 1px solid var(--vn-l); border-bottom: 1px solid var(--vn-l); color: var(--vn-i); font-family: var(--vn-font); letter-spacing: .12em; }
.vn-stage[data-template="eu"] .vn-choice.is-active { color: var(--vn-a); }
.vn-stage[data-template="eu"] .vn-choice.is-active::before { content: "\2756"; position: absolute; left: 28px; font-size: .68em; }

/* 10 胶片放映 —— 对话框铺满整幅，字幕靠底居中 */
.vn-stage[data-template="fm"] .chrome-bar { position: absolute; left: 0; right: 0; height: 92px; background: var(--vn-s); }
.vn-stage[data-template="fm"] .chrome-bar.top { top: 0; }
.vn-stage[data-template="fm"] .chrome-bar.bottom { bottom: 0; height: 132px; }
.vn-stage[data-template="fm"] .chrome-perf { position: absolute; top: 0; bottom: 0; width: 26px; display: flex; flex-direction: column; justify-content: space-around; padding: 8px 0; }
.vn-stage[data-template="fm"] .chrome-perf.l { left: 0; }
.vn-stage[data-template="fm"] .chrome-perf.r { right: 0; }
.vn-stage[data-template="fm"] .chrome-perf i { display: block; width: 14px; height: 20px; margin: 0 auto; border-radius: 2px; background: var(--vn-m); }
.vn-stage[data-template="fm"] .chrome-grain { position: absolute; inset: 0; background: radial-gradient(circle at 22% 32%,rgba(255,255,255,.05) 0 1px,transparent 1px),radial-gradient(circle at 68% 71%,rgba(0,0,0,.07) 0 1px,transparent 1px); background-size: 9px 9px,13px 13px; }
.vn-stage[data-template="fm"] .vn-box { inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 0 14% 42px; text-align: center; pointer-events: none; }
.vn-stage[data-template="fm"] .vn-name { margin-bottom: 8px; color: var(--vn-a); font-family: var(--font-mono); font-size: .94em; font-weight: 700; letter-spacing: .3em; }
.vn-stage[data-template="fm"] .vn-text { max-width: 100%; font-size: 1.82em; line-height: 1.5; color: var(--vn-i); text-shadow: 0 2px 6px rgba(0,0,0,.9); }
.vn-stage[data-template="fm"] .vn-meta { position: absolute; left: 34px; bottom: 30px; color: var(--vn-a); font-family: var(--font-mono); font-size: .94em; letter-spacing: .16em; }
.vn-stage[data-template="fm"] .vn-avatar { position: absolute; left: 34px; top: 116px; width: 96px; height: 96px; border: 2px solid color-mix(in srgb,var(--vn-l) 55%,transparent); --vn-avatar-filter: contrast(1.1) saturate(.85); }
.vn-stage[data-template="fm"] .vn-tail { display: none; }
.vn-stage[data-template="fm"] .vn-choices { width: 560px; gap: 10px; }
.vn-stage[data-template="fm"] .vn-choice { background: color-mix(in srgb,var(--vn-s) 70%,transparent); color: var(--vn-i); font-family: var(--font-mono); font-size: 1.26em; letter-spacing: .08em; }
.vn-stage[data-template="fm"] .vn-choice.is-active { color: var(--vn-a); }

/* 11 档案 */
.vn-stage[data-template="ar"] { --vn-font: var(--font-mono); }
.vn-stage[data-template="ar"] .vn-box { left: 40px; right: 40px; bottom: 36px; height: 226px; padding: 54px 40px 0 116px; background: var(--vn-s); color: var(--vn-i); box-shadow: 0 8px 22px rgba(30,22,12,.42); }
.vn-stage[data-template="ar"] .vn-meta { position: absolute; left: 0; right: 0; top: 0; height: 36px; display: flex; align-items: center; padding: 0 22px 0 116px; background: var(--vn-a); color: var(--vn-m); font-size: .88em; letter-spacing: .28em; }
.vn-stage[data-template="ar"] .box-punch { left: 46px; top: 66px; width: 22px; height: 158px; z-index: 1; background: radial-gradient(circle at 11px 11px,color-mix(in srgb,var(--vn-i) 30%,transparent) 11px,transparent 11px) repeat-y; background-size: 22px 68px; }
.vn-stage[data-template="ar"] .vn-name { margin: 0 0 12px; font-size: 1.19em; font-weight: 700; letter-spacing: .16em; }
.vn-stage[data-template="ar"] .vn-name::before { content: "SUBJECT \25B8 "; color: var(--vn-a); }
.vn-stage[data-template="ar"] .vn-text { font-size: 1.38em; line-height: calc(var(--vn-line) + .02); }
.vn-stage[data-template="ar"] .vn-avatar { position: absolute; z-index: 3; right: 44px; top: -54px; width: 116px; height: 142px; border: 5px solid var(--vn-m); box-shadow: 0 6px 16px rgba(30,22,12,.45); transform: rotate(2.5deg); --vn-avatar-filter: sepia(.55) contrast(1.05); }
.vn-stage[data-template="ar"] .vn-tail { position: absolute; right: 182px; top: -24px; padding: 5px 16px; background: var(--vn-m); color: var(--vn-a); font-size: .82em; font-weight: 700; letter-spacing: .2em; transform: rotate(-3deg); box-shadow: 0 3px 9px rgba(30,22,12,.35); }
.vn-stage[data-template="ar"] .vn-tail::after { content: "CONFIDENTIAL"; }
.vn-stage[data-template="ar"] .vn-choices { width: 540px; gap: 8px; }
.vn-stage[data-template="ar"] .vn-choice { background: var(--vn-s); color: var(--vn-i); font-size: 1.26em; text-align: left; padding-left: 58px; box-shadow: 0 4px 12px rgba(30,22,12,.32); }
.vn-stage[data-template="ar"] .vn-choice::before { content: "\25A1"; position: absolute; left: 24px; }
.vn-stage[data-template="ar"] .vn-choice.is-active::before { content: "\25A0"; color: var(--vn-a); }

/* 12 粗野主义 */
.vn-stage[data-template="br"] .chrome-grid { position: absolute; inset: 0; background: repeating-linear-gradient(90deg,transparent 0 79px,color-mix(in srgb,var(--vn-l) 17%,transparent) 79px 80px); }
.vn-stage[data-template="br"] .vn-box { left: 36px; right: 36px; bottom: 36px; height: 216px; padding: 40px 40px 0 300px; background: var(--vn-s); color: var(--vn-i); border: 9px solid var(--vn-l); }
.vn-stage[data-template="br"] .vn-avatar { position: absolute; left: 0; top: 0; width: 250px; height: 100%; border-right: 9px solid var(--vn-l); --vn-avatar-filter: grayscale(1) contrast(1.32); }
.vn-stage[data-template="br"] .vn-name { position: absolute; left: -9px; bottom: 100%; padding: 8px 24px; background: var(--vn-a); color: var(--vn-i); border: 9px solid var(--vn-l); font-size: 1.88em; font-weight: 900; letter-spacing: -.01em; }
.vn-stage[data-template="br"] .vn-text { font-size: 1.75em; font-weight: 700; line-height: 1.52; }
.vn-stage[data-template="br"] .vn-meta { position: absolute; right: -9px; bottom: -9px; padding: 7px 18px; background: var(--vn-l); color: var(--vn-a); font-size: .94em; letter-spacing: .2em; }
.vn-stage[data-template="br"] .vn-tail { display: none; }
.vn-stage[data-template="br"] .vn-choices { width: 560px; gap: 0; }
.vn-stage[data-template="br"] .vn-choice { background: var(--vn-s); border: 7px solid var(--vn-l); border-bottom-width: 0; color: var(--vn-i); font-weight: 900; text-align: left; }
.vn-stage[data-template="br"] .vn-choice:last-child { border-bottom-width: 7px; }
.vn-stage[data-template="br"] .vn-choice.is-active { background: var(--vn-a); }

/* ---- 空字段：名字与小字为空时不留空壳 ---- */
.vn-box[data-empty-name="true"] .vn-name { display: none; }
.vn-box[data-empty-meta="true"] .vn-meta { display: none; }
/* 档案的密级条是结构件，没有小字也要留着 */
.vn-stage[data-template="ar"] .vn-box[data-empty-meta="true"] .vn-meta { display: flex; }
/* 杂志的横线跟着小字所在的左块走，与小字无关 */
.vn-stage[data-template="mg"] .vn-box[data-empty-meta="true"] .vn-meta { display: none; }

/* ---- 暮樱：头像是名牌里的小方图，但它本身是对话框的直接子元素 ---- */
.vn-stage[data-template="adv"] .vn-name { padding: 0 24px 0 14px; }
.vn-stage[data-template="adv"] .vn-box.has-avatar .vn-name { padding-left: 56px; }
.vn-stage[data-template="adv"] .vn-avatar { position: absolute; left: 6px; top: -20px; z-index: 2; }

/* ================= 对话框装饰（候选） =================
   每个对话框只多三个空的 <i class="deco d1|d2|d3">，长相全部由 CSS 给，
   所以正式接入时渲染层只多三行标记，十二套各自的花样都在样式里。
   颜色一律取自那五个色槽，不引入新的颜色。                          */
.vn-box .deco { position: absolute; z-index: 2; pointer-events: none; }

/* 01 暮樱 ADV —— 名牌左侧的小菱形 / 框内顶部高光 / 右下角细斜线 */
.vn-stage[data-template="adv"] .d1 { left: -12px; top: -37px; width: 14px; height: 14px; background: var(--vn-a); transform: rotate(45deg); }
.vn-stage[data-template="adv"] .d2 { left: 26px; right: 26px; top: 6px; height: 1px; background: linear-gradient(90deg,transparent,color-mix(in srgb,var(--vn-l) 55%,transparent),transparent); }
.vn-stage[data-template="adv"] .d3 { right: 26px; bottom: 46px; width: 54px; height: 22px; background: repeating-linear-gradient(115deg,color-mix(in srgb,var(--vn-m) 46%,transparent) 0 1px,transparent 1px 7px); }

/* 02 黑白编辑部 —— 姓名下划线的方块端点 / 正文左侧引文竖线 / 右上角栏目号 */
.vn-stage[data-template="ed"] .d1 { left: 248px; top: 22px; width: 26px; height: 9px; background: var(--vn-a); }
.vn-stage[data-template="ed"] .d2 { left: 232px; top: 52px; bottom: 34px; width: 2px; background: var(--vn-l); opacity: .32; }
.vn-stage[data-template="ed"] .d3 { right: 60px; bottom: 26px; font: 800 13px/1 var(--font-mono); letter-spacing: .2em; color: var(--vn-m); }
.vn-stage[data-template="ed"] .d3::before { content: "\25a0 COLUMN 01"; }

/* 03 复古终端 —— 四角 ASCII 角标 / 底部虚线状态条 */
.vn-stage[data-template="crt"] .d1 { left: 8px; right: 8px; top: 4px; height: 0; }
.vn-stage[data-template="crt"] .d1::before,.vn-stage[data-template="crt"] .d1::after { position: absolute; top: 0; font: 400 18px/1 var(--vn-mono); color: var(--vn-a); opacity: .7; }
.vn-stage[data-template="crt"] .d1::before { content: "+"; left: 0; }
.vn-stage[data-template="crt"] .d1::after { content: "+"; right: 0; }
.vn-stage[data-template="crt"] .d2 { display: none; }  /* 头像旁的 01 02 03 行号列，按评审去掉 */
.vn-stage[data-template="crt"] .d3 { left: 186px; right: 26px; bottom: 12px; height: 2px; background: repeating-linear-gradient(90deg,var(--vn-l) 0 8px,transparent 8px 16px); opacity: .5; }

/* 04 手记 —— 纸卷上沿撕口 / 左侧装订孔 / 右下角墨点 */
.vn-stage[data-template="nv"] .d1 { left: 0; right: 0; top: -7px; height: 8px; background: repeating-linear-gradient(135deg,var(--vn-s) 0 7px,transparent 7px 14px); }
.vn-stage[data-template="nv"] .d2 { left: 16px; top: 40px; bottom: 40px; width: 10px; background: radial-gradient(circle at 5px 5px,color-mix(in srgb,var(--vn-l) 70%,transparent) 4px,transparent 4px) repeat-y; background-size: 10px 44px; }
.vn-stage[data-template="nv"] .d3 { right: 46px; bottom: 40px; width: 13px; height: 13px; border-radius: 50%; background: var(--vn-a); opacity: .34; }

/* 05 赛博终端 —— 右上阶梯短线 / 左缘数据竖条 / 切角亮点 */
.vn-stage[data-template="cy"] .d1 { right: 210px; top: 22px; width: 46px; height: 26px; background:
  linear-gradient(var(--vn-l),var(--vn-l)) 0 0/46px 2px no-repeat,
  linear-gradient(var(--vn-l),var(--vn-l)) 12px 8px/34px 2px no-repeat,
  linear-gradient(var(--vn-l),var(--vn-l)) 24px 16px/22px 2px no-repeat; opacity: .6; }
.vn-stage[data-template="cy"] .d2 { left: 18px; top: 44px; bottom: 44px; width: 4px; background: repeating-linear-gradient(180deg,var(--vn-m) 0 10px,transparent 10px 18px); opacity: .7; }
.vn-stage[data-template="cy"] .d3 { right: 2px; top: 2px; width: 5px; height: 5px; background: var(--vn-a); }

/* 06 绘本 —— 卡片四角圆点 / 名字旁小星 / 卡片外柔边 */
.vn-stage[data-template="sb"] .d1 { left: 22px; top: 22px; width: 9px; height: 9px; border-radius: 50%; background: var(--vn-m);
  box-shadow: 1064px 0 0 var(--vn-m), 0 132px 0 var(--vn-m), 1064px 132px 0 var(--vn-m); }
.vn-stage[data-template="sb"] .d2 { left: 158px; top: -14px; font: 700 22px/1 var(--font-serif); color: var(--vn-a); }
.vn-stage[data-template="sb"] .d2::before { content: "\2726"; }
.vn-stage[data-template="sb"] .d3 { inset: -12px; border-radius: 40px; border: 2px solid color-mix(in srgb,var(--vn-l) 55%,transparent); }

/* 07 杂志 —— 红块底部粗杠 / 正文栏大引号 / 栏底细线 */
.vn-stage[data-template="mg"] .d1 { left: 26px; bottom: 156px; width: 96px; height: 7px; background: var(--vn-s); }
.vn-stage[data-template="mg"] .d2 { left: 348px; top: 30px; font: 900 82px/.72 var(--font-serif); color: var(--vn-a); opacity: .22; }
.vn-stage[data-template="mg"] .d2::before { content: "\201c"; }
.vn-stage[data-template="mg"] .d3 { left: 392px; right: 56px; bottom: 18px; height: 1px; background: var(--vn-l); opacity: .35; }

/* 08 像素游戏 —— 四角像素块 / 正文前的箭头 / HUD 下的能量格 */
.vn-stage[data-template="px"] .d1 { left: 6px; top: 6px; width: 8px; height: 8px; background: var(--vn-a);
  box-shadow: 1180px 0 0 var(--vn-a), 0 196px 0 var(--vn-a), 1180px 196px 0 var(--vn-a); }
.vn-stage[data-template="px"] .d2 { left: 166px; top: 34px; width: 0; height: 0; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 10px solid var(--vn-a); }
.vn-stage[data-template="px"] .d3 { left: 190px; bottom: 54px; width: 132px; height: 8px; background: repeating-linear-gradient(90deg,var(--vn-m) 0 8px,transparent 8px 14px); opacity: .8; }

/* 09 欧风 —— 框内四角卷草 / 名牌两侧菱形 / 正文上方细饰线 */
.vn-stage[data-template="eu"] .d1 { left: 18px; right: 18px; top: 10px; height: 0; }
.vn-stage[data-template="eu"] .d1::before,.vn-stage[data-template="eu"] .d1::after { position: absolute; top: 0; font: 400 20px/1 var(--font-serif); color: var(--vn-a); opacity: .8; }
.vn-stage[data-template="eu"] .d1::before { content: "\2766"; left: 0; }
.vn-stage[data-template="eu"] .d1::after { content: "\2767"; right: 0; }
.vn-stage[data-template="eu"] .d2 { left: 50%; top: -12px; width: 0; height: 9px; }
.vn-stage[data-template="eu"] .d2::before,.vn-stage[data-template="eu"] .d2::after { content: ""; position: absolute; top: 0; width: 9px; height: 9px; background: var(--vn-a); transform: rotate(45deg); }
.vn-stage[data-template="eu"] .d2::before { left: -134px; }
.vn-stage[data-template="eu"] .d2::after { left: 125px; }
.vn-stage[data-template="eu"] .d3 { left: 50%; top: 30px; width: 120px; margin-left: -60px; height: 1px; background: linear-gradient(90deg,transparent,var(--vn-l),transparent); }

/* 10 胶片放映 —— 字幕上方细线 / 左上 REC 点 / 右下帧号框 */
.vn-stage[data-template="fm"] .d1 { left: 22%; right: 22%; bottom: 128px; height: 1px; background: color-mix(in srgb,var(--vn-i) 40%,transparent); }
.vn-stage[data-template="fm"] .d2 { left: 34px; top: 34px; width: 13px; height: 13px; border-radius: 50%; background: #c8432e; box-shadow: 0 0 10px rgba(200,67,46,.7); }
.vn-stage[data-template="fm"] .d3 { right: 34px; bottom: 30px; padding: 3px 10px; border: 1px solid color-mix(in srgb,var(--vn-i) 45%,transparent); font: 400 14px/1.3 var(--font-mono); letter-spacing: .16em; color: var(--vn-i); }
.vn-stage[data-template="fm"] .d3::before { content: "24 FPS"; }

/* 11 档案 —— 右下条形码 / 卡纸右上折角 / 密级条右端斜纹 */
.vn-stage[data-template="ar"] .d1 { right: 40px; bottom: 22px; width: 118px; height: 26px; background: repeating-linear-gradient(90deg,var(--vn-i) 0 2px,transparent 2px 5px,var(--vn-i) 5px 6px,transparent 6px 11px); opacity: .72; }
.vn-stage[data-template="ar"] .d2 { right: 0; top: 36px; width: 0; height: 0; border-top: 26px solid color-mix(in srgb,var(--vn-i) 22%,transparent); border-left: 26px solid transparent; }
.vn-stage[data-template="ar"] .d3 { right: 0; top: 0; width: 92px; height: 36px; background: repeating-linear-gradient(115deg,color-mix(in srgb,var(--vn-m) 60%,transparent) 0 3px,transparent 3px 9px); }

/* 12 粗野主义 —— 右上黑三角 / 正文左侧黄竖条 / 底部黑白条纹 */
.vn-stage[data-template="br"] .d1 { right: 0; top: 0; width: 0; height: 0; border-top: 36px solid var(--vn-l); border-left: 36px solid transparent; }
.vn-stage[data-template="br"] .d2 { left: 276px; top: 34px; bottom: 34px; width: 10px; background: var(--vn-a); }
.vn-stage[data-template="br"] .d3 { left: 300px; right: -9px; bottom: -9px; height: 14px; background: repeating-linear-gradient(90deg,var(--vn-l) 0 14px,transparent 14px 28px); }

/* ---- 欧风：对话框底部中央的花饰 ----
   素材 SVG/1.svg，viewBox 625.91×124.56（比例 5:1）。内联进标记而不是当图片贴，
   颜色才能由色槽驱动：主体走 --vn-ornament（默认指向强调色），原稿里那几块深色
   走 --vn-ornament-alt（默认由主体色压暗推出来），镂空保持 fill:none。
   内联路径也比 mask-image 更经得起导出——html-to-image 不必处理遮罩。 */
.vn-stage[data-template="eu"] {
  --vn-ornament: var(--vn-a);
  --vn-ornament-alt: color-mix(in srgb, var(--vn-a) 55%, #000);
}
.vn-stage[data-template="eu"] .box-ornament {
  position: absolute; left: 50%; bottom: 7px; width: 230px; height: 46px; margin-left: -115px;
  pointer-events: none; z-index: 2;
}
.vn-stage[data-template="eu"] .box-ornament svg { display: block; width: 100%; height: 100%; }
.vn-stage[data-template="eu"] .orn-main { fill: var(--vn-ornament); }
.vn-stage[data-template="eu"] .orn-alt { fill: var(--vn-ornament-alt); }
.vn-stage[data-template="eu"] .orn-none { fill: none; }
/* 正式使用时底部一般不填页码，花饰就压到最低；真填了页码就自动抬到它上面去 */
.vn-stage[data-template="eu"] .vn-box:not([data-empty-meta="true"]) .box-ornament { bottom: 44px; }
.vn-stage[data-template="eu"] .vn-box { height: 236px; }

.vn-stage[data-orient="portrait"][data-template="eu"] .vn-box { height: 340px; }
.vn-stage[data-orient="portrait"][data-template="eu"] .box-ornament { width: 200px; height: 40px; margin-left: -100px; bottom: 6px; }
.vn-stage[data-orient="portrait"][data-template="eu"] .vn-box:not([data-empty-meta="true"]) .box-ornament { bottom: 42px; }

/* 原来的 d3（正文上方一道渐隐细线）让位给花饰 */
.vn-stage[data-template="eu"] .d3 { display: none; }
/* ---- 逐条取舍（按评审结果）----
   没提到的六套按预览原样保留；提到的几套在这里开关。 */
/* 绘本：去掉四角圆点；外扩描边要落在头像与姓名后面，所以压到 z-index 0 */
.vn-stage[data-template="sb"] .d1 { display: none; }
.vn-stage[data-template="sb"] .d3 { z-index: 0; }
/* 胶片：只留右下角的 24 FPS 框 */
.vn-stage[data-template="fm"] .d1,
.vn-stage[data-template="fm"] .d2 { display: none; }
/* 粗野主义：去掉框底那排黑白条纹 */
.vn-stage[data-template="br"] .d3 { display: none; }
/* 像素游戏：四角像素块、正文前箭头、能量格一律不要 */
.vn-stage[data-template="px"] .d1,
.vn-stage[data-template="px"] .d2,
.vn-stage[data-template="px"] .d3 { display: none; }

/* ---- 档案：卡纸上覆一层淡网格，模拟笔记本 ----
   从密级条下方起铺；横线比竖线重一点，更像横格本而不是坐标纸。
   压在正文下面（正文是 z-index 1）。 */
.vn-stage[data-template="ar"] .box-grid {
  position: absolute; inset: 36px 0 0 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 37px, color-mix(in srgb, var(--vn-i) 13%, transparent) 37px 38px),
    repeating-linear-gradient(90deg, transparent 0 37px, color-mix(in srgb, var(--vn-i) 6%, transparent) 37px 38px);
}

/* ---- 竖屏下的装饰位置 ----
   装饰的坐标是照横屏的对话框画的，竖屏几套的内边距完全不同，
   直接沿用会压到正文，所以这三条单独给一份。 */
/* 复古终端：竖屏没有左侧栏，行号列无处可放，收起来 */
/* 黑白编辑部：竖线是横屏用来隔开左侧头像栏的，竖屏没有左栏，收起来 */
.vn-stage[data-orient="portrait"][data-template="ed"] .d2 { display: none; }
/* 杂志：红块从左栏变成顶部通栏，粗横杠跟着挪到band 底部 */
.vn-stage[data-orient="portrait"][data-template="mg"] .d1 { left: 40px; top: 96px; bottom: auto; }
/* 粗野主义：头像移出框外，黄竖条收进左侧内边距的空档 */
.vn-stage[data-orient="portrait"][data-template="br"] .d2 { left: 14px; }

/* ================= 小配件 =================
   十二套不各画一遍：字体从 --vn-font / --vn-mono 继承，颜色从五个色槽来，
   只有「边框怎么做」按版式给一份配方（--vn-chip-*）。整组用 grid 竖排，
   章节卡居中、右上角一列提示、左侧资料卡，行与行之间不可能叠在一起。      */
.vn-widgets { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.vn-chip {
  --vn-chip-bg: color-mix(in srgb, var(--vn-s) 88%, transparent);
  position: absolute; transform: translate(-50%,-50%) scale(var(--chip-scale,1));
  pointer-events: auto; touch-action: none; cursor: move;
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px;
  border: var(--vn-chip-border, 2px solid color-mix(in srgb, var(--vn-l) 60%, transparent));
  border-radius: var(--vn-chip-radius, 0);
  background: var(--vn-chip-bg); color: var(--vn-i);
  font-size: 1.06em; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere;
}
.vn-chip i { color: var(--vn-a); font-style: normal; font-size: 1.1em; }
.vn-chip[data-kind="chapter"] { padding: 12px 34px; font-size: 1.25em; letter-spacing: .22em; text-indent: .22em; }
.vn-chip[data-kind="system"] { color: var(--vn-m); font-family: var(--vn-mono); font-size: .94em; letter-spacing: .12em; }
.vn-profile { flex-direction: column; align-items: flex-start; gap: 6px; width: 300px; padding: 16px 20px; }
.vn-profile b { color: var(--vn-a); font-size: 1.19em; letter-spacing: .12em; }
.vn-profile span { color: var(--vn-i); font-size: .94em; opacity: .92; }
.vn-stage.stickers-only .vn-widgets { visibility: hidden; }

/* 边框配方：跟各套对话框自己的做法保持一致 */
.vn-stage[data-template="adv"] { --vn-chip-border: 2px solid color-mix(in srgb,var(--vn-l) 55%,transparent); }
.vn-stage[data-template="ed"] { --vn-chip-border: 2px solid var(--vn-l); --vn-chip-bg: var(--vn-s); }
.vn-stage[data-template="crt"] { --vn-chip-border: 2px solid var(--vn-l); }
.vn-stage[data-template="nv"] { --vn-chip-border: 1px solid var(--vn-l); --vn-chip-radius: 3px; --vn-chip-bg: color-mix(in srgb,var(--vn-s) 94%,transparent); }
.vn-stage[data-template="cy"] { --vn-chip-border: 1px solid color-mix(in srgb,var(--vn-l) 45%,transparent); }
.vn-stage[data-template="cy"] .vn-chip { clip-path: polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,12px 100%,0 calc(100% - 12px)); }
.vn-stage[data-template="sb"] { --vn-chip-border: 4px solid var(--vn-l); --vn-chip-radius: 999px; --vn-chip-bg: color-mix(in srgb,var(--vn-s) 95%,transparent); }
.vn-stage[data-template="sb"] .vn-profile { border-radius: 26px; }
.vn-stage[data-template="mg"] { --vn-chip-border: 0; --vn-chip-bg: var(--vn-s); }
.vn-stage[data-template="mg"] .vn-chip { border-left: 9px solid var(--vn-a); }
.vn-stage[data-template="px"] { --vn-chip-border: 0; --vn-chip-bg: var(--vn-s); }
.vn-stage[data-template="px"] .vn-chip { box-shadow: 0 0 0 4px var(--vn-s), 0 0 0 8px var(--vn-a); }
.vn-stage[data-template="eu"] { --vn-chip-border: 1px solid var(--vn-l); --vn-chip-bg: color-mix(in srgb,var(--vn-s) 92%,transparent); }
.vn-stage[data-template="eu"] .vn-chip { border-left: 0; border-right: 0; }
.vn-stage[data-template="fm"] { --vn-chip-border: 0; --vn-chip-bg: color-mix(in srgb,var(--vn-s) 72%,transparent); }
.vn-stage[data-template="ar"] { --vn-chip-border: 0; --vn-chip-bg: var(--vn-s); }
.vn-stage[data-template="ar"] .vn-chip { box-shadow: 0 4px 12px rgba(30,22,12,.32); }
.vn-stage[data-template="ar"] .vn-chip[data-kind="chapter"] { background: var(--vn-a); color: var(--vn-m); }
.vn-stage[data-template="br"] { --vn-chip-border: 7px solid var(--vn-l); --vn-chip-bg: var(--vn-s); }
.vn-stage[data-template="br"] .vn-chip[data-kind="chapter"] { background: var(--vn-a); }

.vn-stage[data-orient="portrait"] .vn-profile { width: 260px; }

/* ================= 竖屏 720×1280 =================
   横屏那套的侧栏是固定像素宽的（杂志红块 336、粗野头像 250、绘本卡片左右各缩进 132、
   欧风对称留白各 190、终端与像素的头像位 186/190）。这些数字不随画布缩放，掉到 720 宽
   就吃掉大半张画布，正文只剩八到十个字一行。所以竖屏不是压扁，而是把这些侧栏
   改成上下堆叠，把省下来的横向空间还给正文——竖屏多出来的 560px 纵向正好装得下。 */
.vn-stage[data-orient="portrait"] .vn-choices { width: 600px; }

/* 01 暮樱 ADV —— 只是把框加高，结构不动 */
.vn-stage[data-orient="portrait"][data-template="adv"] .vn-box { height: 300px; }

/* 02 黑白编辑部 —— 头像与姓名并排放到顶部，正文占满整宽 */
.vn-stage[data-orient="portrait"][data-template="ed"] .vn-box { height: 300px; padding: 52px 40px 0; }
.vn-stage[data-orient="portrait"][data-template="ed"] .vn-avatar { left: 40px; top: -59px; width: 118px; height: 118px; }
.vn-stage[data-orient="portrait"][data-template="ed"] .vn-name { margin: 0 0 26px 138px; padding: 0 0 12px; border-bottom: 2px solid var(--vn-l); }
.vn-stage[data-orient="portrait"][data-template="ed"] .vn-meta { right: 40px; top: 116px; }
.vn-stage[data-orient="portrait"][data-template="ed"] .box-rule { display: none; }

/* 03 复古终端 —— 头像缩小、字号降到 24（仍是 12 的整数倍） */
.vn-stage[data-orient="portrait"][data-template="crt"] .vn-box { height: 330px; padding: 84px 26px 0; }
.vn-stage[data-orient="portrait"][data-template="crt"] .vn-avatar { left: 26px; top: -50px; width: 100px; height: 100px; }
.vn-stage[data-orient="portrait"][data-template="crt"] .vn-name { left: 142px; top: -30px; }
.vn-stage[data-orient="portrait"][data-template="crt"] .vn-meta { left: 26px; }
.vn-stage[data-orient="portrait"][data-template="crt"] .vn-choice { font-size: 1.25em; }

/* 04 手记 —— 纸卷起点下移，横向本来就够 */
.vn-stage[data-orient="portrait"][data-template="nv"] .vn-box { left: 46px; right: 46px; top: 58%; }

/* 05 赛博终端 —— 头像从右侧挪到框内顶部 */
.vn-stage[data-orient="portrait"][data-template="cy"] .vn-box { height: 340px; padding: 106px 40px 0; }
.vn-stage[data-orient="portrait"][data-template="cy"] .vn-avatar { left: 40px; right: auto; top: -70px; width: 140px; height: 140px; }
.vn-stage[data-orient="portrait"][data-template="cy"] .vn-name { position: absolute; left: 200px; top: 34px; margin-bottom: 0; }

/* 06 绘本 —— 圆头像改成骑在卡片上沿正中，姓名居中挂它下面 */
.vn-stage[data-orient="portrait"][data-template="sb"] .vn-box { left: 40px; right: 40px; height: 340px; padding: 152px 40px 0; }
.vn-stage[data-orient="portrait"][data-template="sb"] .vn-avatar { left: 50%; margin-left: -66px; top: -66px; }
.vn-stage[data-orient="portrait"][data-template="sb"] .vn-name { left: 0; right: 0; top: 82px; padding: 0; border-radius: 0; background: transparent; text-align: center; }
.vn-stage[data-orient="portrait"][data-template="sb"] .vn-name > span { display: inline-block; padding: 5px 20px; border-radius: 999px; background: var(--vn-a); color: var(--vn-s); }
.vn-stage[data-orient="portrait"][data-template="sb"] .vn-meta { left: 40px; }

/* 07 杂志 —— 红色块从左栏改成顶部通栏，正文panel 落在下面 */
.vn-stage[data-orient="portrait"][data-template="mg"] .vn-box { height: 400px; padding: 168px 40px 0; }
.vn-stage[data-orient="portrait"][data-template="mg"] .box-fill.left { left: 0; right: 0; top: 0; bottom: 280px; width: auto; height: auto; }
.vn-stage[data-orient="portrait"][data-template="mg"] .box-fill.right { left: 0; right: 0; bottom: 0; height: 280px; }
.vn-stage[data-orient="portrait"][data-template="mg"] .box-rule { left: 40px; right: 40px; top: 138px; }
.vn-stage[data-orient="portrait"][data-template="mg"] .vn-name { left: 40px; right: 168px; top: 20px; width: auto; font-size: 1.9em; }
.vn-stage[data-orient="portrait"][data-template="mg"] .vn-avatar { left: auto; right: 40px; top: -52px; bottom: auto; width: 104px; height: 104px; }
.vn-stage[data-orient="portrait"][data-template="mg"] .vn-meta { left: 40px; right: 168px; top: 74px; bottom: auto; width: auto; }

/* 08 像素游戏 —— 头像上移到框内顶部，正文占满整宽 */
.vn-stage[data-orient="portrait"][data-template="px"] .vn-box { height: 330px; padding: 106px 32px 0; }
.vn-stage[data-orient="portrait"][data-template="px"] .vn-avatar { left: 24px; top: -70px; }
.vn-stage[data-orient="portrait"][data-template="px"] .vn-name { left: 190px; top: 26px; }
.vn-stage[data-orient="portrait"][data-template="px"] .vn-meta { left: 32px; }

/* 09 欧风 —— 椭圆浮雕从框内左侧改到框内顶部正中 */
.vn-stage[data-orient="portrait"][data-template="eu"] .vn-box { height: 340px; padding: 62px 54px 0; }
.vn-stage[data-orient="portrait"][data-template="eu"] .vn-box.has-avatar { padding-left: 54px; padding-right: 54px; }
.vn-stage[data-orient="portrait"][data-template="eu"] .vn-avatar { left: 50%; top: -158px; margin-top: 0; margin-left: -46px; width: 92px; height: 114px; }

/* 10 胶片放映 —— 黑边收窄，字幕两侧留白按比例缩 */
.vn-stage[data-orient="portrait"][data-template="fm"] .chrome-bar { height: 150px; }
.vn-stage[data-orient="portrait"][data-template="fm"] .chrome-bar.bottom { height: 210px; }
.vn-stage[data-orient="portrait"][data-template="fm"] .vn-box { padding: 0 8% 68px; }
.vn-stage[data-orient="portrait"][data-template="fm"] .vn-avatar { top: 174px; }

/* 11 档案 —— 卡片加高即可，装订孔跟着拉长 */
.vn-stage[data-orient="portrait"][data-template="ar"] .vn-box { height: 330px; }
.vn-stage[data-orient="portrait"][data-template="ar"] .box-punch { height: 226px; }
.vn-stage[data-orient="portrait"][data-template="ar"] .vn-tail { right: 150px; }

/* 12 粗野主义 —— 左侧整块头像改成顶部通栏 */
.vn-stage[data-orient="portrait"][data-template="br"] .vn-box { height: 320px; padding: 44px 40px 0; }
.vn-stage[data-orient="portrait"][data-template="br"] .vn-avatar { left: -9px; right: auto; top: auto; bottom: 100%; width: 150px; height: 150px; border: 9px solid var(--vn-l); border-bottom: 0; }
.vn-stage[data-orient="portrait"][data-template="br"] .vn-name { left: 141px; right: auto; top: auto; bottom: 100%; font-size: 1.5em; }

/* ---- 逐字出现 ---- */
/* 用 visibility 而不是 display，未出现的部分照样占位，换行位置和整句时一模一样 */
.vn-veil { visibility: hidden; }
@keyframes vnCharIn { from { opacity: 0; } to { opacity: 1; } }
.vn-char-in { animation: vnCharIn var(--vn-char-in,120ms) linear both; }
/* 录制时先出一张没有正文的底图，两张图的排版必须完全一致 */
.vn-stage.reveal-hide-text .vn-text { visibility: hidden; }

/* ================= 贴纸 ================= */
.sticker-layer { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.canvas-sticker { --x:50%; --y:20%; --w:160px; --h:54px; --r:0deg; position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); transform: translate(-50%,-50%) rotate(var(--r)); pointer-events: auto; touch-action: none; cursor: move; }
.canvas-sticker.is-hidden { display: none; }
.sticker-body { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.sticker-font-sans { font-family: var(--font-ui); }
.sticker-font-serif { font-family: var(--font-serif); }
.image-sticker .sticker-body img { width: 100%; height: 100%; object-fit: contain; }
.image-sticker .sticker-body.fit-cover img { object-fit: cover; }
.image-sticker .sticker-body.fit-stretch img { object-fit: fill; }
.canvas-sticker.is-selected:not(.is-locked),
.vn-sprite.is-selected,
.vn-chip.is-selected { outline: 3px solid var(--ui-accent); outline-offset: 3px; }
/* 手柄是编辑器 UI，不该跟着画面滤镜一起被染色 */
.sticker-handle { filter: none; }
.vn-sprite:not(.is-selected) .sticker-handle,
.vn-chip:not(.is-selected) .sticker-handle { display: none; }
.vn-stage.is-exporting .vn-sprite,
.vn-stage.is-exporting .vn-chip { outline: 0 !important; }
.sticker-handle { position: absolute; width: 28px; height: 28px; border: 2px solid var(--ui-accent); border-radius: 50%; background: #fff; cursor: pointer; touch-action: none; }
.resize-handle { right: -14px; bottom: -14px; cursor: nwse-resize; }
.rotate-handle { left: 50%; top: -44px; margin-left: -14px; cursor: grab; }
.rotate-handle::after { content: ""; position: absolute; left: 11px; top: 25px; width: 2px; height: 18px; background: var(--ui-accent); }
.canvas-sticker:not(.is-selected) .sticker-handle,.canvas-sticker.is-locked .sticker-handle,.vn-stage.is-exporting .sticker-handle { display: none; }
.vn-stage.is-exporting .canvas-sticker { outline: 0 !important; }
.vn-stage.stickers-only .vn-plate,.vn-stage.stickers-only .vn-chrome,.vn-stage.stickers-only .vn-box,.vn-stage.stickers-only .vn-choices,.vn-stage.stickers-only .vn-mark { visibility: hidden; }
.vn-stage.stickers-only { background: transparent; box-shadow: none; }

/* ================= 裁切弹窗 ================= */
.crop-modal[hidden] { display: none; }
.crop-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; }
.crop-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(28,24,36,.72); backdrop-filter: blur(4px); cursor: default; }
.crop-dialog { position: relative; width: min(720px,100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border-radius: 14px; background: var(--ui-card); box-shadow: 0 24px 90px rgba(0,0,0,.4); }
.crop-dialog header,.crop-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crop-dialog header small { color: var(--ui-accent); font: 800 9px/1 var(--font-mono); letter-spacing: .12em; }
.crop-dialog h2 { margin: 4px 0 0; font-family: var(--font-serif); font-size: 18px; }
.crop-dialog > p { margin: 10px 0 14px; color: var(--ui-muted); font-size: 12px; line-height: 1.6; }
.crop-stage { position: relative; display: grid; place-items: center; min-height: 180px; overflow: hidden; border: 1px solid var(--ui-line-strong); border-radius: 10px; background: #23202b; }
.crop-stage canvas { display: block; width: 100%; max-height: min(56dvh,560px); object-fit: contain; cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-stage > span { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 5px 8px; border-radius: 999px; background: rgba(22,19,28,.72); color: #fff; font-size: 10px; pointer-events: none; }
.crop-zoom { display: grid; grid-template-columns: 108px 1fr; align-items: center; gap: 12px; margin: 14px 0; font-size: 11px; font-weight: 750; }
.crop-zoom output { display: block; margin-top: 4px; color: var(--ui-accent); font: 800 10px/1 var(--font-mono); }
.crop-zoom input { width: 100%; accent-color: var(--ui-accent); }
.crop-dialog footer { justify-content: flex-end; }
body.crop-modal-open { overflow: hidden; }
@media (max-width:600px) {
  .crop-dialog { padding: 14px; }
  .crop-stage canvas { max-height: 50dvh; }
  .crop-zoom { grid-template-columns: 1fr; gap: 6px; }
}

/* ================= 播放模式 =================
   录屏时不该录进编辑器，所以把画面整个搬进这张全屏黑幕里播。
   画面元素还是同一个 #vn-stage，只是临时换了父节点，播完再搬回预览区。 */
.play-overlay[hidden] { display: none; }
.play-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: hidden; background: #000; cursor: pointer; }
.play-overlay.is-running { cursor: none; }
.play-hold { position: relative; display: block; flex: none; }
/* transform 不参与布局。原先让 1280px 画布作为 grid 子项居中，手机上会先按
   原尺寸排版再缩放，结果整块画面跑到屏幕右侧，只剩黑幕。固定到容器左上角后，
   容器与缩放后的画面拥有完全相同的边界。 */
.play-hold .vn-stage { position: absolute; left: 0; top: 0; transform-origin: top left; box-shadow: none; }
/* 播放时画面是成品不是编辑对象：贴纸、立绘、小配件的选中描边与缩放手柄一律不出现，
   点击也不再落到图层上（点击整个交给遮罩，用来开始／中断播放）。 */
.play-hold .vn-stage [data-layer] { pointer-events: none; }
.play-hold .vn-stage [data-layer].is-selected { outline: 0 !important; }
.play-hold .vn-stage .sticker-handle { display: none !important; }
.play-hint { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; padding: 14px 22px; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; background: rgba(18,16,24,.72); color: #fff; text-align: center; transition: opacity .25s ease; }
.play-hint b { font-size: 14px; font-weight: 800; }
.play-hint span { color: rgba(255,255,255,.62); font-size: 11.5px; }
.play-overlay.is-running .play-hint { opacity: 0; pointer-events: none; }
.play-exit { min-width: 116px; height: 36px; margin-top: 5px; padding: 0 14px; border: 1px solid rgba(255,255,255,.28); border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; font: 800 12px/1 var(--font-ui); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.play-exit:active { transform: scale(.97); }
@media (max-width:600px) {
  .play-hint { bottom: max(18px,env(safe-area-inset-bottom)); width: calc(100vw - 28px); padding: 12px 14px; }
  .play-hint span { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .play-hint { transition: none; } }

/* ================= 教程与提示 ================= */
.mobile-resizer,.mobile-main-tabs { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 140; max-width: calc(100vw - 32px); padding: 10px 14px; border-radius: 6px; background: var(--ui-accent-dark); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%,16px); transition: .16s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width:1280px) {
  .workspace { grid-template-columns:316px minmax(390px,1fr) 336px; }
  .brand { min-width:194px; }
  .brand-copy small { display:none; }
  .top-actions { gap:4px; }
  .button { padding-inline:10px; }
}
@media (max-width:900px) {
  :root { --topbar-height:62px; }
  .topbar { gap:8px; padding:0 10px; }
  .brand { min-width:44px; }
  .brand-copy,.project-field,.desktop-action { display:none; }
  .brand-mark { width:40px; height:40px; }
  .top-actions { width:calc(100% - 50px); justify-content:flex-end; gap:6px; }
  .top-actions .button { min-height:40px; padding:0 12px; }
  .workspace { --mobile-preview-height:42%; height:auto; min-height:0; grid-template-columns:1fr; grid-template-rows:var(--mobile-preview-height) 20px 48px minmax(0,1fr); grid-template-areas:"preview" "resizer" "tabs" "panel"; }
  .preview-panel { grid-area:preview; grid-template-rows:42px minmax(0,1fr); border-bottom:0; }
  .preview-toolbar { padding:0 8px; }
  .preview-viewport { overflow:auto; }
  .preview-stage { margin:0 auto; }
  .mobile-resizer { grid-area:resizer; display:grid; place-items:center; border-top:1px solid var(--ui-line); border-bottom:1px solid var(--ui-line); background:#f0eef3; cursor:row-resize; touch-action:none; user-select:none; z-index:12; }
  .mobile-resizer span { width:112px; height:5px; border-radius:4px; background:var(--ui-line-strong); pointer-events:none; }
  .mobile-main-tabs { grid-area:tabs; display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--ui-line); border-bottom:1px solid var(--ui-line); background:#f7f6f9; z-index:14; }
  .mobile-main-tabs button { border:0; border-right:1px solid var(--ui-line); background:transparent; font-size:13px; font-weight:850; }
  .mobile-main-tabs button:last-child { border-right:0; }
  .mobile-main-tabs button.active { background:var(--ui-accent-soft); box-shadow:inset 0 -3px var(--ui-accent); }
  .editor-panel { grid-area:panel; min-height:0; border:0; display:grid; grid-template-rows:minmax(0,1fr); }
  .panel-heading { display:none; }
  .panel-scroll { padding:12px 10px calc(20px + env(safe-area-inset-bottom)); scrollbar-gutter:auto; }
  body[data-active-mobile-panel="content"] .style-panel,body[data-active-mobile-panel="style"] .content-panel { display:none; }
  .editor-card { padding:13px; }
  .field input,.field textarea,.field select { min-height:42px; }
  .sticker-handle { width:36px; height:36px; }
  .resize-handle { right:-20px; bottom:-20px; }
  .rotate-handle { top:-52px; }
  .rotate-handle::after { left:15px; top:33px; }
  .toast { bottom:calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width:520px) {
  .top-actions .button { padding-inline:9px; font-size:12px; }
  .field-grid { grid-template-columns:1fr; gap:0; }
  .color-grid { grid-template-columns:1fr; }
  .preset-sticker-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .style-grid { grid-template-columns:1fr; }
  .frame-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .sticker-editor-actions { grid-template-columns:repeat(2,1fr); }
  .export-grid { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition-duration:.01s !important; animation-duration:.01s !important; scroll-behavior:auto !important; } }
