:root{--ink:#181d26;--body:#333840;--muted:#606873;--line:#dce0e5;--soft:#f8fafc;--cream:#f5e9d4;--coral:#aa2d00;--forest:#0a2e0e;--font:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}html,body{margin:0}body{color:var(--body);background:#fff;font:14px/1.55 var(--font)}button,input,textarea,select{font:inherit}button{cursor:pointer}h1,h2,h3,p{margin:0}a{color:inherit;text-decoration:none}[hidden]{display:none!important}
.site-header{height:64px;padding:0 clamp(24px,3vw,48px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:38px}.brand{display:inline-flex;align-items:center;gap:10px;font-size:16px;font-weight:600;color:var(--ink);white-space:nowrap}.brand img{width:29px;height:29px}.site-header nav{display:flex;align-items:center;gap:26px}.site-header nav a{padding:20px 0;color:var(--muted)}.site-header nav a[aria-current]{color:var(--ink);box-shadow:inset 0 -2px var(--ink);font-weight:600}.site-home{margin-left:auto;color:var(--ink);font-size:13px}.site-header a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #458fff;outline-offset:2px}
.desktop-app{padding:28px clamp(24px,3vw,48px) 36px;max-width:1800px;margin:0 auto}
.studio{display:grid;grid-template-columns:minmax(340px,395px) minmax(0,1fr);gap:20px;align-items:stretch;min-height:calc(100dvh - 210px)}.controls,.preview-panel{border:1px solid var(--line);border-radius:12px;background:#fff;min-width:0}.controls{display:flex;flex-direction:column;overflow:hidden}.control-section{padding:18px 20px;border-bottom:1px solid var(--line)}.section-heading{display:flex;align-items:center;gap:9px;margin-bottom:8px}.section-heading span{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--ink);color:#fff;font-size:11px}.section-heading h2{font-size:17px;font-weight:500;color:var(--ink)}.hint{font-size:12px;color:var(--muted);line-height:1.5}.source-section textarea{display:block;width:100%;height:180px;resize:vertical;margin:12px 0 9px;padding:12px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:#fff;line-height:1.6;font-family:ui-monospace,Consolas,"Microsoft YaHei",monospace;font-size:12px}.source-actions{display:flex;gap:8px}.button{border:0;border-radius:10px;display:inline-flex;justify-content:center;align-items:center;gap:6px;padding:10px 15px;min-height:39px;font-weight:500;white-space:nowrap}.button-primary{background:var(--ink);color:#fff}.button-primary:active{background:#0d1218}.button-secondary{background:#fff;border:1px solid var(--line);color:var(--ink)}.button-secondary:active{border-color:#9297a0}.button:disabled{opacity:.55;cursor:not-allowed}.source-actions .button{font-size:12px;padding:8px 13px;min-height:33px}
.segmented{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}.segment{background:#fff;border:1px solid var(--line);border-radius:9px;padding:10px;text-align:left;font-weight:600;color:var(--ink)}.segment small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:3px}.segment.active{background:#eef3fa;border-color:#718fb9;box-shadow:inset 0 0 0 1px #718fb9}.template-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.template-choice{border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px;display:flex;align-items:center;gap:9px;text-align:left;color:var(--ink);font-size:12px}.template-choice.active{border-color:#718fb9;box-shadow:inset 0 0 0 1px #718fb9;background:#f8fbff}.swatch{display:block;width:34px;height:42px;border:1px solid rgba(24,29,38,.1);border-radius:3px;position:relative;flex:none}.swatch:before{content:"";position:absolute;top:9px;left:6px;width:20px;height:3px;background:currentColor;box-shadow:0 7px currentColor,0 14px currentColor}.swatch-editorial{background:#fff;color:#aa2d00;border-top:5px solid #aa2d00}.swatch-warm{background:#f5e9d4;color:#aa2d00}.swatch-forest{background:#eef4e8;color:#0a2e0e}.swatch-night{background:#181d26;color:#f5e9d4}.compact-row{display:flex;justify-content:space-between;align-items:center;margin-top:13px}.compact-row label,.field-label{font-size:12px;color:var(--ink);font-weight:500}.compact-row select{width:130px;height:34px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:0 8px}.checkbox-row{display:flex;align-items:center;gap:7px;font-size:12px;margin-top:13px;cursor:pointer}.checkbox-row input{accent-color:var(--ink)}.field-label{display:block;margin-top:12px}.field-label span{color:var(--muted);font-weight:400}#coverTitle{width:100%;height:36px;margin-top:5px;padding:0 10px;border:1px solid var(--line);border-radius:6px}.action-panel{margin-top:auto;padding:16px 20px 18px;background:var(--soft)}.action-panel p{font-size:12px;color:var(--muted);margin-bottom:9px}.action-panel .button{width:100%;font-size:14px}
.preview-panel{display:flex;flex-direction:column;overflow:hidden}.preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:50px 20px;color:var(--muted);text-align:center}.preview-empty h3{color:var(--ink);font-size:18px;font-weight:500;margin:20px 0 4px}.empty-art{width:190px;height:170px;position:relative}.empty-art i{position:absolute;width:102px;height:140px;background:#fff;border:1px solid #cbd6e4;border-radius:6px;box-shadow:0 4px 14px rgba(24,29,38,.07)}.empty-art i:nth-child(1){transform:rotate(-12deg);left:20px;top:16px;background:#f5e9d4}.empty-art i:nth-child(2){transform:rotate(7deg);left:65px;top:12px;background:#e5eef8}.empty-art i:nth-child(3){left:45px;top:20px;background:linear-gradient(155deg,#fff 70%,#e8f0fc)}.preview-results{display:grid;grid-template-columns:minmax(0,1fr) 210px;gap:0;flex:1;min-height:0}.preview-main{min-width:0;min-height:0;background:#f1f3f6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;padding:24px}.preview-main>img{display:block;max-width:100%;max-height:min(70dvh,760px);object-fit:contain;box-shadow:0 12px 36px rgba(24,29,38,.16);background:#fff}.preview-main-meta{display:flex;align-items:center;justify-content:space-between;gap:20px;width:min(100%,620px);color:var(--muted);font-size:12px}.preview-main-meta .button{font-size:12px}.preview-side{padding:17px 16px;border-left:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.preview-side h3{font-size:14px;color:var(--ink);font-weight:500}.preview-side h3 span{color:var(--muted)}.thumb-list{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;overflow-y:auto;align-content:start;padding:12px 2px;max-height:calc(100dvh - 390px);min-height:180px}.thumb{border:1px solid var(--line);border-radius:7px;background:#fff;padding:4px;color:var(--muted);font-size:11px;text-align:center}.thumb.active{border-color:#458fff;box-shadow:0 0 0 1px #458fff}.thumb img{width:100%;height:100px;object-fit:contain;background:#f3f4f6;display:block;margin-bottom:4px}.preview-side>.button{width:100%;margin-top:auto}.preview-side>.hint{margin-top:9px;text-align:center}.message{padding:11px 18px;border-top:1px solid var(--line);background:#fff8e9;color:#865c12;font-size:13px}.message.error{background:#fff2ef;color:#9a2c0b}
.desktop-only{display:none}#renderHost{position:fixed;left:-20000px;top:0;width:800px;z-index:-1;pointer-events:none}
/* 工作区始终适配视口；较矮窗口只滚动设置区内容，不产生页面滚动条。 */
body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.workspace-nav{flex:none}
.desktop-app{flex:1;min-height:0;width:100%;display:flex;flex-direction:column;padding-top:14px;padding-bottom:16px}
.studio{flex:1;min-height:0}
.controls,.preview-panel{min-height:0}
.controls-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-width:none}
.controls-scroll::-webkit-scrollbar,.thumb-list::-webkit-scrollbar{display:none}
.control-section{padding:10px 14px}
.section-heading{margin-bottom:5px}
.source-section textarea{height:100px;resize:none;margin:8px 0}
.source-section textarea:focus{height:clamp(135px,19dvh,185px)}
.source-section textarea{scrollbar-width:none}
.source-section textarea::-webkit-scrollbar{display:none}
.segment{display:flex;align-items:center;gap:10px;min-width:0}
.segment img{display:block;width:28px;height:28px;flex:none;object-fit:contain}
.segment span{display:block;min-width:0}
.segment small{white-space:nowrap}
.segment{padding:6px 8px}
.segmented{margin-bottom:6px}
.image-text-fields input[type="text"]:disabled{background:#f5f6f8;color:#9198a2}
#coverTitle[aria-invalid="true"]{border-color:#bb3c24;box-shadow:0 0 0 2px rgba(187,60,36,.13)}
.template-choice{padding:5px 8px}
.template-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.template-choice{min-width:0;min-height:59px;flex-direction:column;justify-content:center;gap:3px;padding:4px 3px;text-align:center;font-size:11px;line-height:1.25}
.template-choice span{white-space:nowrap}
.template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.template-choice{min-height:0;gap:6px;padding:7px;font-size:12px}
.template-art{display:block;position:relative;width:100%;height:88px;overflow:hidden;border:1px solid #dce0e5;border-radius:6px;background:#f1f3f6;pointer-events:none}
.template-art .sheet{position:absolute;left:calc(50% - 80.73px);top:0;transform:scale(.26);transform-origin:top left;pointer-events:none}
.swatch{width:24px;height:29px}
.swatch:before{width:14px;left:4px;top:5px;box-shadow:0 6px currentColor,0 12px currentColor}
.swatch-ocean{background:linear-gradient(145deg,#f3fbff,#d9eef6);color:#187b91;border-top:4px solid #187b91}
.swatch-rose{background:linear-gradient(145deg,#fff9fb,#f9dbe6);color:#b94166;border-radius:7px}
.swatch-blueprint{background-color:#102b46;background-image:linear-gradient(rgba(107,212,225,.16) 1px,transparent 1px),linear-gradient(90deg,rgba(107,212,225,.16) 1px,transparent 1px);background-size:8px 8px;color:#8be3e6}
.swatch-mono{background:#fff;color:#141414;border-left:5px solid #141414}
.compact-row{margin-top:9px}
.checkbox-row,.field-label{margin-top:9px}
.action-panel{flex:none;padding:11px 16px 13px}
.action-panel p{margin-bottom:6px}
.preview-main{min-height:0}
.preview-main>img{max-height:calc(100% - 60px)}
.thumb-list{flex:1;min-height:0;max-height:none;scrollbar-width:none}
.image-text-fields{padding-top:8px}
.field-heading{display:flex;align-items:center;gap:8px;margin-top:9px}
.field-heading .field-label{margin-top:0}
.field-heading input[type="checkbox"]{flex:none;width:15px;height:15px;margin:0;accent-color:var(--ink);cursor:pointer}
.image-text-fields input[type="text"]{display:block;width:100%;height:34px;margin-top:5px;padding:0 10px;border:1px solid var(--line);border-radius:6px;background:#fff}
.image-text-fields .checkbox-row input{width:auto;height:auto;margin:0;accent-color:var(--ink)}
@media(max-height:700px) and (min-width:901px){.desktop-app{padding-top:8px;padding-bottom:8px}.preview-main{padding:12px}}
/* 图片模板：预览和最终导出共用同一 DOM 与样式。 */
.sheet{--paper:#fff;--text:#181d26;--sub:#545c66;--accent:#aa2d00;--rule:#d6d9df;--callout:#f5e9d4;width:621px;height:830px;flex:none;display:flex;flex-direction:column;overflow:hidden;background:var(--paper);color:var(--text);padding:42px 46px 32px;font-family:var(--font);position:relative}.sheet.theme-editorial{border-top:10px solid #aa2d00;padding-top:34px}.sheet.theme-warm{--paper:#f5e9d4;--text:#3a2720;--sub:#6a5145;--accent:#aa2d00;--rule:#d4bda9;--callout:#fff9ed;background:linear-gradient(145deg,#fcf5e9,#f5e9d4)}.sheet.theme-forest{--paper:#eef4e8;--text:#0a2e0e;--sub:#33563a;--accent:#0a2e0e;--rule:#b7cdb8;--callout:#dcebdc;background:linear-gradient(150deg,#f5f8ef,#e7f0e6)}.sheet.theme-night{--paper:#181d26;--text:#f7f7f3;--sub:#b7c3d0;--accent:#fcab79;--rule:#465363;--callout:#283745;background:linear-gradient(150deg,#232d3b,#181d26 72%)}.sheet.compact{--body-size:18px;--body-leading:1.56}.sheet:not(.compact){--body-size:21px;--body-leading:1.65}.sheet-top{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:14px;border-bottom:1px solid var(--rule);flex:none;font-size:12px;letter-spacing:.13em;font-weight:700;color:var(--accent)}.sheet-top .top-mark{width:28px;height:4px;background:var(--accent);border-radius:2px}.sheet-content{flex:1;min-height:0;overflow:hidden;padding:14px 0 4px;color:var(--text);font-size:var(--body-size);line-height:var(--body-leading);overflow-wrap:anywhere}.sheet-content>*{margin-top:0;margin-bottom:15px}.sheet-content h1,.sheet-content h2,.sheet-content h3{color:var(--text);line-height:1.3;font-weight:600;page-break-after:avoid}.sheet-content h1{font-size:34px;padding-bottom:12px;border-bottom:3px solid var(--accent)}.sheet-content h2{font-size:27px;margin-top:22px}.sheet-content h2:before{content:"";display:inline-block;width:6px;height:23px;background:var(--accent);margin-right:11px;vertical-align:-3px;border-radius:3px}.sheet-content h3{font-size:23px;margin-top:18px}.sheet-content p{color:var(--text)}.sheet-content strong{color:var(--accent)}.sheet-content a{color:var(--accent);text-decoration:underline}.sheet-content blockquote{margin-left:0;margin-right:0;padding:14px 18px;background:var(--callout);border-left:5px solid var(--accent);border-radius:5px;color:var(--text)}.sheet-content blockquote p:last-child{margin-bottom:0}.sheet-content ul,.sheet-content ol{padding-left:1.4em}.sheet-content li{margin:6px 0}.sheet-content pre{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--callout);padding:15px;border-radius:8px;font-size:16px;line-height:1.5}.sheet-content code{font-family:Consolas,"Courier New",monospace;font-size:.83em}.sheet-content :not(pre)>code{background:var(--callout);padding:2px 5px;border-radius:4px}.sheet-content img{max-width:100%;height:auto;display:block;margin:0 auto;border-radius:6px}.sheet-content table{width:100%;border-collapse:collapse;font-size:16px}.sheet-content th,.sheet-content td{padding:8px;border:1px solid var(--rule);vertical-align:top}.sheet-content th{background:var(--callout)}.sheet-content hr{border:0;border-top:2px solid var(--rule);margin:18px 0}.sheet-content .math-block{overflow-wrap:anywhere;text-align:center;overflow:hidden}.sheet-content .katex-display{margin:10px 0}.sheet-footer{flex:none;display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--rule);padding-top:12px;color:var(--sub);font-size:12px;letter-spacing:.08em}.sheet-footer .footer-dot{width:6px;height:6px;background:var(--accent);border-radius:50%}.sheet.cover{justify-content:space-between}.sheet.cover .cover-body{display:flex;flex:1;flex-direction:column;justify-content:center;padding:45px 0}.sheet.cover .cover-tag{display:inline-block;background:var(--accent);color:var(--paper);padding:8px 14px;border-radius:5px;font-size:13px;font-weight:600;letter-spacing:.12em;align-self:flex-start;margin-bottom:28px}.sheet.cover .cover-title{font-size:56px;line-height:1.18;font-weight:600;letter-spacing:-.02em;overflow-wrap:anywhere;margin:0;color:var(--text);max-height:400px;overflow:hidden}.sheet.cover .cover-rule{width:110px;height:7px;border-radius:4px;background:var(--accent);margin-top:36px}.sheet.cover .cover-sub{font-size:18px;color:var(--sub);line-height:1.6;margin-top:24px;max-height:100px;overflow:hidden}.sheet.long{width:750px;height:auto;min-height:400px;padding:48px 58px 38px}.sheet.long .sheet-content{flex:none;height:auto;overflow:visible;padding:24px 0 20px}.sheet.long .sheet-footer{margin-top:20px}.sheet.long .sheet-content>*{break-inside:avoid}
/* 新增样式都作用在导出用的 sheet 上，所见预览与下载图片保持一致。 */
.sheet.cover .cover-body{min-height:0}
.sheet.cover .cover-title{max-height:none;overflow:visible;flex:none}
.sheet.cover .cover-sub{max-height:none;overflow:visible;overflow-wrap:anywhere;flex:none}
.sheet.theme-editorial.cover{border-top:5px solid var(--accent);padding-top:39px}
.sheet.theme-editorial.cover .sheet-top{border:0;padding:0}
.sheet.theme-editorial.cover .sheet-top .top-mark{display:none}
.sheet.theme-editorial.cover .cover-rule{width:68px;height:4px;margin-top:28px}
.sheet.theme-editorial.cover .sheet-footer{border:0}
.sheet.theme-ocean{--paper:#e8f5fa;--text:#17384d;--sub:#426779;--accent:#177b91;--rule:#abd4df;--callout:#d9eef3;background:linear-gradient(155deg,#f5fbfe,#e0f0f5 70%,#d2e9f0)}
.sheet.theme-ocean .sheet-top{border-bottom:2px solid var(--accent)}
.sheet.theme-ocean .sheet-top .top-mark{width:36px;height:6px;border-radius:99px}
.sheet.theme-ocean .cover-rule{width:72px;height:9px;border-radius:99px}
.sheet.theme-ocean .sheet-content h2:before{border-radius:99px}
.sheet.theme-rose{--paper:#fff1f5;--text:#492a3a;--sub:#745263;--accent:#b94069;--rule:#e7bbcb;--callout:#f9dce6;background:radial-gradient(circle at 92% 10%,#fbd8e5 0,#fbd8e5 16%,transparent 42%),linear-gradient(155deg,#fff9fb,#fce5ed)}
.sheet.theme-rose .sheet-top{background:rgba(255,255,255,.72);border:1px solid var(--rule);border-radius:12px;padding:10px 14px}
.sheet.theme-rose .sheet-content{margin-top:14px;padding:17px 18px 4px;background:rgba(255,255,255,.58);border-radius:16px}
.sheet.theme-rose.cover .cover-body{margin:20px 0;padding:30px;background:rgba(255,255,255,.6);border:1px solid var(--rule);border-radius:20px}
.sheet.theme-rose .cover-rule{height:4px;border-radius:99px}
.sheet.theme-blueprint{--paper:#102b46;--text:#eaf8fa;--sub:#a7cdd7;--accent:#88e3e6;--rule:#436c81;--callout:#1b4258;background-color:#102b46;background-image:linear-gradient(rgba(119,210,221,.1) 1px,transparent 1px),linear-gradient(90deg,rgba(119,210,221,.1) 1px,transparent 1px);background-size:32px 32px}
.sheet.theme-blueprint .sheet-top{border-bottom:2px solid var(--accent)}
.sheet.theme-blueprint .sheet-content{margin-top:13px;padding:16px 18px 4px;background:rgba(8,31,51,.82);border-left:4px solid var(--accent)}
.sheet.theme-blueprint .sheet-content strong{color:#a6f0f0}
.sheet.theme-blueprint .cover-title{letter-spacing:-.03em}
.sheet.theme-mono{--paper:#fff;--text:#101010;--sub:#555;--accent:#101010;--rule:#9b9b9b;--callout:#eee;background:#fff;border-left:12px solid #101010;padding-left:34px}
.sheet.theme-mono .sheet-top{border-bottom:3px solid #101010;font-family:Consolas,"Courier New",monospace;letter-spacing:.03em}
.sheet.theme-mono .sheet-top .top-mark{width:12px;height:12px;border-radius:0}
.sheet.theme-mono .sheet-content h1{font-weight:800;letter-spacing:-.04em}
.sheet.theme-mono .sheet-content h2:before{width:10px;border-radius:0}
.sheet.theme-mono .cover-title{font-weight:800;letter-spacing:-.05em}
.sheet.theme-mono .cover-rule{width:100%;height:3px;border-radius:0}
.sheet.theme-mono .sheet-footer{font-family:Consolas,"Courier New",monospace}
@media(max-width:900px){.workspace-nav,.desktop-app{display:none}.desktop-only{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:30px;text-align:center;background:#f8fafc}.desktop-only img{width:48px;height:48px;margin-bottom:20px}.desktop-only h1{font-size:22px;line-height:1.35;color:var(--ink);margin-bottom:10px}.desktop-only p{color:var(--muted);max-width:320px}.desktop-only a{margin-top:24px;background:var(--ink);color:#fff;border-radius:9px;padding:11px 18px}}
/* 图片工作台：编辑 / 模板 / 自定义三栏与实时 DOM 预览。 */
.studio{grid-template-columns:minmax(410px,42%) minmax(0,1fr)}
.workspace-tabs{display:grid;grid-template-columns:repeat(3,1fr);flex:none;border-bottom:1px solid var(--line);background:#f8fafc;padding:6px;gap:4px}
.workspace-tabs button{border:0;background:transparent;border-radius:7px;padding:8px 4px;color:#67717e;font-size:12px;font-weight:600}
.workspace-tabs button[aria-selected="true"]{background:#fff;color:#21466c;box-shadow:0 1px 5px rgba(23,49,78,.12)}
.controls-scroll{display:flex;flex-direction:column}
.workspace-pane.active{display:flex;flex-direction:column;flex:1;min-height:100%}
.workspace-pane[data-pane="edit"] .source-section{display:flex;flex-direction:column;flex:1;min-height:340px}
.controls-scroll{scrollbar-width:thin}
.source-section textarea,.source-section textarea:focus{height:auto;min-height:220px;flex:1;resize:none;font-size:13px;line-height:1.65;margin:8px 0;border-radius:7px;background:#fff}
.editor-toolbar{display:flex;flex-wrap:wrap;gap:3px;margin-top:0;padding:5px;border:1px solid var(--line);background:#f8fafc;border-radius:8px}
.editor-toolbar button{border:0;border-radius:5px;background:transparent;padding:4px 7px;min-height:27px;font-size:11px;color:#35465a}
.editor-toolbar button:hover{background:#e8eef6;color:#173e65}
.editor-toolbar button:disabled{opacity:.35;cursor:not-allowed}
.editor-tip{margin-top:7px}.editor-tip code{padding:1px 4px;border-radius:4px;background:#edf1f6}
.template-filters{display:flex;gap:5px;overflow-x:auto;padding:0 0 12px;scrollbar-width:none}
.template-filters button{border:1px solid var(--line);border-radius:99px;background:#fff;color:#566170;padding:5px 10px;white-space:nowrap;font-size:11px}
.template-filters button.active{background:#1c3855;color:#fff;border-color:#1c3855}
.template-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.template-choice{padding:6px;overflow:hidden}.template-choice span{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.template-art{height:104px}.template-art .sheet{left:calc(50% - 80.73px)}
.custom-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.custom-grid label{font-size:11px;color:#586575}.custom-grid input{display:block;width:100%;height:35px;padding:2px;border:1px solid var(--line);border-radius:6px;background:#fff;margin-top:4px}
.custom-toggle-row{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:7px 0 16px}.custom-toggle-row label{display:flex;align-items:center;gap:3px;font-size:10px;color:#566170;white-space:nowrap}.custom-toggle-row input{margin:0;accent-color:#21466c}
.custom-fields{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px 8px}.custom-fields label{font-size:12px;color:#263544}.custom-fields output{font-size:10px;color:#6b7886;margin-left:6px}.custom-fields select{height:34px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:0 8px;max-width:190px}.custom-fields input[type="range"]{width:170px;accent-color:#286b92}.custom-fields+#resetCustom{margin-top:16px}
.live-results .preview-main{overflow:hidden}.live-canvas{display:flex;align-items:flex-start;justify-content:center;width:100%;height:100%;min-height:0;overflow:auto;padding:12px;scrollbar-width:thin}.live-page-frame{flex:none;position:relative;box-shadow:0 12px 36px rgba(24,29,38,.17);background:#fff}.live-page-frame>.sheet{position:absolute;top:0;left:0}.live-thumb-art{display:block;width:100%;height:100px;overflow:hidden;position:relative;background:#f3f4f6;border-radius:3px;margin-bottom:4px}.live-thumb-art>.sheet{position:absolute;left:calc(50% - 40px);top:0;pointer-events:none}.live-results .preview-side>.hint{margin-top:auto}
.sheet.family-stationery{background:var(--paper);border:1px solid var(--rule);border-top:14px solid var(--accent);padding-top:28px}.sheet.family-stationery .sheet-top{border-bottom:1px dashed var(--accent)}.sheet.family-stationery .sheet-content{background:repeating-linear-gradient(to bottom,transparent 0,transparent 35px,var(--rule) 36px,transparent 37px)}.sheet.family-stationery .cover-rule{width:100%;height:2px;border-radius:0}
.sheet.family-poster{background:var(--paper)}.sheet.family-poster:before{content:"";position:absolute;top:0;right:0;width:140px;height:140px;border-radius:0 0 0 100%;background:var(--callout);pointer-events:none}.sheet.family-poster .sheet-top{border:0;border-bottom:5px solid var(--accent);position:relative}.sheet.family-poster .sheet-content h1{font-size:39px;letter-spacing:-.04em;border:0}.sheet.family-poster .sheet-content h2:before{width:10px;height:27px;border-radius:0}.sheet.family-poster .cover-title{font-weight:800;letter-spacing:-.04em}.sheet.family-poster .cover-rule{width:100%;height:9px;border-radius:0}
.sheet.family-frame{background:var(--paper);outline:2px solid var(--accent);outline-offset:-18px;padding:48px 54px 38px}.sheet.family-frame .sheet-top{border:0}.sheet.family-frame .sheet-content h1{border-bottom:1px solid var(--accent);font-weight:400}.sheet.family-frame .sheet-content h2:before{display:none}.sheet.family-frame .sheet-content blockquote{border-left:0;border-top:2px solid var(--accent);border-radius:0}.sheet.family-frame .cover-rule{height:2px;border-radius:0}
.sheet.family-grid{background-color:var(--paper);background-image:linear-gradient(var(--rule) 1px,transparent 1px),linear-gradient(90deg,var(--rule) 1px,transparent 1px);background-size:32px 32px}.sheet.family-grid .sheet-top{background:var(--callout);padding:10px 13px;border-left:5px solid var(--accent)}.sheet.family-grid .sheet-content{background:var(--paper);margin-top:12px;padding:14px 17px 2px;border:1px solid var(--rule)}.sheet.family-grid .sheet-footer{background:var(--paper);padding:11px 13px}.sheet.family-grid .cover-body{background:var(--paper);margin:16px 0;padding:24px;border:1px solid var(--rule)}
@media(max-width:1250px) and (min-width:901px){.studio{grid-template-columns:minmax(390px,44%) minmax(0,1fr)}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.preview-results{grid-template-columns:minmax(0,1fr) 150px}.preview-side{padding:12px}.thumb-list{grid-template-columns:1fr}.custom-fields input[type="range"]{width:130px}}
/* 宽屏铺满视口；编辑区使用排版视图，源码只在主动切换时显示。 */
.desktop-app{max-width:none;padding-left:clamp(14px,1.4vw,32px);padding-right:clamp(14px,1.4vw,32px)}
.studio{grid-template-columns:minmax(430px,45%) minmax(0,1fr);gap:14px}
.source-section .rich-editor{display:block;width:100%;min-height:250px;flex:1;overflow:auto;outline:none;margin:8px 0;padding:18px 20px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#27313d;font-size:15px;line-height:1.75;overflow-wrap:anywhere;scrollbar-width:thin}
.rich-editor:empty:before{content:attr(data-placeholder);color:#929daa;pointer-events:none}
.rich-editor:focus{border-color:#7d9dc4;box-shadow:0 0 0 3px rgba(76,124,183,.12)}
.rich-editor h1,.rich-editor h2,.rich-editor h3{line-height:1.35;color:#172a42;margin:18px 0 11px}.rich-editor h1{font-size:25px}.rich-editor h2{font-size:21px}.rich-editor h3{font-size:18px}
.rich-editor h1:first-child,.rich-editor h2:first-child,.rich-editor h3:first-child{margin-top:0}
.rich-editor p{margin:0 0 13px}.rich-editor ul,.rich-editor ol{padding-left:1.5em;margin:8px 0 15px}.rich-editor li{margin:4px 0}.rich-editor blockquote{border-left:4px solid #80a7bf;background:#f1f6f8;padding:8px 14px;margin:13px 0;color:#43566a}.rich-editor blockquote p:last-child{margin-bottom:0}
.rich-editor pre{padding:12px 14px;border-radius:7px;background:#eef2f7;white-space:pre-wrap;overflow-wrap:anywhere}.rich-editor code{font-family:Consolas,monospace;background:#eef2f7;padding:1px 3px;border-radius:3px}.rich-editor img{max-width:100%;height:auto}.rich-editor table{border-collapse:collapse;max-width:100%;display:block;overflow:auto}.rich-editor th,.rich-editor td{border:1px solid #cbd5df;padding:5px 8px}.rich-editor hr{border:0;border-top:1px solid #b9c8d7;margin:16px 0}.rich-editor .editor-page-break{border:1px dashed #81a3c5;background:#eef5fb;color:#315d80;text-align:center;padding:7px 10px;margin:15px 0;border-radius:5px;font-size:12px;user-select:none}
.source-section textarea:not([hidden]){min-height:250px}
.editor-toolbar #clearFormat,.editor-toolbar #toggleSourceMode{background:#e9f0f8;color:#254f75;padding-inline:9px;white-space:nowrap}.editor-toolbar #clearFormat{margin-left:auto}.editor-toolbar #toggleSourceMode[aria-pressed="true"]{background:#234d70;color:#fff}
.custom-fields>.range-control{width:min(100%,310px);min-width:185px;padding:0 8px 21px}.range-control input[type="range"]{display:block;width:100%!important;height:24px;margin:0;accent-color:#286b92}.range-scale{position:relative;height:18px;margin-top:0}.range-mark{position:absolute;top:0;transform:translateX(-50%);font-size:9px;color:#7a8794;white-space:nowrap;text-align:center;padding-top:7px}.range-mark:before{content:"";position:absolute;top:1px;left:50%;height:5px;border-left:1px solid #9aaabb}.range-mark:first-child{transform:translateX(-10%)}.range-mark:last-child{transform:translateX(-90%)}
@media(max-width:1250px) and (min-width:901px){.studio{grid-template-columns:minmax(390px,45%) minmax(0,1fr)}.custom-fields>.range-control{min-width:130px}}
/* 当前模板在缩略图与名称上都保持明确的选中态。 */
.template-choice{position:relative;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}
.template-choice:hover{border-color:#8daac7;background:#f7faff}
.template-choice.active,.template-choice.active:hover{border:2px solid #245f9b;padding:5px;background:#eaf3ff;box-shadow:0 0 0 2px rgba(36,95,155,.16),0 5px 14px rgba(25,73,119,.12)}
.template-choice.active .template-art{border-color:#245f9b}
.template-choice.active span:last-child{color:#174c83;font-weight:700}
.template-choice.active:after{content:"✓";position:absolute;right:12px;top:12px;z-index:2;display:grid;place-items:center;width:23px;height:23px;border-radius:50%;background:#245f9b;color:#fff;font-size:14px;font-weight:700;box-shadow:0 2px 6px rgba(19,57,97,.3)}
/* 控件标签单独成行，刻度只标端点与中值，当前数值由 output 显示。 */
.custom-fields>label[for="bodySize"],.custom-fields>label[for="lineHeight"],.custom-fields>label[for="pagePadding"]{grid-column:1/-1;margin-top:8px;font-weight:600}
.custom-fields>.range-control{grid-column:1/-1;width:100%;max-width:none;min-width:0;padding:0 9px 2px}
.range-control input[type="range"]{appearance:none;-webkit-appearance:none;display:block;width:100%;height:22px;background:transparent;cursor:pointer}
.range-control input[type="range"]::-webkit-slider-runnable-track{height:5px;border-radius:99px;background:#dce6f0}
.range-control input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:17px;height:17px;margin-top:-6px;border:3px solid #fff;border-radius:50%;background:#286b92;box-shadow:0 0 0 1px #286b92,0 2px 6px rgba(24,64,96,.22)}
.range-control input[type="range"]::-moz-range-track{height:5px;border-radius:99px;background:#dce6f0}
.range-control input[type="range"]::-moz-range-thumb{width:13px;height:13px;border:3px solid #fff;border-radius:50%;background:#286b92;box-shadow:0 0 0 1px #286b92}
.range-scale{height:9px;margin:0 1px;position:relative}
.range-mark{top:0;display:block;width:1px;height:5px;padding:0;transform:translateX(-50%);background:#9eb0bf}
.range-mark:before{display:none}.range-mark:first-child,.range-mark:last-child{transform:translateX(-50%)}
.range-labels{display:flex;justify-content:space-between;align-items:center;margin:0 -1px;color:#697989;font-size:11px;line-height:1.2}
.cover-section .checkbox-row{margin-top:3px}.cover-section #coverTextFields{padding-top:8px}
/* 多版式模板：所有装饰均为 CSS 图形，正文和封面文字仍来自可编辑字段。 */
.template-art{height:164px;background:#e8edf2}
.template-art .sheet{left:calc(50% - 59px);transform:scale(.19)}
.sheet.family-journal{background:var(--paper);border-left:15px solid var(--accent);padding-left:39px}
.sheet.family-journal .sheet-top{border-bottom:2px dashed var(--accent)}
.sheet.family-journal .sheet-content{background:repeating-linear-gradient(to bottom,transparent 0,transparent 34px,var(--rule) 35px,transparent 36px)}
.sheet.family-journal .sheet-content h1{border-bottom:0;font-family:Georgia,"Songti SC",serif;font-style:italic}
.sheet.family-journal .sheet-footer{border-top:2px dashed var(--rule)}
.sheet.family-scrapbook{background:var(--paper)}
.sheet.family-scrapbook:before,.sheet.family-scrapbook:after{content:"";position:absolute;width:96px;height:20px;background:var(--callout);opacity:.9;transform:rotate(-28deg);z-index:2;pointer-events:none}
.sheet.family-scrapbook:before{left:-26px;top:28px}.sheet.family-scrapbook:after{right:-26px;bottom:48px}
.sheet.family-scrapbook .sheet-top{border:0;transform:rotate(-1.5deg);background:var(--callout);padding:12px 16px}
.sheet.family-scrapbook .sheet-content{margin:16px 0 10px;padding:18px 22px;background:var(--paper);border:2px solid var(--rule);box-shadow:8px 8px 0 var(--callout);transform:rotate(.35deg)}
.sheet.family-scrapbook .sheet-content h1{border:0;color:var(--accent)}
.sheet.family-scrapbook .cover-body{margin:22px 0;background:var(--callout);padding:28px;transform:rotate(-1deg)}
.sheet.family-polaroid{background:var(--accent);padding:28px 28px 44px}
.sheet.family-polaroid .sheet-top,.sheet.family-polaroid .sheet-content,.sheet.family-polaroid .sheet-footer{background:var(--paper);padding-left:26px;padding-right:26px}
.sheet.family-polaroid .sheet-top{padding-top:25px;border:0}.sheet.family-polaroid .sheet-content{padding-top:16px}.sheet.family-polaroid .sheet-footer{padding-bottom:33px;border:0}
.sheet.family-polaroid .sheet-content h1{font-family:Georgia,"Songti SC",serif;border:0}
.sheet.family-polaroid.cover .cover-body{background:var(--paper);padding:34px;min-height:0}
.sheet.family-watercolor{background:radial-gradient(circle at 8% 8%,var(--callout),transparent 37%),radial-gradient(circle at 94% 85%,var(--rule),transparent 36%),var(--paper)}
.sheet.family-watercolor .sheet-top{border:0}.sheet.family-watercolor .sheet-content h1{border:0;font-family:Georgia,"Songti SC",serif;font-style:italic;font-size:39px}
.sheet.family-watercolor .sheet-content h2:before{width:20px;height:20px;border-radius:50%;vertical-align:-2px}
.sheet.family-watercolor .sheet-content blockquote{border:0;border-radius:28px;background:var(--callout)}
.sheet.family-watercolor .cover-rule{width:68px;height:18px;border-radius:50%;filter:blur(2px)}
.sheet.family-magazine{background:var(--paper);border-top:30px solid var(--accent);padding-top:22px}
.sheet.family-magazine .sheet-top{font-size:15px;letter-spacing:.25em;border-bottom:5px solid var(--text)}
.sheet.family-magazine .sheet-content h1{font-family:Georgia,"Songti SC",serif;font-size:45px;line-height:1.12;letter-spacing:-.05em;border:0}
.sheet.family-magazine .sheet-content h2{border-top:2px solid var(--accent);padding-top:9px}.sheet.family-magazine .sheet-content h2:before{display:none}
.sheet.family-magazine .sheet-footer{border-top:5px solid var(--text)}.sheet.family-magazine .cover-title{font-family:Georgia,"Songti SC",serif;font-size:64px}
.sheet.family-billboard{background:var(--paper);border-left:30px solid var(--accent);padding-left:25px}
.sheet.family-billboard:after{content:"";position:absolute;top:0;right:0;border-top:95px solid var(--callout);border-left:95px solid transparent;pointer-events:none}
.sheet.family-billboard .sheet-top{border:0;text-transform:uppercase}.sheet.family-billboard .sheet-content h1{font-size:49px;line-height:1.07;font-weight:900;letter-spacing:-.06em;border:0}
.sheet.family-billboard .sheet-content h2:before{width:24px;height:7px;vertical-align:5px;border-radius:0}
.sheet.family-billboard .cover-title{font-size:68px;font-weight:900;line-height:1.04}
.sheet.family-ticket{background:var(--paper);border:3px dashed var(--accent);border-radius:22px;padding:37px 42px 30px}
.sheet.family-ticket:before,.sheet.family-ticket:after{content:"";position:absolute;top:48%;width:28px;height:28px;border-radius:50%;background:#e8edf2;z-index:2}
.sheet.family-ticket:before{left:-15px}.sheet.family-ticket:after{right:-15px}
.sheet.family-ticket .sheet-top{border-bottom:2px dashed var(--accent);letter-spacing:.2em}
.sheet.family-ticket .sheet-content h1{border-bottom:0;background:var(--callout);padding:10px 12px;border-radius:9px}
.sheet.family-ticket .sheet-footer{border-top:2px dashed var(--accent)}
.sheet.family-zen{background:var(--paper);padding:78px 78px 64px}
.sheet.family-zen .sheet-top{border:0;font-weight:400;letter-spacing:.28em}.sheet.family-zen .sheet-top .top-mark{width:1px;height:27px}
.sheet.family-zen .sheet-content{padding-top:35px}.sheet.family-zen .sheet-content h1{font-family:Georgia,"Songti SC",serif;font-weight:400;font-size:40px;border:0}
.sheet.family-zen .sheet-content h2:before{display:none}.sheet.family-zen .sheet-content blockquote{background:transparent;border-left:1px solid var(--accent)}
.sheet.family-zen .sheet-footer{border:0}.sheet.family-zen .cover-rule{width:42px;height:1px;border-radius:0}
.sheet.family-gallery{background:var(--paper);outline:3px solid var(--accent);outline-offset:-19px;padding:52px 62px 48px}
.sheet.family-gallery .sheet-top{border:0;justify-content:center}.sheet.family-gallery .sheet-top .top-mark{display:none}
.sheet.family-gallery .sheet-content h1{text-align:center;border:0;font-family:Georgia,"Songti SC",serif;font-weight:400}
.sheet.family-gallery .sheet-content h2:before{display:none}.sheet.family-gallery .sheet-content blockquote{background:transparent;border:1px solid var(--rule);border-radius:0}
.sheet.family-gallery .sheet-footer{border-top:1px solid var(--accent)}.sheet.family-gallery .cover-body{align-items:center;text-align:center}
.sheet.family-typewriter{background:var(--paper);font-family:Consolas,"Courier New","Microsoft YaHei",monospace;border-left:5px solid var(--accent)}
.sheet.family-typewriter .sheet-top{border-bottom:1px dotted var(--accent);letter-spacing:.02em}.sheet.family-typewriter .sheet-top .top-mark{height:2px;border-radius:0}
.sheet.family-typewriter .sheet-content h1{font-family:inherit;font-size:32px;border:0;text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:9px}
.sheet.family-typewriter .sheet-content h2:before{display:none}.sheet.family-typewriter .sheet-content h2{font-family:inherit}
.sheet.family-typewriter .sheet-content blockquote{background:transparent;border-left:2px dotted var(--accent)}
.sheet.family-typewriter .sheet-footer{border-top:1px dotted var(--accent)}
.sheet.family-sidebar{background:var(--paper);border-left:62px solid var(--accent);padding-left:27px}
.sheet.family-sidebar .sheet-top{border-bottom:0;background:var(--callout);padding:11px 14px}
.sheet.family-sidebar .sheet-content h1{border:0;font-size:38px}.sheet.family-sidebar .sheet-content h2{border-bottom:2px solid var(--accent);padding-bottom:7px}
.sheet.family-sidebar .sheet-content h2:before{display:none}.sheet.family-sidebar .sheet-footer{border-top:2px solid var(--accent)}
.sheet.family-terminal{--paper:#151e2b;--text:#eef7f0;--sub:#abc2bd;--accent:#7ee2aa;--rule:#33514a;--callout:#20362f;background:var(--paper);font-family:Consolas,"Courier New","Microsoft YaHei",monospace;border:2px solid var(--accent);padding:34px}
.sheet.family-terminal .sheet-top{background:var(--callout);padding:12px 14px;border:0;border-radius:6px 6px 0 0;letter-spacing:.02em}
.sheet.family-terminal .sheet-top .top-mark{width:9px;height:9px;border-radius:50%;box-shadow:-14px 0 var(--accent),14px 0 var(--accent)}
.sheet.family-terminal .sheet-content{border:1px solid var(--rule);padding:20px 22px}.sheet.family-terminal .sheet-content h1{border:0;font-family:inherit;font-size:31px}
.sheet.family-terminal .sheet-content h1:before,.sheet.family-terminal .sheet-content h2:before{content:"";display:inline-block;width:10px;height:20px;background:var(--accent);margin-right:12px;vertical-align:-3px}
.sheet.family-terminal .sheet-footer{border:0;background:var(--callout);padding:10px 14px}.sheet.family-terminal .cover-body{border:1px solid var(--rule);padding:30px}
.sheet.family-blueprint{background-color:var(--paper);background-image:linear-gradient(var(--rule) 1px,transparent 1px),linear-gradient(90deg,var(--rule) 1px,transparent 1px);background-size:28px 28px}
.sheet.family-blueprint .sheet-top{background:var(--paper);border:2px solid var(--accent);padding:10px 13px}
.sheet.family-blueprint .sheet-content{background:var(--paper);border:2px solid var(--accent);margin-top:13px;padding:15px 18px}
.sheet.family-blueprint .sheet-content h1{border-bottom:2px dashed var(--accent)}.sheet.family-blueprint .sheet-content h2:before{border-radius:0}
.sheet.family-blueprint .sheet-footer{background:var(--paper);border:2px solid var(--accent);margin-top:12px;padding:8px 12px}
.sheet.family-blueprint .cover-body{background:var(--paper);border:2px solid var(--accent);margin:14px 0;padding:24px}
.sheet.family-neon{background:radial-gradient(circle at 85% 15%,var(--callout),transparent 45%),radial-gradient(circle at 0 90%,var(--rule),transparent 42%),var(--paper);border:2px solid var(--accent)}
.sheet.family-neon .sheet-top{border-bottom:2px solid var(--accent);text-shadow:0 0 12px var(--accent)}
.sheet.family-neon .sheet-content h1{border-bottom:0;text-shadow:0 0 18px var(--accent)}.sheet.family-neon .sheet-content h2:before{box-shadow:0 0 12px var(--accent)}
.sheet.family-neon .sheet-content blockquote{border:1px solid var(--accent);box-shadow:0 0 12px rgba(241,139,219,.22)}
.sheet.family-neon .cover-rule{box-shadow:0 0 16px var(--accent)}
.sheet.family-dashboard{background:var(--paper)}
.sheet.family-dashboard .sheet-top{background:var(--accent);color:var(--paper);padding:12px 16px;border:0;border-radius:8px}
.sheet.family-dashboard .sheet-top .top-mark{background:var(--paper)}
.sheet.family-dashboard .sheet-content{display:flex;flex-direction:column;gap:9px;padding-top:15px}
.sheet.family-dashboard .sheet-content>*{margin:0;background:var(--callout);border:1px solid var(--rule);border-radius:9px;padding:10px 13px}
.sheet.family-dashboard .sheet-content h1{font-size:30px;border-left:6px solid var(--accent);border-bottom:0}
.sheet.family-dashboard .sheet-content h2:before{display:none}.sheet.family-dashboard .sheet-content blockquote{border-left:6px solid var(--accent)}
.sheet.family-dashboard .sheet-footer{border:0}.sheet.family-dashboard .cover-body{background:var(--callout);border:1px solid var(--rule);border-radius:16px;margin:18px 0;padding:27px}
/* 缩略图展示完整的一页正文，而非只露出页首；正文和导出仍共用 sheet。 */
.template-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.template-choice{padding:9px;gap:8px}
.template-choice.active,.template-choice.active:hover{padding:8px}
.template-art{height:218px}
.template-art .sheet{left:calc(50% - 77.6px);transform:scale(.25)}
@media(max-width:1100px) and (min-width:901px){.template-art{height:190px}.template-art .sheet{left:calc(50% - 68.3px);transform:scale(.22)}}
@media(min-width:1700px){.template-art{height:244px}.template-art .sheet{left:calc(50% - 90px);transform:scale(.29)}}
/* 原创纹理与植物线描：只作为装饰，不承载不可编辑的文字。 */
.sheet.family-journal{background-color:var(--paper);background-image:radial-gradient(rgba(104,83,58,.1) .6px,transparent .9px);background-size:7px 7px}
.sheet.family-journal:before{content:"";position:absolute;left:14px;top:92px;bottom:78px;width:12px;background:radial-gradient(circle,var(--paper) 0 4px,var(--rule) 4.5px 5.5px,transparent 6px) center top/12px 74px repeat-y;pointer-events:none}
.sheet.family-journal .sheet-content li::marker{color:var(--accent)}
.sheet.family-journal .sheet-content blockquote{background:var(--callout);border-left:2px solid var(--accent);border-radius:0;font-family:Georgia,"Songti SC",serif;font-style:italic}
.sheet.family-journal.cover .cover-body{border-left:2px dashed var(--accent);padding-left:25px}
.sheet.family-journal.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-style:italic}
.sheet.family-journal.cover .cover-rule{width:100%;height:2px;border-radius:0}
.sheet.family-scrapbook{background-image:radial-gradient(var(--rule) .7px,transparent 1px);background-size:13px 13px;background-color:var(--paper)}
.sheet.family-scrapbook .sheet-content h2{display:table;padding:6px 11px;background:var(--callout);transform:rotate(-.5deg)}
.sheet.family-scrapbook .sheet-content h2:before{display:none}
.sheet.family-scrapbook .sheet-content blockquote{border:2px dashed var(--accent);background:var(--callout);transform:rotate(-.4deg)}
.sheet.family-scrapbook .sheet-content li::marker{color:var(--accent)}
.sheet.family-scrapbook.cover .cover-title{color:var(--accent);font-weight:800}
.sheet.family-scrapbook.cover .cover-rule{width:100%;height:3px;border-radius:0;transform:rotate(1deg)}
.sheet.family-polaroid .sheet-content blockquote{background:var(--callout);border:0;border-radius:0 0 20px 20px}
.sheet.family-polaroid .sheet-content h2{font-family:Georgia,"Songti SC",serif}
.sheet.family-polaroid .sheet-content li::marker{color:var(--accent)}
.sheet.family-polaroid.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-weight:400}
.sheet.family-polaroid.cover .cover-rule{width:45px;height:2px;border-radius:0}
.sheet.family-watercolor:before,.sheet.family-watercolor:after{content:"";position:absolute;width:165px;height:165px;background:url('/md2social/image/decor/botanical.svg') center/contain no-repeat;opacity:.46;pointer-events:none}
.sheet.family-watercolor:before{right:-18px;top:-17px;transform:rotate(188deg)}
.sheet.family-watercolor:after{left:-24px;bottom:-25px}
.sheet.family-watercolor .sheet-content,.sheet.family-watercolor .cover-body{position:relative;z-index:1}
.sheet.family-watercolor .sheet-content li::marker{color:var(--accent)}
.sheet.family-watercolor .sheet-content blockquote{font-family:Georgia,"Songti SC",serif;font-style:italic}
.sheet.family-watercolor.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-weight:400}
.sheet.family-watercolor.cover .cover-tag{border-radius:99px}
.sheet.family-magazine .sheet-content p:first-of-type{font-size:1.05em;font-weight:500}
.sheet.family-magazine .sheet-content li::marker{font-weight:800;color:var(--accent)}
.sheet.family-magazine .sheet-content blockquote{border-left:0;border-top:4px solid var(--accent);border-bottom:1px solid var(--rule);border-radius:0;background:transparent;font-family:Georgia,"Songti SC",serif;font-size:1.06em}
.sheet.family-magazine.cover .cover-body{border-top:5px solid var(--text);border-bottom:5px solid var(--text);margin:18px 0}
.sheet.family-magazine.cover .cover-rule{width:100%;height:4px;border-radius:0}
.sheet.family-billboard .sheet-content strong{background:var(--accent);color:var(--paper);padding:0 4px}
.sheet.family-billboard .sheet-content blockquote{border-left:10px solid var(--accent);background:var(--callout);border-radius:0;font-weight:700}
.sheet.family-billboard .sheet-content li::marker{font-weight:900;color:var(--accent)}
.sheet.family-billboard.cover .cover-body{border-bottom:12px solid var(--accent)}
.sheet.family-billboard.cover .cover-rule{width:90%;height:12px;border-radius:0}
.sheet.family-ticket .sheet-content li::marker{font-weight:800;color:var(--accent)}
.sheet.family-ticket .sheet-content blockquote{border:2px dashed var(--accent);background:transparent;border-radius:10px}
.sheet.family-ticket.cover .cover-body{border-top:2px dashed var(--accent);border-bottom:2px dashed var(--accent);margin:20px 0}
.sheet.family-ticket.cover .cover-tag{border-radius:99px}
.sheet.family-ticket.cover .cover-rule{width:100%;height:2px;background:repeating-linear-gradient(90deg,var(--accent) 0 12px,transparent 12px 20px)}
.sheet.family-zen{--body-size:20px;--body-leading:1.8}
.sheet.family-zen .sheet-content strong{color:var(--text);font-weight:500;border-bottom:1px solid var(--accent)}
.sheet.family-zen .sheet-content li::marker{color:var(--accent)}
.sheet.family-zen.cover .cover-body{align-items:center;text-align:center}
.sheet.family-zen.cover .cover-tag{background:transparent;color:var(--accent);border:1px solid var(--accent);border-radius:0}
.sheet.family-gallery{--body-size:20px;--body-leading:1.72}
.sheet.family-gallery .sheet-content h2{font-family:Georgia,"Songti SC",serif;font-weight:400}
.sheet.family-gallery .sheet-content li::marker{color:var(--accent)}
.sheet.family-gallery.cover .cover-tag{background:transparent;color:var(--accent);border-bottom:1px solid var(--accent);border-radius:0}
.sheet.family-gallery.cover .cover-rule{width:100%;height:1px;border-radius:0}
.sheet.family-typewriter{background-color:var(--paper);background-image:linear-gradient(90deg,transparent 0 14px,var(--rule) 15px,transparent 16px),radial-gradient(rgba(99,78,55,.07) .7px,transparent 1px);background-size:auto,6px 6px}
.sheet.family-typewriter .sheet-content li::marker{color:var(--accent)}
.sheet.family-typewriter .sheet-content strong{color:var(--text);background:var(--callout);padding:1px 3px}
.sheet.family-typewriter.cover .cover-body{border:1px dotted var(--accent);padding:34px}
.sheet.family-typewriter.cover .cover-title{font-family:inherit;font-weight:700}
.sheet.family-typewriter.cover .cover-rule{height:2px;border-radius:0}
.sheet.family-sidebar .sheet-content li::marker{color:var(--accent)}
.sheet.family-sidebar .sheet-content blockquote{border:0;background:var(--callout);border-radius:0 14px 14px 0}
.sheet.family-sidebar.cover .cover-body{border-left:7px solid var(--accent);padding-left:28px}
.sheet.family-sidebar.cover .cover-rule{width:100%;height:2px;border-radius:0}
.sheet.family-terminal{--body-size:18px;--body-leading:1.58}
.sheet.family-terminal .sheet-content strong{color:var(--accent)}
.sheet.family-terminal .sheet-content li::marker{color:var(--accent)}
.sheet.family-terminal .sheet-content blockquote{background:var(--callout);border-left:2px solid var(--accent);border-radius:0}
.sheet.family-terminal.cover .cover-body{background:var(--callout);padding:30px}
.sheet.family-terminal.cover .cover-title{font-family:inherit;font-size:49px}
.sheet.family-terminal.cover .cover-rule{width:100%;height:2px;border-radius:0}
.sheet.family-blueprint .sheet-content li::marker{color:var(--accent)}
.sheet.family-blueprint .sheet-content blockquote{background:var(--callout);border:1px dashed var(--accent);border-left:4px solid var(--accent);border-radius:0}
.sheet.family-blueprint.cover .cover-body{border:2px solid var(--accent);background:var(--paper);padding:28px;margin:14px 0}
.sheet.family-blueprint.cover .cover-title{font-family:Consolas,"Microsoft YaHei",monospace;font-size:48px}
.sheet.family-blueprint.cover .cover-rule{width:100%;height:2px;border-radius:0}
.sheet.family-neon .sheet-content strong{color:var(--accent);text-shadow:0 0 9px var(--accent)}
.sheet.family-neon .sheet-content li::marker{color:var(--accent)}
.sheet.family-neon.cover .cover-body{border:1px solid var(--accent);padding:30px;background:var(--callout)}
.sheet.family-neon.cover .cover-title{text-shadow:0 0 18px var(--accent)}
.sheet.family-neon.cover .cover-rule{width:100%;height:2px}
.sheet.family-dashboard .sheet-content li::marker{color:var(--accent);font-weight:700}
.sheet.family-dashboard .sheet-content strong{background:var(--accent);color:var(--paper);padding:0 4px;border-radius:3px}
.sheet.family-dashboard.cover .cover-body{border-left:7px solid var(--accent)}
.sheet.family-dashboard.cover .cover-rule{width:100%;height:2px;border-radius:0}
/* 经典八款也完善标题、引语和封面，避免只剩下配色差异。 */
.sheet.theme-editorial .sheet-content h1{font-family:Georgia,"Songti SC",serif;font-weight:500;letter-spacing:-.03em}
.sheet.theme-editorial .sheet-content blockquote{border-left-width:2px;border-radius:0;background:var(--callout);font-family:Georgia,"Songti SC",serif}
.sheet.theme-editorial.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-weight:500}
.sheet.theme-editorial.cover .cover-body{margin:18px 0}
.sheet.theme-warm{background-image:radial-gradient(rgba(132,89,47,.07) .7px,transparent 1px),linear-gradient(145deg,#fcf5e9,#f5e9d4);background-size:6px 6px,auto}
.sheet.theme-warm .sheet-content h1{font-family:Georgia,"Songti SC",serif;border-bottom:1px solid var(--accent)}
.sheet.theme-warm .sheet-content li::marker{color:var(--accent)}
.sheet.theme-warm.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-weight:500}
.sheet.theme-warm.cover .cover-tag{background:transparent;color:var(--accent);border:1px solid var(--accent)}
.sheet.theme-forest:after{content:"";position:absolute;right:-26px;bottom:-35px;width:155px;height:155px;background:url('/md2social/image/decor/botanical.svg') center/contain no-repeat;opacity:.26;pointer-events:none}
.sheet.theme-forest .sheet-content h1{border:0;font-family:Georgia,"Songti SC",serif}
.sheet.theme-forest .sheet-content h2:before{border-radius:50%;width:17px;height:17px;vertical-align:0}
.sheet.theme-forest .sheet-content blockquote{border:0;border-radius:20px 4px 20px 4px}
.sheet.theme-forest.cover .cover-title{font-family:Georgia,"Songti SC",serif;font-weight:500}
.sheet.theme-forest.cover .cover-rule{width:60px;height:3px;border-radius:0}
.sheet.theme-night .sheet-content h1{font-size:39px;letter-spacing:-.04em;border-bottom:1px solid var(--accent)}
.sheet.theme-night .sheet-content h2:before{width:16px;height:4px;vertical-align:5px}
.sheet.theme-night .sheet-content blockquote{border:1px solid var(--accent);border-radius:0;background:var(--callout)}
.sheet.theme-night.cover .cover-title{font-size:62px;font-weight:700}
.sheet.theme-night.cover .cover-body{border-left:3px solid var(--accent);padding-left:30px}
.sheet.theme-night.cover .cover-rule{width:100%;height:3px;border-radius:0}
/* 横线只作为段落与列表项的底线，不再使用固定间距背景穿过字形。 */
.sheet.family-journal .sheet-content{background:none}
.sheet.family-journal .sheet-content>p,.sheet.family-journal .sheet-content li{border-bottom:1px solid var(--rule);padding-bottom:7px}
.sheet.family-journal .sheet-content blockquote p{border:0;padding-bottom:0}
/* 点击即用的预设色板，保留模板原色入口与当前色值。 */
.color-settings{display:grid;gap:16px;margin:13px 0 18px}
.palette-field{min-width:0}
.palette-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px;font-size:12px;font-weight:600;color:#263544}
.palette-heading output{font-size:11px;font-weight:400;font-family:ui-monospace,Consolas,monospace;color:#687788}
.color-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px}
.color-choice{display:flex;align-items:center;justify-content:center;gap:5px;min-width:0;height:37px;padding:4px 5px;border:1px solid #dce2e8;border-radius:7px;background:#fff;color:#344455;font-size:10px;white-space:nowrap}
.color-choice span{overflow:hidden;text-overflow:ellipsis}
.color-choice:hover{border-color:#7c9dbb;background:#f6faff}
.color-choice.selected{border:2px solid #245f9b;background:#eaf3ff;box-shadow:0 0 0 2px rgba(36,95,155,.12);color:#174c83;font-weight:700}
.color-choice:focus-visible{outline:2px solid #245f9b;outline-offset:2px}
.color-swatch{display:block;flex:none;width:17px;height:17px;border:1px solid rgba(24,29,38,.2);border-radius:50%;box-shadow:inset 0 0 0 1px rgba(255,255,255,.2)}
.color-default{font-size:11px}
@media(max-width:1050px) and (min-width:901px){.color-palette{grid-template-columns:repeat(5,minmax(0,1fr))}}
/* 首次制作指引常驻工作区上方，关闭后不占用编辑空间。 */
.quick-guide{flex:none;display:flex;align-items:center;gap:12px 20px;padding:10px 14px;margin-bottom:12px;border:1px solid #d7e4df;border-radius:10px;background:linear-gradient(110deg,#f0f8f4,#f8fbfd);color:#263d36}
.quick-guide strong{flex:none;font-size:13px;white-space:nowrap}
.quick-guide ol{display:flex;flex:1;align-items:center;flex-wrap:wrap;gap:6px 16px;min-width:0;margin:0;padding:0;list-style:none;counter-reset:quick-step}
.quick-guide li{display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap}
.quick-guide li::before{counter-increment:quick-step;content:counter(quick-step);display:grid;place-items:center;flex:none;width:19px;height:19px;border-radius:50%;background:#287562;color:#fff;font-size:11px;font-weight:600}
.quick-guide button{flex:none;border:1px solid #b9d2c9;border-radius:7px;background:#fff;color:#275e4e;padding:5px 10px;font-size:12px}
.quick-guide button:hover{border-color:#287562;background:#f6fffb}
@media(max-width:1200px) and (min-width:901px){.quick-guide{display:grid;grid-template-columns:1fr auto;gap:5px 12px}.quick-guide ol{grid-column:1/-1;grid-row:2}.quick-guide button{grid-column:2;grid-row:1}}
@media(max-height:700px) and (min-width:901px){.quick-guide{padding-top:6px;padding-bottom:6px;margin-bottom:8px}}
.source-actions #clearSource{margin-left:auto}
