*{box-sizing:border-box}body{margin:0;background:#f4f5f7;color:#191b22;font-family:Inter,"Microsoft YaHei","PingFang SC",sans-serif;font-size:16px}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.6}header{height:78px;background:#fff;border-bottom:1px solid #e4e5e9;display:flex;align-items:center;justify-content:space-between;padding:0 40px}.brand{display:flex;align-items:center;gap:12px;color:inherit;font-size:21px;text-decoration:none;font-weight:700}.brand-mark{display:grid;place-items:center;background:#1a1d22;color:#dcf851;width:35px;height:35px;border-radius:9px}.brand-tag{font-size:12px;font-weight:500;letter-spacing:2px;color:#8b8d96;margin-left:8px}.local-note{font-size:13px;color:#767a85}main{max-width:1540px;margin:auto;padding:36px 40px}.page-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}.eyebrow{font-size:12px;letter-spacing:2.5px;color:#7e8390;margin:0 0 10px}h1{font-size:29px;letter-spacing:-.5px;margin:0 0 10px}.page-title p:last-child{margin:0;color:#777c87;font-size:14px}button{border:1px solid #dddfe5;border-radius:9px;background:#fff;padding:11px 17px;color:inherit}.primary{background:#d9f650;border-color:#d9f650;font-weight:600}.dark{background:#23262d;color:#fff;border-color:#23262d;width:100%}.workspace{display:grid;grid-template-columns:minmax(255px,310px) minmax(330px,1fr) 270px;gap:20px;align-items:start}.panel{background:#fff;border:1px solid #e2e4e9;border-radius:14px;padding:23px}.panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:25px}.panel-title h2{color:#969ba7;font-size:14px;letter-spacing:1px;margin:0}.panel-title h2 span{font-size:17px;color:#23262d;margin-left:10px;letter-spacing:0}.badge{font-size:12px;color:#777b83;padding:5px 8px;background:#f2f3f5;border-radius:5px}label{display:block;font-size:14px;margin:20px 0 10px;font-weight:600}textarea,input,select{width:100%;border:1px solid #dce0e7;border-radius:8px;background:#fbfcfd;color:#333843;padding:11px 12px;outline:none;font-size:14px}textarea{line-height:1.8;resize:vertical;min-height:190px}textarea:focus,input:focus,select:focus{border-color:#859c23;box-shadow:0 0 0 3px #eaf3cf}.hint{font-size:12px;color:#858995;line-height:1.7}.stage{border-radius:14px;padding:20px 28px 18px;background:#e9ebef;min-height:630px}.stage-toolbar{display:flex;justify-content:space-between;align-items:center;font-size:14px;margin-bottom:25px}.card-placeholder{position:relative;max-width:340px;aspect-ratio:3/4;background:#dff45c;margin:0 auto;padding:27px;color:#20271f;box-shadow:0 12px 25px #26293114}.card-kicker{font-size:10px;letter-spacing:1.5px;margin-bottom:33px}.card-placeholder h2{font-size:34px;line-height:1.4;letter-spacing:-1px;margin:0;font-weight:800}.card-rule{width:42px;height:5px;background:#283221;margin:22px 0}.card-placeholder p{font-size:13px;line-height:1.9}.card-footer{position:absolute;bottom:24px;left:27px;right:27px;display:flex;justify-content:space-between;font-size:9px;border-top:1px solid #47562b44;padding-top:14px}.stage-caption{text-align:center;color:#90959f;font-size:12px;margin-top:25px}.template-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.template{background:#dff45c;border:2px solid transparent;font-size:29px;font-weight:700;text-align:left;height:91px;padding:12px}.template span{display:block;font-size:12px;font-weight:400;margin-top:6px}.template.selected{border-color:#29321d;box-shadow:0 0 0 2px #fff inset}.blue{background:#dceaff;color:#2556a8}.paper{background:#f2eee5;color:#5c4935}.pink{background:#f5dfed;color:#814169}.tip{border-top:1px solid #eceef2;margin-top:24px;padding-top:18px;font-size:13px;line-height:1.8;color:#8b8f99}button:focus-visible{outline:3px solid #7f9a22;outline-offset:3px}@media(max-width:1100px){main{padding:25px 20px}.workspace{grid-template-columns:260px 1fr}.settings{grid-column:1/-1}.template-grid{grid-template-columns:repeat(4,1fr)}.stage{padding:20px;min-height:620px}}@media(max-width:700px){header{padding:0 20px}.brand-tag,.local-note{display:none}.page-title{align-items:flex-start;gap:15px;flex-direction:column}h1{font-size:25px}.workspace{grid-template-columns:1fr}.settings{grid-column:auto}.stage{min-height:0}.template-grid{grid-template-columns:1fr 1fr}main{padding:25px 16px}}

.notice{font-size:14px;color:#525965;padding:12px 16px;background:#edf0e7;border:1px solid #dce3d2;border-radius:8px;margin:-8px 0 22px;line-height:1.6}.notice.error{background:#fff0ec;border-color:#f1bfb4;color:#a03a23}
summary{font-size:14px;font-weight:600;cursor:pointer;margin-bottom:14px;line-height:1.8}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.import-actions{display:flex;align-items:center;justify-content:space-between;margin:10px 0 14px}.small{font-size:14px;padding:8px 12px}.text-button{padding:6px;border:0;background:transparent;font-size:14px;color:#666e42}.text-button:hover{background:#e5e9d8}
.list-header{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #eceef2;margin-top:18px;padding-top:18px;font-size:14px;font-weight:600}.items{display:grid;gap:7px;max-height:300px;overflow:auto;margin-top:10px}.item{display:flex;align-items:center;gap:10px;text-align:left;padding:11px 10px;width:100%;border-color:transparent;background:#f5f6f8}.item.active{background:#eef3da;border-color:#c5d394}.item-index{font-size:12px;color:#899074}.item-copy{min-width:0;flex:1}.item-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.item-pages{font-size:12px;color:#858b94;display:block;margin-top:4px}
.canvas-wrap{display:flex;align-items:center;justify-content:center;min-height:260px}canvas{display:block;max-width:100%;width:340px;height:auto;box-shadow:0 12px 30px #26293119}canvas[hidden]{display:none}#empty{font-size:14px;color:#7b828e;padding:40px 20px;line-height:1.8}#empty[hidden]{display:none}.pager{display:flex;justify-content:center;align-items:center;gap:10px;margin:22px 0;font-size:13px}.pager>button:not(.text-button){padding:6px 11px}.pager .text-button{margin-left:5px}.stage{min-height:0}.stage-toolbar>span:first-child{max-width:60%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#editor{border-top:1px solid #d7dbe1;padding-top:17px}#editor summary{margin:0;color:#626974}#editor label{margin-top:12px}#editor button{margin-top:10px}#editor input,#editor textarea{background:#f7f8fa}#font-size{accent-color:#7d952c;padding:0}output{float:right;color:#869343;font-weight:400}.tip p{margin-bottom:0}.tip b{color:#656d76;font-weight:500}
.progress-box{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);width:min(480px,calc(100% - 32px));background:#fff;border:1px solid #d5dcc6;border-radius:12px;box-shadow:0 10px 40px #0002;padding:18px;z-index:5}.progress-box>div{display:flex;align-items:center;justify-content:space-between;font-size:14px}progress{width:100%;height:7px;margin-top:14px;accent-color:#8fa32c}dialog{border:1px solid #dce1e8;border-radius:14px;padding:28px;max-width:440px;width:calc(100% - 40px);color:#222831}dialog::backdrop{background:#171a2266}dialog h2{font-size:20px;margin:0 0 16px}dialog p{font-size:15px;color:#737b86;line-height:1.8}.dialog-actions{display:flex;gap:12px;margin-top:20px}.dialog-actions button{width:auto;flex:1}
@media(min-width:1500px){canvas{width:380px}}@media(max-width:1100px){.settings{display:grid;grid-template-columns:1fr 1fr;column-gap:24px}.settings .panel-title,.settings .template-grid,.settings>label:first-of-type,.settings .tip{grid-column:1/-1}.settings>label:not(:first-of-type){grid-column:1}.settings>input,.settings>select{grid-column:2;align-self:center;margin-top:12px}}
@media(max-width:700px){.settings{display:block}.pager{gap:7px}.notice{margin-top:0}canvas{width:340px}.stage-toolbar{gap:12px}.stage{padding:16px}.template-grid{grid-template-columns:1fr 1fr}}


.settings-tools{grid-column:1/-1;min-width:0}.custom-section{border-top:1px solid #e5e8ed;padding-top:16px;margin-top:18px}.custom-section>label:first-child{margin-top:0}.custom-section summary{font-size:14px;margin-bottom:8px}.upload-entry{width:100%;padding:17px 10px;border:1px dashed #aab67f;background:#f7faeb;font-size:14px}.upload-entry:hover{background:#edf4d7}.background-meta{display:flex;align-items:center;gap:9px;min-width:0;margin-top:12px}.background-meta span{overflow-wrap:anywhere}.background-meta img{width:48px;height:56px;object-fit:cover;border-radius:5px;border:1px solid #dce1d6}.color-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}input[type=color]{height:38px;padding:3px;cursor:pointer}input[type=range]{accent-color:#7d952c;padding:0}.stack-actions{display:grid;gap:8px;margin-top:12px}.custom-badge{font-weight:400;font-size:12px;color:#536321;background:#eaf1cd;border-radius:4px;padding:3px 5px}.custom-badge[hidden],.background-meta img[hidden]{display:none}.settings-tools label{margin-top:14px}.settings-tools .hint{margin-bottom:5px}

#editor{margin-bottom:20px;padding-bottom:18px;border-bottom:1px solid #d7dbe1}#editor-name{overflow-wrap:anywhere}.item-pages{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.gallery-heading{display:flex;justify-content:space-between;align-items:center;margin-top:18px;font-size:14px}.background-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:350px;overflow:auto;margin-top:12px;padding:2px}.gallery-card{min-width:0;border:1px solid #e0e5dc;border-radius:8px;background:#f9faf7;overflow:hidden}.gallery-pick{border:2px solid transparent;border-radius:6px;padding:5px;width:100%;text-align:left;background:transparent}.gallery-pick[aria-pressed=true]{border-color:#7c922b;background:#f0f5d9}.gallery-pick img{width:100%;height:90px;display:block;object-fit:cover;border-radius:4px}.gallery-pick span{display:block;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:6px}.gallery-delete{display:block;margin:0 auto;padding:5px 12px;font-size:12px;color:#7c6356;border:0;background:transparent}.gallery-delete:hover{color:#9d2c21;background:#fff0e9}#gallery-empty[hidden]{display:none}#delete-background-name{overflow-wrap:anywhere}

.rich-tools{margin-top:14px;padding:12px;background:#fff;border:1px solid #d7dbe1;border-radius:9px}.rich-tools>p:first-child{margin:0;color:#52602c;overflow-wrap:anywhere}.rich-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px}.rich-grid>div{min-width:0}.rich-grid select,.rich-grid input{min-width:0}.rich-actions{display:flex;flex-wrap:wrap;gap:8px}.rich-color-label{display:flex;align-items:center;gap:6px}.rich-color-label input{width:16px;height:16px;padding:0}.rich-tools .hint:last-child{margin-bottom:0}

#preview-surface{position:relative;width:340px;max-width:100%;margin:auto}#preview-surface[hidden]{display:none}#preview-surface canvas{width:100%;max-width:none}#preview-text{position:absolute;left:0;top:0;width:1080px;transform-origin:top left;overflow:hidden;user-select:text;-webkit-user-select:text;cursor:text;color:transparent}.preview-line{position:absolute;width:100%;white-space:pre}.preview-field span::selection{background:#639deb66;color:transparent}.preview-field:focus-visible{outline:none}.rich-tools{position:fixed;z-index:20;width:380px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto;margin:0;box-shadow:0 12px 48px #0003;padding:16px}.rich-tools[hidden]{display:none}.rich-tools>p:first-of-type{padding-right:28px}.popup-close{position:absolute;right:6px;top:6px;border:0;padding:2px 9px;font-size:22px}.rich-tools label{margin:10px 0 5px}.rich-tools textarea{min-height:58px}.rich-tools .rich-actions{margin:8px 0}.rich-tools button[aria-pressed=true]{background:#e6f3b1;border-color:#879946}.danger{color:#b33932}.rich-tools #rich-apply{display:none}@media(min-width:1500px){#preview-surface{width:380px}}

.rich-tools{width:320px}.rich-tools>details{margin-top:12px;border-top:1px solid #e3e5e9;padding-top:8px}.rich-tools>details summary{margin:0}.rich-tools .hint{font-size:12px}.rich-tools #rich-font option[value=""]{display:none}

#export-results{background:white;border:1px solid #e0e4e8;border-radius:12px;padding:20px;margin-top:24px}#export-results[hidden],#random-settings[hidden]{display:none}#export-results h2{font-size:18px}#export-links{display:flex;flex-wrap:wrap;gap:10px}.zip-download{display:block;padding:10px 14px;border-radius:7px;background:#edf3d7;color:#364b12;overflow-wrap:anywhere}#random-settings{padding:10px;background:#f4f7eb;border-radius:8px}

.workspace{grid-template-columns:minmax(280px,360px) minmax(330px,1fr) 270px}.input-panel{min-width:0}.input-panel .items{max-height:180px}.input-panel #editor{margin:20px 0 0;padding:18px 0 0;border-bottom:0}.input-panel #editor textarea{min-height:260px}.stage{position:sticky;top:20px}@media(max-width:1100px){.workspace{grid-template-columns:minmax(280px,340px) minmax(0,1fr)}}@media(max-width:700px){.workspace{grid-template-columns:1fr}.stage{position:static}.input-panel #editor textarea{min-height:210px}}

.header-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;max-width:600px}.header-actions .dark{width:auto}.header-actions .hint{flex-basis:100%;text-align:right}#draft-qr{width:240px;max-width:100%;margin:auto}#draft-qr svg{display:block;width:100%;height:auto}#draft-dialog a{color:#567021}@media(max-width:700px){.header-actions{justify-content:flex-start}.header-actions .hint{text-align:left}}

.template.poster{grid-column:1/-1;font-size:23px;background:#fff;border-color:#f4cfce;color:#111}.template.poster[aria-pressed=true]{border-color:#e64b55;background:#fff2f2}#cover-settings[hidden]{display:none}.qr-platforms{display:flex;gap:8px}.qr-platforms button{flex:1}.qr-platforms [aria-pressed=true]{background:#edf3d7;border-color:#8ca13e}#qr-platform-title{text-align:center;font-size:16px;margin:16px 0 8px}
.settings #cover-settings{grid-column:1/-1}

#cover-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:300px;overflow:auto}#cover-gallery .gallery-pick{min-width:0}#cover-gallery .gallery-pick img{width:100%;height:95px;object-fit:cover}#cover-gallery .gallery-pick[aria-pressed=true]{outline:2px solid #829536}#cover-gallery>.hint{grid-column:1/-1}
