:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:#292731;background:#f6f5f9;font-synthesis:none;--accent:#7163aa;--muted:#888593;--border:#eae8f0}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #afa4e0;outline-offset:2px}.editor:focus,.editor:focus-visible{outline:none}/* 正文本身就是写字的地方，光标已说明焦点；外框像"被选中"，会打扰写作 */.topbar{height:74px;padding:0 max(28px,calc((100% - 1100px)/2 + 28px));display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #ebe9f0}.brand{display:flex;align-items:center;gap:11px;font-size:18px;font-weight:750;letter-spacing:.08em}.brand small,.document-type small{display:block;color:#a09cae;font-size:8px;letter-spacing:.16em;font-weight:600;margin-top:3px}.brand-mark{width:35px;height:35px;display:grid;place-items:center;background:#eeeaf9;color:var(--accent);border-radius:11px;font-size:21px}.save-label{color:#6e6b79;font-size:12px;display:flex;align-items:center;gap:8px;white-space:nowrap}.dot{width:7px;height:7px;border-radius:50%;background:#b1a8ce}.save-label.saved .dot{background:#64b893}.save-label.error .dot{background:#e17c78}.workspace{max-width:1100px;padding:0 28px;margin:auto}.intro{display:flex;align-items:center;justify-content:space-between;padding:42px 2px 29px}.eyebrow{font-size:10px;letter-spacing:.15em;color:#9b8fc5;font-weight:750}.intro h1{font-size:26px;margin:8px 0;color:#2c2937;letter-spacing:.02em}.intro p,.action-copy p,.export-card p{color:#908c9a;font-size:13px;line-height:1.7;margin:0}.intro-mark{font-size:54px;color:#ddd5f2;padding-right:15px}.document,.actions,.export-card{background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:0 6px 28px #3c2f5510}.document{overflow:hidden}.document-top{display:flex;align-items:center;justify-content:space-between;padding:22px 28px 12px}.document-type{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:700}.document-icon{display:grid;place-items:center;width:32px;height:32px;background:#f3f0fb;color:var(--accent);border-radius:10px;font-size:18px}.private-tag{color:#9d94b4;background:#f7f5fc;border-radius:20px;padding:6px 10px;font-size:11px}.title{width:calc(100% - 56px);margin:12px 28px 18px;border:0;padding:6px 0;font-size:23px;font-weight:700;background:transparent;color:#302c38;outline:none}.title::placeholder{color:#c4c0cc;font-weight:500}.toolbar{display:flex;gap:4px;align-items:center;padding:8px 23px;background:#faf9fc;border-block:1px solid #f0eef4;min-height:48px}.toolbar button{border:0;background:transparent;color:#6e687c;min-width:34px;height:32px;border-radius:8px}.toolbar button:hover{background:#eeeaf8;color:var(--accent)}.toolbar-line{height:21px;width:1px;background:#e6e3ed;margin:0 5px}.toolbar .image-tool{display:inline-flex;align-items:center;gap:5px;padding:0 9px;color:#7163aa;font-size:13px;font-weight:650;line-height:1}.image-tool .tool-icon{flex:0 0 auto;width:15px;height:15px}.toolbar-help{margin-left:auto;color:#b2aeba;font-size:11px}.editor{padding:25px 30px;min-height:360px;line-height:1.85;overflow-wrap:anywhere;outline:none;color:#34313a;font-size:16px}.editor:empty:before{content:attr(data-placeholder);color:#c5c1ce;pointer-events:none}.editor p,.editor div{margin:0 0 .8em}.editor img{display:block;max-width:100%;height:auto;margin:1em auto;border-radius:6px}.editor blockquote{border-left:3px solid #c3b8e4;margin:1em 0;padding-left:1em;color:#70697d}.document-bottom{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #f1eff4;padding:13px 28px;color:#a49fab;font-size:11px}.actions,.export-card{padding:23px 27px;margin-top:20px}.actions{display:flex;align-items:center;justify-content:space-between;gap:20px}.actions h2,.export-card h2{font-size:17px;margin:7px 0}.action-copy{max-width:560px}.action-buttons,.export-controls{display:flex;gap:10px;flex-wrap:wrap}.secondary,.primary,select{border-radius:10px;min-height:40px;padding:0 15px;font-size:13px;font-weight:650}.secondary{border:1px solid #e6e1f1;color:#7468a8;background:#fff}.secondary:hover{background:#f6f3fc}.primary{border:1px solid #7163aa;background:#7163aa;color:#fff}.primary:hover{background:#62549d}.primary span{margin-left:12px}.export-card{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center}.export-controls select{border:1px solid #e5e1ec;background:#faf9fc;color:#514c5b;max-width:100%}.export-note{grid-column:1/-1;font-size:11px!important}.alert{background:#fff5f1;color:#9a4e42;border:1px solid #f1cdc3;border-radius:12px;padding:12px 15px;margin:0 0 16px;font-size:13px;line-height:1.5;display:flex;justify-content:space-between;gap:10px}.alert[hidden]{display:none}.alert button{background:none;border:0;font-size:22px;color:inherit}footer{text-align:center;color:#b4adbe;padding:30px 0 40px;font-size:11px}footer span{color:#a496ce;margin-left:5px}.sr-only{position:absolute;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;width:1px;height:1px}.disabled{opacity:.6;pointer-events:none}
@media(max-width:680px){.topbar{height:62px;padding:0 14px}.brand{font-size:16px}.brand small{font-size:7px}.save-label{font-size:11px}.workspace{padding:0 14px}.intro{padding:30px 3px 22px}.intro h1{font-size:22px}.intro-mark{font-size:38px}.document{border-radius:15px}.document-top{padding:18px 18px 8px}.title{width:calc(100% - 36px);margin:12px 18px;font-size:20px}.toolbar{padding:8px 13px}.toolbar-help{display:none}.editor{padding:20px 19px;min-height:320px}.document-bottom{padding:13px 18px}.document-bottom span:last-child{font-size:10px;text-align:right}.actions,.export-card{padding:20px;margin-top:14px}.actions{display:block}.action-buttons{margin-top:16px}.action-buttons button{flex:1;white-space:nowrap}.export-card{display:block}.export-controls{margin-top:16px}.export-controls select{flex:1;min-width:0}.export-note{margin-top:12px!important}}

