/* 画页 Studio — 界面样式 */
:root {
  --accent: #4f46e5; --accent-2: #6366f1; --accent-soft: #eef2ff; --accent-ink: #3730a3;
  --ink: #18181b; --ink-2: #3f3f46; --muted: #71717a; --line: #e4e4e7; --line-2: #d4d4d8;
  --bg: #f4f4f6; --panel: #ffffff; --stage: #e9e9ee; --top: #17171f; --top-2: #24242f;
  --danger: #dc2626; --radius: 10px; --shadow: 0 8px 30px rgba(15, 15, 30, .14), 0 2px 6px rgba(15, 15, 30, .06);
  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.view { display: none; height: 100%; }
.view.active { display: block; }
#editor.active { display: flex; flex-direction: column; }
.muted { color: var(--muted); font-size: 13px; }
kbd { font: 12px ui-monospace, Menlo, monospace; background: #f4f4f5; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--ink-2); white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-weight: 500; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #f4f4f5; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-ink); }
.btn-block { width: 100%; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: #f4f4f5; color: var(--ink); }

/* ---------- 主页 ---------- */
#home { overflow: auto; }
.home-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 14px 40px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 700; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #4f46e5, #0ea5e9); }
.home-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; background: #f4f4f5; color: var(--muted); }
.home-search input { flex: 1; border: 0; background: none; outline: none; color: var(--ink); }
.home-actions { margin-left: auto; display: flex; gap: 10px; }
.hero { margin: 28px 40px 8px; padding: 44px 40px 36px; border-radius: 18px; color: #fff; text-align: center; background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .18), transparent 40%), linear-gradient(120deg, #312e81 0%, #4f46e5 45%, #0ea5e9 100%); }
.hero h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: 1px; }
.hero p { margin: 0 0 28px; opacity: .85; font-size: 15px; }
.hero-sizes { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.hs { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; border: 0; background: none; color: #fff; font-size: 12.5px; }
.hs-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); transition: transform .15s, background .15s; }
.hs:hover .hs-ic { background: rgba(255, 255, 255, .3); transform: translateY(-2px); }
.home-sec { padding: 20px 40px 8px; }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 19px; }
.tpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: 20px; }
.tpl-tile { cursor: pointer; }
.tpl-thumb { border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s, transform .15s; width: fit-content; }
.tpl-tile:hover .tpl-thumb { box-shadow: 0 0 0 2px var(--accent), var(--shadow); transform: translateY(-2px); }
.tpl-tile b { display: block; margin-top: 10px; }
.tpl-tile small { color: var(--muted); }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 22px; }
.doc-card { cursor: pointer; }
.doc-thumb { width: 264px; border-radius: 10px; overflow: hidden; background: #e4e4e7; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s; }
.doc-card:hover .doc-thumb { box-shadow: 0 0 0 2px var(--accent); }
.doc-thumb .thumb-box { max-height: 100%; }
.doc-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 10px 2px 0; width: 264px; }
.doc-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.doc-meta small { color: var(--muted); font-size: 12px; }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; padding: 50px; color: var(--muted); border: 2px dashed var(--line-2); border-radius: 14px; }
.home-foot { padding: 30px 40px; color: #a1a1aa; font-size: 12px; }

/* 缩略图 */
.thumb-box { position: relative; overflow: hidden; flex: none; background: #fff; }
.thumb-scale { transform-origin: 0 0; pointer-events: none; }

/* ---------- 顶栏 ---------- */
.topbar { flex: none; height: 54px; display: flex; align-items: center; padding: 0 12px; gap: 10px; background: var(--top); color: #fff; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 4px; flex: 1; }
.tb-right { justify-content: flex-end; gap: 8px; }
.tb-center { flex: 0 1 360px; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 8px; border: 0; background: none; color: #e4e4e7; font-weight: 500; white-space: nowrap; }
.tb-btn:hover { background: var(--top-2); color: #fff; }
.tb-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: none; color: #e4e4e7; border-radius: 8px; }
.tb-icon:hover:not(:disabled) { background: var(--top-2); }
.tb-sep { width: 1px; height: 22px; background: #3f3f46; margin: 0 6px; }
.tb-ghost { background: var(--top-2); }
.tb-ghost:hover { background: #33333f; }
.tb-solid { background: var(--accent); color: #fff; }
.tb-solid:hover { background: var(--accent-2); }
.save-state { color: #a1a1aa; font-size: 12px; margin-left: 8px; white-space: nowrap; }
.save-state.saving { color: #fbbf24; }
.doc-title { width: 100%; height: 34px; border: 1px solid transparent; border-radius: 8px; background: none; color: #fff; text-align: center; font-weight: 600; font-size: 15px; outline: none; }
.doc-title:hover { border-color: #3f3f46; }
.doc-title:focus { border-color: var(--accent-2); background: var(--top-2); }

/* ---------- 编辑区布局 ---------- */
.ed-body { flex: 1; display: flex; min-height: 0; }
.rail { flex: none; width: 76px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 2px; z-index: 3; }
.rail-item { width: 66px; padding: 9px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; border-radius: 10px; color: var(--muted); font-size: 11.5px; }
.rail-item:hover { color: var(--ink); background: #f4f4f5; }
.rail-item.active { color: var(--accent); background: var(--accent-soft); }
.panel { position: relative; flex: none; width: 320px; background: var(--panel); border-right: 1px solid var(--line); transition: width .2s, margin .2s; z-index: 2; }
.panel.collapsed { width: 0; border-right: 0; }
.panel.collapsed .panel-inner { display: none; }
.panel-inner { height: 100%; overflow-y: auto; padding: 16px 18px 40px; }
.panel-collapse { position: absolute; top: 50%; right: -16px; width: 16px; height: 64px; transform: translateY(-50%); border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; background: #fff; color: var(--muted); display: grid; place-items: center; padding: 0; }
.panel.collapsed .panel-collapse svg { transform: rotate(180deg); }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--stage); }

/* ---------- 上下文工具栏 ---------- */
.ctxbar { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 0 22px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.ctxbar::-webkit-scrollbar { height: 0; }
.cb-left, .cb-right { display: flex; align-items: center; gap: 4px; flex: none; }
.cb { display: inline-flex; align-items: center; gap: 5px; height: 34px; min-width: 34px; padding: 0 8px; border: 0; background: none; border-radius: 7px; color: var(--ink-2); white-space: nowrap; font-size: 13px; }
.cb:hover { background: #f4f4f5; }
.cb.on { background: var(--accent-soft); color: var(--accent); }
.cb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.cb-info { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 0 6px; white-space: nowrap; }
.cb-select { height: 34px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 6px; background: #fff; outline: none; }
.cb-select:focus { border-color: var(--accent); }
.num-input { display: inline-flex; align-items: center; height: 34px; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.num-input button { width: 26px; height: 100%; border: 0; background: none; display: grid; place-items: center; color: var(--muted); }
.num-input button:hover { background: #f4f4f5; color: var(--ink); }
.num-input input { width: 44px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; outline: none; }
.cb-swatch { padding: 0 6px; }
.sw-fill { width: 24px; height: 24px; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); background-image: linear-gradient(var(--c), var(--c)), repeating-conic-gradient(#ddd 0 25%, #fff 0 50%); background-size: auto, 8px 8px; }
.sw-stroke { width: 24px; height: 24px; border-radius: 6px; border: 4px solid var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.sw-text { font-weight: 700; font-size: 17px; line-height: 1; padding-bottom: 2px; border-bottom: 4px solid var(--c); font-family: Georgia, serif; }
.cb-range { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; color: var(--muted); }
.cb-range input { width: 90px; accent-color: var(--accent); }

/* ---------- 舞台 ---------- */
.stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; position: relative; }
.stage.dropping { outline: 3px dashed var(--accent-2); outline-offset: -10px; }
.page-wrap { position: relative; margin: 40px; flex: none; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); background: #fff; }
.page { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.page .page-render .el { cursor: default; }
.page .page-render .el-text { cursor: text; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.page .tx.editing { outline: none; cursor: text; caret-color: var(--accent); }
.page td.editing { outline: 2px solid var(--accent); outline-offset: -2px; background: #fff !important; color: #111 !important; }
.hover-box { position: absolute; border: 2px solid #a5b4fc; transform-origin: 50% 50%; }
.sel-box { position: absolute; border: 2px solid var(--accent-2); transform-origin: 50% 50%; pointer-events: auto; cursor: move; }
.sel-box.multi { border-style: dashed; border-width: 1.5px; }
.sel-box.locked { border-color: #f59e0b; cursor: default; }
.sel-box.editing { pointer-events: none; border-color: var(--accent-2); }
.sel-sub { position: absolute; border: 1.5px solid #a5b4fc; transform-origin: 50% 50%; }
.hd { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 1px 4px rgba(0, 0, 0, .25); pointer-events: auto; }
.hd-nw { left: -8px; top: -8px; cursor: nwse-resize; } .hd-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.hd-ne { right: -8px; top: -8px; cursor: nesw-resize; } .hd-sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.hd-n, .hd-s { left: 50%; width: 22px; height: 8px; border-radius: 5px; margin-left: -11px; cursor: ns-resize; }
.hd-n { top: -5px; } .hd-s { bottom: -5px; }
.hd-e, .hd-w { top: 50%; width: 8px; height: 22px; border-radius: 5px; margin-top: -11px; cursor: ew-resize; }
.hd-e { right: -5px; } .hd-w { left: -5px; }
.hd-rot { position: absolute; left: 50%; bottom: -44px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--ink-2); box-shadow: 0 1px 6px rgba(0, 0, 0, .25); pointer-events: auto; cursor: grab; }
.lock-badge { position: absolute; right: -12px; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: #f59e0b; color: #fff; display: grid; place-items: center; }
.guide { position: absolute; background: #ec4899; }
.guide.gx { top: 0; bottom: 0; width: 1px; }
.guide.gy { left: 0; right: 0; height: 1px; }
.marquee { position: absolute; border: 1px solid var(--accent-2); background: rgba(99, 102, 241, .08); }
.size-label { position: absolute; transform: translate(-50%, 0); background: #18181b; color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; }

/* ---------- 备注与胶片栏 ---------- */
.notes { display: none; flex: none; border-top: 1px solid var(--line); background: #fff; }
.notes.show { display: block; }
.notes textarea { width: 100%; height: 90px; border: 0; resize: vertical; padding: 10px 18px; outline: none; }
.bottombar { flex: none; height: 104px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: #fff; border-top: 1px solid var(--line); }
.bb-btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.bb-btn:hover, .bb-btn.on { background: #f4f4f5; }
.bb-icon { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; display: grid; place-items: center; color: var(--muted); }
.bb-icon:hover { background: #f4f4f5; }
.filmstrip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; overflow-x: auto; padding: 8px 4px; }
.film-item { position: relative; flex: none; cursor: pointer; border-radius: 7px; }
.film-thumb { border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.film-item.active .film-thumb { box-shadow: 0 0 0 2.5px var(--accent); }
.film-item.drop .film-thumb { box-shadow: 0 0 0 2.5px #ec4899; }
.film-item.dragging { opacity: .4; }
.film-num { position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; background: rgba(24, 24, 27, .72); color: #fff; font-size: 11px; display: grid; place-items: center; }
.film-actions { position: absolute; right: 4px; top: 4px; display: none; gap: 3px; }
.film-item:hover .film-actions { display: flex; }
.film-actions button { width: 22px; height: 22px; border: 0; border-radius: 5px; background: rgba(255, 255, 255, .94); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.film-add { flex: none; width: 56px; height: 56px; border-radius: 8px; border: 1.5px dashed var(--line-2); background: #fafafa; display: grid; place-items: center; color: var(--muted); }
.film-add:hover { border-color: var(--accent); color: var(--accent); }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom input { width: 110px; accent-color: var(--accent); }
#zoomFit { min-width: 56px; justify-content: center; }

/* ---------- 面板通用 ---------- */
.p-head { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.p-sub { margin: 18px 0 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: baseline; gap: 8px; }
.p-sub small, .p-sec-head small { font-weight: 400; color: var(--muted); font-size: 12px; }
.p-sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; font-size: 13px; color: var(--ink-2); }
.p-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); color: var(--muted); }
.p-search:focus-within { border-color: var(--accent); }
.p-search input { flex: 1; border: 0; outline: none; min-width: 0; color: var(--ink); }
.p-empty { padding: 26px 8px; text-align: center; color: var(--muted); font-size: 13px; }
.p-actions { margin-top: 18px; }
.grid { display: grid; gap: 8px; }
.g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); }
.tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; background: #f4f4f5; cursor: pointer; transition: background .12s, transform .12s; color: var(--ink-2); }
.tile:hover { background: #e9e9ff; transform: scale(1.03); }
.tile-lg { aspect-ratio: 1.25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12px; }
.tile-ic { color: var(--ink-2); }
.row-gap { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row-gap.wrap { flex-wrap: wrap; }
.sw-dot { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); display: inline-block; }

/* 模板 */
.tpl-list { margin-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.tpl-cover { border-radius: 9px; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px var(--line); width: fit-content; transition: box-shadow .15s; }
.tpl-cover:hover { box-shadow: 0 0 0 2px var(--accent); }
.tpl-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 7px; }
.tpl-meta span { color: var(--muted); font-size: 12px; }
.tpl-pages { display: none; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.tpl-card.open .tpl-pages { display: grid; }
.tpl-page { border-radius: 6px; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px var(--line); width: fit-content; }
.tpl-page:hover { box-shadow: 0 0 0 2px var(--accent); }
.tpl-apply { grid-column: 1 / -1; }

/* 文字 */
.text-presets { display: flex; flex-direction: column; gap: 8px; }
.tp { padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; }
.tp:hover { border-color: var(--accent); background: #fafaff; }
.tp-h1 { font-size: 26px; font-weight: 700; } .tp-h2 { font-size: 18px; font-weight: 600; } .tp-body { font-size: 14px; }
.combo-list { display: flex; flex-direction: column; gap: 10px; }
.combo { padding: 14px 6px; border-radius: 9px; background: #f4f4f5; cursor: pointer; display: flex; justify-content: center; overflow: hidden; }
.combo:hover { background: #e9e9ff; }
.combo .page-render { pointer-events: none; overflow: visible; }
.font-list { display: flex; flex-direction: column; gap: 2px; }
.font-item { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 16px; }
.font-item:hover { background: #f4f4f5; }
.font-item small { color: var(--muted); font-size: 13px; }

/* 上传 */
.dropzone { margin-top: 12px; padding: 24px 12px; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12.5px; line-height: 1.6; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.up-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.up-grid.small { grid-template-columns: repeat(3, 1fr); margin-top: 10px; }
.up-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f4f4f5; cursor: pointer; }
.up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-item:hover { box-shadow: 0 0 0 2px var(--accent); }
.up-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: none; place-items: center; padding: 0; }
.up-item:hover .up-del { display: grid; }

/* 背景 / 取色 */
.sw-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sw-grid.big { gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); padding: 0; transition: transform .1s; }
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.sw-none { background: linear-gradient(135deg, #fff 45%, #ef4444 45%, #ef4444 55%, #fff 55%) !important; }
.grad-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.grad { aspect-ratio: 1; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.grad:hover { transform: scale(1.1); }
.grad-custom, .cp-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.grad-custom input[type=color], .cp-custom input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; }
.grad-custom input[type=range] { flex: 1; accent-color: var(--accent); }
.cp { padding: 4px; }
.cp-title { font-weight: 700; margin-bottom: 8px; }
.cp-sub { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.cp-hex { flex: 1; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 8px; outline: none; min-width: 0; }

/* 位置 */
.pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pos-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.pos-grid button { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12.5px; }
.pos-grid button:hover { background: #f4f4f5; }
.xywh { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xywh label { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); font-size: 12px; }
.xywh input { flex: 1; width: 100%; border: 0; outline: none; text-align: right; color: var(--ink); }
.xywh input:disabled { background: none; color: var(--muted); }
.layers { display: flex; flex-direction: column; gap: 4px; }
.layer { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; }
.layer:hover { border-color: var(--line-2); background: #fafafa; }
.layer.on { border-color: var(--accent); background: var(--accent-soft); }
.layer.off { opacity: .5; }
.layer.drop { box-shadow: 0 -3px 0 var(--accent); }
.layer.dragging { opacity: .35; }
.ly-grip { color: #c4c4cc; cursor: grab; }
.ly-ic { color: var(--muted); }
.ly-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer button { width: 26px; height: 26px; border: 0; background: none; border-radius: 6px; color: #a1a1aa; display: grid; place-items: center; }
.layer button:hover { background: #ececf1; color: var(--ink); }
.layer button.on { color: #f59e0b; }

/* 图片调整 */
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fp { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-2); }
.fp-img { width: 100%; aspect-ratio: 1; border-radius: 8px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.fp:hover .fp-img { box-shadow: 0 0 0 2px var(--accent); }
.sliders { display: grid; grid-template-columns: 1fr; gap: 2px; }
.sliders label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.sliders output { color: var(--muted); }
.sliders input, .pop-form input[type=range] { width: 100%; accent-color: var(--accent); }

/* 图表数据 */
.chart-types { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.chart-types button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 11px; color: var(--ink-2); }
.chart-types button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dgrid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.dgrid { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.dgrid th, .dgrid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; }
.dgrid th { background: #fafafa; }
.dgrid input { width: 100%; min-width: 64px; height: 32px; border: 0; padding: 0 8px; outline: none; background: none; }
.dgrid input:focus { background: var(--accent-soft); }
.ser-h, .lab-c { display: flex; align-items: center; }
.ser-color { flex: none; width: 14px; height: 14px; margin-left: 6px; border-radius: 4px; border: 0; padding: 0; }
.dgrid .x { flex: none; width: 20px; height: 20px; border: 0; border-radius: 4px; background: none; color: #a1a1aa; display: grid; place-items: center; padding: 0; }
.dgrid .x:hover { color: var(--danger); background: #fee2e2; }
.paste-area { width: 100%; height: 70px; border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px; font-size: 12px; resize: vertical; outline: none; }

/* ---------- 弹出层 / 菜单 ---------- */
.popover { position: fixed; z-index: 1000; background: #fff; border-radius: 12px; box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .05); padding: 10px; animation: pop-in .12s ease; max-height: 80vh; overflow: auto; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-menu { display: flex; flex-direction: column; }
.pop-menu button { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13.5px; }
.pop-menu button span { flex: 1; }
.pop-menu button:hover:not(:disabled) { background: #f4f4f5; }
.pop-menu button.on { color: var(--accent); background: var(--accent-soft); }
.pop-menu button.danger { color: var(--danger); }
.pop-menu kbd { font-size: 11px; }
.pm-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.pop-tip { font-size: 12px; color: var(--muted); padding: 2px 10px 6px; }
.pop-form { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.pop-form label { display: flex; justify-content: space-between; font-size: 13px; }
.pop-form output { color: var(--muted); }
.pop-form .chk { justify-content: flex-start; gap: 8px; align-items: center; padding: 4px 0; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; height: 30px; padding: 0 12px; font-size: 13px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pop-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pop-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border: 0; border-radius: 8px; background: none; font-size: 11.5px; color: var(--ink-2); }
.pop-grid button:hover { background: #f4f4f5; }

/* 下载 */
.dl { padding: 4px; }
.dl-fmts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.dl-fmt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.dl-fmt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dl-fmt input { display: none; }
.dl-fmt b { display: block; color: var(--ink); font-size: 13.5px; }
.dl-fmt small { color: var(--muted); font-size: 12px; }
.dl-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.dl-row select { height: 32px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 8px; }

/* ---------- 弹窗 ---------- */
.modal-back { position: fixed; inset: 0; z-index: 900; background: rgba(15, 15, 25, .45); display: grid; place-items: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { max-width: calc(100vw - 40px); max-height: calc(100vh - 60px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; font-size: 16px; }
.modal-head button { border: 0; background: none; color: var(--muted); }
.modal-body { padding: 6px 18px 10px; overflow: auto; line-height: 1.6; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 18px 16px; }
.modal-foot:empty { display: none; }
.size-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.size-opt { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.size-opt svg { grid-row: span 2; color: var(--muted); }
.size-opt small { color: var(--muted); font-size: 12px; }
.size-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.custom-size { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); }
.custom-size label { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.custom-size input { width: 80px; border: 0; outline: none; }
.kb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kb-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.kb-table td:first-child { width: 44%; }
.share-list { display: flex; flex-direction: column; gap: 8px; }
.share-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; color: var(--accent); }
.share-item:hover { border-color: var(--accent); background: #fafaff; }
.share-item b { display: block; color: var(--ink); }
.share-item small { color: var(--muted); }

/* ---------- 提示与进度 ---------- */
#toast { position: fixed; left: 50%; bottom: 128px; transform: translate(-50%, 20px); z-index: 2000; background: #18181b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.progress { position: fixed; inset: 0; z-index: 3000; background: rgba(255, 255, 255, .7); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 14px; color: var(--ink-2); backdrop-filter: blur(2px); }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #e0e7ff; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 演示 ---------- */
#presenter { position: fixed; inset: 0; z-index: 5000; background: #000; }
.pr-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.pr-slide { flex: none; transform-origin: center; }
.pr-slide.in { animation: fade .4s ease; }
.pr-slide.in-next { animation: pr-next .45s cubic-bezier(.2, .7, .2, 1); }
.pr-slide.in-prev { animation: pr-prev .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes pr-next { from { opacity: 0; translate: 60px 0; } }
@keyframes pr-prev { from { opacity: 0; translate: -60px 0; } }
.pr-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(30, 30, 36, .85); color: #fff; opacity: 0; transition: opacity .3s; }
#presenter.show-bar .pr-bar { opacity: 1; }
.pr-bar button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: #fff; display: grid; place-items: center; }
.pr-bar button:hover { background: rgba(255, 255, 255, .15); }
.pr-count { min-width: 64px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.pr-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .25); margin: 0 4px; }
.pr-grid { position: absolute; inset: 0; display: none; flex-wrap: wrap; align-content: flex-start; gap: 22px; padding: 50px; overflow: auto; background: rgba(10, 10, 14, .94); }
.pr-grid.show { display: flex; }
.pr-gi { position: relative; cursor: pointer; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px #333; }
.pr-gi.on { box-shadow: 0 0 0 3px var(--accent-2); }
.pr-gi span { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 1px 7px; border-radius: 4px; }

@media (max-width: 900px) {
  .panel { position: absolute; left: 76px; top: 106px; bottom: 0; box-shadow: var(--shadow); }
  .tb-btn span, .save-state { display: none; }
  .home-head { padding: 12px 16px; gap: 12px; } .hero, .home-sec { margin-left: 16px; margin-right: 16px; padding-left: 16px; padding-right: 16px; }
}
