 --bg: #000000;
 --bg2: #0d1117;
 --surface: #16202c;
 --surface2: #1e2732;
 --border: #2f3336;
 --border-h: #3d4650;
 --text: #e7e9ea;
 --text2: #71767b;
 --text3: #536471;
 --blue: #1d9bf0;
 --blue-h: #1a8cd8;
 --blue-dim: #1d9bf015;
 --blue-glow: #1d9bf030;
 --green: #00ba7c;
 --red: #f4212e;
 --amber: #f5a623;
 --radius: 12px;
 --radius-sm: 8px;
 --radius-xs: 5px;
 --sidebar-w: 260px;
}
html{height: 100%;}
body {
 background: var(--bg);
 color: var(--text);
 font-family: 'DM Sans', -apple-system, sans-serif;
 height: 100vh;
 display: flex;
 overflow: hidden;
 font-size: 14px;
 line-height: 1.5;
}
.sb {
 width: var(--sidebar-w);
 flex-shrink: 0;
 background: var(--bg);
 border-right: 1px solid var(--border);
 display: flex;
 flex-direction: column;
 height: 100vh;
 overflow-y: auto;
 transition: transform 0.25s cubic-bezier(.4,0,.2,1), width 0.25s;
 z-index: 50;
}
.sb-inner {
 display: flex;
 flex-direction: column;
 padding: 20px 12px;
 gap: 4px;
 min-height: 100%;
}
.brand {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 4px 10px 20px;
}
.brand-mark {
 width: 34px;height: 34px;
 flex-shrink: 0;
}
.brand-mark svg{width: 100%;height: 100%;}
.brand-name {
 font-size: 20px;
 font-weight: 700;
 color: var(--text);
 letter-spacing: -0.4px;
}
.sb-footer{margin-top: auto;padding-top: 16px;}
.storage-block{padding: 0 8px 16px;}
.storage-row {
 display: flex;justify-content: space-between;
 font-size: 11.5px;color: var(--text3);margin-bottom: 8px;
}
.storage-track {
 height: 3px;background: var(--surface2);
 border-radius: 99px;overflow: hidden;
}
.storage-fill {
 height: 100%;width: 0;
 background: linear-gradient(90deg, var(--blue), #60a5fa);
 border-radius: 99px;transition: width 0.5s ease;
}
.sb-user {
 display: flex;align-items: center;gap: 10px;
 padding: 10px 12px;border-radius: 99px;cursor: pointer;
 transition: background 0.15s;
}
.sb-user:hover{background: rgba(231,233,234,0.07);}
.sb-avatar {
 width: 36px;height: 36px;border-radius: 50%;
 background: var(--blue);color: white;
 display: flex;align-items: center;justify-content: center;
 font-size: 12px;font-weight: 700;flex-shrink: 0;
}
.sb-user-info{flex: 1;min-width: 0;}
.sb-user-name{font-size: 13px;font-weight: 700;color: var(--text);}
.sb-user-sub{font-size: 11.5px;color: var(--text2);}
.sb-user-more{color: var(--text2);font-size: 18px;letter-spacing: 1px;}
.topbar {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 0 20px;
 height: 53px;
 border-bottom: 1px solid var(--border);
 background: rgba(0,0,0,0.85);
 backdrop-filter: blur(12px);
 -webkit-backdrop-filter: blur(12px);
 flex-shrink: 0;
 position: sticky;
 top: 0;
 z-index: 40;
}
.hamburger {
 display: none;
 width: 36px;height: 36px;
 background: none;border: none;cursor: pointer;
 color: var(--text2);border-radius: 50%;
 align-items: center;justify-content: center;
 transition: background 0.15s;
}
.hamburger:hover{background: rgba(231,233,234,0.07);}
.hamburger svg{width: 20px;height: 20px;}
.search-drop {
 position: absolute;
 top: calc(100% + 8px);
 left: 0;right: 0;
 background: var(--bg2);
 border: 1px solid var(--border);
 border-radius: var(--radius);
 box-shadow: 0 16px 64px rgba(0,0,0,0.6);
 overflow: hidden;
 display: none;
 z-index: 100;
 max-height: 460px;
 overflow-y: auto;
}
.search-drop.open{display: block;animation: dropIn 0.18s ease;}
@keyframes dropIn {
 from{opacity: 0;transform: translateY(-8px);}
 to{opacity: 1;transform: translateY(0);}
}
.sd-header {
 padding: 10px 16px 6px;
 font-size: 10.5px;
 font-weight: 700;
 color: var(--text3);
 letter-spacing: 0.07em;
 text-transform: uppercase;
 border-bottom: 1px solid var(--border);
}
.sd-section + .sd-section{border-top: 1px solid var(--border);}
.sd-section-label {
 padding: 10px 16px 4px;
 font-size: 10.5px;
 font-weight: 700;
 color: var(--text3);
 letter-spacing: 0.07em;
 text-transform: uppercase;
}
.sd-item {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 10px 16px;
 cursor: pointer;
 transition: background 0.1s;
}
.sd-item:hover, .sd-item.focused {
 background: rgba(29,155,240,0.06);
}
.sd-thumb {
 width: 36px;height: 36px;
 border-radius: 8px;
 background: var(--surface2);
 display: flex;align-items: center;justify-content: center;
 overflow: hidden;flex-shrink: 0;
}
.sd-thumb img{width: 100%;height: 100%;object-fit: cover;border-radius: 8px;}
.sd-thumb svg{width: 16px;height: 16px;}
.sd-ext{font-size: 9px;font-weight: 800;color: var(--text3);}
.sd-info{flex: 1;min-width: 0;}
.sd-name {
 font-size: 13.5px;font-weight: 500;color: var(--text);
 white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
}
.sd-meta{font-size: 11.5px;color: var(--text2);margin-top: 2px;}
.sd-name mark {
 background: rgba(29,155,240,0.2);
 color: var(--blue);
 border-radius: 3px;
 padding: 0 2px;
 font-style: normal;
}
.sd-empty {
 padding: 32px 16px;
 text-align: center;
 color: var(--text3);
 font-size: 13.5px;
}
.sd-shortcut{color: var(--text3);font-size: 11px;flex-shrink: 0;}
.content {
 flex: 1;
 overflow-y: auto;
 padding: 32px 40px;
}
.view{display: none;}
.view.active{display: block;}
.view-header{margin-bottom: 28px;}
.view-title {
 font-size: 22px;
 font-weight: 800;
 letter-spacing: -0.4px;
 margin-bottom: 4px;
}
.view-meta{font-size: 13px;color: var(--text3);}
.section-block{margin-bottom: 32px;}
.section-head {
 display: flex;
 align-items: center;
 justify-content: space-between;
 margin-bottom: 12px;
 gap: 12px;
}
.section-title {
 font-size: 15px;
 font-weight: 700;
 color: var(--text);
 display: flex;
 align-items: center;
 gap: 8px;
}
.count-pill {
 background: var(--surface2);
 color: var(--text3);
 font-size: 11px;
 font-weight: 600;
 padding: 2px 8px;
 border-radius: 99px;
}
.section-actions{display: flex;align-items: center;gap: 8px;}
.queue-list{display: flex;flex-direction: column;gap: 6px;}
.qi {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 12px 16px;
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 animation: slideUp 0.2s ease;
 transition: border-color 0.15s;
}
.qi:hover{border-color: var(--border-h);}
@keyframes slideUp {
 from{opacity: 0;transform: translateY(8px);}
 to{opacity: 1;transform: translateY(0);}
}
.qi-thumb {
 width: 40px;height: 40px;
 border-radius: 8px;
 background: var(--surface2);
 display: flex;align-items: center;justify-content: center;
 overflow: hidden;flex-shrink: 0;
}
.qi-thumb img{width: 100%;height: 100%;object-fit: cover;border-radius: 8px;}
.qi-ext{font-size: 9px;font-weight: 800;color: var(--text3);}
.qi-body{flex: 1;min-width: 0;}
.qi-name{font-size: 13.5px;font-weight: 500;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;margin-bottom: 3px;}
.qi-size{font-size: 11px;color: var(--text3);margin-bottom: 7px;}
.qi-track{height: 3px;background: var(--surface2);border-radius: 99px;overflow: hidden;}
.qi-bar {
 height: 100%;width: 0;
 background: linear-gradient(90deg, var(--blue), #60a5fa);
 border-radius: 99px;
 transition: width 0.07s linear;
}
.qi-bar.done{background: var(--green);}
.qi-right{display: flex;align-items: center;gap: 6px;flex-shrink: 0;}
.qi-pct{font-size: 11px;font-weight: 700;color: var(--text3);min-width: 30px;text-align: right;}
.qi-status-icon{width: 18px;height: 18px;display: flex;align-items: center;justify-content: center;}
.qi-del {
 width: 28px;height: 28px;border-radius: 50%;
 background: none;border: none;cursor: pointer;
 color: var(--text3);display: flex;
 align-items: center;justify-content: center;
 transition: all 0.15s;
}
.qi-del svg{width: 13px;height: 13px;}
.qi-del:hover{background: rgba(244,33,46,0.12);color: var(--red);}
.files-grid-view.grid-mode {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
 gap: 12px;
}
.files-grid-view.list-mode {
 display: flex;
 flex-direction: column;
 gap: 6px;
}
.file-row {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 10px 14px;
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 transition: all 0.15s;
 animation: slideUp 0.2s ease;
}
.file-row:hover {
 border-color: var(--border-h);
 background: var(--surface2);
}
.fr-thumb {
 width: 38px;height: 38px;
 border-radius: 8px;
 background: var(--surface2);
 display: flex;align-items: center;justify-content: center;
 overflow: hidden;flex-shrink: 0;
}
.fr-thumb.img-thumb{cursor: zoom-in;}
.fr-thumb.img-thumb:hover{opacity: 0.8;}
.fr-thumb img{width: 100%;height: 100%;object-fit: cover;border-radius: 8px;}
.fr-thumb svg{width: 16px;height: 16px;color: var(--text3);opacity: 0.5;}
.fr-ext{font-size: 9px;font-weight: 800;color: var(--text3);}
.fr-info{flex: 1;min-width: 0;}
.fr-name{font-size: 13.5px;font-weight: 500;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.fr-meta{font-size: 11.5px;color: var(--text3);margin-top: 1px;}
.fr-date{font-size: 12px;color: var(--text3);flex-shrink: 0;white-space: nowrap;}
.fr-acts {
 display: flex;gap: 3px;opacity: 0;transition: opacity 0.15s;
}
.file-row:hover .fr-acts{opacity: 1;}
.fr-btn {
 width: 28px;height: 28px;border-radius: 50%;
 background: none;border: none;cursor: pointer;
 color: var(--text3);display: flex;align-items: center;justify-content: center;
 transition: all 0.15s;
}
.fr-btn svg{width: 13px;height: 13px;}
.fr-btn:hover{background: var(--surface2);color: var(--text);}
.fr-btn.del:hover{color: var(--red);background: rgba(244,33,46,0.1);}
.view#view-notes{height: calc(100vh - 53px);padding: 0;}
.notes-layout {
 display: grid;
 grid-template-columns: 280px 1fr;
 height: 100%;
 overflow: hidden;
}
.notes-sidebar {
 border-right: 1px solid var(--border);
 display: flex;flex-direction: column;
 overflow: hidden;
 background: var(--bg);
}
.notes-sidebar-head {
 display: flex;align-items: center;
 justify-content: space-between;
 padding: 16px 16px 12px;
 border-bottom: 1px solid var(--border);
 flex-shrink: 0;
}
.notes-list-inner{flex: 1;overflow-y: auto;}
.note-item {
 padding: 14px 16px;
 border-bottom: 1px solid var(--border);
 cursor: pointer;
 transition: background 0.12s;
 position: relative;
}
.note-item:hover{background: rgba(231,233,234,0.04);}
.note-item.active{background: var(--blue-dim);}
.note-item.active::before {
 content: '';
 position: absolute;left: 0;top: 0;bottom: 0;
 width: 3px;background: var(--blue);
}
.ni-title{font-size: 13.5px;font-weight: 600;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;margin-bottom: 3px;}
.ni-preview{font-size: 12px;color: var(--text3);white-space: nowrap;overflow: hidden;text-overflow: ellipsis;margin-bottom: 6px;}
.ni-date{font-size: 11px;color: var(--text3);}
.notes-empty-state {
 padding: 40px 20px;text-align: center;
 font-size: 13px;color: var(--text3);
 line-height: 1.6;
}
.toolbar {
 display: flex;align-items: center;
 gap: 2px;flex-wrap: wrap;
 padding: 8px 16px;
 border-bottom: 1px solid var(--border);
 background: var(--bg2);
 flex-shrink: 0;
}
.tb-sep{width: 1px;height: 20px;background: var(--border);margin: 0 4px;}
.tb-btn {
 width: 32px;height: 32px;
 background: none;border: none;cursor: pointer;
 border-radius: var(--radius-xs);
 color: var(--text2);
 display: flex;align-items: center;justify-content: center;
 font-family: inherit;font-size: 13px;font-weight: 700;
 transition: all 0.12s;
}
.tb-btn svg{width: 15px;height: 15px;}
.tb-btn:hover{background: var(--surface2);color: var(--text);}
.tb-btn.active{background: var(--blue-dim);color: var(--blue);}
.tb-select {
 height: 30px;
 background: var(--surface);
 border: 1px solid var(--border);
 border-radius: var(--radius-xs);
 color: var(--text);
 font-family: inherit;font-size: 12.5px;
 padding: 0 8px;outline: none;cursor: pointer;
 transition: border-color 0.15s;
}
.tb-select:focus{border-color: var(--blue);}
.note-title-wrap {
 padding: 20px 28px 0;
 flex-shrink: 0;
}
.note-title {
 width: 100%;
 background: none;border: none;outline: none;
 font-family: inherit;font-size: 26px;font-weight: 800;
 color: var(--text);letter-spacing: -0.5px;
 line-height: 1.3;
}
.note-title::placeholder{color: var(--text3);}
.editor-scroll{flex: 1;overflow-y: auto;padding: 12px 28px 40px;}
.editor-body {
 min-height: 300px;
 outline: none;
 font-size: 15px;
 line-height: 1.8;
 color: var(--text);
}
.editor-body:empty::before {
 content: attr(data-placeholder);
 color: var(--text3);
 pointer-events: none;
 display: block;
}
.editor-body h1{font-size: 28px;font-weight: 800;margin: 20px 0 8px;letter-spacing: -.5px;}
.editor-body h2{font-size: 22px;font-weight: 700;margin: 16px 0 6px;letter-spacing: -.3px;}
.editor-body h3{font-size: 17px;font-weight: 700;margin: 14px 0 4px;}
.editor-body p{margin: 0 0 10px;}
.editor-body ul, .editor-body ol{margin: 0 0 10px;padding-left: 24px;}
.editor-body li{margin: 3px 0;}
.editor-body blockquote {
 border-left: 3px solid var(--blue);
 margin: 14px 0;padding: 6px 16px;
 color: var(--text2);font-style: italic;
}
.editor-body a{color: var(--blue);}
.editor-body img {
 max-width: 100%;border-radius: var(--radius-sm);
 margin: 12px 0;display: block;
}
.editor-body code {
 background: var(--surface2);
 border: 1px solid var(--border);
 border-radius: 4px;padding: 1px 6px;
 font-size: 13px;font-family: ui-monospace, monospace;color: #60a5fa;
}
.editor-body pre {
 background: var(--surface2);
 border: 1px solid var(--border);
 border-radius: var(--radius-sm);
 padding: 16px 18px;overflow-x: auto;margin: 12px 0;
}
.editor-body pre code{background: none;border: none;padding: 0;}
.editor-body strong{font-weight: 700;}
.editor-body mark{background: rgba(29,155,240,0.2);color: var(--blue);border-radius: 3px;padding: 0 2px;}
.toast-dock {
 position: fixed;bottom: 24px;left: 50%;
 transform: translateX(-50%);
 z-index: 999;
 display: flex;flex-direction: column;
 align-items: center;gap: 8px;
 pointer-events: none;
}
.toast {
 background: var(--surface2);
 border: 1px solid var(--border);
 color: var(--text);
 font-size: 13.5px;font-weight: 500;
 padding: 10px 20px;
 border-radius: 99px;
 box-shadow: 0 8px 32px rgba(0,0,0,0.5);
 animation: toastIn 0.25s cubic-bezier(.34,1.4,.64,1);
 display: flex;align-items: center;gap: 8px;
 white-space: nowrap;
}
.toast.success::before{content: '✓';color: var(--green);font-weight: 700;}
.toast.error{border-color: rgba(244,33,46,0.4);}
.toast.error::before{content: '✕';color: var(--red);font-weight: 700;}
@keyframes toastIn {
 from{opacity: 0;transform: translateY(12px) scale(0.92);}
 to{opacity: 1;transform: translateY(0) scale(1);}
}
@media (max-width: 900px) {
 .sb{position: fixed;left: 0;top: 0;transform: translateX(-100%);z-index: 60;}
 .sb.open{transform: translateX(0);box-shadow: 4px 0 40px rgba(0,0,0,0.6);}
 .hamburger{display: flex;}
 .content{padding: 20px 20px;}
 .notes-layout{grid-template-columns: 1fr;}
 .notes-sidebar{display: none;}
 .files-grid-view.grid-mode{grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));}
}
@media (max-width: 600px) {
 .search-wrap{max-width: 100%;}
 .topbar-actions .btn-primary span{display: none;}
 .content{padding: 16px;}
}
