:root{--ink:#233a32;--muted:#7b827b;--green:#356651;--line:#e4e7de;--canvas:#f4f5ee;--gold:#be9c60;font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--canvas);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.55}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline}[v-cloak]{display:none}#loading{min-height:100vh;display:grid;align-content:center;justify-items:center;color:var(--muted)}.loading-mark{font-family:KaiTi,serif;font-size:42px;color:var(--green);border:1px solid var(--green);padding:6px 13px}#loading p{margin:22px 0 10px}
.app-header{height:94px;padding:0 42px;display:flex;justify-content:space-between;align-items:center;background:#fafbf6;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:14px;font-size:23px;font-weight:650;letter-spacing:2px}.brand:hover{text-decoration:none}.brand-mark{font-family:KaiTi,"STKaiti",serif;font-size:31px;line-height:44px;width:46px;text-align:center;border:1px solid #62806c;outline:1px solid #62806c;outline-offset:-5px;font-weight:400;letter-spacing:0}.brand small{display:block;font-size:11px;letter-spacing:1px;color:var(--muted);font-weight:400;margin-top:6px}.header-note{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.status-dot{height:6px;width:6px;border-radius:50%;background:#7a9c78}
.workspace{max-width:1490px;margin:auto;display:grid;grid-template-columns:328px minmax(0,1fr);gap:46px;padding:32px 42px 120px}.editor{display:flex;flex-direction:column;gap:16px}.panel{background:#fffefb;border:1px solid var(--line);padding:24px;border-radius:12px}.section-heading{display:flex;align-items:center;gap:10px;margin-bottom:12px}.step{font-size:10px;letter-spacing:1px;color:#8f9b8d;border-bottom:1px solid #b4c1ad;padding-bottom:3px}h1,h2{font-size:16px;margin:0;font-weight:600;letter-spacing:.4px}.optional{font-size:10px;font-weight:400;margin-left:6px;color:#8d9387;background:#eef1e9;padding:3px 6px;border-radius:3px}.muted{font-size:12px;color:var(--muted);line-height:1.7;margin:0 0 18px}label{display:block;font-size:11px;color:#667264;line-height:1.4;margin-bottom:8px}.field-note{float:right;color:#9b9f95;font-size:10px}input:not([type=checkbox]):not([type=file]),select,textarea{width:100%;border:1px solid #dde2d7;background:#fffefb;color:var(--ink);border-radius:5px;padding:10px 11px;outline:none;margin-top:7px;font-size:13px;transition:border-color .15s}input:focus,textarea:focus,select:focus{border-color:#63896e!important;box-shadow:0 0 0 2px #63896e14}input::placeholder,textarea::placeholder{color:#a5aa9f;font-size:11px}textarea{resize:vertical;min-height:65px;max-height:140px}.name-input-wrap input#name{font-size:24px;letter-spacing:5px;margin:0;padding:13px 14px;height:60px}.generate-button{width:100%;margin-top:10px;border:0;background:var(--green);color:white;font-size:13px;padding:12px 16px;border-radius:5px;display:flex;justify-content:space-between;align-items:center}.generate-button:hover,.primary:hover{background:#274f3c}.generate-button span{font-size:18px}.input-hint,.error{font-size:11px;line-height:1.6;margin:10px 0 0}.error{color:#b4453e}.input-hint{color:#938255}.character-editor{display:flex;gap:12px;padding:16px 0;border-bottom:1px solid #edf0e7}.character-editor:last-of-type{border-bottom:0}.character-badge{width:48px;flex-shrink:0;padding-top:8px}.character-badge svg{width:48px;height:48px}.character-fields{flex:1;min-width:0}.character-fields label{margin:0;font-size:10px}.character-fields input,.character-fields select{margin-top:4px!important;padding:7px 8px!important;font-size:12px!important}.field-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:9px}.field-pair label{min-width:0}.stroke-count{font-size:10px;color:#969e90;display:block;margin-top:8px}.small-note{font-size:10px;line-height:1.7;color:#969d91;margin-top:14px}.branding-panel>label{margin-bottom:14px}.upload-row{display:flex;justify-content:space-between;align-items:center;margin:8px 0 18px}.upload-button{cursor:pointer;border:1px dashed #b9c4b4;padding:9px 16px;border-radius:5px;font-size:11px;display:inline-block;margin-top:2px;background:#f7f9f2}.upload-button:hover{border-color:var(--green)}input[type=file]{display:none}.upload-preview{width:52px;height:52px;position:relative;border:1px solid var(--line);border-radius:4px;background:white}.upload-preview img{width:100%;height:100%;object-fit:contain}.remove-button{position:absolute;right:-6px;top:-6px;width:18px;height:18px;line-height:14px;border:1px solid #ccd4c7;border-radius:50%;background:white;color:#75816c;padding:0;font-size:15px}.text-button{border:0;background:transparent;color:#71846b;padding:6px 0;font-size:11px;text-decoration:underline;text-underline-offset:3px}.layout-panel .field-pair{margin-top:12px}.checkbox-label{display:flex;align-items:center;gap:6px;margin-top:13px}.checkbox-label input{accent-color:var(--green);margin:0}.editor-footer{text-align:center;color:#9ca293;font-size:10px;line-height:1.8;padding-top:4px}.editor-footer a{text-decoration:underline;text-underline-offset:2px}
.preview-area{min-width:0}.preview-toolbar{display:flex;align-items:center;justify-content:space-between;height:40px;margin-bottom:18px}.preview-toolbar>div:first-child{display:flex;align-items:center;gap:18px}.preview-label{font-size:13px;font-weight:500}.paper-label{font-size:10px;color:#969e91;letter-spacing:.4px}.preview-controls{display:flex;border:1px solid #d9e0d2;border-radius:5px;overflow:hidden}.preview-controls button{border:0;background:transparent;color:#7f8b75;padding:6px 12px;font-size:11px}.preview-controls button.active{background:#e5ecdd;color:#3d5e44}.preview-stage{padding:26px;background:#e8ebdf;border:1px solid #dfe4d4;border-radius:8px;overflow:auto}.paper{max-width:794px;margin:auto;box-shadow:0 5px 23px #37452b13;background:white;line-height:0;aspect-ratio:794/1123}.paper>svg{display:block;width:100%;height:auto}.actual-size .paper{width:794px;max-width:none}.preview-caption{display:flex;justify-content:space-between;font-size:10px;color:#969d90;margin-top:15px;padding:0 2px;letter-spacing:.3px}.export-bar{height:84px;position:fixed;bottom:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;padding:0 42px;border-top:1px solid #dce2d3;background:#fafbf7f5;backdrop-filter:blur(14px);z-index:10}.export-info{display:flex;gap:12px;align-items:center;font-size:12px}.export-check{background:#e9efe3;border-radius:50%;color:#5d7d54;height:28px;width:28px;display:grid;place-items:center}.export-info small{display:block;color:#95a18a;font-size:10px;margin-top:6px;letter-spacing:.5px}.export-actions{display:flex;gap:10px}.button{padding:11px 20px;border-radius:5px;font-size:12px;min-width:92px}.secondary{border:1px solid #d5ddcd;background:transparent;color:#5d7054}.secondary:hover{background:#edf1e8}.primary{border:1px solid var(--green);color:white;background:var(--green);min-width:145px;display:flex;gap:25px;align-items:center;justify-content:space-between}.toast{position:fixed;bottom:105px;left:50%;transform:translateX(-50%);background:#263e33;color:#fff;padding:13px 22px;box-shadow:0 6px 24px #263e3326;border-radius:7px;z-index:20;font-size:12px;max-width:90vw;line-height:1.6}
@media(min-width:1200px){.preview-area{position:sticky;top:24px;align-self:start}}
@media(max-width:1000px){.workspace{grid-template-columns:292px minmax(0,1fr);gap:24px;padding:24px 24px 110px}.panel{padding:20px}.app-header{padding:0 24px}.preview-stage{padding:16px}.export-bar{padding:0 24px}.paper-label{display:none}}
@media(max-width:720px){.app-header{height:76px;padding:0 18px}.brand{font-size:20px;gap:12px}.brand-mark{font-size:27px;width:40px;line-height:40px}.header-note{display:none}.workspace{display:flex;flex-direction:column;padding:20px 16px 100px;gap:24px}.editor{gap:12px}.preview-area{order:0}.editor .panel{padding:20px}.preview-stage{padding:10px}.preview-caption{font-size:9px;gap:12px}.export-bar{padding:0 14px;height:74px}.export-info{display:none}.export-actions{width:100%;gap:8px}.button{flex:1;padding:11px 8px;min-width:0;font-size:11px}.primary{flex:1.35;gap:8px}.toast{bottom:90px}.preview-toolbar{margin-bottom:12px}}
@page{size:A4 portrait;margin:0}
@media print{html,body{margin:0!important;padding:0!important;background:white!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.app-header,.editor,.preview-toolbar,.preview-caption,.export-bar,.toast,#loading{display:none!important}.workspace{display:block!important;margin:0!important;padding:0!important;max-width:none!important}.preview-area{position:static!important;display:block!important}.preview-stage{padding:0!important;margin:0!important;border:0!important;border-radius:0!important;background:white!important;overflow:visible!important}.paper{margin:0!important;width:210mm!important;height:297mm!important;max-width:none!important;box-shadow:none!important;aspect-ratio:auto!important;break-inside:avoid;page-break-inside:avoid}.paper>svg{width:210mm!important;height:297mm!important;display:block!important}}

.export-result{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:14px;padding:12px 15px;background:#e7efdf;border:1px solid #d7e3cd;border-radius:5px;font-size:11px;color:#547447}.export-result a{text-decoration:underline;text-underline-offset:3px;white-space:nowrap}@media print{.export-result{display:none!important}}

.font-description{margin:10px 0 0}.font-status{font-size:11px;color:#6f8765;margin:10px 0 0}.font-warning{font-size:11px;line-height:1.7;color:#937541;margin:12px 0 0}.font-panel .error .text-button{display:block}

.font-sample{margin-top:12px;border:1px solid #e4e8de;border-radius:5px;background:#f8faf4;line-height:0}.font-sample svg{display:block;width:100%;height:auto}
.font-import-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:12px}.font-import-actions .upload-button{margin:0}.font-import-actions .disabled{opacity:.55;cursor:default}

.custom-panel .checkbox-label{margin-top:0}.custom-summary{font-size:10px;color:#8d9786;line-height:1.6;margin:10px 0}.custom-character-row{display:flex;gap:12px;align-items:center;padding:13px 0;border-top:1px solid #edf0e7}.custom-thumbnail{flex-shrink:0;width:60px;height:60px;border:1px solid #dde3d5;border-radius:4px;display:grid;place-items:center;background:#f7f9f2;font:32px KaiTi,serif}.custom-thumbnail.has-image{background-color:#fff;background-image:linear-gradient(45deg,#e9ede3 25%,transparent 25%),linear-gradient(-45deg,#e9ede3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9ede3 75%),linear-gradient(-45deg,transparent 75%,#e9ede3 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.custom-thumbnail img{width:100%;height:100%;object-fit:contain}.custom-character-info{flex:1;min-width:0}.custom-character-info strong{font-size:13px;display:block}.custom-character-info small{font-size:10px;display:block;margin-top:4px;color:#8f9987;line-height:1.5}.custom-row-actions{display:flex;align-items:center;gap:12px;margin-top:5px}.custom-upload,.custom-backup-import{font-size:11px;color:#5f7952;cursor:pointer;text-decoration:underline;text-underline-offset:3px;margin:0;padding:6px 0}.custom-library-actions{display:flex;gap:18px;align-items:center;flex-wrap:wrap;margin-top:12px}.custom-library-actions .upload-button{margin-bottom:0}.custom-panel input:disabled{cursor:default}

.custom-row-actions{flex-wrap:wrap;gap:3px 12px}.custom-remove{color:#9a8875}.custom-undo{display:flex;align-items:center;gap:10px;font-size:11px;color:#829176}.export-image-details{font-size:11px;color:#718368;margin-top:10px}.export-image-details summary{cursor:pointer}.export-image-details img{display:block;width:100%;height:auto;margin-top:10px;border:1px solid #dde4d5;background:white}@media print{.export-result-wrapper{display:none!important}}

.teacher-current{margin:10px 0 0}.teacher-manager{margin-top:14px;padding-top:12px;border-top:1px solid #edf0e7;font-size:11px;color:#718368}.teacher-manager summary{cursor:pointer}.teacher-manager form{padding-top:14px}.library-button{border:1px solid #6a8a61;border-radius:5px;background:#eff4e9;color:#4c6e41;width:100%;padding:9px 12px;font-size:11px}.archived-libraries{margin-top:12px;border-top:1px solid #e5ebdf;padding-top:12px;font-size:10px}.archived-libraries>div{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-top:6px}.archived-libraries span{word-break:break-word}.teacher-missing{font-size:11px;background:#f5f1e5;border:1px solid #e7dfc7;padding:10px 12px;border-radius:5px;color:#8f794f;margin:12px 0}.teacher-missing p{margin:0 0 8px;line-height:1.6}.teacher-missing .checkbox-label{margin-bottom:0}.teacher-missing small{font-size:10px;display:block;margin-top:8px;line-height:1.5}.preview-caption{flex-wrap:wrap;gap:10px}.preview-caption span:first-child{max-width:75%;word-break:break-word}

.source-options{display:grid;gap:9px}.source-options label{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:6px;padding:12px;margin:0;cursor:pointer;font-size:13px}.source-options label.selected{border-color:#6c8a64;background:#f0f5eb}.source-options input{accent-color:var(--green);width:16px!important;margin:0!important}.source-options small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.view-library-button{margin-top:14px}.library-dialog{width:min(780px,calc(100vw - 32px));max-height:85vh;border:1px solid #d9e1d1;border-radius:12px;padding:0;color:var(--ink);background:#fffefb;box-shadow:0 15px 70px #243b3240}.library-dialog::backdrop{background:#20392c70}.library-viewer{padding:24px}.library-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:20px}.library-dialog-header p{font-size:12px;color:var(--muted);margin:8px 0}.dialog-close{background:#edf2e7;border:0;border-radius:50%;width:32px;height:32px;font-size:23px;color:#5e7552;flex-shrink:0}.library-viewer-tools{display:flex;align-items:end;gap:20px;margin-top:10px}.library-viewer-tools label:first-child{flex:1;margin:0}.library-viewer-tools .upload-button{white-space:nowrap;margin:0}.gallery-hint{margin:10px 0 16px}.library-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.library-glyph{border:1px solid var(--line);border-radius:6px;background:white;padding:6px;color:var(--ink)}.library-glyph.selected{border-color:var(--green);background:#f0f5eb}.library-glyph img{width:100%;aspect-ratio:1;object-fit:contain;display:block}.library-glyph span{display:block;font-size:12px;margin-top:6px}.library-selected{display:flex;gap:20px;align-items:center;background:#f4f7ef;border:1px solid var(--line);border-radius:8px;padding:12px;margin-bottom:18px}.library-selected>img{width:150px;height:150px;object-fit:contain;background:white}.library-selected strong{font-size:24px}.library-selected p{font-size:11px;color:var(--muted);word-break:break-all}.library-empty{padding:40px 10px;text-align:center;font-size:13px;color:var(--muted);line-height:1.8}.library-pagination{display:flex;justify-content:space-between;align-items:center;margin-top:18px;font-size:11px;color:var(--muted)}.library-pagination>div{display:flex;gap:18px}
@media(max-width:720px){.library-viewer{padding:18px}.library-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.library-selected>img{width:110px;height:110px}.library-viewer-tools{gap:12px}}
@media print{.library-dialog{display:none!important}}

.mode-tabs{display:flex;gap:6px;padding:5px;background:#e5ebdf;border-radius:9px}.mode-tabs button{flex:1;border:0;border-radius:6px;padding:12px 8px;font-size:13px;background:transparent;color:#6e7c65}.mode-tabs button.active{background:#fffefb;color:var(--green);box-shadow:0 2px 5px #233a3210;font-weight:600}.general-panel textarea{min-height:105px;max-height:320px;font-size:13px;line-height:1.7}.field-help{display:block;font-size:10px;color:var(--muted);margin-top:5px;line-height:1.6}.general-panel label{margin-bottom:16px}.paper+.paper{margin-top:24px}.preview-stage{max-height:calc(100vh - 230px)}
@media(max-width:720px){.preview-stage{max-height:none}}
@media print{.paper+.paper{margin-top:0!important}.paper{break-after:page;page-break-after:always}.paper:last-child{break-after:auto;page-break-after:auto}.preview-stage{max-height:none!important}}

.preview-loading{min-height:440px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:32px;text-align:center;color:var(--muted);font-size:13px;background:#fffefb;border-radius:4px}.preview-loading strong{font-size:15px;font-weight:500;color:var(--ink)}.preview-loading small{font-size:11px}.loading-spinner{display:block;width:30px;height:30px;border:2px solid #dde7d6;border-top-color:var(--green);border-radius:50%;animation:font-spin .8s linear infinite}.preview-error{color:#a15c50;line-height:1.7}@keyframes font-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.loading-spinner{animation:none}}@media print{.preview-loading{display:none!important}}

.processing-progress,.processing-summary{padding:12px;background:#f1f5eb;border:1px solid #dce5d4;border-radius:6px;margin-top:12px;font-size:11px;line-height:1.7}.processing-progress progress{display:block;width:100%;margin-top:8px;accent-color:var(--green)}.processing-summary p{margin:3px 0;overflow-wrap:anywhere}.processing-summary details{margin-top:8px}.glyph-comparison{display:flex;gap:10px;flex-shrink:0}.glyph-comparison figure{margin:0;width:125px;text-align:center}.glyph-comparison img{display:block;width:125px;height:125px;object-fit:contain;background:white}.glyph-comparison figcaption{font-size:11px;color:var(--muted);margin-top:6px}.library-selected{flex-wrap:wrap}.glyph-comparison span{display:grid;place-items:center;height:125px;font-size:11px}.library-dialog .processing-progress{margin:12px 0}@media(max-width:720px){.glyph-comparison figure,.glyph-comparison img{width:110px}.glyph-comparison img,.glyph-comparison span{height:110px}}

.glyph-size-panel .section-heading{justify-content:space-between}.glyph-size-value{font-size:14px;font-weight:600;color:var(--green)}.glyph-size-panel input[type=range]{appearance:auto;width:100%;padding:0;margin-top:12px;accent-color:var(--green);border:0;background:transparent;height:24px;cursor:pointer}.glyph-size-actions{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted)}.glyph-size-panel .small-note{margin-bottom:0}

.admin-entry{margin-left:auto;color:#355c4c;text-decoration:none;font-size:14px;padding:8px 12px;border:1px solid #d8e1dc;border-radius:8px}.app-header .header-note{margin-left:16px}@media print{.admin-entry{display:none}}
