:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light;color:#333;background-color:#f5f5f5;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#f5f5f5}.app{min-height:100vh;display:flex;flex-direction:column}.app-header{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;padding:1rem 2rem;display:flex;align-items:center;gap:2rem;flex-wrap:wrap}.app-header h1{margin:0;font-size:1.5rem}.book-meta{display:flex;gap:1rem;flex:1}.meta-input{padding:.5rem 1rem;border:none;border-radius:4px;font-size:1rem;background:#fff3;color:#fff;min-width:150px}.meta-input::placeholder{color:#ffffffb3}.tabs{display:flex;background:#fff;border-bottom:1px solid #ddd;padding:0 1rem}.tabs button{padding:1rem 1.5rem;border:none;background:none;cursor:pointer;font-size:1rem;color:#666;border-bottom:3px solid transparent;transition:all .2s}.tabs button:hover{color:#333}.tabs button.active{color:#667eea;border-bottom-color:#667eea}.main-content{flex:1;padding:1rem}.chapters-view{display:grid;grid-template-columns:250px 1fr;gap:1rem;height:calc(100vh - 180px)}.chapter-list{background:#fff;border-radius:8px;padding:1rem;overflow-y:auto}.btn-add{width:100%;padding:.75rem;background:#667eea;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:1rem}.btn-add:hover{background:#5a6fd6}.chapter-actions{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}.btn-import{width:100%;padding:.75rem;background:#28a745;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:1rem}.btn-import:hover:not(:disabled){background:#218838}.btn-import:disabled{opacity:.6;cursor:not-allowed}.import-preview-overlay{position:fixed;inset:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.import-preview{background:#fff;border-radius:12px;padding:1.5rem;max-width:600px;width:90%;max-height:80vh;overflow-y:auto}.import-preview h3{margin:0 0 1rem;color:#333}.preview-stats{display:flex;gap:1.5rem;margin-bottom:1rem;padding:.75rem;background:#f0f4ff;border-radius:8px}.preview-stats span{color:#667eea;font-weight:500}.preview-chapters{max-height:300px;overflow-y:auto;border:1px solid #ddd;border-radius:8px;margin-bottom:1rem}.preview-chapter{padding:.75rem 1rem;border-bottom:1px solid #eee}.preview-chapter:last-child{border-bottom:none}.preview-chapter strong{display:block;color:#333;margin-bottom:.25rem}.preview-chapter .word-count{font-size:.75rem;color:#999;margin-left:.5rem}.preview-excerpt{font-size:.875rem;color:#666;margin:.5rem 0 0;line-height:1.4}.preview-actions{display:flex;gap:1rem;justify-content:flex-end}.warning{color:#856404;background:#fff3cd;padding:.5rem 1rem;border-radius:4px;margin:0;font-size:.875rem}.existing-warning{margin-bottom:1rem}.btn-clear{width:100%;padding:.5rem;margin-top:.5rem;background:#dc3545;color:#fff;border:none;border-radius:4px;cursor:pointer}.btn-clear:hover{background:#c82333}.chapter-item{padding:.75rem;border-radius:4px;cursor:pointer;margin-bottom:.5rem;transition:background .2s}.chapter-item:hover{background:#f0f0f0}.chapter-item.selected{background:#667eea;color:#fff}.empty-state{color:#999;text-align:center;padding:2rem}.editor-area{background:#fff;border-radius:8px;padding:1.5rem;overflow-y:auto}.no-selection{display:flex;align-items:center;justify-content:center;height:100%;color:#999}.chapter-editor{display:flex;flex-direction:column;gap:1.5rem}.chapter-header{display:flex;gap:1rem;align-items:center}.btn-analyze{padding:.5rem 1rem;background:#17a2b8;color:#fff;border:none;border-radius:4px;cursor:pointer;white-space:nowrap}.btn-analyze:hover:not(:disabled){background:#138496}.btn-analyze:disabled{opacity:.6;cursor:not-allowed}.analysis-panel{background:linear-gradient(135deg,#f8f9ff,#f0f4ff);border:1px solid #667eea;border-radius:8px;padding:1rem;margin-bottom:1rem}.analysis-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.analysis-header h4{margin:0;color:#667eea}.btn-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:#999;line-height:1}.btn-close:hover{color:#333}.analysis-section{margin-bottom:1rem}.analysis-section strong{color:#333}.analysis-section p{margin:.5rem 0;color:#555}.analysis-section ul{margin:.5rem 0;padding-left:1.25rem}.analysis-section li{margin:.5rem 0;color:#555}.tone-badge{display:inline-block;background:#667eea;color:#fff;padding:.25rem .75rem;border-radius:20px;font-size:.875rem;margin-left:.5rem}.suggestions-list li{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:.5rem;background:#fff;border-radius:4px;margin:.5rem 0}.btn-apply{padding:.25rem .75rem;background:#28a745;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:.75rem;white-space:nowrap;flex-shrink:0}.btn-apply:hover:not(:disabled){background:#218838}.btn-apply:disabled{opacity:.6;cursor:not-allowed}.chapter-title-input{flex:1;padding:.75rem;font-size:1.25rem;border:2px solid #ddd;border-radius:4px}.chapter-title-input:focus{outline:none;border-color:#667eea}.chapter-content{width:100%;padding:1rem;font-size:1rem;line-height:1.6;border:2px solid #ddd;border-radius:4px;resize:vertical;font-family:Georgia,serif}.chapter-content:focus{outline:none;border-color:#667eea}.ai-section{background:#f9f9f9;padding:1rem;border-radius:8px}.ai-section h4{margin:0 0 .75rem;color:#667eea}.ai-input-group{display:flex;gap:.5rem}.ai-input-group input{flex:1;padding:.5rem;border:1px solid #ddd;border-radius:4px}.illustration-preview{margin-bottom:1rem;padding:1rem;background:#fff;border-radius:4px;text-align:center}.illustration-preview svg{max-width:100%;height:auto;max-height:200px}.btn-primary{padding:.5rem 1rem;background:#667eea;color:#fff;border:none;border-radius:4px;cursor:pointer;white-space:nowrap}.btn-primary:hover:not(:disabled){background:#5a6fd6}.btn-primary:disabled{opacity:.6;cursor:not-allowed}.btn-secondary{padding:.5rem 1rem;background:#6c757d;color:#fff;border:none;border-radius:4px;cursor:pointer}.btn-danger{padding:.5rem 1rem;background:#dc3545;color:#fff;border:none;border-radius:4px;cursor:pointer}.btn-danger:hover{background:#c82333}.cover-editor{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1.5rem;background:#fff;padding:1.5rem;border-radius:8px}.cover-section h3{margin:0 0 1rem;color:#333}.cover-preview{background:#f0f0f0;border-radius:8px;padding:1rem;min-height:300px;display:flex;align-items:center;justify-content:center;margin-bottom:1rem}.cover-preview svg{max-width:100%;max-height:280px}.cover-placeholder{color:#999;text-align:center}.custom-svg-section textarea{width:100%;padding:.75rem;border:1px solid #ddd;border-radius:4px;font-family:monospace;font-size:.875rem;margin-bottom:.5rem}.toggle-group{display:flex;margin-bottom:.5rem}.toggle-group button{flex:1;padding:.5rem;border:1px solid #ddd;background:#fff;cursor:pointer}.toggle-group button:first-child{border-radius:4px 0 0 4px}.toggle-group button:last-child{border-radius:0 4px 4px 0;border-left:none}.toggle-group button.active{background:#667eea;color:#fff;border-color:#667eea}.export-container{display:grid;grid-template-columns:350px 1fr;gap:1.5rem;height:calc(100vh - 180px)}.export-panel{background:#fff;padding:1.5rem;border-radius:8px;height:fit-content}.export-panel h3{margin:0 0 1.5rem;text-align:center;color:#333}.export-info{background:#f9f9f9;padding:1rem;border-radius:8px;margin-bottom:1.5rem}.export-info p{margin:.5rem 0}.export-buttons{display:flex;gap:1rem;margin-bottom:1.5rem}.btn-export{flex:1;padding:1rem;font-size:1rem;border:none;border-radius:8px;cursor:pointer;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;transition:transform .2s,box-shadow .2s}.btn-export:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 4px 12px #667eea66}.btn-export:disabled{opacity:.6;cursor:not-allowed}.export-tips{background:#fff3cd;padding:1rem;border-radius:8px;border-left:4px solid #ffc107}.export-tips h4{margin:0 0 .5rem;color:#856404}.export-tips ul{margin:0;padding-left:1.25rem;color:#856404}.export-tips li{margin:.25rem 0}.btn-toggle-preview{width:100%;padding:.75rem;background:#6c757d;color:#fff;border:none;border-radius:4px;cursor:pointer;margin-top:1rem}.btn-toggle-preview:hover{background:#5a6268}.book-preview{background:#e9ecef;border-radius:8px;padding:1rem;overflow-y:auto}.book-preview h3{margin:0 0 1rem;color:#333}.preview-book{display:flex;flex-direction:column;gap:1rem}.preview-page{background:#fff;border-radius:4px;padding:1.5rem;box-shadow:0 2px 8px #0000001a;min-height:200px;font-family:Georgia,serif}.preview-cover{background:#2c3e50;display:flex;align-items:center;justify-content:center;min-height:300px}.preview-cover svg{max-width:100%;max-height:280px}.default-cover{text-align:center;color:#fff}.default-cover h2{font-size:1.5rem;margin-bottom:.5rem}.default-cover p{color:#bdc3c7}.title-page{text-align:center;padding:3rem 1rem}.title-page h1{font-size:1.75rem;margin-bottom:1rem;color:#2c3e50}.title-page .author{color:#666;font-style:italic}.toc{padding-left:1.5rem}.toc li{display:flex;justify-content:space-between;padding:.5rem 0;border-bottom:1px dotted #ddd}.toc-title{color:#333}.toc-page{color:#999}.preview-chapter-page .chapter-title{text-align:center;color:#2c3e50;margin-bottom:1rem;font-size:1.25rem}.chapter-illustration{text-align:center;margin:1rem 0}.chapter-illustration svg{max-width:100%;max-height:150px}.chapter-text p{text-indent:1.5em;margin:.5em 0;line-height:1.6;color:#333}@media(max-width:900px){.cover-editor,.chapters-view{grid-template-columns:1fr}.chapter-list{max-height:200px}}
