:root{--red:#9b1c1c;--red2:#c62922;--ink:#171515;--muted:#756e69;--line:#e7e1da;--paper:#fbfaf8;--cream:#f4eee4;--white:#fff;--shadow:0 16px 50px rgba(49,33,22,.09)}
*{box-sizing:border-box}html{font-size:16px}body{margin:0;background:linear-gradient(135deg,#f7f3ed 0,#f1ebe3 100%);color:var(--ink);font-family:"Microsoft YaHei","PingFang SC","Noto Sans SC",Arial,sans-serif;min-height:100vh}
button,input,textarea,select{font:inherit}.topbar{height:76px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}.brand{display:flex;align-items:center;gap:13px}.brand-mark{width:42px;height:42px;border-radius:12px;background:linear-gradient(145deg,var(--red2),#761414);color:#fff;display:grid;place-items:center;font-size:24px;font-family:serif;box-shadow:0 7px 18px rgba(155,28,28,.2)}.brand h1{font-size:19px;line-height:1.1;margin:0}.brand p{font-size:12px;margin:4px 0 0;color:var(--muted);letter-spacing:.05em}.top-actions,.results-actions{display:flex;align-items:center;gap:9px}.button{border:0;border-radius:10px;padding:10px 15px;cursor:pointer;font-weight:700;transition:.2s}.button:hover{transform:translateY(-1px)}.button.primary{background:var(--red);color:#fff}.button.ghost{background:#f5f2ee;color:var(--ink)}.button.dark{background:#1d1a18;color:#fff}.workspace{display:grid;grid-template-columns:minmax(360px,460px) minmax(560px,1fr);gap:20px;padding:20px;max-width:1680px;margin:0 auto}.panel{background:#fff;border:1px solid rgba(104,83,65,.11);box-shadow:var(--shadow);border-radius:18px}.controls{padding:8px 22px 24px;max-height:calc(100vh - 116px);overflow:auto}.controls section{padding:18px 0;border-bottom:1px solid var(--line)}.controls section:last-child{border:0}.section-title{display:flex;align-items:center;gap:9px;margin-bottom:12px}.section-title span{font-size:11px;color:#fff;background:var(--red);border-radius:6px;padding:4px 6px;font-weight:800}.section-title h2{font-size:15px;margin:0}.section-title em{font-size:12px;color:var(--muted);font-style:normal;margin-left:auto}.mode-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.mode-card{border:1px solid var(--line);background:var(--paper);border-radius:12px;padding:13px;text-align:left;cursor:pointer;color:var(--ink)}.mode-card strong{display:block;font-size:13px}.mode-card small{display:block;font-size:11px;color:var(--muted);margin-top:5px;line-height:1.4}.mode-card.active{border-color:var(--red);background:#fff7f4;box-shadow:inset 0 0 0 1px var(--red)}.dropzone{position:relative;border:1.5px dashed #cbbeb2;border-radius:13px;display:flex;min-height:92px;align-items:center;justify-content:center;flex-direction:column;background:#fbf9f6;cursor:pointer;text-align:center;padding:15px;overflow:hidden}.dropzone.drag{border-color:var(--red);background:#fff3ef}.dropzone input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;display:block;z-index:2}.dropzone b,.dropzone small{pointer-events:none}.dropzone b{font-size:14px}.dropzone small{font-size:11px;color:var(--muted);margin-top:5px}.thumb-strip{display:flex;gap:8px;overflow:auto;margin-top:10px}.thumb{width:64px;height:44px;border-radius:7px;object-fit:cover;border:2px solid transparent}.thumb:first-child{border-color:var(--red)}textarea{width:100%;resize:vertical;border:1px solid var(--line);border-radius:11px;padding:12px;line-height:1.65;min-height:150px;outline:0;background:#fbfaf8;font-size:13px}textarea:focus,select:focus{border-color:var(--red)}.field-note{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:6px}.field-note #duplicateNote{color:#b33b27;font-weight:700}.preset-row{display:flex;gap:8px;margin-bottom:14px}.preset{border:1px solid var(--line);background:#f8f6f2;border-radius:999px;padding:7px 11px;font-size:12px;cursor:pointer}.preset.active{background:#241f1c;color:#fff;border-color:#241f1c}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-grid label{font-size:12px;color:#5f5752;display:flex;flex-direction:column;gap:6px}.form-grid select{height:37px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 9px}.form-grid input[type=range]{width:100%;accent-color:var(--red)}.form-grid input[type=color]{width:100%;height:37px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:3px}.form-grid output{float:right;align-self:flex-end;margin-top:-20px;color:var(--red);font-weight:700}.checkline{display:flex;align-items:center;gap:8px;font-size:12px;margin-top:12px;color:#514a45}.checkline input{accent-color:var(--red)}.results{padding:20px;min-height:calc(100vh - 116px);display:flex;flex-direction:column}.results-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.results-head h2{font-size:18px;margin:0}.results-head p{font-size:12px;color:var(--muted);margin:4px 0 0}.results-actions .button.ghost{padding:9px 12px}.results-actions span{font-size:12px;color:var(--muted);min-width:45px;text-align:center}.stage-wrap{position:relative;display:grid;place-items:center;min-height:390px;background:radial-gradient(circle at 50% 30%,#f7f3ec,#e8e1d8);border-radius:14px;overflow:hidden;padding:16px}.stage-empty{position:absolute;display:flex;flex-direction:column;align-items:center;gap:6px;color:#6f655d}.stage-empty b{font-size:18px}.stage-empty span{font-size:12px}.stage-wrap canvas{max-width:100%;max-height:62vh;box-shadow:0 18px 60px rgba(31,23,19,.22);display:none;background:#eee}.batch-grid{display:grid;grid-template-columns:repeat(6,minmax(90px,1fr));gap:10px;margin-top:14px}.batch-item{border:2px solid transparent;padding:0;background:0;border-radius:9px;overflow:hidden;cursor:pointer;position:relative;aspect-ratio:16/9}.batch-item.active{border-color:var(--red)}.batch-item canvas{display:block;width:100%;height:100%;object-fit:cover}.batch-item span{position:absolute;right:4px;bottom:4px;background:rgba(0,0,0,.68);color:#fff;border-radius:4px;padding:2px 5px;font-size:10px}.compliance-note{margin-top:auto;padding-top:15px;color:#81766e;font-size:11px;text-align:center}.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);background:#211d1a;color:#fff;padding:11px 17px;border-radius:10px;opacity:0;pointer-events:none;transition:.25s;z-index:50;font-size:13px}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:980px){.topbar{padding:0 16px}.workspace{grid-template-columns:1fr;padding:12px}.controls{max-height:none}.results{min-height:auto}.batch-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:620px){.topbar{height:auto;padding:12px}.brand p{display:none}.top-actions .ghost{display:none}.workspace{padding:8px}.panel{border-radius:13px}.controls,.results{padding:14px}.mode-grid,.form-grid{grid-template-columns:1fr}.results-head{align-items:flex-start;gap:10px;flex-direction:column}.results-actions{width:100%;flex-wrap:wrap}.stage-wrap{min-height:250px;padding:8px}.batch-grid{grid-template-columns:repeat(3,1fr)}}
.generator-card{background:linear-gradient(135deg,#fff9ed,#f6eee0);border:1px solid #e4d2b8;border-radius:14px;padding:14px}.generator-row{display:grid;grid-template-columns:1.35fr .65fr;gap:10px;margin-bottom:11px}.generator-row label{display:flex;flex-direction:column;gap:6px;color:#61574f;font-size:12px}.generator-row select{height:38px;border:1px solid #d7c9b7;background:#fff;border-radius:9px;padding:0 9px;color:#29231f}.generate-button{width:100%;border:0;border-radius:10px;background:linear-gradient(135deg,#a9231d,#74130f);color:#fff;padding:12px;font-weight:800;cursor:pointer;box-shadow:0 8px 20px rgba(132,28,22,.2);transition:.2s}.generate-button:hover{transform:translateY(-1px);box-shadow:0 11px 24px rgba(132,28,22,.25)}.generate-button span{color:#f7d78e;margin-right:5px}.generator-card p{font-size:11px;color:#786b60;line-height:1.5;margin:9px 2px 0}
.generator-kicker{font-size:12px;font-weight:800;color:#8d4b20;margin-bottom:10px;letter-spacing:.04em}.ai-generator-card{margin-top:10px;background:linear-gradient(145deg,#fff6f1,#f6ece7);border-color:#e9c8bd}.ai-kicker{color:var(--red)}.ai-options{grid-template-columns:1.2fr .8fr}.full-label{display:flex;flex-direction:column;gap:6px;color:#61574f;font-size:12px;margin-bottom:11px}.full-label select{height:38px;border:1px solid #d7c9b7;background:#fff;border-radius:9px;padding:0 9px;color:#29231f}.ai-generate-button{background:linear-gradient(135deg,#bd1f1f,#711010)}.ai-generate-button:disabled{cursor:wait;opacity:.68;transform:none;box-shadow:none}.ai-status{font-size:11px;color:#786b60;line-height:1.55;margin:9px 2px 0}.ai-status::before{content:'AI';display:inline-grid;place-items:center;margin-right:6px;width:24px;height:18px;border-radius:5px;background:#2b2420;color:#fff;font-size:9px;font-weight:800}
@media(max-width:620px){.generator-row{grid-template-columns:1fr}.generate-button{padding:13px}}
.match-result{display:flex;align-items:flex-start;gap:5px;background:rgba(255,255,255,.7);border:1px solid #eadbc8;border-radius:9px;padding:8px 9px;margin-bottom:10px;font-size:11px;line-height:1.45;color:#66584d}.match-result b{color:var(--red);white-space:nowrap}.match-result span{color:#544940}
.copy-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:11px;background:#fbfaf8;max-height:240px;overflow:auto;padding:5px}.copy-row{display:grid;grid-template-columns:25px 1fr 30px;align-items:center;gap:4px;border-radius:8px;padding:4px 5px;transition:.15s}.copy-row:hover{background:#f5f0e9}.copy-row.selected{background:#fff0eb;box-shadow:inset 3px 0 0 var(--red)}.copy-row input[type=radio]{width:17px;height:17px;margin:0;accent-color:var(--red);cursor:pointer}.copy-text{width:100%;border:1px solid transparent;background:transparent;border-radius:6px;padding:7px 5px;outline:0;font-size:13px;color:#241f1c}.copy-text:focus{background:#fff;border-color:#d7cbc0}.copy-delete{border:0;background:transparent;color:#9a8f86;width:28px;height:28px;border-radius:6px;cursor:pointer}.copy-delete:hover{background:#f0dfd8;color:var(--red)}.copy-toolbar{display:flex;gap:8px;margin-top:8px}.copy-toolbar button,.bulk-editor button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 10px;font-size:12px;cursor:pointer}.copy-toolbar button:first-child{color:var(--red);font-weight:700}.bulk-editor{margin-top:8px;padding:9px;background:#f6f2ec;border-radius:10px}.bulk-editor textarea{min-height:120px}.bulk-editor button{margin-top:7px;background:#29231f;color:#fff;border-color:#29231f}.bulk-editor[hidden]{display:none}
.preset.redyellow-preset{border-color:#e3b22c;background:linear-gradient(135deg,#b81111 0 52%,#ffd33d 52%);color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.45)}.preset.redyellow-preset.active{box-shadow:0 0 0 2px #fff,0 0 0 4px #c51c17}
.drag-tip{margin:10px 0 2px;color:#8a6045;font-size:13px;line-height:1.5}
.controls section.highlight-section{padding:10px 0 16px}.highlight-editor{padding:12px;border:1px solid #eadfd2;border-radius:11px;background:linear-gradient(135deg,#fffaf1,#faf4eb)}.highlight-editor-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:9px}.highlight-editor-head strong{font-size:13px;color:#3e342e}.highlight-editor-head span{font-size:10px;color:#897c72}.highlight-row{display:grid;grid-template-columns:minmax(0,1fr) 44px auto;gap:7px;align-items:center}.highlight-row input[type=text]{width:100%;height:36px;border:1px solid #ded3c8;border-radius:8px;background:#fff;padding:0 9px;color:#5d5149;font-size:12px;outline:0}.highlight-row input[type=color]{width:44px;height:36px;border:1px solid #ded3c8;border-radius:8px;background:#fff;padding:3px;cursor:pointer}.highlight-row button,.clear-highlight{height:36px;border:0;border-radius:8px;background:var(--red);color:#fff;padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}.clear-highlight{height:auto;margin-top:7px;padding:5px 0;background:transparent;color:#8b7464;font-weight:400;text-decoration:underline}.highlight-row button:hover{background:#7e1515}.clear-highlight:hover{color:var(--red)}
#previewCanvas.text-hover{cursor:grab}
#previewCanvas.dragging{cursor:grabbing;touch-action:none}
@media(max-width:620px){.highlight-editor-head{align-items:flex-start;flex-direction:column}.highlight-row{grid-template-columns:minmax(0,1fr) 44px}.highlight-row button{grid-column:1/-1}}

/* Multi-line copy and per-line typography controls */
.copy-row{align-items:start}
.copy-row input[type=radio]{margin-top:9px}
.copy-text{min-height:38px;max-height:112px;resize:vertical;line-height:1.55}
.copy-delete{margin-top:4px}
.bulk-editor small{display:block;margin-top:5px;color:#87796f;font-size:10px}
.line-size-editor{margin-top:9px;padding:12px;border:1px solid #e0d8cf;border-radius:11px;background:#fff}
.line-size-list{display:flex;flex-direction:column;gap:7px}
.line-size-row{display:grid;grid-template-columns:44px minmax(0,1fr) 46px;align-items:center;gap:8px}
.line-size-row b{font-size:11px;color:#655b54}
.line-size-row input{width:100%;accent-color:var(--red)}
.line-size-row output{font-size:11px;color:var(--red);font-weight:800;text-align:right}
.line-size-preview{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:#91857c;grid-column:2/4;margin-top:-4px}
.line-size-empty{font-size:11px;color:#8b8078;padding:2px 0}
.line-size-actions{display:flex;justify-content:flex-end;margin-top:7px}
.line-size-reset{border:0;background:transparent;color:#8b7464;text-decoration:underline;font-size:11px;cursor:pointer;padding:3px}
.line-size-reset:hover{color:var(--red)}
.history-button{border:1px solid #ded6ce;background:#fff;color:#3b332e;padding:9px 12px}
.history-button:not(:disabled):hover{border-color:#bda99a;background:#fbf7f2}
.history-button:disabled{opacity:.42;cursor:not-allowed;transform:none}
@media(max-width:760px){.top-actions{gap:5px}.history-button{font-size:12px;padding:8px}.top-actions .primary{padding:8px 10px}}
@media(max-width:540px){.history-button{font-size:0;width:36px}.history-button:first-of-type::after{content:'↶';font-size:18px}.history-button:nth-of-type(2)::after{content:'↷';font-size:18px}}
.form-grid .wide-control{grid-column:1/-1}
.form-grid #textStyle,.form-grid #textFont{border-color:#cfbdb0;background:#fffaf6;font-weight:700;color:#342b26}
.typography-module{padding:11px;border:1px solid #e4d8ce;border-radius:11px;background:linear-gradient(135deg,#fffdf9,#faf3ec)}
.typography-module-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.typography-module-head strong{font-size:13px;color:#3d332d}
.typography-module-head span{font-size:10px;color:#887a70;text-align:right}
.typography-module select{width:100%}
.typography-module .font-weight-control{margin-top:3px;padding-top:9px;border-top:1px solid #eadfd6;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px}
.typography-module .font-weight-control output{grid-column:3;margin:0;align-self:center}
.typography-module .font-weight-control input{grid-column:1/-1;width:100%;accent-color:var(--red)}
.thumb-item{position:relative;flex:0 0 64px;height:44px}.thumb-item .thumb{display:block;width:64px;height:44px}.thumb-item:not(.active) .thumb{border-color:transparent}.thumb-item.active .thumb{border-color:var(--red)}.thumb-delete{position:absolute;right:-3px;top:-7px;width:21px;height:21px;border:2px solid #fff;border-radius:50%;background:#2b2522;color:#fff;display:grid;place-items:center;padding:0;line-height:1;font-size:15px;font-weight:700;cursor:pointer;box-shadow:0 2px 7px rgba(0,0,0,.28)}.thumb-delete:hover{background:var(--red);transform:scale(1.08)}.clear-backgrounds{margin-top:8px;border:0;background:transparent;color:#8b7464;text-decoration:underline;font-size:11px;cursor:pointer;padding:3px 0}.clear-backgrounds:hover{color:var(--red)}.clear-backgrounds[hidden]{display:none}
.section-title .cloud-status{margin-left:auto;color:#946f20;font-weight:700}.section-title .cloud-status::before{content:'●';margin-right:5px}.section-title .cloud-status.synced{color:#1f7a45}.section-title .cloud-status.error{color:#b12620}.section-title .cloud-status+#copyCount{margin-left:8px}
.mode-grid{margin-bottom:11px}.mode-card{min-height:76px}.mode-card.active{border-color:var(--red);background:#fff4f1;box-shadow:inset 0 0 0 1px var(--red)}.mode-card.active strong{color:var(--red)}

/* Individually removable generated previews */
.batch-item{position:relative;border:0;overflow:visible;cursor:default}
.batch-preview{position:absolute;inset:0;width:100%;height:100%;border:2px solid transparent;padding:0;background:transparent;border-radius:9px;overflow:hidden;cursor:pointer}
.batch-item.active{border-color:transparent}
.batch-item.active .batch-preview{border-color:var(--red)}
.batch-preview canvas{display:block;width:100%;height:100%;object-fit:cover}
.batch-preview span{position:absolute;right:4px;bottom:4px;background:rgba(0,0,0,.68);color:#fff;border-radius:4px;padding:2px 5px;font-size:10px}
.batch-delete{position:absolute;top:-7px;right:-7px;z-index:2;width:24px;height:24px;border:2px solid #fff;border-radius:50%;background:#a90d0d;color:#fff;display:grid;place-items:center;padding:0;line-height:1;font-size:17px;font-weight:800;cursor:pointer;box-shadow:0 3px 9px rgba(70,15,15,.32)}
.batch-delete:hover{background:#d01b1b;transform:scale(1.06)}
.batch-delete:focus-visible,.batch-preview:focus-visible{outline:3px solid rgba(169,13,13,.32);outline-offset:2px}
.layer-note{display:block;margin-top:7px;color:#796b62;font-size:11px;line-height:1.45}
.shade-controls{display:grid;grid-template-columns:1.2fr .8fr;gap:10px;margin-top:9px;padding:11px;border:1px solid #e1d7cf;border-radius:10px;background:#fffaf6;transition:.2s}
.shade-controls label{display:flex;flex-direction:column;gap:5px;font-size:11px;color:#665b54}
.shade-controls select{height:35px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:0 8px}
.shade-controls input[type=color]{width:100%;height:35px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:3px}
.shade-controls input[type=range]{width:100%;accent-color:var(--red)}
.shade-controls .shade-opacity{grid-column:1/-1}.shade-controls output{align-self:flex-end;margin-top:-19px;color:var(--red);font-weight:800}
.shade-controls.disabled{opacity:.48}

.template-intro{font-size:12px;color:#777;line-height:1.7;margin:8px 0}.template-toolbar{display:flex;gap:8px;margin:10px 0;align-items:center}.template-toolbar select,.template-toolbar input{min-width:0;flex:1}.template-toolbar button,.template-card button,#categoryEditor button{border:1px solid #dfd7ce;border-radius:6px;background:#fff;padding:7px 9px;cursor:pointer;font-size:12px}.template-cards{display:grid;grid-template-columns:1fr 1fr;gap:9px}.template-card{border:1px solid #e2dad2;border-radius:9px;padding:7px;background:#fff;min-width:0}.template-card.selected{border:2px solid #a90d0d;padding:6px;background:#fff9f4}.template-card .template-pick{border:0;padding:0;width:100%;background:transparent;text-align:left}.template-card canvas{width:100%;display:block;border-radius:5px}.template-card strong{display:block;font-size:12px;margin:6px 0}.template-card footer{display:flex;gap:5px;justify-content:flex-end}.template-card footer button{font-size:11px;padding:3px 6px}.template-empty{grid-column:1/-1;color:#888;font-size:13px;padding:20px 0}dialog{border:1px solid #ded6cc;border-radius:14px;padding:24px;width:min(540px,92vw);max-height:85vh;overflow:auto;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#0006}dialog h2{margin:0 0 16px;font-size:20px}dialog p{font-size:13px;color:#777;line-height:1.8}dialog label{display:grid;gap:7px;margin:14px 0;font-size:13px}dialog input,dialog select,.template-toolbar select{padding:9px;border:1px solid #d9d4ce;border-radius:6px;background:#fff;width:100%}.category-edit-row{display:flex;gap:6px;margin:9px 0}.category-edit-row input{min-width:0;flex:1}#templateStatus.error{color:#b31b1b}

.sync-uploaded-button{width:100%;margin-top:14px;white-space:normal;line-height:1.5}.sync-uploaded-button:disabled{opacity:.5;cursor:default}

.font-picker-editor{border:1px solid #e5d8cb;border-radius:10px;padding:12px;margin:12px 0;background:#fffaf6}.font-picker-controls{display:grid;grid-template-columns:1fr;gap:10px;margin-top:12px}.font-picker-controls label{display:grid;gap:6px;font-size:12px}.font-picker-controls select{width:100%;padding:10px;border:1px solid #d9c6b5;border-radius:6px;background:#fff;font-size:16px}.font-picker-editor .button{width:100%;font-size:12px}

@font-face{font-family:PFZhiMangXing;src:url('/fonts/zhi-mang-xing-v1.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:PFMaShanZheng;src:url('/fonts/ma-shan-zheng-v1.woff2') format('woff2');font-weight:400;font-display:swap}
.font-picker-editor .font-loading{color:#966b44}

.local-outline-controls{border-top:1px solid #eadbd0;margin-top:12px;padding-top:8px}.local-outline-row{display:grid;grid-template-columns:90px 1fr;gap:14px;margin:10px 0}.local-outline-row label{display:grid;gap:6px;font-size:12px}.local-outline-row input[type=color]{width:100%;height:32px;border:1px solid #ddd}.local-outline-controls .button{width:100%;color:#b00000;background:#fff;border:1px solid #e6cfc5}.local-outline-row output{font-size:12px;color:#a11}

.font-choice-row{display:flex;gap:8px;align-items:center}.font-choice-row select{flex:1;min-width:0}.font-picker-editor .font-choice-row .button{width:auto;white-space:nowrap;color:var(--red);border:1px solid #e5d8cb;background:#fff}
