:root{font-family:-apple-system,BlinkMacSystemFont,"Noto Sans SC","Microsoft YaHei",sans-serif;color:#33251e;background:#f8f3eb}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}.shell{max-width:1480px;margin:auto;padding:22px}.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:17px}.brand{display:flex;align-items:center;gap:12px}.seal{width:42px;height:42px;border-radius:12px;background:#8d3d2e;color:#fff;display:grid;place-items:center;font-size:25px}.brand h1{font-size:22px;margin:0}.brand small{color:#8d7e72}.actions,.fields,.tools,.candidate-list,.status-row{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.btn{border:1px solid #d7c9b8;background:#fffaf3;color:#4a3026;border-radius:10px;padding:9px 13px;min-height:39px}.btn:hover{border-color:#a6765f}.btn.primary{background:#8d3d2e;border-color:#8d3d2e;color:white}.btn.warn{color:#9d4936}.btn.active{background:#eedbc5;border-color:#9e7059}.panel{background:#fffdf9;border:1px solid #e8ddd1;border-radius:16px;box-shadow:0 8px 28px #765a3710;margin-bottom:14px}.meta{padding:16px 20px}.fields label{display:flex;align-items:center;gap:7px;color:#79685b;font-size:13px}.fields input,.fields select{border:1px solid #dccfbe;background:white;color:#382a23;border-radius:8px;padding:8px 10px;min-width:80px}.fields input.title{width:210px}.fields input.small{width:74px}.tools{border-top:1px solid #eee4d8;margin-top:15px;padding-top:15px}.hint{font-size:12px;color:#8f8174;margin-left:auto}.entry{padding:17px 20px}.entry-title{font-size:14px;font-weight:700;color:#624b3d;margin-bottom:10px}.input-row{display:flex;align-items:center;gap:10px}.jianzi-input{width:min(420px,100%);border:1px solid #cbb7a2;border-radius:10px;padding:11px 13px;background:#fff;font-size:18px;outline:none}.jianzi-input:focus{border-color:#8d3d2e;box-shadow:0 0 0 3px #8d3d2e1b}.input-help{font-size:12px;color:#948276}.candidate-list{margin-top:12px;min-height:50px}.candidate{min-width:80px;display:flex;flex-direction:column;align-items:center;gap:2px;border:1px solid #e2d3c1;background:#fff9ef;border-radius:11px;padding:7px 9px}.candidate.selected{border-color:#8d3d2e;background:#f9eada}.candidate svg{width:48px;height:48px}.candidate .code{font-size:11px;color:#9b8776}.rhythm-panel{padding:15px 20px}.rhythm-title{font-size:14px;font-weight:700;color:#624b3d;margin-bottom:10px}.rhythm-buttons{display:flex;gap:7px;flex-wrap:wrap}.rhythm-buttons .btn{min-width:76px;padding:7px 10px}.rhythm-buttons .symbol{display:block;font-size:23px;line-height:26px}.rhythm-buttons .caption{display:block;font-size:11px}.duration-controls{display:flex;gap:8px;align-items:center;margin-bottom:12px;font-size:13px;color:#71594a}.duration-controls button{min-width:42px}.score-panel{padding:18px 20px 26px;min-height:340px}.score-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.score-header strong{font-size:17px}.score-line{margin:0 0 20px}.line-head{display:flex;align-items:center;gap:9px;margin-bottom:7px;color:#866a56;font-size:13px}.line-head input{border:0;border-bottom:1px solid #d8c9b8;background:transparent;color:#513c32;max-width:130px;padding:3px}.line-head .line-num{font-size:12px;color:#a28d79}.staff-scroll{overflow-x:auto;max-width:100%;border:1px solid #eadfce;border-radius:12px;background:#fff}.staff{display:grid;grid-template-columns:60px repeat(var(--columns),84px);width:max-content;min-width:100%}.staff .side{position:sticky;left:0;z-index:2;background:#f8efe2;display:flex;align-items:center;justify-content:center;border-right:1px solid #e3d4c1;font-size:12px;color:#8a6f5a;min-height:58px}.staff .side.jianzi-side{min-height:86px;border-top:1px solid #eee3d3}.slot{position:relative;border:0;border-right:1px solid #efe6dc;background:#fff;min-width:84px;min-height:58px;color:#423229}.slot.jianzi{min-height:86px;border-top:1px solid #eee3d3}.slot:hover{background:#fff8ec}.slot.selected{background:#fff0db;box-shadow:inset 0 0 0 2px #a2573b}.slot .cell-index{position:absolute;top:3px;left:5px;color:#b5a99c;font-size:10px}.slot .cell-text{font-size:11px;color:#927a69;position:absolute;bottom:3px;left:2px;right:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.slot svg{width:63px;height:63px;margin:8px auto 10px;display:block}.slot .rhythm-glyph{font-size:29px;line-height:1}.slot .rhythm-caption{font-size:11px;color:#9a8170}.status-row{justify-content:space-between;color:#806d5d;font-size:12px;padding:0 5px 16px}.toast{position:fixed;right:20px;bottom:22px;background:#392a24;color:#fff;padding:11px 16px;border-radius:10px;box-shadow:0 5px 24px #0004;z-index:10}.hidden{display:none}.help{font-size:12px;color:#8d7a69}.empty{color:#b2a192;font-size:12px}@media(max-width:720px){.shell{padding:12px}.topbar{align-items:flex-start;flex-direction:column}.actions{width:100%}.meta,.entry,.rhythm-panel,.score-panel{padding:13px}.hint{margin-left:0}.fields label{width:calc(50% - 5px)}.fields input.title{width:100%}.input-row{flex-direction:column;align-items:stretch}.jianzi-input{width:100%}}

/* 文档式编辑器：谱字自然换行，光标和输入浮层跟随当前插入点。 */
body{padding-bottom:0}
.actions a.btn{text-decoration:none;display:inline-flex;align-items:center}
.brand-icon{width:46px;height:46px;display:block;object-fit:cover;border-radius:12px;box-shadow:0 2px 8px #32201520}
.meta-title-row{display:flex;align-items:flex-end;gap:20px;padding-bottom:14px;border-bottom:1px solid #eee4d8}
.meta-title-row .title-field{display:flex;flex:1;min-width:0;flex-direction:column;gap:7px;font-size:13px;font-weight:700;color:#795c4b}
.meta-title-row .title-field input{width:100%;border:0;outline:none;background:transparent;padding:3px 0;color:#33251e;font-size:23px;font-weight:600}
.meta-title-row .title-field input:focus{box-shadow:0 2px 0 #ad755e}
.meta-caption{font-size:12px;color:#a38b79;white-space:nowrap}
.meta-settings{display:grid;grid-template-columns:minmax(250px,2.3fr) repeat(3,minmax(100px,1fr));gap:12px;margin-top:14px}
.meta-settings label{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:0;font-size:12px;color:#79685b}
.meta-settings input,.meta-settings select{width:100%;min-width:0;border:1px solid #dccfbe;background:#fff;color:#382a23;border-radius:8px;padding:8px 10px}
.meta-settings .tuning-field small{font-size:11px;color:#9b7962;line-height:1.35}
@media(max-width:800px){.meta-settings{grid-template-columns:repeat(2,minmax(0,1fr))}.meta-settings .tuning-field{grid-column:1/-1}}
@media(max-width:520px){.meta-title-row .title-field input{font-size:20px}.meta-settings{gap:10px}.meta-caption{display:none}}
.editor-shell{max-width:1180px}
.page{background:#fff;min-height:620px;width:100%;margin:22px auto;border:1px solid #e6ddd2;box-shadow:0 15px 50px #5c41251c;padding:50px 56px;outline:none;cursor:text}
.page-title{text-align:center;font-size:25px;font-weight:700;letter-spacing:.14em;margin-bottom:35px}
.paragraph{margin-bottom:30px;min-height:95px}
.paragraph-heading{display:flex;align-items:center;gap:8px;color:#998574;font-size:12px;margin-bottom:10px}
.paragraph-heading input{background:transparent;border:0;border-bottom:1px solid #e8dac8;color:#644a3e;padding:4px;max-width:95px}
.paragraph-heading input[type=number]{width:52px}
.paragraph-body{display:flex;flex-wrap:wrap;align-items:flex-end;align-content:flex-start;min-height:84px;row-gap:7px}
.doc-token{display:inline-flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:54px;min-height:86px;padding:1px 2px;border-radius:3px;cursor:text;user-select:none}
.doc-token:hover{background:#fff5e8}
.doc-token.range-selected{background:#f4dfc3}
.doc-token svg{width:58px;height:58px;display:block}
.doc-note{font-size:23px;line-height:25px;min-height:25px;color:#55483e}
.empty-glyph{display:block;height:58px;width:40px}
.caret-spot{display:inline-block;width:2px;height:83px;align-self:flex-end;position:relative;cursor:text}
.caret-spot.doc-caret::after{content:'';position:absolute;left:0;top:0;width:2px;height:82px;background:#963f30;animation:caret-blink 1s step-end infinite}
@keyframes caret-blink{50%{opacity:0}}
.ime{position:fixed;z-index:30;display:none;min-width:130px;max-width:min(400px,calc(100vw - 24px));background:#fffdf8;border:1px solid #c7a78d;border-radius:8px;box-shadow:0 9px 28px #42281638;padding:5px}
.ime.composing{display:block}
.ime input{border:0;outline:none;background:transparent;padding:5px 7px;width:100%;font-size:20px;color:#412a20}
.ime .candidate-list{margin:3px 0 0;max-height:210px;overflow-x:auto;overflow-y:hidden;min-height:0;flex-wrap:nowrap;align-items:stretch;scrollbar-width:thin}
.ime .candidate{min-width:64px;padding:4px;flex-shrink:0;font-size:12px}
.ime .candidate svg{width:45px;height:45px}
@media(max-width:800px){.page{padding:25px 18px;min-height:500px}}
@font-face{font-family:BravuraText;src:url('assets/fonts/BravuraText.otf') format('opentype');font-display:block}
.doc-note{font-family:BravuraText,sans-serif}
.ime.composing:not(.has-text){min-width:1px;width:1px;padding:0;border:0;box-shadow:none;background:transparent}
.ime:not(.has-text) input{width:1px;padding:0;opacity:0}
.ime:not(.has-text) .candidate-list{display:none}
.paragraph{min-height:50px;margin-bottom:18px}
.paragraph-body{min-height:44px;row-gap:4px}
.doc-token{min-width:29px;min-height:44px;padding:0 1px}
.doc-token svg{width:29px;height:29px}
.doc-note{font-size:14px;line-height:14px;min-height:14px}
.empty-glyph{height:29px;width:20px}
.caret-spot{height:44px}
.caret-spot.doc-caret::after{height:43px}
.doc-token.invalid{background:#fff0e9;box-shadow:inset 0 -2px #c74934}
.paragraph{min-height:80px}
.paragraph-body{min-height:75px;align-items:flex-end}
.doc-token{min-height:74px;min-width:32px}
.doc-note{font-size:18px;line-height:19px;min-height:38px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
.note-symbols{display:flex;align-items:center;justify-content:center;min-height:20px;white-space:nowrap}
.note-component{display:inline-block;min-width:16px;text-align:center}
.beat-count{font-family:-apple-system,BlinkMacSystemFont,"Noto Sans SC",sans-serif;font-size:11px;line-height:13px;color:#9b654b;white-space:nowrap}
.doc-glyph{display:grid;place-items:center;min-width:32px;height:35px;border-radius:3px}
.doc-token svg{width:28px;height:28px}
.doc-token .empty-glyph{height:28px;width:28px}
.caret-spot{height:74px}
.caret-spot.doc-caret::after{height:73px;z-index:2}
.caret-spot.layer-rhythm.doc-caret::after{top:0;height:38px;background:#ad6538}
.caret-spot.layer-jianzi.doc-caret::after{top:39px;height:34px;background:#70834b}
.caret-spot.doc-caret.editing::after{animation:caret-breathe 1.8s ease-in-out infinite}
.doc-token.active-rhythm .doc-note{background:#f5d7bb;color:#7e3d21;border-radius:3px;animation:slot-breathe 1.8s ease-in-out infinite}
.doc-token.active-jianzi .doc-glyph{background:#e1e5c4;animation:slot-breathe 1.8s ease-in-out infinite}
@keyframes slot-breathe{50%{background-color:transparent}}
@keyframes caret-breathe{50%{opacity:.25;box-shadow:0 0 5px currentColor}}
.validation-results{width:100%;margin:10px auto 18px;padding:14px 17px;border:1px solid #e6c8bd;background:#fff8f3;border-radius:10px;color:#754135}
.validation-results.hidden{display:none}
.validation-results strong{display:block;margin-bottom:8px}
.validation-results .validation-ok{color:#3f7655;margin:0}
.issue-list{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-height:180px;overflow:auto}
.issue{border:0;background:transparent;color:#8e4233;padding:5px;text-align:left;cursor:pointer}
.publish-dialog{width:min(520px,calc(100vw - 30px));border:1px solid #d8c9b9;border-radius:16px;padding:25px;background:#fffdf9;color:#392920;box-shadow:0 25px 70px #0005}
.publish-dialog::backdrop{background:#1c130ec2}
.publish-dialog h2{margin:0 0 9px;font-size:22px}
.publish-dialog p{font-size:14px;line-height:1.55;color:#786455;margin:0 0 17px}
.publish-dialog form{float:right}
.dialog-close{border:0;background:transparent;color:#755f51;font-size:27px;line-height:1}
.publish-identity,.publish-status{font-size:13px;color:#6b5548;line-height:1.5;margin:8px 0}
.pair-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:29px;font-weight:700;letter-spacing:.12em;color:#8d3d2e;min-height:42px;word-break:break-all}
.pair-qr{width:min(240px,100%);margin:12px auto 4px;padding:12px;background:white;border:1px solid #e5d9cb;border-radius:10px}
.pair-qr[hidden]{display:none}
.pair-qr svg{display:block;width:100%;height:auto}
.pair-code{text-align:center;font-size:17px;letter-spacing:.16em}
.publish-actions{display:flex;gap:8px;margin:9px 0 18px;flex-wrap:wrap}
.publish-intro{display:block;font-size:13px;font-weight:700;color:#6b5548}
.publish-intro textarea{display:block;width:100%;margin:7px 0 15px;border:1px solid #d8c9b9;border-radius:9px;padding:10px;resize:vertical;color:#392920}
.publish-status{min-height:22px}
.publish-dialog .btn.primary{width:100%}
.issue:hover{text-decoration:underline}
.cloud-drafts-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0 8px;color:#60493a;font-size:14px}
.cloud-drafts-heading .btn{min-height:30px;padding:4px 9px;font-size:12px}
.cloud-drafts{display:grid;gap:7px;max-height:230px;overflow:auto;margin-bottom:12px}
.cloud-drafts[hidden]{display:none}
.cloud-draft{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;text-align:left;padding:11px 12px;border:1px solid #e6d9cc;border-radius:9px;background:#fffaf3;color:#453025}
.cloud-draft:hover,.cloud-draft:focus-visible{border-color:#a96b50;background:#f9ecdc}
.cloud-draft strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cloud-draft small{flex:none;color:#8b7565}
.cloud-drafts-empty{padding:10px 2px;color:#8b7565}
@media(max-width:520px){.cloud-draft{align-items:flex-start;flex-direction:column;gap:3px}.cloud-draft small{font-size:11px}}
.editor-shell[hidden]{display:none}
.cloud-draft-picker{display:flex;align-items:center;gap:7px;color:#6c5243;font-size:13px;white-space:nowrap}
.cloud-draft-picker select{width:clamp(180px,24vw,320px);max-width:100%;height:39px;border:1px solid #d7c9b8;border-radius:10px;background:#fffaf3;color:#4a3026;padding:7px 10px}
.paragraph-body{width:100%;min-width:0}
.paragraph-body .doc-token{flex:0 0 auto}
.doc-glyph{position:relative}
.doc-token.ends-sentence .doc-glyph::after{content:'';position:absolute;right:2px;bottom:2px;width:6px;height:6px;border-radius:50%;background:#9a651b;box-shadow:0 0 0 2px #fff}
@media(max-width:720px){.cloud-draft-picker{width:100%}.cloud-draft-picker select{flex:1;width:100%}}
.topbar{position:relative;align-items:flex-start;padding-right:102px;flex-wrap:wrap}
.topbar .brand{min-height:46px}
.topbar .actions{flex:1;justify-content:flex-end}
.help-link{position:absolute;right:0;top:4px;display:inline-flex;align-items:center;gap:5px;color:#176d70;font-size:13px;font-weight:700;text-decoration:none;white-space:nowrap;padding:8px 0}
.help-link svg{width:19px;height:19px;flex:none}
.help-link:hover,.help-link:focus-visible{color:#0d4e50;text-decoration:underline}
.section-number{font-weight:700;color:#6b4532;white-space:nowrap}
.paragraph-heading input[data-section-title]{min-width:115px;max-width:180px}
@media(max-width:900px){.topbar .actions{flex-basis:100%;justify-content:flex-start}}
@media(max-width:720px){.topbar{padding-right:0;padding-top:36px}.help-link{top:0}.topbar .actions{width:100%}}