.chapter-panel{margin:16px 0 20px;padding:14px 16px;border:1px solid #e7e3f0;border-radius:14px;background:#faf9fd}.chapter-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px;font-weight:700;color:#5d5676}.chapter-heading button,.chapter-current button{border:0;background:transparent;color:#7060ac;cursor:pointer;padding:8px;font:inherit}.chapter-list{display:flex;gap:8px;overflow-x:auto;padding:10px 0}.chapter-list button{flex:0 0 auto;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #e1dcef;border-radius:9px;background:#fff;color:#625b70;padding:8px 12px;cursor:pointer}.chapter-list button[aria-current="true"]{background:#ece8f8;border-color:#bcb0dc;color:#5e4e9e;font-weight:700}.chapter-current{display:flex;align-items:center;gap:10px}.chapter-current label{white-space:nowrap;font-size:13px;color:#777183}.chapter-current input{min-width:0;flex:1;border:1px solid #e0dbea;background:#fff;border-radius:8px;padding:9px 10px;color:#282332;font:inherit}.chapter-current button{white-space:nowrap;color:#a05565;font-size:13px}@media(max-width:680px){.chapter-panel{padding:12px}.chapter-current{gap:6px}.chapter-current button{padding:6px}}

.chapter-actions{display:flex;gap:8px;margin-top:8px}.chapter-actions button{border:0;background:transparent;color:#7060ac;font-size:13px;padding:6px 8px;cursor:pointer}.chapter-actions button:disabled{opacity:.35;cursor:default}
@font-face{font-family:'LXGW WenKai';src:url('vendor/LXGWWenKai-Regular.ttf') format('truetype');font-display:swap}
.toolbar{flex-wrap:wrap}.toolbar select{min-height:32px;max-width:170px;padding:0 8px;border:1px solid #e1dcef;background:#fff;color:#625b70;font-size:12px}.image-controls{display:flex;align-items:center;gap:12px;padding:10px 26px;background:#f7f4fc;color:#625b70;font-size:13px}.image-controls[hidden]{display:none}.image-controls input{width:min(220px,40vw);accent-color:#7163aa}.image-controls button{border:0;border-radius:7px;padding:5px 10px;background:#ece8f8;color:#5e4e9e}.editor img{cursor:pointer}
.toolbar button svg{width:18px;height:18px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.image-list-panel{padding:12px 26px;background:#faf9fc;border-bottom:1px solid #f0eef4;color:#625b70;font-size:13px}.image-list-panel[hidden]{display:none}.image-list-heading,.image-list-row{display:flex;align-items:center;gap:10px}.image-list-heading strong,.image-list-row span{flex:1;min-width:0}.image-list-panel button{border:0;border-radius:7px;padding:6px 10px;background:#ece8f8;color:#5e4e9e}.image-list-row{margin-top:10px}.image-list-row img{width:40px;height:40px;object-fit:contain;background:#fff;border:1px solid #ddd7e8;border-radius:6px}.image-list-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.alert:not([hidden]){position:sticky;top:12px;z-index:20}

/* Book shelf, book details and the focused chapter editor. */
[hidden]{display:none!important}
textarea{font:inherit;resize:vertical}
textarea:focus-visible{outline:3px solid #afa4e0;outline-offset:2px}
.page-heading{display:flex;justify-content:space-between;align-items:end;gap:16px;padding:40px 2px 24px}
.page-heading h1,.book-fields h1{font-size:26px;margin:8px 0;color:#2c2937}
.page-heading p,.chapter-heading p{margin:0;color:#908c9a;font-size:13px;line-height:1.6}
.page-nav{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:25px 0 18px}
.back-link,.link-button{border:0;background:transparent;color:var(--accent);font-size:13px;font-weight:650;padding:8px 0}
.back-link:hover,.link-button:hover{text-decoration:underline}
.bookshelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(235px,1fr));gap:16px;min-height:120px}
.book-card{display:flex;gap:16px;align-items:flex-start;width:100%;min-height:162px;padding:18px;border:1px solid var(--border);border-radius:18px;background:#fff;box-shadow:0 6px 28px #3c2f550d;text-align:left;color:#302c38;transition:border-color .15s,transform .15s}
.book-card:hover{border-color:#c1b5df;transform:translateY(-2px)}
.book-card-cover,.book-cover-preview{display:grid;place-items:center;flex-shrink:0;overflow:hidden;background:linear-gradient(145deg,#e7e1f5,#cfc3e8);color:#7e6caf;font-size:28px}
.book-card-cover{width:76px;aspect-ratio:2/3;border-radius:8px;box-shadow:0 5px 12px #74639722}
.book-card-cover img,.book-cover-preview img{width:100%;height:100%;object-fit:cover}
.book-card-content{min-width:0;flex:1}.book-card-title{font-weight:750;font-size:16px;overflow-wrap:anywhere}.book-card-description{font-size:12px;color:#918b9b;line-height:1.5;margin-top:7px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.book-card-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.book-card-tags span{font-size:10px;color:#7566a6;background:#f1eef9;padding:3px 7px;border-radius:20px}.book-card-meta{color:#aaa4b1;font-size:11px;margin-top:10px}.book-card-empty{color:#97909f;font-size:13px;grid-column:1/-1;padding:35px;text-align:center;background:#fff;border:1px dashed #e2dcec;border-radius:16px}
.book-settings{display:flex;align-items:flex-start;gap:28px;padding:26px;background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:0 6px 28px #3c2f5510}
.book-cover-area{width:150px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:8px}
.book-cover-preview{width:138px;aspect-ratio:2/3;border-radius:12px;box-shadow:0 6px 18px #74639722;font-size:40px}
.cover-upload{display:flex;align-items:center;justify-content:center;width:100%;cursor:pointer}.book-cover-area .link-button{font-size:12px}
.book-fields{display:flex;flex-direction:column;gap:7px;flex:1;min-width:0}.book-fields-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:4px}.book-fields h1{font-size:20px;margin:5px 0}.book-fields label{margin-top:5px;font-size:13px;font-weight:700;color:#625b70}.book-fields input,.book-fields textarea{width:100%;border:1px solid #e5e1ec;background:#fbfafd;color:#302c38;border-radius:10px;padding:10px 12px;line-height:1.5}.book-fields input::placeholder,.book-fields textarea::placeholder{color:#b9b3c1}.book-fields small{color:#9e98a7;font-size:11px}
#bookView .chapter-panel{margin:20px 0 0;padding:24px 26px;background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:0 6px 28px #3c2f5510}
#bookView .chapter-heading h2{font-size:18px;margin:5px 0;color:#302c38}#bookView .chapter-heading button{padding:0 15px;border:1px solid #e6e1f1;border-radius:10px;background:#fff;font-size:13px}
#bookView .chapter-list{display:flex;flex-direction:column;gap:7px;overflow:visible;padding:14px 0 4px}
#bookView .chapter-list button{width:100%;max-width:none;flex:none;padding:12px 14px;border-radius:10px;background:#faf9fc;text-align:left;white-space:normal;overflow-wrap:anywhere}
#editorView .chapter-current{padding:12px 28px 20px}#editorView .chapter-current input{font-size:16px;font-weight:650}
.export-card{display:block}.export-scope{border:0;padding:16px 0 12px;margin:0;color:#625b70;font-size:13px}.export-scope legend{padding:0;margin-bottom:8px;font-weight:700}.export-scope>label{display:inline-flex;align-items:center;gap:5px;margin-right:20px;min-height:30px}.export-scope input{accent-color:var(--accent)}.export-chapter-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;max-height:240px;overflow-y:auto;margin:8px 0;border:1px solid #ebe7f2;border-radius:10px;padding:12px;background:#faf9fc}.export-chapter-list label{display:flex;gap:8px;align-items:flex-start;overflow-wrap:anywhere}.export-note{margin-top:12px!important}
@media(max-width:680px){.page-heading{padding:26px 2px 18px;align-items:center}.page-heading h1{font-size:22px}.page-heading .primary{white-space:nowrap;padding:0 10px}.page-nav{padding:16px 0 12px}.bookshelf{grid-template-columns:1fr;gap:10px}.book-card{min-height:130px;padding:14px}.book-card-cover{width:65px}.book-settings{padding:18px;gap:15px}.book-cover-area{width:90px}.book-cover-preview{width:90px}.book-fields-heading{align-items:flex-start}.book-fields-heading .primary{padding:0 9px;white-space:nowrap}.book-fields h1{font-size:18px}.book-fields input,.book-fields textarea{padding:8px 9px;font-size:14px}#bookView .chapter-panel{margin-top:14px;padding:20px}#editorView .chapter-current{padding:10px 18px 16px}}
#bookCoverInput:focus-visible + .cover-upload{outline:3px solid #afa4e0;outline-offset:2px}
.chapter-sort-label{align-self:center;font-size:12px;color:#928c9b}
.chapter-actions{flex-wrap:wrap}
@media(max-width:370px){.book-settings{gap:12px}.book-cover-area,.book-cover-preview{width:70px}.book-cover-area .cover-upload{padding:0 5px;font-size:12px}.book-fields-heading{gap:6px}.book-fields-heading .primary{font-size:12px;padding:0 7px}}
/* Image handles and insertion marker are outside the editable document. */
.editor img { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.editor div[style*="text-align"] > img { display:inline-block; vertical-align:middle; margin:1em 0; }
.image-frame { position:fixed; z-index:10010; pointer-events:none; border:2px solid #7163aa; box-shadow:0 0 0 1px #fff9; }
.image-frame[hidden], .image-frame-handle[hidden], .image-insert-line[hidden] { display:none !important; }
.image-frame-lock { pointer-events:auto; position:absolute; right:-2px; top:-37px; min-width:38px; height:34px; border:1px solid #dad3eb; border-radius:8px; background:#fff; color:#65569e; box-shadow:0 2px 8px #28203b25; font-size:17px; }
.image-frame-handle { pointer-events:auto; position:absolute; transform:translate(-50%,-50%); width:28px; height:28px; border:0; padding:0; background:transparent; touch-action:none; }
.image-frame-handle::after { content:''; position:absolute; width:9px; height:9px; top:50%; left:50%; transform:translate(-50%,-50%); background:#7163aa; border:1px solid white; border-radius:2px; }
.image-drag-ghost { position:fixed; z-index:10009; pointer-events:none; opacity:.55; object-fit:contain; border:2px solid #7163aa; box-shadow:0 4px 14px #28203b30; }
.image-insert-line { position:fixed; z-index:10011; pointer-events:none; border-top:3px solid #7163aa; }
.image-insert-line::after { content:attr(data-alignment); position:absolute; right:0; top:2px; padding:2px 6px; background:#7163aa; border-radius:4px; color:white; font-size:11px; }

/* Allow the browser to render bold and italic when a Chinese font has only a regular face. */
.editor{font-synthesis:weight style}
.toolbar button[aria-pressed="true"]{background:#e8e2f7;color:#55459b}

.image-frame-move { pointer-events:auto; position:absolute; left:-2px; top:-37px; min-width:38px; height:34px; border:1px solid #dad3eb; border-radius:8px; background:#fff; color:#65569e; box-shadow:0 2px 8px #28203b25; font-size:21px; touch-action:none; }
.image-frame-move[hidden] { display:none !important; }

/* Immersive writing keeps the live editor mounted and its save status visible. */
/* macOS places the brand, navigation and live save status in its native top bar. */
html.toolbox-native-header .topbar { display: none; }
.brand-mark { object-fit: contain; flex: 0 0 auto; }
html.app-immersive .topbar { height: 28px; padding: 0 20px; justify-content: flex-end; border-bottom: 0; background: transparent; }
html.app-immersive .topbar .brand { display: none; }
html.app-immersive .workspace { padding-left: 20px; padding-right: 20px; }
html.app-immersive .page-heading { padding-top: 12px; padding-bottom: 12px; }
html.app-immersive .page-nav { padding-top: 8px; padding-bottom: 8px; }
html.app-immersive .document-top { padding-top: 8px; padding-bottom: 4px; }
html.app-immersive footer { display: none; }

/* The native host supplies the effective app appearance to WebKit. These
   rules change the editor chrome only; saved manuscript styles stay intact. */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; color: #eceaf1; background: #1c1c1e; --accent: #b7a8ed; --muted: #aaa5b6; --border: #3f3f42; }
  body { background: #1c1c1e; }
  .topbar { background: #242426; border-color: #3a3a3d; }
  .brand-mark, .document-icon { background: #39324d; }
  .save-label { color: #c4bfce; }
  .intro h1, .page-heading h1, .book-fields h1, #bookView .chapter-heading h2 { color: #f1eff6; }
  .intro p, .action-copy p, .export-card p, .page-heading p, .chapter-heading p { color: #b2adbd; }
  .intro-mark { color: #706586; }
  .document, .actions, .export-card, .book-card, .book-settings, #bookView .chapter-panel, .book-card-empty { background: #29292b; border-color: #3f3f42; box-shadow: 0 6px 28px #0003; }
  .book-card { color: #eeeaf4; }
  .book-card:hover { border-color: #9a88cd; }
  .book-card-description, .book-card-meta, .book-card-empty, .book-fields small, .chapter-sort-label { color: #bbb5c5; }
  .book-card-tags span, .private-tag { color: #d2c3f4; background: #3d354d; }
  .book-cover-preview, .book-card-cover { background: linear-gradient(145deg,#55496c,#373044); color: #e1d4ff; }
  .book-fields label, .export-scope, .chapter-heading, .chapter-current label { color: #d0cad9; }
  .book-fields input, .book-fields textarea, .chapter-current input, .title { color: #f1eff6; }
  .book-fields input, .book-fields textarea, .chapter-current input { background: #1f1f21; border-color: #4a4a4d; }
  /* Mac v2.42.8 测评第 14 条：深色里的占位字以前是 #aaa3b2，亮得接近已经填好的字；压暗到和浅色里一样"淡" */
  .book-fields input::placeholder, .book-fields textarea::placeholder, .title::placeholder, .editor:empty:before { color: #6f6a7b; }
  .toolbar, .image-list-panel { background: #242426; border-color: #3f3f42; color: #d1cadd; }
  .toolbar button { color: #d2cadf; }
  .toolbar .image-tool { color: #c9b7f3; }
  .toolbar button:hover, .toolbar button[aria-pressed="true"] { background: #48405b; color: #f3eaff; }
  .toolbar select, .export-controls select { background: #333139; border-color: #57515f; color: #f1ecf7; }
  .toolbar-line { background: #514c59; }
  .toolbar-help, .document-bottom, footer { color: #b5aebe; }
  .editor { color: #efedf3; caret-color: #d3c5ff; }
  .editor blockquote { border-color: #aa98d7; color: #c9c0d4; }
  .document-bottom { border-color: #3f3f42; }
  .secondary, #bookView .chapter-heading button { border-color: #5b526c; color: #d1c2f2; background: #302d36; }
  .secondary:hover, #bookView .chapter-heading button:hover { background: #423a4d; }
  .primary { color: #fff; }
  .chapter-panel, #bookView .chapter-list button, .export-chapter-list { background: #242426; border-color: #414144; color: #e3dfeb; }
  .chapter-list button { background: #2f2f31; border-color: #4a4a4d; color: #e8e2ed; }
  .chapter-list button[aria-current="true"] { background: #4a3f60; border-color: #a190d3; color: #f6efff; }
  .chapter-heading button, .chapter-actions button { color: #c9b7f3; }
  .chapter-current button { color: #efa8b4; }
  .image-controls { background: #332d3d; color: #e1daeb; }
  .image-controls button, .image-list-panel button { background: #49405b; color: #f0e6ff; }
  .image-list-row img { background: #fff; border-color: #81798c; }
  .image-frame-lock, .image-frame-move { background: #302b38; border-color: #70647f; color: #e1d2ff; }
  .alert { background: #4b302e; border-color: #895b56; color: #ffded5; }
}

/* Chapter naming controls follow the writer's existing compact form style. */
.chapter-current select{flex:0 0 auto;max-width:145px;min-height:36px;padding:0 8px;border:1px solid #e1dcef;border-radius:8px;background:var(--control,#fff);color:inherit}.numbered-chapter-fields{flex:1;min-width:0;display:flex;align-items:center;gap:8px}.numbered-chapter-fields[hidden]{display:none!important}.chapter-current .numbered-chapter-fields #chapterNumber{flex:0 0 64px;min-width:48px;text-align:center}.chapter-current .numbered-chapter-fields #chapterName{flex:1;min-width:60px}.chapter-number-error{margin:0 26px 12px;color:#ae4c5d;font-size:12px}.chapter-number-error[hidden]{display:none}@media(max-width:680px){.chapter-current{flex-wrap:wrap}.chapter-current .numbered-chapter-fields{flex:1 1 100%;order:3}.chapter-number-error{margin-left:18px;margin-right:18px}}
@media (prefers-color-scheme:dark){.chapter-current select{background:#1f1f21;border-color:#4a4a4d;color:#f1eff6}.chapter-number-error{color:#efa8b4}}

/* Update notice shown only when a newer version is found. */
.update-notice{display:inline-flex;align-items:center;gap:6px;margin-left:10px;padding:3px 4px 3px 12px;border-radius:999px;background:#efeafb;color:#5b4f93;font-size:12px;white-space:nowrap}
.update-notice button{border:0;border-radius:999px;background:#7163aa;color:#fff;padding:4px 10px;font-size:12px;font-weight:650}
.update-notice .update-notice-close{background:transparent;color:#7d7590;padding:2px 8px;font-size:15px;font-weight:400}
@media (prefers-color-scheme:dark){.update-notice{background:#353044;color:#d8cff7}.update-notice .update-notice-close{color:#b9b2c9}}

/* Mac app bookshelf: use the available width, larger book cards, and keep
   the backup note on its own line above the buttons. Editing pages keep
   their comfortable reading width. */
html.toolbox-native-header .workspace:has(#shelfView:not([hidden])){max-width:1440px}
/* 对齐测评第 1 条（2026-11-19）：顶栏和书架要共用一对左右边线。
   - Mac：顶栏是工具箱外壳画的（NovelProjectsView.swift，左右内边距 12pt），网页里书架再缩 28px，差 16pt。
     书架这里改成 12px，图标左边 = 书封左边，"?"右边 = "输入分享码"右边。
   - Windows / 安卓：顶栏的边距算法改成"内容列边距 + 28"（上面 .topbar），见 style.css 第 2 行。 */
html.toolbox-native-header .workspace:has(#shelfView:not([hidden])){padding-left:12px;padding-right:12px}
html.toolbox-native-header .bookshelf{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px}
html.toolbox-native-header .book-card{min-height:190px;padding:20px;gap:20px}
html.toolbox-native-header .book-card-cover{width:100px}
html.toolbox-native-header .book-card-title{font-size:18px}
html.toolbox-native-header .book-card-description,html.toolbox-native-header .book-card-meta{font-size:13px}
html.toolbox-native-header .actions{display:block}
html.toolbox-native-header .action-copy{max-width:none}
html.toolbox-native-header .action-buttons{margin-top:16px;display:flex;flex-wrap:wrap;gap:10px}


/* Comfortable reading in the chapter editor: a limited line length, clear
   paragraph spacing and a two-character first-line indent (paragraphs that
   already start with spaces, centred or right-aligned text keep theirs). */
.editor{max-width:38em;margin-left:auto;margin-right:auto;line-height:1.9;text-indent:2em}
.editor div{margin:0 0 .9em}
.editor [data-writer-own-indent],.editor [data-writer-image-wrapper],.editor [style*="center"],.editor [style*="right"],.editor blockquote,.editor li,.editor h1,.editor h2,.editor h3,.editor h4{text-indent:0}
.editor img{text-indent:0}
@media(max-width:680px){.editor{max-width:none}}

/* Bookmarks, back to top and return. */
.writer-bookmark{display:inline-block;width:6px;height:1.15em;margin:0 3px;vertical-align:-.18em;border-radius:2px;background:#e0876a;text-indent:0;user-select:none;cursor:default}
.writer-bookmark-flash{background:#fbefe9;transition:background .6s}
.writer-rail{position:fixed;right:18px;top:50%;transform:translateY(-50%);z-index:30;display:flex;flex-direction:column;gap:6px;padding:6px;border-radius:24px;background:#efeafb;box-shadow:0 4px 16px #3c2f5522}
.writer-rail[hidden]{display:none}
.writer-rail button{display:flex;flex-direction:column;align-items:center;gap:1px;width:44px;padding:7px 0;border:0;border-radius:18px;background:transparent;color:#5b4f93;font-size:15px;line-height:1.1}
.writer-rail button[hidden]{display:none}
.writer-rail button:hover{background:#ddd5f5}
.writer-rail small{font-size:10px}
.writer-rail-count{font-size:13px;font-weight:700}
.writer-bookmarks{position:fixed;right:76px;top:50%;transform:translateY(-50%);z-index:31;width:240px;max-height:60vh;overflow:auto;padding:10px;border:1px solid var(--border);border-radius:14px;background:#fff;box-shadow:0 10px 30px #3c2f5526}
.writer-bookmarks[hidden]{display:none}
.writer-bookmarks-add{width:100%;margin-bottom:6px;padding:8px;border:1px dashed #c7bde6;border-radius:9px;background:#faf9fd;color:#5b4f93;font-size:13px}
.writer-bookmarks-empty{margin:8px 4px;color:#908c9a;font-size:12px}
.writer-bookmarks-row{display:flex;align-items:center;gap:4px;padding:2px 0}
.writer-bookmarks-go{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;padding:6px 8px;border:0;border-radius:8px;background:transparent;text-align:left;color:inherit}
.writer-bookmarks-go:hover{background:#f3f0fa}
.writer-bookmarks-go strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.writer-bookmarks-go small{font-size:11px;color:#908c9a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.writer-bookmarks-icon{width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:#7d7590}
.writer-bookmarks-icon:hover{background:#f3f0fa}
.writer-bookmarks-row input{flex:1;min-width:0;height:32px;padding:0 8px;border:1px solid #d9d2ee;border-radius:8px;font-size:13px}
.writer-bookmarks-row input+button{height:32px;padding:0 10px;border:0;border-radius:8px;background:#7163aa;color:#fff;font-size:12px}
@media(max-width:680px){
  .writer-rail{top:auto;bottom:16px;right:12px;transform:none;flex-direction:row;padding:4px}
  .writer-rail button{width:40px;padding:5px 0}
  .writer-bookmarks{top:auto;bottom:70px;right:12px;left:12px;width:auto;transform:none;max-height:50vh}
}
@media (prefers-color-scheme:dark){
  .writer-rail{background:#2c2c2f;box-shadow:0 4px 16px #0006}
  .writer-rail button{color:#d8cff7}
  .writer-rail button:hover{background:#3a3a3e}
  .writer-bookmarks{background:#262628;border-color:#3f3f42}
  .writer-bookmarks-add{background:#2c2c2f;border-color:#55555a;color:#d8cff7}
  .writer-bookmarks-go:hover,.writer-bookmarks-icon:hover{background:#333336}
  .writer-bookmarks-row input{background:#1f1f21;border-color:#4a4a4d;color:#eceaf1}
  .writer-bookmark-flash{background:#3a2f2a}
}


/* Paper backgrounds for the chapter editor: the text sits on a sheet with
   margins. In the Mac app the page itself stays transparent, so the desk
   is the toolbox's own window background rather than a separate colour. */
html.toolbox-native-header,html.toolbox-native-header body{background:transparent}
.paper-select{min-height:32px;max-width:120px;padding:0 8px;border:1px solid #e1dcef;border-radius:8px;background:#fff;color:#625b70;font-size:12px}
html[data-writer-paper] .document{background:#e9e7ee;box-shadow:none;border-color:transparent}
html.toolbox-native-header[data-writer-paper] .document{background:transparent}
html[data-writer-paper] .document .toolbar{border-radius:12px;border:1px solid #e7e3f0}
html[data-writer-paper] .editor{margin-top:22px;margin-bottom:28px;padding:48px 56px;border-radius:4px;box-shadow:0 1px 3px #0000001a,0 6px 24px #0000000f}
html[data-writer-paper="white"] .editor{background:#fff;color:#2f2c35}
html[data-writer-paper="sepia"] .editor{background:#f7f1e1;color:#4a3828;caret-color:#7a5a3c}
html[data-writer-paper="sepia"] .document{background:#e8e2d2}
html.toolbox-native-header[data-writer-paper="sepia"] .document{background:transparent}
html[data-writer-paper="sepia"] .editor blockquote{color:#7a6450;border-color:#c9b48f}
@media(max-width:680px){html[data-writer-paper] .editor{padding:28px 22px;margin-top:12px}}
@media (prefers-color-scheme:dark){
  .paper-select{background:#242426;border-color:#4a4a4d;color:#d8d5de}
  html[data-writer-paper] .document{background:#1c1c1e}
  html[data-writer-paper] .document .toolbar{border-color:#3f3f42}
  html[data-writer-paper="white"] .editor{background:#29292b;color:#d9d5cc;box-shadow:0 1px 3px #0006,0 6px 24px #0004}
  html[data-writer-paper="sepia"] .document{background:#1c1c1e}
}
html[data-writer-paper] .editor{max-width:43em}
@media(max-width:680px){html[data-writer-paper] .editor{max-width:none}}

/* Export area: rows apart, the novel-project actions as their own group, and
   a calm success line instead of the warning banner. */
.export-controls[hidden]{display:none}
/* The progress bar and status line sit between the rows, so space the project row by id. */
#nativeUpdateControls{margin-top:18px;padding-top:16px;border-top:1px dashed var(--border,#eae8f0);align-items:center}
.export-controls{row-gap:12px}
#exportProgressHost:not(:empty){margin-top:12px}
.export-group-label{align-self:center;margin-right:4px;color:#908c9a;font-size:12px}
.export-status{margin:12px 0 0;padding:8px 12px;border-radius:9px;background:#eef8f1;color:#2f6b45;font-size:12.5px;line-height:1.5}
.export-status[hidden]{display:none}
.export-status .link-button{padding:0;font-size:inherit;color:inherit;text-decoration:underline}
@media (prefers-color-scheme:dark){.export-status{background:#203226;color:#bfe6cb}}

/* Export progress bar shown under the export buttons. */
.writer-progress{display:flex;align-items:center;gap:10px;margin-top:12px}
.writer-progress[hidden]{display:none}
.writer-progress-track{flex:1;height:6px;border-radius:3px;background:#ece8f5;overflow:hidden}
.writer-progress-fill{width:0;height:100%;border-radius:3px;background:#7163aa}
.writer-progress.done .writer-progress-fill{background:#3f9a62}
.writer-progress.failed .writer-progress-fill{background:#c46a5c}
.writer-progress-text{min-width:120px;color:#7d7590;font-size:12px;font-variant-numeric:tabular-nums}
@media (prefers-color-scheme:dark){.writer-progress-track{background:#333336}.writer-progress-text{color:#b9b2c9}}

/* Deleting a book and the recently deleted list */
.book-danger{display:flex;justify-content:flex-end;margin-top:18px;padding-top:12px;border-top:1px solid #f1eff4}
.danger-link{color:#b0455a!important}
.trash-shelf{margin-top:26px;padding:18px 22px;border:1px dashed #e3dfeb;border-radius:16px}
.trash-shelf[hidden]{display:none}
.trash-head h2{margin:0;font-size:15px}.trash-head p{margin:4px 0 0;color:#918b9b;font-size:12px}
.trash-list{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px}
.trash-list li{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;background:#faf9fc}
.trash-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.trash-info strong{font-size:14px;overflow-wrap:anywhere}.trash-info span{color:#918b9b;font-size:12px}
.trash-list .secondary{min-height:34px}
@media (prefers-color-scheme:dark){.book-danger{border-color:#3a3842}.trash-shelf{border-color:#45424d}.trash-list li{background:#2a2930}.danger-link{color:#f0a3b2!important}}

/* 图片工具条（方案 A）：对齐、宽度、锁定、删除。挂在图片框上方，贴近顶部时放到下方。 */
.image-bar { pointer-events:auto; position:absolute; left:50%; bottom:calc(100% + 8px); transform:translateX(-50%); display:flex; align-items:center; gap:2px; padding:4px; background:#fff; border:1px solid #dad3eb; border-radius:10px; box-shadow:0 6px 18px #28203b30; white-space:nowrap; }
.image-bar.below { bottom:auto; top:calc(100% + 8px); }
.image-bar button { border:0; background:transparent; color:#5e5374; min-width:30px; height:28px; padding:0 6px; border-radius:7px; font-size:12px; display:inline-flex; align-items:center; justify-content:center; }
.image-bar button svg { width:16px; height:16px; }
.image-bar button:hover:not(:disabled) { background:#f1edf9; color:#5e4e9e; }
.image-bar button[aria-pressed="true"] { background:#ebe5f8; color:#5e4e9e; font-weight:650; }
.image-bar button:disabled { opacity:.35; cursor:default; }
.image-bar .image-frame-lock { position:static; min-width:30px; height:28px; border:0; box-shadow:none; background:transparent; font-size:14px; }
.image-bar .image-bar-delete { color:#b2555f; }
.image-bar .image-bar-delete:hover:not(:disabled) { background:#fbeff0; color:#a1434e; }
.image-bar-sep { width:1px; height:18px; background:#e6e1ef; margin:0 4px; }
/* 图片段里的图片跟着这一段的 text-align 走（居左/居中/居右），左右边缘和正文对齐。
   不在图片段里的旧图片仍按原来的方式居中。 */
.editor [data-writer-image-wrapper] img { display:inline-block; margin:1em 0; vertical-align:top; }
@media (prefers-color-scheme: dark) {
  .image-bar { background:#2b2733; border-color:#4a4256; }
  .image-bar button { color:#d8cdef; }
  .image-bar button:hover:not(:disabled), .image-bar button[aria-pressed="true"] { background:#3a3346; color:#efe6ff; }
  .image-bar-sep { background:#4a4256; }
}
