*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{--bg:#f0f2f5;--surface:#fff;--border:#e5e7eb;--text:#1f2937;--text-muted:#6b7280;--primary:#6366f1;--primary-light:#eef2ff;--radius:12px}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC',sans-serif;background:var(--bg);color:var(--text);height:100vh;display:flex;flex-direction:column;overflow:hidden}
.topbar{display:flex;align-items:center;gap:10px;padding:0 16px;height:52px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0;box-shadow:0 1px 3px rgba(0,0,0,.06);z-index:10}
.logo{font-size:17px;font-weight:700;color:var(--primary);letter-spacing:-.5px;margin-right:4px;white-space:nowrap;cursor:pointer}.logo span{color:var(--text)}
.topbar-sep{width:1px;height:22px;background:var(--border);margin:0 2px}
.nav-actions{display:flex;align-items:center;gap:6px;margin-left:auto;flex-shrink:0}
.btn{display:inline-flex;align-items:center;gap:5px;padding:6px 12px;border-radius:8px;font-size:12px;font-weight:500;cursor:pointer;border:none;transition:all .15s;white-space:nowrap}
.btn-ghost{background:transparent;color:var(--text-muted)}.btn-ghost:hover{background:var(--bg);color:var(--text)}
.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:#4f46e5}
.btn-outline{background:transparent;border:1px solid var(--border);color:var(--text)}.btn-outline:hover{background:var(--bg)}
.btn-danger{background:#ef4444;color:#fff}.btn-danger:hover{background:#dc2626}
.btn-success{background:#10b981;color:#fff}.btn-success:hover{background:#059669}
.main{display:flex;flex:1;overflow:hidden}
.editor-panel{width:440px;flex-shrink:0;display:flex;flex-direction:column;background:var(--surface);border-right:1px solid var(--border);position:relative;z-index:1}
.editor-panel.fullscreen-editor{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:10000;border:none}
.panel-header{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;border-bottom:1px solid var(--border);font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;flex-shrink:0}
.panel-hint{font-size:10px;color:#c4c9d4;text-transform:none;letter-spacing:0;font-weight:400}
.editor-toolbar{display:flex;flex-wrap:wrap;gap:3px;padding:6px 10px;border-bottom:1px solid var(--border);flex-shrink:0;background:#fafafa}
.tb-btn{padding:4px 8px;border-radius:5px;font-size:12px;border:1px solid var(--border);background:#fff;cursor:pointer;color:var(--text-muted);font-weight:600;transition:all .1s;line-height:1.4;min-width:26px;text-align:center}
.tb-btn:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
.tb-sep{width:1px;height:22px;background:var(--border);margin:0 2px;flex-shrink:0}
.tb-btn[data-tip]{position:relative}
.tb-btn[data-tip]:hover::after{content:attr(data-tip);position:absolute;top:110%;left:50%;transform:translateX(-50%);background:#1f2937;color:#fff;font-size:10px;padding:3px 8px;border-radius:4px;white-space:nowrap;z-index:20;pointer-events:none;font-weight:400}
textarea#md-input{flex:1;padding:14px;border:none;outline:none;resize:none;font-family:'JetBrains Mono','Fira Code','Courier New',monospace;font-size:13px;line-height:1.7;color:var(--text);background:var(--surface);tab-size:4}
textarea#md-input::placeholder{color:#c4c9d4}
.editor-footer{padding:6px 14px;border-top:1px solid var(--border);font-size:10px;color:var(--text-muted);display:flex;justify-content:space-between;flex-shrink:0}
.side-panel{width:260px;flex-shrink:0;display:flex;flex-direction:column;background:#fafafa;border-right:1px solid var(--border);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
.side-section-title-no-collapse{padding:10px 10px 6px;font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}
.side-section-title{display:flex;align-items:center;justify-content:space-between;cursor:pointer;user-select:none;padding:10px 10px 6px;font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}
.side-section-title .arrow{font-size:10px;transition:transform .2s}
.side-section-title.collapsed .arrow{transform:rotate(-90deg)}
.side-section-body{overflow-y:auto;overflow-x:hidden;transition:max-height .3s ease;max-height:2000px;scrollbar-width:thin;scrollbar-color:#d1d5db transparent}
.side-section-body::-webkit-scrollbar{width:3px}
.side-section-body::-webkit-scrollbar-track{background:transparent}
.side-section-body::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}
.side-section-body.collapsed{max-height:0}
/* ===== Theme Grid with Scroll Arrows ===== */
.theme-scroll-wrap{position:relative;padding:0 22px}
.theme-scroll-wrap .scroll-arrow{position:absolute;top:50%;transform:translateY(-50%);width:18px;height:32px;background:var(--surface);border:1px solid var(--border);border-radius:6px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:10px;color:var(--text-muted);z-index:5;box-shadow:0 1px 4px rgba(0,0,0,.08);transition:all .15s;user-select:none}
.theme-scroll-wrap .scroll-arrow:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
.theme-scroll-wrap .scroll-arrow.left{left:0}
.theme-scroll-wrap .scroll-arrow.right{right:0}
.theme-scroll-wrap .scroll-arrow.hidden{opacity:0;pointer-events:none}
.theme-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:6px 8px 8px;overflow:visible}
.theme-card,.theme-card *{pointer-events:auto}
.theme-card{cursor:pointer;border-radius:6px;overflow:hidden;border:2px solid transparent;transition:all .2s;position:relative}
.theme-card:hover{transform:translateY(-1px);box-shadow:0 3px 10px rgba(0,0,0,.12)}
.theme-card.active{border-color:var(--primary);box-shadow:0 0 0 3px rgba(99,102,241,.15)}
.theme-preview{height:38px;padding:3px 4px;display:flex;flex-direction:column;gap:2px}
.tp-line{border-radius:2px}
.theme-label{padding:3px 2px;font-size:9px;font-weight:600;text-align:center;background:rgba(0,0,0,.04);color:#666;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-card-saved{position:absolute;top:1px;right:2px;font-size:7px;background:#10b981;color:#fff;padding:0 3px;border-radius:3px;display:none;line-height:1.4}
.theme-card.has-saved .theme-card-saved{display:block}
.theme-replace-badge{position:absolute;top:1px;right:2px;font-size:7px;background:#f59e0b;color:#fff;padding:0 3px;border-radius:3px;line-height:1.4;z-index:1}
.theme-vip-badge{position:absolute;top:1px;left:2px;font-size:7px;background:linear-gradient(135deg,#7c3aed,#db2777);color:#fff;padding:0 3px;border-radius:3px;line-height:1.4;z-index:1;letter-spacing:0}
.vip-theme{position:relative}
.vip-theme::after{content:'';position:absolute;inset:0;border-radius:6px;pointer-events:none;transition:opacity .15s}
.vip-theme:not(.vip-unlocked)::after{background:rgba(255,255,255,0);}
.setting-row{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;font-size:11px;color:var(--text)}
.setting-row label{flex-shrink:0;min-width:56px;color:var(--text-muted);font-size:11px}
.setting-row input[type="color"]{width:28px;height:24px;border:1px solid var(--border);border-radius:4px;cursor:pointer;padding:0;background:none}
.setting-row select,.font-select{padding:4px 6px;border:1px solid var(--border);border-radius:4px;font-size:11px;cursor:pointer;background:#fff;min-width:80px;max-width:140px;flex:1}
.font-select{max-width:130px;font-size:10px}
.setting-input-group{display:flex;align-items:center;gap:3px}
.setting-input{width:44px;padding:3px 4px;border:1px solid var(--border);border-radius:5px;font-size:10px;text-align:center;outline:none;background:#fff}
.setting-input:focus{border-color:var(--primary);box-shadow:0 0 0 2px rgba(99,102,241,.1)}
.setting-unit{font-size:9px;color:var(--text-muted);flex-shrink:0}
.setting-reset{padding:4px 12px 8px}
.setting-range{width:60px;height:4px;-webkit-appearance:none;appearance:none;background:#e5e7eb;border-radius:2px;outline:none;cursor:pointer;flex-shrink:0}
.setting-range::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:12px;border-radius:50%;background:var(--primary);cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.setting-range::-webkit-slider-thumb:hover{transform:scale(1.2);background:#4f46e5}
.setting-range::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--primary);cursor:pointer;border:none}
.setting-stepper{display:flex;flex-direction:column;gap:0;margin-left:1px;flex-shrink:0}
.setting-stepper-btn{width:16px;height:14px;border:1px solid var(--border);background:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:8px;color:var(--text-muted);line-height:1;padding:0;transition:all .1s}
.setting-stepper-btn:first-child{border-radius:3px 3px 0 0}
.setting-stepper-btn:last-child{border-radius:0 0 3px 3px;border-top:none}
.setting-stepper-btn:hover{background:var(--primary);color:#fff;border-color:var(--primary)}
/* Shadow button group */
.shadow-btn-group{display:flex;gap:2px}
.shadow-btn{padding:3px 8px;border-radius:4px;font-size:10px;border:1px solid var(--border);background:#fff;cursor:pointer;color:var(--text-muted);transition:all .1s;font-weight:500}
.shadow-btn:hover{border-color:var(--primary);color:var(--primary)}
.shadow-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}

/* Color setting rows with hex input */
.color-setting-row{display:flex;align-items:center;justify-content:space-between;padding:5px 12px;font-size:11px}
.color-setting-row label{flex-shrink:0;min-width:56px;color:var(--text-muted);font-size:11px}
.color-input-wrap{display:flex;align-items:center;gap:4px}
.color-input-wrap input[type="color"]{width:28px;height:24px;border:1px solid var(--border);border-radius:4px;cursor:pointer;padding:0;background:none}
.color-hex-input{width:72px;padding:3px 6px;border:1px solid var(--border);border-radius:4px;font-size:10px;font-family:'JetBrains Mono',monospace;outline:none;background:#fff}
.color-hex-input:focus{border-color:var(--primary);box-shadow:0 0 0 2px rgba(99,102,241,.1)}
/* Style borrow rows */
.style-borrow-row{display:flex;align-items:center;justify-content:space-between;padding:5px 12px;font-size:11px}
.style-borrow-row label{flex-shrink:0;min-width:56px;color:var(--text-muted);font-size:11px}
.style-borrow-select{padding:4px 6px;border:1px solid var(--border);border-radius:5px;font-size:10px;cursor:pointer;background:#fff;max-width:130px;flex-shrink:0}
.style-borrow-select:focus{border-color:var(--primary);outline:none}
/* Element pick hint */
.element-pick-hint{text-align:center;padding:16px 10px;font-size:11px;color:var(--text-muted);line-height:1.6}
.element-selected-info{padding:4px 12px}
.element-selected-label{font-size:11px;color:var(--primary);font-weight:600;padding:6px 10px;background:var(--primary-light);border-radius:6px;text-align:center;margin-bottom:4px}
/* Selected element highlight in preview */
.wx-content .element-selected{outline:2px dashed var(--primary)!important;outline-offset:2px}

.preview-panel{flex:1;display:flex;flex-direction:column;overflow:hidden}
.preview-header{display:flex;align-items:center;gap:6px;padding:8px 14px;border-bottom:1px solid var(--border);background:var(--surface);flex-shrink:0}
.preview-header-title{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}
.preview-actions{margin-left:auto;display:flex;gap:6px}
.preview-scroll{flex:1;overflow-y:auto;padding:24px;display:flex;justify-content:center}
.preview-phone-wrap{position:relative;flex-shrink:0}
.phone-label{position:absolute;top:-20px;left:0;right:0;text-align:center;font-size:10px;color:var(--text-muted)}
.wx-article-frame{width:390px;min-height:600px;background:#fff;box-shadow:0 4px 24px rgba(0,0,0,.1);border-radius:16px;overflow:hidden}
.wx-titlebar{height:40px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #f0f0f0}
.wx-titlebar-dot{width:5px;height:5px;border-radius:50%;background:#d1d5db;margin:0 2px}
.wx-content{padding:20px 16px 32px}
.wx-content h1,.wx-content h2,.wx-content h3,.wx-content h4{margin:1.4em 0 .6em;line-height:1.3;font-weight:700}
.wx-content p{margin:.8em 0}.wx-content ul,.wx-content ol{padding-left:1.5em;margin:.8em 0}.wx-content li{margin:.3em 0}
.wx-content pre{margin:1em 0;border-radius:8px;overflow:hidden}.wx-content pre code{font-size:12.5px;line-height:1.6}
.wx-content table{width:100%;border-collapse:collapse;margin:1em 0;font-size:13px}
.wx-content th,.wx-content td{padding:8px 12px;border:1px solid #e5e7eb;text-align:left}
.wx-content a{text-decoration:none}.wx-content img{max-width:100%;border-radius:6px}.wx-content hr{border:none;height:1px;margin:1.5em 0}
.wx-content mark{padding:1px 4px;border-radius:3px}
.wx-content input[type="checkbox"]{margin-right:4px;transform:scale(1.1)}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);background:#1f2937;color:#fff;padding:10px 20px;border-radius:24px;font-size:13px;font-weight:500;opacity:0;transition:all .3s;z-index:1000;box-shadow:0 4px 16px rgba(0,0,0,.2);white-space:nowrap}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:20px;font-size:10px;font-weight:500;background:var(--primary-light);color:var(--primary)}
::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:4px}
.loading-hint{text-align:center;padding:60px 20px;color:var(--text-muted);font-size:14px}.loading-hint .icon{font-size:40px;display:block;margin-bottom:12px}
.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);z-index:100;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity .2s}
.modal-overlay.show{opacity:1;pointer-events:auto}
.modal{background:#fff;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.15);max-width:520px;width:92%;max-height:85vh;overflow-y:auto;transform:translateY(20px);transition:transform .2s}
.modal-overlay.show .modal{transform:translateY(0)}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}
.modal-header h3{font-size:16px;font-weight:600}
.modal-close{width:28px;height:28px;border-radius:50%;border:none;background:#f3f4f6;cursor:pointer;font-size:16px;display:flex;align-items:center;justify-content:center;color:var(--text-muted)}
.modal-close:hover{background:#e5e7eb}
.modal-body{padding:20px}.modal-footer{padding:12px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}
.form-group{margin-bottom:14px}.form-group label{display:block;font-size:12px;font-weight:600;color:var(--text);margin-bottom:4px}
.form-group input,.form-group textarea,.form-group select{width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:8px;font-size:13px;outline:none;transition:border-color .15s}
.form-group input:focus,.form-group textarea:focus{border-color:var(--primary)}
.form-group .hint{font-size:10px;color:var(--text-muted);margin-top:3px}
.form-row{display:flex;gap:10px}.form-row .form-group{flex:1}
.tabs{display:flex;gap:0;border-bottom:2px solid var(--border);margin-bottom:16px}
.tab{padding:8px 16px;font-size:13px;font-weight:500;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;color:var(--text-muted);transition:all .15s}
.tab:hover{color:var(--text)}.tab.active{color:var(--primary);border-bottom-color:var(--primary)}
.tab-content{display:none}.tab-content.active{display:block}
.about-content{text-align:center;padding:30px 20px}
.about-logo{font-size:28px;font-weight:800;color:var(--primary);margin-bottom:8px}
.about-logo span{color:var(--text)}
.about-desc{font-size:13px;color:var(--text-muted);line-height:1.8;margin-bottom:20px}
.about-section{text-align:left;margin:16px 0;padding:12px 16px;background:#f9fafb;border-radius:10px}
.about-section h4{font-size:12px;font-weight:600;color:var(--text);margin-bottom:8px}
.about-section p{font-size:12px;color:var(--text-muted);line-height:1.7}
.about-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border-radius:20px;font-size:11px;background:#eff6ff;color:#1e40af;margin:4px}
.user-status{display:flex;align-items:center;gap:6px;cursor:pointer;padding:4px 10px;border-radius:8px;transition:background .15s}
.user-status:hover{background:var(--bg)}
.user-avatar{width:26px;height:26px;border-radius:50%;background:var(--primary-light);color:var(--primary);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}
.user-name{font-size:12px;color:var(--text);font-weight:500}
.login-hint{font-size:11px;color:var(--text-muted);cursor:pointer}
.login-hint:hover{color:var(--primary)}
.article-item{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border:1px solid var(--border);border-radius:8px;margin-bottom:6px;cursor:pointer;transition:all .15s}
.article-item:hover{background:var(--primary-light);border-color:var(--primary)}
.article-item.selected{border-color:var(--primary);background:var(--primary-light)}
.article-item-info{flex:1;min-width:0}
.article-item-title{font-size:13px;font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.article-item-meta{font-size:10px;color:var(--text-muted);margin-top:2px}
.article-item-actions{display:flex;gap:4px;flex-shrink:0}
.article-item-actions .btn{padding:3px 8px;font-size:10px}

/* ===== Export Dropdown ===== */
.export-dropdown{position:relative}
.export-menu{display:none;position:absolute;top:100%;right:0;margin-top:6px;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);min-width:160px;z-index:50;overflow:hidden;padding:4px 0}
.export-menu.show{display:block}
.export-menu div{padding:8px 14px;font-size:12px;color:var(--text);cursor:pointer;transition:background .15s}
.export-menu div:hover{background:var(--primary-light);color:var(--primary)}

/* ===== Drag Overlay ===== */
.drag-overlay{display:none;position:absolute;inset:0;background:rgba(99,102,241,.08);border:3px dashed var(--primary);border-radius:8px;z-index:10;align-items:center;justify-content:center;pointer-events:none}
.drag-overlay.show{display:flex}
.drag-overlay-inner{text-align:center;color:var(--primary)}
.drag-overlay-inner p{margin-top:8px;font-size:13px;font-weight:500}

/* ===== Changelog ===== */
.changelog-section{margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--border)}
.changelog-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}
.changelog-ver{font-size:14px;font-weight:700;color:var(--text);margin-bottom:10px}
.changelog-list{list-style:none;padding:0;margin:0}
.changelog-list li{font-size:12px;color:var(--text-muted);line-height:1.7;padding:2px 0}
.cl-tag{display:inline-block;padding:1px 6px;border-radius:4px;font-size:10px;font-weight:600;margin-right:6px}
.cl-tag.new{background:#dcfce7;color:#166534}
.cl-tag.fix{background:#fef3c7;color:#92400e}
.cl-tag.imp{background:#fee2e2;color:#991b1b}
.cl-tag.doc{background:#e0f2fe;color:#0369a1}
.cl-tag.opt{background:#ede9fe;color:#5b21b6}

/* ===== Theme Preview Cards ===== */
.tp-minimal .theme-preview{background:#fff}.tp-minimal .tp-line:nth-child(1){height:5px;width:60%;background:#111}.tp-minimal .tp-line:nth-child(2){height:3px;width:85%;background:#666}.tp-minimal .tp-line:nth-child(3){height:3px;width:70%;background:#aaa}.tp-minimal .theme-label{color:#333}
.tp-business .theme-preview{background:#fff;border:1px solid #e0e7ff}.tp-business .tp-line:nth-child(1){height:5px;width:70%;background:#1e40af}.tp-business .tp-line:nth-child(2){height:3px;width:90%;background:#3b82f6}.tp-business .tp-line:nth-child(3){height:3px;width:75%;background:#93c5fd}.tp-business .theme-label{color:#1e40af}
.tp-tech .theme-preview{background:#fff;border:1px solid #e0e7ff}.tp-tech .tp-line:nth-child(1){height:6px;width:55%;background:#f8fafc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.08);border-bottom:2px solid #3b82f6}.tp-tech .tp-line:nth-child(2){height:4px;width:80%;background:#f8fafc;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.05)}.tp-tech .tp-line:nth-child(3){height:3px;width:65%;background:#cbd5e1;border-radius:2px}.tp-tech .theme-label{color:#3b82f6}
.tp-warm .theme-preview{background:#f0f0ea}.tp-warm .tp-line:nth-child(1){height:5px;width:60%;background:#1c1917}.tp-warm .tp-line:nth-child(2){height:3px;width:85%;background:#44403c}.tp-warm .tp-line:nth-child(3){height:3px;width:70%;background:#a8a29e}.tp-warm .theme-label{color:#1c1917;font-family:Georgia,serif}
.tp-literary .theme-preview{background:#fdf6ee}.tp-literary .tp-line:nth-child(1){height:5px;width:55%;background:#5c3317}.tp-literary .tp-line:nth-child(2){height:3px;width:80%;background:#7c4f2f}.tp-literary .tp-line:nth-child(3){height:3px;width:65%;background:#c8a882}.tp-literary .theme-label{color:#5c3317}
.tp-vivid .theme-preview{background:#fdf6e3}.tp-vivid .tp-line:nth-child(1){height:5px;width:55%;background:#c0392b;border-radius:2px}.tp-vivid .tp-line:nth-child(2){height:3px;width:80%;background:#5c4b37}.tp-vivid .tp-line:nth-child(3){height:3px;width:65%;background:#d4c5a9;border-radius:2px}.tp-vivid .theme-label{color:#c0392b}
.tp-dark .theme-preview{background:#0f172a}.tp-dark .tp-line:nth-child(1){height:5px;width:65%;background:#e2e8f0}.tp-dark .tp-line:nth-child(2){height:3px;width:85%;background:#94a3b8}.tp-dark .tp-line:nth-child(3){height:3px;width:60%;background:#475569}.tp-dark .theme-label{background:#1e293b;color:#94a3b8}
/* Creative themes */
.tp-magazine .theme-preview{background:#fff}.tp-magazine .tp-line:nth-child(1){height:6px;width:50%;background:#1a202c}.tp-magazine .tp-line:nth-child(2){height:3px;width:80%;background:#e53e3e}.tp-magazine .tp-line:nth-child(3){height:3px;width:60%;background:#4a5568}.tp-magazine .theme-label{color:#e53e3e}
.tp-neon .theme-preview{background:#0a0a1a}.tp-neon .tp-line:nth-child(1){height:5px;width:60%;background:#ff00ff;box-shadow:0 0 4px #ff00ff}.tp-neon .tp-line:nth-child(2){height:3px;width:80%;background:#00ffff;box-shadow:0 0 4px #00ffff}.tp-neon .tp-line:nth-child(3){height:3px;width:50%;background:#ffff00;box-shadow:0 0 4px #ffff00}.tp-neon .theme-label{background:#1a1a3e;color:#ff00ff}
.tp-notebook .theme-preview{background:#fefcf3;background-image:repeating-linear-gradient(transparent,transparent 14px,#e8dcc8 14px,#e8dcc8 15px)}.tp-notebook .tp-line:nth-child(1){height:5px;width:55%;background:#e74c3c}.tp-notebook .tp-line:nth-child(2){height:3px;width:80%;background:#3c2415}.tp-notebook .tp-line:nth-child(3){height:3px;width:65%;background:#d35400}.tp-notebook .theme-label{color:#e74c3c}
.tp-forest .theme-preview{background:#f0fdf4}.tp-forest .tp-line:nth-child(1){height:5px;width:55%;background:#14532d}.tp-forest .tp-line:nth-child(2){height:3px;width:80%;background:#22c55e}.tp-forest .tp-line:nth-child(3){height:3px;width:60%;background:#86efac}.tp-forest .theme-label{color:#166534}
.tp-sunset .theme-preview{background:linear-gradient(180deg,#fff7ed,#fed7aa)}.tp-sunset .tp-line:nth-child(1){height:5px;width:55%;background:#7c2d12}.tp-sunset .tp-line:nth-child(2){height:3px;width:80%;background:#f97316}.tp-sunset .tp-line:nth-child(3){height:3px;width:60%;background:#ef4444}.tp-sunset .theme-label{color:#c2410c}
/* New creative themes */
.tp-chinese .theme-preview{background:#fefce8;background-image:linear-gradient(45deg,transparent 48%,#fecaca 48%,#fecaca 52%,transparent 52%)}.tp-chinese .tp-line:nth-child(1){height:5px;width:55%;background:#991b1b}.tp-chinese .tp-line:nth-child(2){height:3px;width:80%;background:#b91c1c}.tp-chinese .tp-line:nth-child(3){height:3px;width:60%;background:#dc2626}.tp-chinese .theme-label{color:#991b1b}
.tp-retrowave .theme-preview{background:linear-gradient(180deg,#1a0533,#2d1b69,#1a0533)}.tp-retrowave .tp-line:nth-child(1){height:5px;width:60%;background:#ff71ce;text-shadow:0 0 4px #ff71ce}.tp-retrowave .tp-line:nth-child(2){height:3px;width:80%;background:#01cdfe;text-shadow:0 0 4px #01cdfe}.tp-retrowave .tp-line:nth-child(3){height:3px;width:50%;background:#05ffa1;text-shadow:0 0 4px #05ffa1}.tp-retrowave .theme-label{background:#1a0533;color:#ff71ce}
.tp-academic .theme-preview{background:#f8fafc}.tp-academic .tp-line:nth-child(1){height:5px;width:50%;background:#0f172a}.tp-academic .tp-line:nth-child(2){height:3px;width:85%;background:#475569}.tp-academic .tp-line:nth-child(3){height:3px;width:70%;background:#94a3b8}.tp-academic .theme-label{color:#0f172a}
.tp-candy .theme-preview{background:linear-gradient(135deg,#fce7f3,#ede9fe,#dbeafe)}.tp-candy .tp-line:nth-child(1){height:5px;width:55%;background:#ec4899}.tp-candy .tp-line:nth-child(2){height:3px;width:80%;background:#8b5cf6}.tp-candy .tp-line:nth-child(3){height:3px;width:60%;background:#3b82f6}.tp-candy .theme-label{color:#ec4899}
.tp-aurora .theme-preview{background:linear-gradient(180deg,#0c1445,#1e3a5f,#2d6a4f)}.tp-aurora .tp-line:nth-child(1){height:4px;width:60%;background:linear-gradient(90deg,#00ff87,#60efff);border-radius:2px}.tp-aurora .tp-line:nth-child(2){height:3px;width:80%;background:#60efff}.tp-aurora .tp-line:nth-child(3){height:3px;width:50%;background:#00ff87}.tp-aurora .theme-label{background:#0c1445;color:#60efff}
.tp-cyberpunk .theme-preview{background:#0a0a0a}.tp-cyberpunk .tp-line:nth-child(1){height:5px;width:55%;background:#fde047;text-shadow:0 0 6px #fde047}.tp-cyberpunk .tp-line:nth-child(2){height:3px;width:80%;background:#ff003c;text-shadow:0 0 4px #ff003c}.tp-cyberpunk .tp-line:nth-child(3){height:3px;width:60%;background:#00f0ff;text-shadow:0 0 4px #00f0ff}.tp-cyberpunk .theme-label{background:#0a0a0a;color:#fde047}
.tp-pop .theme-preview{background:#fffbe6}.tp-pop .tp-line:nth-child(1){height:6px;width:50%;background:#ff0000}.tp-pop .tp-line:nth-child(2){height:3px;width:80%;background:#000;border-radius:2px}.tp-pop .tp-line:nth-child(3){height:3px;width:60%;background:#0057b8}.tp-pop .theme-label{color:#ff0000}
.tp-ocean .theme-preview{background:linear-gradient(180deg,#ecfdf5,#dbeafe)}.tp-ocean .tp-line:nth-child(1){height:5px;width:55%;background:#0e7490}.tp-ocean .tp-line:nth-child(2){height:3px;width:80%;background:#06b6d4}.tp-ocean .tp-line:nth-child(3){height:3px;width:60%;background:#67e8f9}.tp-ocean .theme-label{color:#0e7490}
/* New themes 21-25 */
.tp-zen .theme-preview{background:#faf9f6}.tp-zen .tp-line:nth-child(1){height:4px;width:40%;background:#999}.tp-zen .tp-line:nth-child(2){height:3px;width:75%;background:#2c2c2c}.tp-zen .tp-line:nth-child(3){height:3px;width:55%;background:#d4d0c8}.tp-zen .theme-label{color:#666}
.tp-pixel .theme-preview{background:#1a1c2c}.tp-pixel .tp-line:nth-child(1){height:5px;width:55%;background:#f4a261}.tp-pixel .tp-line:nth-child(2){height:3px;width:80%;background:#e76f51}.tp-pixel .tp-line:nth-child(3){height:3px;width:60%;background:#2a9d8f}.tp-pixel .theme-label{background:#1a1c2c;color:#f4a261}
.tp-cosmos .theme-preview{background:linear-gradient(180deg,#020617,#1e1b4b,#020617)}.tp-cosmos .tp-line:nth-child(1){height:4px;width:55%;background:linear-gradient(90deg,#c084fc,#818cf8);border-radius:2px}.tp-cosmos .tp-line:nth-child(2){height:3px;width:80%;background:#38bdf8}.tp-cosmos .tp-line:nth-child(3){height:3px;width:60%;background:#fbbf24}.tp-cosmos .theme-label{background:#020617;color:#818cf8}
.tp-matcha .theme-preview{background:#f5f0e8;border:1px solid #d4c5a9}.tp-matcha .tp-line:nth-child(1){height:5px;width:50%;background:#2d5016}.tp-matcha .tp-line:nth-child(2){height:3px;width:80%;background:#4a6741}.tp-matcha .tp-line:nth-child(3){height:3px;width:60%;background:#8fbc8f}.tp-matcha .theme-label{color:#2d5016}
.tp-terminal .theme-preview{background:#0d0d0d}.tp-terminal .tp-line:nth-child(1){height:4px;width:55%;background:#00ff41;text-shadow:0 0 3px #00ff41}.tp-terminal .tp-line:nth-child(2){height:3px;width:80%;background:#00bcd4;text-shadow:0 0 3px #00bcd4}.tp-terminal .tp-line:nth-child(3){height:3px;width:60%;background:#ff9800;text-shadow:0 0 3px #ff9800}.tp-terminal .theme-label{background:#0d0d0d;color:#00ff41}
/* New themes 26-35 */
.tp-autumn .theme-preview{background:#fff8f0}.tp-autumn .tp-line:nth-child(1){height:5px;width:55%;background:#8b4513}.tp-autumn .tp-line:nth-child(2){height:3px;width:80%;background:#cd853f}.tp-autumn .tp-line:nth-child(3){height:3px;width:60%;background:#daa520}.tp-autumn .theme-label{color:#8b4513}
.tp-mint .theme-preview{background:#f0fff4}.tp-mint .tp-line:nth-child(1){height:5px;width:55%;background:#065f46}.tp-mint .tp-line:nth-child(2){height:3px;width:80%;background:#10b981}.tp-mint .tp-line:nth-child(3){height:3px;width:60%;background:#34d399}.tp-mint .theme-label{color:#065f46}
.tp-wine .theme-preview{background:#fdf2f2}.tp-wine .tp-line:nth-child(1){height:5px;width:55%;background:#722f37}.tp-wine .tp-line:nth-child(2){height:3px;width:80%;background:#9b2c2c}.tp-wine .tp-line:nth-child(3){height:3px;width:60%;background:#c62828}.tp-wine .theme-label{color:#722f37}
.tp-sakura .theme-preview{background:#fff0f3}.tp-sakura .tp-line:nth-child(1){height:5px;width:55%;background:#885577}.tp-sakura .tp-line:nth-child(2){height:3px;width:80%;background:#a85587}.tp-sakura .tp-line:nth-child(3){height:3px;width:60%;background:#f472b6}.tp-sakura .theme-label{color:#885577}
.tp-oasis .theme-preview{background:linear-gradient(180deg,#fef3c7,#fef9c3,#f0fdf4)}.tp-oasis .tp-line:nth-child(1){height:5px;width:55%;background:#654321}.tp-oasis .tp-line:nth-child(2){height:3px;width:80%;background:#fbbf24}.tp-oasis .tp-line:nth-child(3){height:3px;width:60%;background:#22c55e}.tp-oasis .theme-label{color:#654321}
.tp-lavender .theme-preview{background:#faf5ff}.tp-lavender .tp-line:nth-child(1){height:5px;width:55%;background:#6d28d9}.tp-lavender .tp-line:nth-child(2){height:3px;width:80%;background:#8b5cf6}.tp-lavender .tp-line:nth-child(3){height:3px;width:60%;background:#a78bfa}.tp-lavender .theme-label{color:#6d28d9}
.tp-coffee .theme-preview{background:#fdf8f3}.tp-coffee .tp-line:nth-child(1){height:5px;width:55%;background:#4e342e}.tp-coffee .tp-line:nth-child(2){height:3px;width:80%;background:#5d4037}.tp-coffee .tp-line:nth-child(3){height:3px;width:60%;background:#8d6e63}.tp-coffee .theme-label{color:#4e342e}
.tp-slate .theme-preview{background:#f3f4f6}.tp-slate .tp-line:nth-child(1){height:5px;width:55%;background:#1f2937}.tp-slate .tp-line:nth-child(2){height:3px;width:80%;background:#4b5563}.tp-slate .tp-line:nth-child(3){height:3px;width:60%;background:#6b7280}.tp-slate .theme-label{color:#374151}
.tp-coral .theme-preview{background:#fff7ed}.tp-coral .tp-line:nth-child(1){height:5px;width:55%;background:#9a3412}.tp-coral .tp-line:nth-child(2){height:3px;width:80%;background:#fb923c}.tp-coral .tp-line:nth-child(3){height:3px;width:60%;background:#ef4444}.tp-coral .theme-label{color:#9a3412}
.tp-rose .theme-preview{background:#fff1f2}.tp-rose .tp-line:nth-child(1){height:5px;width:55%;background:#7c2d5a}.tp-rose .tp-line:nth-child(2){height:3px;width:80%;background:#be185d}.tp-rose .tp-line:nth-child(3){height:3px;width:60%;background:#f472b6}.tp-rose .theme-label{color:#7c2d5a}
/* New creative themes 36-40 */
.tp-vintage .theme-preview{background:#faf3e0;border:1px solid #c9b896}.tp-vintage .tp-line:nth-child(1){height:5px;width:50%;background:#5c4033}.tp-vintage .tp-line:nth-child(2){height:3px;width:80%;background:#8b7355;border-bottom:1px double #c9b896}.tp-vintage .tp-line:nth-child(3){height:2px;width:60%;background:#c9b896}.tp-vintage .theme-label{color:#5c4033}
.tp-space .theme-preview{background:linear-gradient(180deg,#0f0c29,#302b63)}.tp-space .tp-line:nth-child(1){height:5px;width:55%;background:#c084fc;box-shadow:0 0 6px #c084fc}.tp-space .tp-line:nth-child(2){height:3px;width:80%;background:#60a5fa;box-shadow:0 0 4px #60a5fa}.tp-space .tp-line:nth-child(3){height:3px;width:60%;background:#34d399;box-shadow:0 0 4px #34d399}.tp-space .theme-label{color:#c084fc}
.tp-watercolor .theme-preview{background:#fffef5}.tp-watercolor .tp-line:nth-child(1){height:6px;width:55%;background:#d4756a;border-radius:3px}.tp-watercolor .tp-line:nth-child(2){height:4px;width:80%;background:#a76f6a;border-radius:2px}.tp-watercolor .tp-line:nth-child(3){height:4px;width:60%;background:#c9b5b0;border-radius:2px}.tp-watercolor .theme-label{color:#8b5a5a}
.tp-papercut .theme-preview{background:#faf8f5}.tp-papercut .tp-line:nth-child(1){height:5px;width:55%;background:#8b4513;box-shadow:2px 2px 0 #d4a574}.tp-papercut .tp-line:nth-child(2){height:3px;width:80%;background:#cd853f;box-shadow:2px 2px 0 #deb887}.tp-papercut .tp-line:nth-child(3){height:3px;width:60%;background:#daa520}.tp-papercut .theme-label{color:#8b4513}
.tp-geometric .theme-preview{background:#f8fafc}.tp-geometric .tp-line:nth-child(1){height:5px;width:45%;background:#3b82f6}.tp-geometric .tp-line:nth-child(2){height:4px;width:70%;background:#60a5fa;margin-left:15%}.tp-geometric .tp-line:nth-child(3){height:3px;width:55%;background:#93c5fd;margin-left:20%}.tp-geometric .theme-label{color:#1e3a5f}
.tp-ink_bold .theme-preview{background:#fff;padding:8px}.tp-ink_bold .tp-line:nth-child(1){height:7px;width:70%;background:#000;margin:0 auto 6px;border-bottom:3px solid #000}.tp-ink_bold .tp-line:nth-child(2){height:4px;width:90%;background:#222}.tp-ink_bold .tp-line:nth-child(3){height:4px;width:75%;background:#555}.tp-ink_bold .theme-label{color:#000;font-weight:900}
.tp-serif_classic .theme-preview{background:#faf8f5;padding:8px}.tp-serif_classic .tp-line:nth-child(1){height:6px;width:60%;background:#1a1a2e;margin:0 auto 6px;border-bottom:2px double #1a1a2e}.tp-serif_classic .tp-line:nth-child(2){height:4px;width:85%;background:#16213e;font-style:italic}.tp-serif_classic .tp-line:nth-child(3){height:3px;width:70%;background:#0f3460}.tp-serif_classic .theme-label{color:#1a1a2e;font-family:Georgia,serif}
.tp-gentle_gray .theme-preview{background:#fafafa;padding:10px}.tp-gentle_gray .tp-line:nth-child(1){height:4px;width:50%;background:#555;margin:0 auto 8px}.tp-gentle_gray .tp-line:nth-child(2){height:3px;width:80%;background:#aaa}.tp-gentle_gray .tp-line:nth-child(3){height:3px;width:65%;background:#ccc}.tp-gentle_gray .theme-label{color:#666}
.tp-warm_brown .theme-preview{background:#fdf8f4;padding:8px}.tp-warm_brown .tp-line:nth-child(1){height:8px;width:80%;background:linear-gradient(135deg,#5d4037,#8d6e63);margin:0 auto 6px;border-radius:3px}.tp-warm_brown .tp-line:nth-child(2){height:4px;width:85%;background:#f5f0eb;border-left:3px solid #8d6e63}.tp-warm_brown .tp-line:nth-child(3){height:3px;width:70%;background:#d7ccc8}.tp-warm_brown .theme-label{color:#5d4037}
.tp-deep_blue .theme-preview{background:#f0f4f8;padding:8px}.tp-deep_blue .tp-line:nth-child(1){height:6px;width:65%;background:#0f172a;border-bottom:3px solid #1e40af;margin-bottom:6px}.tp-deep_blue .tp-line:nth-child(2){height:4px;width:85%;background:#1e3a5f;border-left:3px solid #3b82f6}.tp-deep_blue .tp-line:nth-child(3){height:3px;width:70%;background:#93c5fd}.tp-deep_blue .theme-label{color:#1e40af}
.tp-emerald .theme-preview{background:#ecfdf5;padding:8px;border-radius:6px}.tp-emerald .tp-line:nth-child(1){height:6px;width:60%;background:#064e3b;margin:0 auto 6px;border-radius:4px}.tp-emerald .tp-line:nth-child(2){height:4px;width:85%;background:#f0fdf4;border-left:3px solid #10b981}.tp-emerald .tp-line:nth-child(3){height:3px;width:70%;background:#a7f3d0}.tp-emerald .theme-label{color:#064e3b}
.tp-purple_ink .theme-preview{background:linear-gradient(135deg,#f5f3ff,#ede9fe);padding:8px;border-radius:6px}.tp-purple_ink .tp-line:nth-child(1){height:6px;width:60%;background:#1e1b4b;margin:0 auto 6px;font-style:italic}.tp-purple_ink .tp-line:nth-child(2){height:4px;width:85%;background:#3730a3;border-bottom:2px solid #8b5cf6}.tp-purple_ink .tp-line:nth-child(3){height:3px;width:70%;background:#c4b5fd}.tp-purple_ink .theme-label{color:#4c1d95}
.tp-crimson .theme-preview{background:#fef2f2;padding:8px}.tp-crimson .tp-line:nth-child(1){height:8px;width:70%;background:#7f1d1d;margin:0 auto 6px;border-bottom:4px solid #ef4444}.tp-crimson .tp-line:nth-child(2){height:5px;width:90%;background:#991b1b;border-left:3px solid #ef4444}.tp-crimson .tp-line:nth-child(3){height:3px;width:75%;background:#fca5a5}.tp-crimson .theme-label{color:#991b1b;font-weight:700}
.tp-teal_calm .theme-preview{background:#f0fdfa;padding:10px}.tp-teal_calm .tp-line:nth-child(1){height:4px;width:45%;background:#042f2e;margin:0 auto 10px}.tp-teal_calm .tp-line:nth-child(2){height:3px;width:75%;background:#115e59;border-bottom:2px solid #14b8a6}.tp-teal_calm .tp-line:nth-child(3){height:3px;width:55%;background:#99f6e4}.tp-teal_calm .theme-label{color:#0f766e}
.tp-golden .theme-preview{background:linear-gradient(135deg,#fffbeb,#fef3c7);padding:8px;border:2px solid #f59e0b;border-radius:6px}.tp-golden .tp-line:nth-child(1){height:6px;width:60%;background:#451a03;margin:0 auto 6px}.tp-golden .tp-line:nth-child(2){height:4px;width:85%;background:#78350f;border-left:3px solid #f59e0b}.tp-golden .tp-line:nth-child(3){height:3px;width:70%;background:#fcd34d}.tp-golden .theme-label{color:#92400e}
.tp-neon_glow .theme-preview{background:#0a0a0a;padding:8px;border:1px solid #333;border-radius:6px}.tp-neon_glow .tp-line:nth-child(1){height:7px;width:65%;background:#111;border:2px solid #00ff88;margin:0 auto 5px;border-radius:4px;box-shadow:0 0 10px #00ff88}.tp-neon_glow .tp-line:nth-child(2){height:4px;width:85%;background:#111;border-left:3px solid #00ccff;box-shadow:0 0 8px #00ccff}.tp-neon_glow .tp-line:nth-child(3){height:3px;width:70%;background:#333}.tp-neon_glow .theme-label{color:#00ff88;text-shadow:0 0 5px #00ff88}
.tp-minimalist_luxury .theme-preview{background:#fff;padding:10px}.tp-minimalist_luxury .tp-line:nth-child(1){height:5px;width:50%;background:#000;margin:0 auto 8px;border-bottom:1px solid #d4af37}.tp-minimalist_luxury .tp-line:nth-child(2){height:3px;width:75%;background:#ddd}.tp-minimalist_luxury .tp-line:nth-child(3){height:3px;width:60%;background:#eee}.tp-minimalist_luxury .theme-label{color:#333;font-weight:300;letter-spacing:2px}
.tp-vintage_editorial .theme-preview{background:#f5f0e8;padding:8px}.tp-vintage_editorial .tp-line:nth-child(1){height:8px;width:70%;background:#1a1a1a;margin-bottom:6px}.tp-vintage_editorial .tp-line:nth-child(2){height:3px;width:90%;background:#666;letter-spacing:2px}.tp-vintage_editorial .tp-line:nth-child(3){height:4px;width:75%;background:#8b4513;border-left:5px solid #8b4513}.tp-vintage_editorial .theme-label{color:#1a1a1a;font-weight:900}
.tp-arctic_frost .theme-preview{background:linear-gradient(135deg,#e0f2fe,#bae6fd);padding:8px;border:1px solid #7dd3fc;border-radius:8px}.tp-arctic_frost .tp-line:nth-child(1){height:6px;width:55%;background:#0c4a6e;margin:0 auto 6px;border-radius:4px}.tp-arctic_frost .tp-line:nth-child(2){height:4px;width:80%;background:#f0f9ff;border-left:3px solid #38bdf8}.tp-arctic_frost .tp-line:nth-child(3){height:3px;width:65%;background:#bae6fd}.tp-arctic_frost .theme-label{color:#0369a1}
.tp-sunset_gradient .theme-preview{background:linear-gradient(135deg,#fff7ed,#fce7f3);padding:8px;border-radius:8px}.tp-sunset_gradient .tp-line:nth-child(1){height:8px;width:70%;background:linear-gradient(135deg,#f97316,#ec4899);margin:0 auto 6px;border-radius:6px}.tp-sunset_gradient .tp-line:nth-child(2){height:4px;width:85%;background:linear-gradient(90deg,#fff7ed,#fef3c7);border-left:3px solid #f97316}.tp-sunset_gradient .tp-line:nth-child(3){height:3px;width:70%;background:#fed7aa}.tp-sunset_gradient .theme-label{color:#c2410c}
.tp-noir_cinema .theme-preview{background:#f5f5f5;padding:8px}.tp-noir_cinema .tp-line:nth-child(1){height:10px;width:80%;background:#000;margin:0 auto 6px}.tp-noir_cinema .tp-line:nth-child(2){height:2px;width:90%;background:#666;letter-spacing:3px}.tp-noir_cinema .tp-line:nth-child(3){height:4px;width:65%;background:#333;font-style:italic}.tp-noir_cinema .theme-label{color:#000;font-weight:900;text-transform:uppercase;letter-spacing:2px}

/* ===== Save Status ===== */
.save-status{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:var(--text-muted);transition:all .2s;cursor:default}
.save-status::before{content:'';width:6px;height:6px;border-radius:50%;background:#10b981;display:inline-block}
.save-status.unsaved::before{background:#f59e0b;animation:pulse 1.5s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}

/* ===== Search & Replace Bar ===== */
.search-bar{display:none;align-items:center;gap:6px;padding:6px 10px;border-bottom:1px solid var(--border);background:#f8faff;flex-shrink:0}
.search-bar.show{display:flex}
.search-bar input{flex:1;padding:5px 10px;border:1px solid var(--border);border-radius:6px;font-size:12px;outline:none;background:#fff}
.search-bar input:focus{border-color:var(--primary)}
.search-bar .btn{padding:4px 10px;font-size:11px}
.search-bar .search-info{font-size:10px;color:var(--text-muted);white-space:nowrap;min-width:50px;text-align:center}

/* ===== Outline Nav ===== */
.outline-panel{width:170px;flex-shrink:0;display:none;flex-direction:column;background:var(--surface);border-right:1px solid var(--border);overflow:hidden}
.outline-panel.show{display:flex}
.outline-header{padding:8px 12px;border-bottom:1px solid var(--border);font-size:11px;font-weight:600;color:var(--text-muted);display:flex;align-items:center;justify-content:space-between}
.outline-list{flex:1;overflow-y:auto;padding:6px;scrollbar-width:thin}
.outline-item{padding:5px 8px;border-radius:5px;font-size:11px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text);transition:all .1s}
.outline-item:hover{background:var(--primary-light);color:var(--primary)}
.outline-item.l1{font-weight:600}.outline-item.l2{padding-left:16px}.outline-item.l3{padding-left:28px;font-size:10px}
.outline-item.active{background:var(--primary-light);color:var(--primary)}
.editor-panel+.outline-panel{border-left:1px solid var(--border);border-right:none}

/* ===== Dark Mode ===== */
body.dark-mode{--bg:#0f172a;--surface:#1e293b;--border:#334155;--text:#e2e8f0;--text-muted:#94a3b8;--primary:#818cf8;--primary-light:rgba(129,140,248,.1)}
body.dark-mode .editor-toolbar{background:#1e293b}
body.dark-mode textarea#md-input{background:var(--surface);color:var(--text)}
body.dark-mode .side-panel{background:#1e293b}
body.dark-mode .search-bar{background:#1e293b}
body.dark-mode .theme-scroll-wrap .scroll-arrow{background:#1e293b;border-color:var(--border);color:var(--text-muted)}
body.dark-mode .tb-btn{background:#1e293b;border-color:var(--border);color:var(--text-muted)}
body.dark-mode .setting-input,.body.dark-mode .color-hex-input{background:#1e293b;color:var(--text);border-color:var(--border)}
body.dark-mode .shadow-btn{background:#1e293b;border-color:var(--border);color:var(--text-muted)}
body.dark-mode .modal{background:var(--surface)}
body.dark-mode .export-menu{background:var(--surface)}
body.dark-mode .copy-menu{background:var(--surface)}
body.dark-mode .word-count-detail{background:var(--surface);border-color:var(--border)}

/* ===== Shortcut Modal ===== */
.shortcut-table{width:100%;border-collapse:collapse;font-size:12px}
.shortcut-table td{padding:8px 6px;border-bottom:1px solid var(--border)}
.shortcut-table td:first-child{width:120px;font-family:monospace;color:var(--primary);font-weight:600}
.shortcut-table tr:last-child td{border-bottom:none}

/* ===== Word Count Detail ===== */
.word-count-detail{position:absolute;top:36px;left:0;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);padding:12px 16px;min-width:200px;z-index:50;display:none;font-size:12px}
.word-count-detail.show{display:block}
.word-count-detail .wc-row{display:flex;justify-content:space-between;padding:4px 0;color:var(--text)}
.word-count-detail .wc-row span:first-child{color:var(--text-muted)}

/* ===== Copy Dropdown ===== */
.copy-dropdown{position:relative}
.copy-menu{display:none;position:absolute;top:100%;right:0;margin-top:6px;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);min-width:160px;z-index:50;overflow:hidden;padding:4px 0}
.copy-menu.show{display:block}
.copy-menu div{padding:8px 14px;font-size:12px;color:var(--text);cursor:pointer;transition:background .15s}
.copy-menu div:hover{background:var(--primary-light);color:var(--primary)}

/* ===== Upload input hidden ===== */
#img-upload-input{display:none}

/* ===== Float Picker ===== */
.float-picker{position:absolute;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.15);padding:10px;z-index:60;width:230px;display:none}
.float-picker-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:12px;font-weight:600;color:var(--text)}
.float-picker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;max-height:220px;overflow-y:auto;scrollbar-width:thin}
.float-picker-item{padding:5px 3px;border-radius:5px;border:1px solid var(--border);font-size:10px;text-align:center;cursor:pointer;transition:all .1s;background:#fff;color:var(--text);line-height:1.3}
.float-picker-item:hover{border-color:var(--primary);color:var(--primary)}
.float-picker-item.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.float-picker-footer{margin-top:8px}
body.dark-mode .float-picker{background:var(--surface);border-color:var(--border)}
body.dark-mode .float-picker-item{background:#1e293b;border-color:var(--border);color:var(--text)}
body.dark-mode .float-picker-item.active{background:var(--primary);color:#fff}

/* ===== User Area ===== */
.user-status-wrap{position:relative}
.user-status{display:flex;align-items:center;gap:6px;cursor:pointer;padding:4px 10px;border-radius:8px;transition:background .15s}
.user-status:hover{background:var(--bg-muted,var(--bg))}
.user-avatar{width:28px;height:28px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}
.user-name{font-size:12px;color:var(--text);font-weight:500}
.user-vip-tag{display:inline-flex;align-items:center;gap:2px;padding:1px 7px;border-radius:10px;font-size:10px;font-weight:700;background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff}
.login-hint{font-size:12px;color:var(--text-muted);cursor:pointer;padding:4px 10px;border-radius:8px;border:1px dashed var(--border);transition:all .15s}
.login-hint:hover{color:var(--primary);border-color:var(--primary)}

/* 用户下拉菜单 */
.user-dropdown{position:absolute;top:calc(100% + 6px);right:0;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.12);min-width:180px;padding:6px 0;z-index:200;opacity:0;pointer-events:none;transform:translateY(-6px);transition:all .18s}
.user-dropdown.show{opacity:1;pointer-events:auto;transform:translateY(0)}
.user-dropdown::before{content:'';position:absolute;top:-6px;right:14px;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff}
.user-dropdown::after{content:'';position:absolute;top:-7px;right:13px;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid var(--border)}
.user-dropdown-item{display:flex;align-items:center;gap:10px;padding:10px 16px;font-size:13px;color:var(--text);cursor:pointer;transition:background .12s;border-radius:0}
.user-dropdown-item:hover{background:var(--primary-light)}
.user-dropdown-item .dd-icon{width:18px;text-align:center;font-size:14px;flex-shrink:0}
.user-dropdown-item .dd-label{flex:1}
.user-dropdown-item .dd-extra{font-size:11px;color:var(--text-muted)}
.user-dropdown-divider{height:1px;background:var(--border);margin:4px 0}
.user-dropdown-item.dd-danger{color:#dc2626}
.user-dropdown-item.dd-danger:hover{background:#fef2f2}
body.dark-mode .user-dropdown{background:var(--surface)}
body.dark-mode .user-dropdown::before{border-bottom-color:var(--surface)}
body.dark-mode .user-dropdown-item.dd-danger:hover{background:#1e1215}

/* ===== VIP Modal ===== */
.vip-feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:16px}
.vip-feature-item{font-size:12px;color:var(--text);padding:6px 10px;background:var(--primary-light);border-radius:6px}

/* VIP 原价套餐展示 */
.vip-pricing-section{background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:16px}
.vip-pricing-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-size:14px;font-weight:600;color:var(--text)}
.vip-pricing-badge{font-size:10px;font-weight:700;color:#fff;background:linear-gradient(135deg,#f59e0b,#ef4444);padding:2px 8px;border-radius:10px;letter-spacing:.5px}
.vip-pricing-cards{display:flex;gap:10px}
.vip-price-card{flex:1;text-align:center;padding:10px 6px;background:var(--card);border:1px solid var(--border);border-radius:10px;position:relative;transition:transform .15s}
.vip-price-card:hover{transform:translateY(-2px)}
.vip-price-card.price-card-hot{border-color:#f59e0b;background:linear-gradient(135deg,#fffbeb,#fef3c7)}
body.dark-mode .vip-price-card.price-card-hot{border-color:#f59e0b;background:linear-gradient(135deg,#451a03,#78350f)}
.price-plan-name{font-size:12px;font-weight:600;color:var(--text);margin-bottom:4px}
.price-original{font-size:18px;font-weight:700;color:#9ca3af;margin-bottom:6px}
.price-original s{color:#ef4444;text-decoration:line-through}
.price-free-tag{font-size:10px;font-weight:700;color:#16a34a;background:#f0fdf4;padding:2px 8px;border-radius:8px;display:inline-block}
body.dark-mode .price-free-tag{background:#052e16;color:#4ade80}

/* VIP 免费获取区 */
.vip-free-section{background:linear-gradient(135deg,#f0fdf4,#ecfdf5);border:1px solid #bbf7d0;border-radius:12px;padding:16px;margin-bottom:16px}
.vip-free-title{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700;color:#166534;margin-bottom:8px}
.vip-free-icon{font-size:18px}
.vip-free-desc{font-size:12px;color:#15803d;margin-bottom:14px;line-height:1.6}
.vip-free-steps{margin-bottom:14px}
.vip-step{display:flex;align-items:flex-start;gap:10px;margin-bottom:10px}
.vip-step-num{width:22px;height:22px;border-radius:50%;background:#22c55e;color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0;margin-top:1px}
.vip-step-text{font-size:12px;color:#166534;line-height:1.5}
.vip-free-input-area{display:flex;gap:8px;align-items:center}
.vip-follow-input{flex:1;padding:8px 12px;border:1px solid #bbf7d0;border-radius:8px;font-size:13px;outline:none;background:#fff;transition:border-color .15s}
.vip-follow-input:focus{border-color:#22c55e}
.vip-free-input-area .btn-primary{white-space:nowrap;font-size:13px}

/* VIP 赞助区 */
.vip-sponsor-divider{text-align:center;margin:16px 0;position:relative;font-size:12px;color:var(--text-muted)}
.vip-sponsor-divider::before,.vip-sponsor-divider::after{content:'';position:absolute;top:50%;width:30%;height:1px;background:var(--border)}
.vip-sponsor-divider::before{left:0}
.vip-sponsor-divider::after{right:0}
.vip-sponsor-section{text-align:center;padding:12px 0}
.vip-sponsor-title{font-size:15px;font-weight:600;color:var(--text);margin-bottom:6px}
.vip-sponsor-desc{font-size:12px;color:var(--text-muted);margin-bottom:14px}
.vip-sponsor-qr-row{display:flex;justify-content:center;gap:24px}
.vip-sponsor-qr-item{text-align:center}
.sponsor-qr-wrap{position:relative}
.sponsor-qr-img{width:140px;height:140px;border-radius:12px;border:2px solid var(--border);object-fit:cover;box-shadow:0 4px 12px rgba(0,0,0,.08)}
.sponsor-qr-label{margin-top:6px;font-size:12px;font-weight:600;color:var(--text)}
.sponsor-qr-placeholder{width:140px;height:140px;border-radius:12px;border:2px dashed var(--border);display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;color:var(--text-muted);gap:4px}

/* 暗黑模式适配 */
body.dark-mode .vip-free-section{background:linear-gradient(135deg,#052e16,#064e3b);border-color:#166534}
body.dark-mode .vip-free-title{color:#86efac}
body.dark-mode .vip-free-desc{color:#4ade80}
body.dark-mode .vip-step-text{color:#86efac}
body.dark-mode .vip-follow-input{background:#022c22;border-color:#166534;color:var(--text)}
body.dark-mode .sponsor-qr-img{border-color:var(--border)}
body.dark-mode .sponsor-qr-label{color:var(--text)}

/* 保留旧的套餐样式（兼容） */
.vip-plans{display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}
.vip-plan{position:relative;border:2px solid var(--border);border-radius:12px;padding:14px 12px;text-align:center;cursor:pointer;transition:all .2s;background:#fff}
.vip-plan:hover{border-color:var(--primary);background:var(--primary-light)}
.vip-plan.selected{border-color:var(--primary);background:var(--primary-light)}
.vip-plan-badge{position:absolute;top:-10px;left:50%;transform:translateX(-50%);background:var(--primary);color:#fff;font-size:10px;font-weight:700;padding:2px 10px;border-radius:10px;white-space:nowrap}
.vip-plan-name{font-size:13px;font-weight:600;color:var(--text);margin-bottom:6px}
.vip-plan-price{font-size:22px;font-weight:800;color:var(--primary);margin-bottom:4px}
.vip-plan-price span{font-size:12px;font-weight:400;color:var(--text-muted)}
.vip-plan-desc{font-size:11px;color:var(--text-muted)}
body.dark-mode .vip-plan{background:var(--surface);border-color:var(--border)}
body.dark-mode .vip-plan.selected,.body.dark-mode .vip-plan:hover{background:rgba(129,140,248,.1)}

/* ===== AI Assistant Modal ===== */
.ai-tabs{display:flex;border-bottom:1px solid var(--border);background:var(--bg,#f0f2f5)}
.ai-tab{flex:1;padding:12px 8px;text-align:center;font-size:13px;font-weight:500;color:var(--text-muted);cursor:pointer;transition:all .2s;border-bottom:2px solid transparent;user-select:none}
.ai-tab:hover{color:var(--text);background:rgba(99,102,241,.05)}
.ai-tab.active{color:var(--primary);border-bottom-color:var(--primary);background:var(--surface,#fff)}
.ai-style-radio{display:inline-flex;align-items:center;cursor:pointer}
.ai-style-radio input{display:none}
.ai-style-radio span{display:inline-block;padding:5px 14px;border-radius:20px;font-size:12px;border:1px solid var(--border);color:var(--text-muted);transition:all .15s;background:var(--surface,#fff)}
.ai-style-radio span:hover{border-color:var(--primary);color:var(--primary)}
.ai-style-radio input:checked+span{background:var(--primary);color:#fff;border-color:var(--primary);font-weight:500}
#ai-result-content{scrollbar-width:thin;scrollbar-color:#d1d5db transparent}
#ai-result-content::-webkit-scrollbar{width:4px}
#ai-result-content::-webkit-scrollbar-track{background:transparent}
#ai-result-content::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:4px}
body.dark-mode .ai-tabs{background:#1e1e2e}
body.dark-mode .ai-tab.active{background:var(--surface)}
body.dark-mode #ai-result-content{background:#1e1e2e;border-color:var(--border)}

/* ===== AI Config Modal ===== */
#ai-config-modal .form-group{margin-bottom:14px}
#ai-config-modal .form-group label{display:block;font-size:12px;font-weight:600;color:var(--text-muted);margin-bottom:5px}
#ai-config-modal .form-group select,
#ai-config-modal .form-group input[type="text"],
#ai-config-modal .form-group input[type="password"]{
  width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:6px;
  font-size:13px;background:var(--surface,#fff);color:var(--text);transition:border-color .2s;
  box-sizing:border-box;
}
#ai-config-modal .form-group select:focus,
#ai-config-modal .form-group input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(99,102,241,.1)}
#ai-config-modal .form-group select{cursor:pointer;appearance:auto}
body.dark-mode #ai-config-modal .form-group select,
body.dark-mode #ai-config-modal .form-group input{background:#1e1e2e;border-color:#333;color:#e0e0e0}
