:root {
  --brand: #2169d3; --brand-d: #00207a; --ink: #1e2938; --muted: #5b6474; --faint: #8a93a3; --line: #e3e8ef; --bg: #f6f8fb;
  --panel: #fff; --warn: #c06a00; --bad: #c3132d; --ok: #267a36; --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; white-space: nowrap; color: var(--ink); }
.btn:hover { border-color: #c9d3e0; background: #fafbfd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1a5bbd; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.big { height: 46px; font-size: 16px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, .select { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 14px; background: #fff; color: var(--ink); min-width: 0; }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, textarea:focus { outline: 2px solid rgba(33, 105, 211, .25); border-color: var(--brand); }
.select.sm, .input.sm { height: 30px; font-size: 13px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--muted); text-align: left; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.sm { padding: 3px 10px; font-size: 12px; }
.link { border: none; background: none; color: var(--brand); cursor: pointer; padding: 4px 0; font-size: 13px; }
.icon-btn { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 12px; padding: 4px 6px; border-radius: 6px; white-space: nowrap; flex: none; }
.icon-btn:hover { color: var(--bad); background: #fdf1f2; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty { color: var(--faint); font-size: 14px; }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---------------------------------------------------------------- top bar */
.top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand img { height: 26px; }
.brand b { font-size: 16px; white-space: nowrap; }
.who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.crumb { color: var(--muted); font-size: 14px; white-space: nowrap; }
.crumb:hover { color: var(--brand); }
.crumb-title { font-weight: 600; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-input { border: 1px solid transparent; border-radius: 6px; height: 32px; padding: 0 8px; font: inherit; font-weight: 600; font-size: 15px; width: 260px; min-width: 120px; background: transparent; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--brand); outline: none; background: #fff; }
.saved { color: var(--faint); font-size: 12px; white-space: nowrap; width: 48px; }
.tools { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.tool { border: none; background: none; height: 32px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--ink); white-space: nowrap; display: inline-flex; align-items: center; }
.tool:hover { background: #eef2f8; }
.tool:disabled { color: #b8c0cc; background: none; cursor: default; }
.tool.strong { color: var(--brand); font-weight: 600; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef3fb, #f8fafd 55%, #eef4fb); }
.login-card { width: 400px; background: #fff; border-radius: 16px; padding: 36px 34px; box-shadow: 0 18px 50px rgba(15, 32, 80, .12); text-align: center; }
.login-card img { height: 40px; }
.login-card h1 { margin: 14px 0 6px; font-size: 24px; }
.login-card p { color: var(--muted); font-size: 13px; margin: 0 0 24px; line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.field .input { height: 42px; font-size: 15px; }
.field small { color: var(--faint); }

/* ---------------------------------------------------------------- home */
.home { max-width: 1180px; margin: 0 auto; padding: 36px 24px 80px; }
.hero { max-width: 860px; margin: 0 auto 36px; text-align: center; }
.hero h1 { font-size: 34px; margin: 6px 0 10px; letter-spacing: .5px; }
.hero > p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 auto 24px; max-width: 760px; }
.composer { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 10px; box-shadow: 0 10px 30px rgba(15, 32, 80, .07); text-align: left; transition: .15s; }
.composer:focus-within { border-color: #b9cdee; box-shadow: 0 12px 34px rgba(33, 105, 211, .12); }
.composer.drop { border-color: var(--brand); border-style: dashed; }
.composer textarea { width: 100%; border: none; resize: none; font: inherit; font-size: 15px; line-height: 1.65; outline: none; min-height: 96px; }
.composer .bar { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid #f0f2f6; }
.att { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; background: #f2f6fc; border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 12.5px; }
.file-chip small { color: var(--faint); }
.file-chip button { border: none; background: none; cursor: pointer; color: var(--faint); font-size: 15px; padding: 0 4px; }
.more { display: grid; grid-template-columns: 1fr 260px; gap: 12px; padding: 8px 0 10px; }
.more label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; }
.examples span { color: var(--faint); font-size: 13px; }
.sec { margin-top: 34px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.sec-head h3 { margin: 0; font-size: 18px; }
.sec-head small { color: var(--faint); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { border: none; background: #eef1f6; border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--ink); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }
.gallery.compact { grid-template-columns: repeat(2, 148px); gap: 12px; }
.theme { border: none; background: none; padding: 0; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; }
.theme .pv { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(15, 32, 80, .06); }
.theme .pv-a, .theme .pv-b { position: absolute; inset: 0; }
.theme .pv-b { opacity: 0; transition: opacity .25s; }
.theme:hover .pv-b { opacity: 1; }
.theme.on .pv { box-shadow: 0 0 0 3px var(--brand), 0 6px 16px rgba(33, 105, 211, .25); }
.theme b { font-size: 13.5px; margin-top: 6px; }
.theme small { color: var(--faint); font-size: 12px; }
.gallery.compact .theme b { font-size: 12.5px; margin-top: 4px; }
.theme.custom .pv { background: repeating-linear-gradient(45deg, #f4f6fa 0 10px, #fff 10px 20px); }
.palette { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.palette label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.palette input[type=color] { width: 40px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; }
.deck { position: relative; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); color: var(--ink); transition: .15s; }
.deck:hover { box-shadow: 0 0 0 1px #c9d6ea, 0 10px 24px rgba(15, 32, 80, .1); transform: translateY(-1px); }
.deck .cover { aspect-ratio: 16 / 9; background: #f2f5f9; overflow: hidden; }
.cover-ph { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 18px; gap: 6px; }
.cover-ph b { font-size: 15px; line-height: 1.4; }
.cover-ph small { color: var(--faint); }
.deck .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.deck .meta b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck .meta small { color: var(--faint); font-size: 12px; }
.deck em { font-style: normal; color: var(--warn); }
.deck em.busy { color: var(--brand); }
.deck .del { position: absolute; top: 8px; right: 8px; display: none; border: none; background: rgba(255, 255, 255, .92); border-radius: 6px; font-size: 12px; padding: 3px 8px; cursor: pointer; color: var(--bad); }
.deck:hover .del { display: block; }

/* ---------------------------------------------------------------- slides (1280 × 720, scaled) */
.slide-frame { position: relative; overflow: hidden; }
.slide { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: #fff; }
.slide .e { position: absolute; box-sizing: border-box; }
.slide .t { display: flex; flex-direction: column; }
.slide .p { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; }
.slide .bu { position: absolute; left: 0; top: 0; }
.slide .ic { -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.slide .img img { width: 100%; height: 100%; display: block; }
.slide .tb table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.slide .tb th, .slide .tb td { border: 1px solid; padding: 4px 10px; overflow: hidden; line-height: 1.25; }
.slide .ch svg { display: block; overflow: visible; }
.slide .ed { cursor: text; border-radius: 3px; }
.slide .ed:hover { outline: 3px dashed rgba(33, 105, 211, .55); outline-offset: 3px; }
.slide .p.ed:empty::before { content: "点击输入"; opacity: .35; font-weight: 400; }
.slide .ed.editing { outline: 3px solid var(--brand); outline-offset: 3px; cursor: text; }
.slide .ed-icon, .slide .ed-data, .slide .img { cursor: pointer; }
.slide .ed-icon:hover, .slide .ed-data:hover { outline: 3px dashed rgba(33, 105, 211, .55); outline-offset: 4px; border-radius: 6px; }

/* ---------------------------------------------------------------- outline page */
.ol-page { display: grid; grid-template-columns: 1fr 372px; height: calc(100vh - 56px); }
.ol-main { overflow-y: auto; padding: 26px 40px 60px; }
.ol-side { overflow-y: auto; border-left: 1px solid var(--line); background: #fff; padding: 20px 22px 30px; display: flex; flex-direction: column; gap: 20px; }
.ol-head { display: flex; align-items: center; gap: 12px; max-width: 860px; margin: 0 auto 14px; }
.ol-head h2 { margin: 0; font-size: 20px; }
.ol-head .status { color: var(--muted); font-size: 13px; }
.ol-doc { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 26px 30px 22px; }
.ol-doc input, .ol-doc textarea { border: 1px solid transparent; border-radius: 6px; font: inherit; width: 100%; background: transparent; color: var(--ink); }
.ol-doc input:hover, .ol-doc textarea:hover { border-color: var(--line); }
.ol-doc input:focus, .ol-doc textarea:focus { border-color: var(--brand); outline: none; background: #fff; }
.ol-doc.ro input, .ol-doc.ro textarea { border-color: transparent !important; }
.ol-title { font-size: 24px !important; font-weight: 700; padding: 4px 8px; }
.ol-sub { font-size: 15px; color: var(--muted) !important; padding: 4px 8px; margin-bottom: 10px; }
.ol-ch { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f2f6; }
.ol-ch-head { display: flex; align-items: center; gap: 8px; }
.ol-ch-head .num { background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; border-radius: 6px; padding: 2px 7px; }
.ol-ch-head input { font-size: 17px; font-weight: 700; padding: 4px 8px; }
.ol-pg { margin: 8px 0 4px 34px; }
.ol-pg-head { display: flex; align-items: center; gap: 6px; }
.ol-pg-head .pn { color: var(--faint); font-size: 12px; width: 26px; flex: none; }
.ol-pg-head input { font-size: 15px; font-weight: 600; padding: 3px 8px; }
.ol-pg textarea { margin-left: 32px; width: calc(100% - 32px); font-size: 13.5px; line-height: 1.7; color: var(--muted); padding: 2px 8px; resize: none; overflow: hidden; }
.add { border: 1px dashed #cfd8e5; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px; padding: 5px 12px; margin: 8px 0 0 66px; }
.add:hover { border-color: var(--brand); color: var(--brand); }
.add.ch { margin-left: 0; margin-top: 18px; }
.ol-doc.thinking { display: flex; align-items: center; gap: 16px; padding: 30px; }
.ol-doc.thinking div { display: flex; flex-direction: column; gap: 6px; }
.ol-doc.thinking small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.caret { display: inline-block; width: 9px; height: 18px; background: var(--brand); margin-left: 8px; animation: blink 1s steps(2) infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }
.ol-md { display: block; max-width: 860px; width: 100%; margin: 0 auto; height: 62vh; font: 13.5px/1.7 ui-monospace, Menlo, monospace; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.ol-ai { max-width: 860px; margin: 16px auto 0; display: flex; gap: 8px; }
.ol-ai .input { flex: 1; height: 40px; }
.ol-ai .btn { height: 40px; }
.error-box { max-width: 860px; margin: 0 auto; background: #fff6f6; border: 1px solid #f3cfd3; border-radius: 12px; padding: 20px 24px; }
.error-box p { color: var(--bad); font-size: 14px; }
.side-sec h4 { margin: 0 0 10px; font-size: 14px; }
.req { font-size: 13.5px; line-height: 1.65; margin: 0 0 6px; white-space: pre-wrap; max-height: 160px; overflow-y: auto; }
.req-meta { color: var(--faint); font-size: 12px; margin: 0; }
.mat { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mat small { color: var(--faint); }
.mat .cap { display: block; margin-left: 20px; }
.side-go { position: sticky; bottom: 0; background: #fff; padding-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.side-go small { color: var(--faint); font-size: 12px; text-align: center; }
.gen-bar { max-width: 860px; height: 6px; background: #e3e9f2; border-radius: 3px; margin: 0 auto 20px; overflow: hidden; }
.gen-bar div { height: 100%; width: 5%; background: var(--brand); transition: width .6s; }
.gen-grid { max-width: 1010px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, 236px); gap: 16px; justify-content: center; }
.gen-card { position: relative; }
.gen-card .pv, .gen-card .ph { border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.gen-card .ph { aspect-ratio: 16 / 9; background: linear-gradient(90deg, #eef1f6 0, #f7f9fc 40%, #eef1f6 80%); background-size: 400% 100%; animation: shimmer 1.6s infinite linear; }
.gen-card.pending .pv { filter: blur(2px) grayscale(.6); opacity: .55; }
.gen-card span { position: absolute; left: 6px; top: 4px; font-size: 11px; color: var(--faint); background: rgba(255, 255, 255, .8); border-radius: 4px; padding: 0 4px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.steps { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; color: var(--muted); }
.mini-ol { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.mini-ol small { color: var(--faint); margin-left: 6px; }

/* ---------------------------------------------------------------- editor */
.editor { display: grid; grid-template-columns: 214px 1fr 336px; height: calc(100vh - 56px); }
.thumbs { overflow-y: auto; padding: 12px 10px 60px 6px; background: #f3f5f9; border-right: 1px solid var(--line); }
.th { position: relative; margin-left: 24px; cursor: pointer; border-radius: 5px; }
.th .pv { border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px #dfe4ec; background: #fff; }
.th.on .pv { box-shadow: 0 0 0 2.5px var(--brand); }
.th.over .pv { box-shadow: 0 0 0 2px #f0a24b; }
.th.dragging { opacity: .4; }
.th .n { position: absolute; left: -22px; top: 1px; width: 18px; text-align: right; font-size: 11.5px; color: var(--faint); }
.th.on .n { color: var(--brand); font-weight: 700; }
.th-tools { position: absolute; right: 3px; bottom: 3px; display: none; gap: 2px; }
.th:hover .th-tools { display: flex; }
.th-tools button { border: none; background: rgba(30, 41, 56, .78); color: #fff; font-size: 10.5px; border-radius: 4px; padding: 2px 5px; cursor: pointer; }
.th-tools button:hover { background: var(--brand); }
.ins { display: block; width: calc(100% - 24px); margin-left: 24px; height: 14px; line-height: 12px; border: none; background: none; color: transparent; cursor: pointer; border-radius: 4px; font-size: 13px; }
.ins:hover { color: var(--brand); background: rgba(33, 105, 211, .1); }
.work { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #e8ecf2; }
.stage-area { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.stage { box-shadow: 0 8px 28px rgba(15, 23, 42, .16); }
.busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(232, 236, 242, .5); backdrop-filter: blur(1.5px); }
.busy-card { background: #fff; border-radius: 12px; padding: 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 0 10px 30px rgba(15, 32, 80, .15); }
.busy-card small { color: var(--muted); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #d7e3f6; border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.under { display: flex; gap: 16px; padding: 0 24px 6px; font-size: 12px; color: var(--muted); min-height: 20px; }
.under .warn { color: var(--warn); }
.notes textarea { display: block; width: 100%; height: 78px; border: none; border-top: 1px solid var(--line); padding: 10px 24px; resize: none; font: inherit; font-size: 13px; line-height: 1.6; background: #fff; }
.notes textarea:focus { outline: none; background: #fffef7; }
.assistant { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fff; min-height: 0; }
.as-head { padding: 14px 16px 10px; border-bottom: 1px solid #f0f2f6; display: flex; align-items: baseline; gap: 8px; }
.as-head small { color: var(--faint); font-size: 12px; }
.as-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg small { display: block; font-size: 11.5px; opacity: .75; margin-bottom: 2px; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: #f1f4f9; border-bottom-left-radius: 4px; }
.msg.ai small { margin: 4px 0 0; }
.msg.ai.bad { background: #fdf1f2; color: var(--bad); }
.msg.ai.pending { color: var(--muted); }
.msg.sys { align-self: center; background: none; color: var(--faint); font-size: 12px; text-align: center; padding: 2px 8px; }
.dots { display: inline-block; width: 18px; }
.dots::after { content: "…"; animation: blink 1s steps(2) infinite; }
.as-input { border-top: 1px solid #f0f2f6; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.scope { display: flex; background: #f1f4f9; border-radius: 8px; padding: 3px; }
.scope button { flex: 1; border: none; background: none; border-radius: 6px; padding: 5px 0; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.scope button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sugs { display: flex; flex-wrap: wrap; gap: 5px; }
.ask { position: relative; }
.ask textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px 40px; font: inherit; font-size: 13.5px; line-height: 1.55; resize: none; }
.ask textarea:focus { outline: none; border-color: var(--brand); }
.ask .btn { position: absolute; right: 8px; bottom: 8px; }

/* ---------------------------------------------------------------- menus, modals, toasts */
.pop { position: fixed; z-index: 60; background: #fff; border-radius: 10px; box-shadow: 0 12px 36px rgba(15, 32, 80, .18), 0 0 0 1px var(--line); padding: 6px; max-height: 70vh; overflow-y: auto; }
.menu { min-width: 220px; display: flex; flex-direction: column; }
.menu > button, .vlist > button { border: none; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.menu > button:hover, .vlist > button:hover { background: #f1f5fb; }
.menu > button.on, .vlist > button.on { color: var(--brand); font-weight: 600; }
.menu small { color: var(--faint); font-size: 12px; font-weight: 400; }
.wide-menu { width: 330px; }
.wide-menu > button, .vlist > button { flex-direction: column; align-items: flex-start; gap: 2px; }
.menu-title { font-size: 12px; color: var(--faint); padding: 6px 10px 4px; }
.menu-note { font-size: 13px; color: var(--muted); max-width: 280px; line-height: 1.6; margin: 6px 10px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-ai { display: flex; gap: 6px; padding: 4px; }
.menu-ai .input { flex: 1; height: 32px; font-size: 13px; }
.vlist { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.icons { width: 372px; padding: 10px; }
.icons .input { width: 100%; margin-bottom: 8px; }
.icon-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; max-height: 280px; overflow-y: auto; }
.icon-grid button { border: 1px solid transparent; background: none; border-radius: 6px; height: 38px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.icon-grid button:hover { border-color: var(--brand); background: #f1f5fb; }
.icon-grid button.none { font-size: 11px; color: var(--muted); }
.icon-grid i { width: 22px; height: 22px; background: var(--ink); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal { background: #fff; border-radius: 14px; padding: 22px 24px; width: 520px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.modal.wide { width: 860px; }
.modal h3 { margin: 0 0 12px; font-size: 18px; }
.modal p { font-size: 14px; line-height: 1.7; color: var(--muted); }
.modal .row { display: flex; gap: 14px; margin-bottom: 12px; }
.modal .row label, .modal label.block { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.modal label.block { margin-top: 14px; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal-foot .err { color: var(--bad); font-size: 13px; margin-right: auto; }
.grid-ed { overflow-x: auto; }
.grid-ed table { border-collapse: collapse; }
.grid-ed th, .grid-ed td { border: 1px solid var(--line); padding: 0; position: relative; }
.grid-ed th { background: #f4f7fb; }
.grid-ed input { border: none; height: 34px; padding: 0 8px; width: 132px; font: inherit; font-size: 13px; background: transparent; }
.grid-ed th input { font-weight: 600; }
.grid-ed input:focus { outline: 2px solid var(--brand); outline-offset: -2px; background: #fff; }
.grid-ed td > button, .grid-ed th > button[data-dels], .grid-ed th > button[data-delc] { border: none; background: none; color: var(--faint); cursor: pointer; padding: 0 8px; }
.grid-ed th > button[data-dels], .grid-ed th > button[data-delc] { position: absolute; right: 0; top: 8px; }
.grid-ed td > button:hover, .grid-ed th > button:hover { color: var(--bad); }
.grid-ed .link { padding: 8px 4px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.img-grid button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.img-grid button:hover { border-color: var(--brand); }
.img-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: #f2f4f8; }
.img-grid small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row { display: flex; gap: 8px; }
.share-row .input { flex: 1; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: #1e2938; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: 80vw; line-height: 1.5; animation: pop .2s; }
.toast.bad { background: var(--bad); }
.toast + .toast { top: 120px; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -6px); } }

/* ---------------------------------------------------------------- slide show */
.show { position: fixed; inset: 0; background: #000; z-index: 1000; cursor: none; user-select: none; }
.show.active { cursor: default; }
.show-stage .slide { position: absolute; }
.show-bar { position: fixed; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 4px; background: rgba(24, 24, 28, .75); border-radius: 10px; padding: 5px; opacity: 0; transition: opacity .2s; }
.show.active .show-bar { opacity: 1; }
.show-bar button { border: none; background: none; color: #fff; font-size: 15px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.show-bar button:hover { background: rgba(255, 255, 255, .15); }
.show-n { color: #ddd; font-size: 13px; padding: 0 6px; }
.show-notes { position: fixed; left: 18px; bottom: 18px; width: min(560px, 50vw); max-height: 40vh; overflow-y: auto; background: rgba(24, 24, 28, .88); color: #eee; padding: 14px 16px; border-radius: 10px;
  font-size: 15px; line-height: 1.7; white-space: pre-wrap; cursor: auto; user-select: text; }

/* ---------------------------------------------------------------- shared page */
.pub { max-width: 1060px; margin: 0 auto; padding: 22px 24px 60px; }
.pub-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.pub-head h1 { font-size: 20px; margin: 0; }
.pub-head small { color: var(--faint); }
.pub-list { display: flex; flex-direction: column; gap: 22px; }
.pub-page { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 22px rgba(15, 23, 42, .12); }
.pub-n { color: var(--faint); font-size: 12px; margin: -14px 0 0 4px; }
.pub-foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 30px; }

/* ---------------------------------------------------------------- print */
.print-root { display: none; }
@media print {
  @page { size: 1280px 720px; margin: 0; }
  html, body { background: #fff; }
  body > *:not(.print-root) { display: none !important; }
  .print-root { display: block; }
  .print-sheet { position: relative; width: 1280px; height: 720px; overflow: hidden; break-after: page; page-break-after: always; }
  .print-sheet .slide { transform: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1180px) {
  .editor { grid-template-columns: 170px 1fr 300px; }
  .tools .tool { padding: 0 7px; }
  .who { display: none; }
}
