:root{
  --bg:#e7ebf2;
  --glass:rgba(255,255,255,.72);
  --glass-strong:rgba(255,255,255,.88);
  --stroke:rgba(25,25,35,.10);
  --text:#1d1d1f;
  --muted:#78787d;
  --blue:#0a84ff;
  --shadow:0 24px 70px rgba(31,35,48,.22),0 3px 14px rgba(31,35,48,.09);
  --radius:22px;
  --sidebar:260px;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",Segoe UI,sans-serif;
  color-scheme:light;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;color:var(--text);overflow:hidden}
button,input,select{font:inherit}
button{color:inherit}
body{
  background:
    radial-gradient(circle at 20% 10%,rgba(255,255,255,.95),transparent 32%),
    radial-gradient(circle at 78% 74%,rgba(163,186,255,.34),transparent 33%),
    linear-gradient(135deg,#dfe8f4,#f8f6fb 52%,#d8e6f5);
}
.desktop{height:100vh;position:relative;padding-top:28px}
.menu-bar{
  position:fixed;z-index:20;top:0;left:0;right:0;height:28px;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 12px;background:rgba(255,255,255,.60);
  backdrop-filter:blur(28px) saturate(170%);
  border-bottom:1px solid rgba(255,255,255,.45);
  font-size:12px;user-select:none
}
.menu-left,.menu-right{display:flex;align-items:center;gap:16px}
.menu-left strong{font-weight:650}
.apple-mark{border:0;background:transparent;padding:0;font-size:11px}
.sync-state{display:inline-flex;align-items:center;gap:6px}
.sync-state:before{content:"";width:7px;height:7px;border-radius:50%;background:#ff9f0a;box-shadow:0 0 0 3px rgba(255,159,10,.12)}
.sync-state.online:before{background:#30d158;box-shadow:0 0 0 3px rgba(48,209,88,.12)}
.sync-state.saving:before{background:#0a84ff;box-shadow:0 0 0 3px rgba(10,132,255,.12)}
.sync-state.error:before{background:#ff453a;box-shadow:0 0 0 3px rgba(255,69,58,.12)}

.window-shell{height:calc(100vh - 28px);padding:26px 34px 82px}
.app-window{
  height:100%;max-width:1540px;margin:0 auto;border-radius:var(--radius);
  background:rgba(248,249,252,.84);border:1px solid rgba(255,255,255,.75);
  box-shadow:var(--shadow);overflow:hidden;
  backdrop-filter:blur(32px) saturate(150%);
}
.window-titlebar{
  height:50px;display:grid;grid-template-columns:120px 1fr 70px;align-items:center;
  background:rgba(246,247,250,.78);border-bottom:1px solid var(--stroke)
}
.traffic-lights{display:flex;gap:8px;padding-left:18px}
.traffic-lights i{width:12px;height:12px;border-radius:50%;display:block;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.traffic-lights .red{background:#ff5f57}.traffic-lights .yellow{background:#febc2e}.traffic-lights .green{background:#28c840}
.browser-tabs-wrap{height:100%;display:flex;align-items:flex-end;min-width:0}
.browser-tabs{display:flex;gap:5px;overflow-x:auto;scrollbar-width:none;min-width:0;padding:7px 6px 0}
.browser-tabs::-webkit-scrollbar{display:none}
.browser-tab{
  height:35px;min-width:150px;max-width:230px;display:flex;align-items:center;gap:8px;
  padding:0 10px 0 12px;border:0;border-radius:10px 10px 0 0;
  background:rgba(226,229,236,.65);font-size:12px;cursor:pointer;color:#5e5e63
}
.browser-tab.active{background:rgba(255,255,255,.94);color:#1d1d1f;box-shadow:0 -1px 0 rgba(0,0,0,.03)}
.browser-tab .tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;text-align:left}
.browser-tab .tab-close{opacity:.45;border:0;background:transparent;border-radius:50%;width:20px;height:20px;line-height:18px;padding:0}
.browser-tab .tab-close:hover{background:rgba(0,0,0,.08);opacity:1}
.tab-add,.icon-btn{
  border:0;background:transparent;border-radius:8px;height:30px;min-width:30px;margin:0 4px 4px;
}
.tab-add:hover,.icon-btn:hover{background:rgba(0,0,0,.06)}
.title-actions{display:flex;justify-content:flex-end;padding-right:8px}

.app-body{height:calc(100% - 50px);display:flex;min-height:0}
.sidebar{
  width:var(--sidebar);flex:0 0 var(--sidebar);display:flex;flex-direction:column;
  padding:14px 10px 10px;background:rgba(240,242,247,.66);border-right:1px solid var(--stroke);
  transition:width .22s ease,flex-basis .22s ease,padding .22s ease;overflow:hidden
}
.sidebar.hidden{width:0;flex-basis:0;padding-left:0;padding-right:0;border-right:0}
.sidebar-top{display:grid;gap:9px;padding:0 4px 10px}
.search-box{display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.72);border:1px solid rgba(0,0,0,.06);padding:7px 9px;border-radius:9px}
.search-box input{border:0;outline:0;background:transparent;min-width:0;width:100%;font-size:12px}
.primary-btn{border:0;background:var(--blue);color:white;border-radius:9px;padding:8px 10px;font-size:12px;font-weight:600;box-shadow:0 3px 9px rgba(10,132,255,.18)}
.side-section{padding:9px 4px;border-top:1px solid rgba(0,0,0,.05);min-height:0}
.side-section:nth-of-type(2){flex:1;overflow:auto}
.side-section.compact{flex:0}
.side-label{font-size:10px;color:#8a8a90;font-weight:700;letter-spacing:.07em;padding:2px 7px 7px}
.note-list{display:grid;gap:2px}
.note-row,.side-action,.import-label{
  width:100%;border:0;background:transparent;text-align:left;border-radius:8px;padding:7px 8px;font-size:12px;cursor:pointer;display:block
}
.note-row:hover,.side-action:hover,.import-label:hover{background:rgba(0,0,0,.045)}
.note-row.active,.side-action.active{background:rgba(10,132,255,.11);color:#0066cc}
.note-row strong{display:block;font-weight:590;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.note-row small{display:block;color:#9a9aa0;margin-top:2px}
.sidebar-footer{margin-top:auto;border-top:1px solid rgba(0,0,0,.05);padding:7px 4px 0}

.workspace{flex:1;min-width:0;background:rgba(255,255,255,.84);display:flex;flex-direction:column}
.editor-head{padding:18px 34px 11px}
.note-title{font-size:28px;font-weight:720;letter-spacing:-.03em;border:0;outline:0;width:100%;background:transparent;color:#111}
.meta-line{font-size:11px;color:#9a9aa0;margin-top:4px}.dot{padding:0 4px}
.toolbar-wrap{padding:0 20px 8px;border-bottom:1px solid rgba(0,0,0,.055)}
.toolbar{
  min-height:39px;display:flex;align-items:center;gap:2px;overflow-x:auto;
  background:rgba(246,247,249,.78);border:1px solid rgba(0,0,0,.055);
  border-radius:11px;padding:4px;scrollbar-width:none
}
.toolbar::-webkit-scrollbar{display:none}
.toolbar button,.toolbar select,.color-chip{
  border:0;background:transparent;height:30px;border-radius:7px;padding:0 8px;font-size:12px;white-space:nowrap
}
.toolbar button:hover,.toolbar select:hover,.color-chip:hover{background:rgba(0,0,0,.055)}
.toolbar select{outline:none}
.divider{height:19px;width:1px;background:rgba(0,0,0,.08);margin:0 3px}
.color-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:30px;font-weight:600}
.color-chip input{position:absolute;opacity:0;width:1px;height:1px}
.color-chip:after{content:"";position:absolute;bottom:4px;left:7px;right:7px;height:2px;background:#1d1d1f;border-radius:2px}
.color-chip.highlight:after{background:#ffd60a}

.document-stage{flex:1;min-height:0;overflow:auto;padding:26px 34px 70px;transition:.2s ease}
.editor{
  min-height:calc(100% - 20px);outline:0;font-size:16px;line-height:1.55;
  overflow-wrap:anywhere;caret-color:var(--blue)
}
.editor:empty:before{content:attr(data-placeholder);color:#b2b2b7;pointer-events:none}
.document-stage.reading{background:#f7f7f7;padding-top:36px}
.document-stage.reading .editor,.document-stage.reading .attachment-tray{
  max-width:760px;margin-left:auto;margin-right:auto;background:white;
  border:1px solid rgba(0,0,0,.055);box-shadow:0 16px 36px rgba(0,0,0,.06)
}
.document-stage.reading .editor{min-height:850px;padding:58px 68px;font-family:Georgia,serif;font-size:17px;line-height:1.78}
.editor h1{font-size:2.05em;line-height:1.15;letter-spacing:-.035em;margin:1.1em 0 .45em}
.editor h2{font-size:1.55em;line-height:1.22;letter-spacing:-.025em;margin:1.1em 0 .4em}
.editor h3{font-size:1.24em;margin:1em 0 .35em}
.editor p{margin:.55em 0}.editor blockquote{border-left:3px solid #c7c7cc;padding-left:14px;color:#6e6e73;margin-left:0}
.editor pre{background:#f3f4f6;border-radius:10px;padding:13px;white-space:pre-wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em}
.editor table{border-collapse:collapse;width:100%;margin:16px 0}
.editor td,.editor th{border:1px solid #d7d7dc;padding:8px;min-width:60px}
.editor a{color:#0a66c2;text-decoration:none;border-bottom:1px solid rgba(10,102,194,.25)}
.editor img{max-width:100%;border-radius:10px}

.attachment-tray{display:flex;flex-wrap:wrap;gap:9px;padding-top:15px}
.attachment-chip{display:flex;align-items:center;gap:9px;max-width:340px;padding:8px 10px;border-radius:10px;background:#f2f3f6;border:1px solid rgba(0,0,0,.05);font-size:12px}
.attachment-chip .file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-chip a{color:#0a66c2;text-decoration:none}
.attachment-chip button{border:0;background:transparent;color:#8e8e93}

.dock{
  position:fixed;z-index:25;bottom:12px;left:50%;transform:translateX(-50%);
  display:flex;align-items:flex-end;gap:9px;padding:7px 10px;
  border:1px solid rgba(255,255,255,.72);border-radius:18px;
  background:rgba(247,248,252,.62);backdrop-filter:blur(26px) saturate(180%);
  box-shadow:0 10px 28px rgba(0,0,0,.16)
}
.dock-app{width:43px;height:43px;border:0;border-radius:12px;background:linear-gradient(180deg,#fff,#eceef3);font-size:20px;box-shadow:0 3px 10px rgba(0,0,0,.12);transition:.15s transform}
.dock-app:hover{transform:translateY(-7px) scale(1.08)}
.dock-app.active{background:linear-gradient(180deg,#fff9d9,#ffd66b)}

dialog{border:0}
.glass-dialog{
  width:min(1000px,calc(100vw - 40px));border-radius:22px;padding:0;overflow:hidden;
  background:rgba(251,251,253,.90);backdrop-filter:blur(30px);box-shadow:0 30px 100px rgba(0,0,0,.30);border:1px solid rgba(255,255,255,.85)
}
.glass-dialog::backdrop,.mini-dialog::backdrop{background:rgba(15,18,28,.22);backdrop-filter:blur(6px)}
.dialog-head{display:flex;align-items:center;justify-content:space-between;padding:20px 22px 10px}
.dialog-head small{font-size:10px;letter-spacing:.1em;color:#8e8e93;font-weight:700}
.dialog-head h2{margin:2px 0 0;font-size:24px}
.dialog-close{border:0;background:#e7e7eb;border-radius:50%;width:28px;height:28px;font-size:20px;line-height:24px}
.graph-summary{padding:0 22px 7px;font-size:13px;color:#6e6e73}
#graphCanvas{width:100%;height:auto;padding:10px 18px 22px}
.mindmap-dialog{width:min(1180px,calc(100vw - 34px))}
.mindmap-status{padding:0 22px 8px;color:#6e6e73;font-size:12px}
.mindmap-canvas-wrap{margin:0 18px 18px;border-radius:15px;background:linear-gradient(180deg,#fff,#f7f8fb);border:1px solid rgba(0,0,0,.06);overflow:auto}
#mindmapSvg{display:block;width:100%;min-width:850px;height:650px}
.mini-dialog{border-radius:12px;padding:6px;background:rgba(250,250,252,.96);box-shadow:0 18px 50px rgba(0,0,0,.22)}
.mini-dialog button{display:block;width:180px;border:0;background:transparent;text-align:left;padding:9px 11px;border-radius:7px}.mini-dialog button:hover{background:#ededf2}
.toast{position:fixed;z-index:50;right:20px;bottom:85px;opacity:0;transform:translateY(8px);pointer-events:none;background:rgba(28,28,30,.9);color:white;padding:9px 12px;border-radius:10px;font-size:12px;transition:.2s}
.toast.show{opacity:1;transform:translateY(0)}

@media (max-width:820px){
  :root{--sidebar:220px}
  .window-shell{padding:10px 8px 74px}
  .app-window{border-radius:16px}
  .window-titlebar{grid-template-columns:82px 1fr 42px}
  .menu-left span{display:none}
  .editor-head{padding:15px 18px 8px}
  .toolbar-wrap{padding:0 8px 8px}
  .document-stage{padding:20px 18px 65px}
  .note-title{font-size:24px}
}
@media (max-width:620px){
  .sidebar{position:absolute;z-index:15;height:calc(100% - 50px);box-shadow:14px 0 34px rgba(0,0,0,.12)}
  .sidebar.hidden{transform:translateX(-100%);width:var(--sidebar);flex-basis:var(--sidebar);padding:14px 10px 10px}
  .window-shell{padding-top:4px}
  .browser-tab{min-width:120px}
  .dock-app{width:38px;height:38px;font-size:17px}
}
