:root { --ink: #252c3e; --purple: #7360dd; --line: #eceef3; --bg: #f7f8fb; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter,"Segoe UI","Microsoft YaHei",sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
button { font: inherit; -webkit-tap-highlight-color: transparent; cursor: pointer; transition: background .18s,transform .18s; border: 0; background: none; color: inherit; }
input { font: inherit; -webkit-tap-highlight-color: transparent; }
select { font: inherit; -webkit-tap-highlight-color: transparent; padding: 11px; border: 1px solid #e6e9ef; border-radius: 8px; color: #7b8395; font-size: 12px; appearance: none; -webkit-appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23828b9e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center/14px 14px; }
textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; color: inherit; text-decoration: none; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:hover:not(:disabled) { filter: brightness(.97); }
:focus { outline: none; }
button:focus-visible { outline: 2px solid #b6aafa; outline-offset: 3px; }
a:focus-visible { outline: 2px solid #b6aafa; outline-offset: 3px; }
.note-card:focus-visible { outline: 2px solid #b6aafa; outline-offset: 3px; }
summary:focus-visible { outline: 2px solid #b6aafa; outline-offset: 3px; }
input:focus { outline: none; box-shadow: none; }
textarea:focus { outline: none; box-shadow: none; }
select:focus { outline: none; box-shadow: none; }
[hidden] { display: none!important; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 244px; position: fixed; inset: 0 auto 0 0; background: #fff; border-right: 1px solid var(--line); padding: 35px 24px; display: flex; flex-direction: column; z-index: 2; padding-bottom: 24px; }
.brand { display: flex; gap: 13px; align-items: center; font-size: 25px; font-weight: 750; letter-spacing: 2px; }
.brand-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: var(--purple); color: white; font-size: 23px; box-shadow: 0 6px 15px #7360dd22; }
.brand small { display: block; font-size: 9px; letter-spacing: 2px; color: #9693a6; margin-top: 5px; font-weight: 500; }
.primary { padding: 12px 21px; border-radius: 9px; background: var(--purple); color: #fff; font-weight: 600; box-shadow: 0 5px 12px #7360dd16; }
.new-button { margin: 39px 0 31px; padding: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nav-label { font-size: 11px; color: #9ca1b1; margin: 0 12px 13px; letter-spacing: 1px; }
.nav-item { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 8px; margin-bottom: 7px; color: #72798a; text-align: left; }
.nav-item.active { background: #f0ecff; color: var(--purple); font-weight: 600; }
.nav-item b { font-size: 11px; font-weight: 500; padding: 2px 7px; background: #f2f3f7; border-radius: 5px; }
.nav-item.active b { background: #e4ddfc; }
.category-heading { margin-top: 33px; }
.category-item { display: flex; gap: 11px; align-items: center; width: 100%; padding: 11px 14px; text-align: left; color: #737b8d; overflow-wrap: anywhere; }
.category-item.active { background: #f5f2ff; color: var(--purple); border-radius: 8px; }
.category-dot { flex-shrink: 0; width: 12px; height: 12px; color: #b7a8ed; }
.category-item:nth-child(3n+2) .category-dot { color: #8ec4ad; }
.category-item:nth-child(3n) .category-dot { color: #edba89; }
#categories { overflow: auto; max-height: 32vh; }
.sidebar-footer { color: #9298a7; font-size: 11px; padding: 22px 0 0; margin-top: auto; flex-shrink: 0; }
main { width: calc(100% - 244px); margin-left: 244px; }
header { background: #ffffffb0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 45px; height: 86px; }
.breadcrumb { font-size: 12px; color: #9298a6; }
.breadcrumb span { padding: 0 13px; color: #c2c6d0; }
.breadcrumb strong { font-weight: 500; color: #626b7f; }
.header-right { display: flex; align-items: center; font-size: 12px; color: #9298a6; gap: 17px; }
.avatar { width: 33px; height: 33px; display: grid; place-items: center; border: 3px solid white; border-radius: 50%; background: #ede8fc; color: #8a74ce; font-size: 12px; }
.workspace { max-width: 1440px; margin: auto; padding: 35px 45px 20px; padding-top: 34px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 22px; }
.list-toolbar h2 { font-size: 18px; margin: 0 0 8px; font-weight: 650; }
.list-toolbar>div>span { font-size: 11px; color: #969eaf; }
.filters { display: flex; gap: 10px; align-items: center; }
.search { background: white; border: 1px solid #e6e9ef; border-radius: 8px; display: flex; align-items: center; padding: 0 11px; gap: 8px; }
.search span { font-size: 25px; color: #a1a8b7; }
.search input { width: 185px; border: 0; background: none; font-size: 12px; padding: 11px 0; color: var(--ink); min-width: 0; }
.search input::placeholder { color: #a8aebb; }
.note-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.note-card { position: relative; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow 180ms, border-color 180ms; cursor: pointer; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 28px; padding: 22px 25px; }
.note-card:hover { box-shadow: 0 6px 22px #27304a08; border-color: #e0d9f6; }
.card-top { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.badge { font-size: 10px; padding: 5px 9px; border-radius: 5px; color: #8d78bf; background: #f3effb; max-width: 85%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card:nth-child(3n+2) .badge { background: #eaf5ef; color: #6c9e88; }
.note-card:nth-child(3n) .badge { background: #fff2e6; color: #ba9469; }
.pin { font-size: 13px; color: #e0a534; }
.note-card h3 { font-size: 16px; line-height: 1.6; font-weight: 650; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 6px; -webkit-line-clamp: 1; }
.excerpt { color: #9299a8; font-size: 12px; line-height: 1.9; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; -webkit-line-clamp: 1; }
.card-bottom { color: #a3a9b6; justify-content: space-between; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 24px; margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-size: 11px; line-height: 1.8; }
.card-actions { display: flex; gap: 7px; }
.card-actions button { color: #8f96a6; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 6px; border-radius: 5px; }
.card-actions button:hover { color: var(--purple); }
.card-actions .pin-button.is-pinned { color: #e0a534; background: #fff7e5; }
.card-actions .pin-button.is-pinned:hover { color: #cb9021; background: #fff0cb; }
.empty { text-align: center; padding: 65px 20px; color: #9a9fb0; border: 1px dashed #dcdfe9; border-radius: 12px; background: #ffffff60; }
.empty>div { font-size: 38px; color: #b6a8e1; }
.empty h3 { font-size: 17px; color: #727a90; font-weight: 500; }
.empty p { font-size: 12px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid #e8ebf0; padding-top: 20px; margin-top: 35px; font-size: 10px; color: #b1b6c2; }
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at top,#ede7ff,transparent 70%); padding: 22px; }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 40px; box-shadow: 0 20px 80px #61507e0c; }
.auth h1 { font-size: 23px; line-height: 1.6; margin-top: 26px; }
.auth p { color: #9299a9; font-size: 12px; line-height: 1.8; }
.auth label { display: block; margin-top: 22px; font-size: 12px; color: #737b8c; }
.auth input { width: 100%; padding: 12px; border: 1px solid #e1e4ec; border-radius: 8px; margin-top: 9px; }
.auth .primary { width: 100%; margin-top: 25px; }
#authError { color: #bf606e; }
dialog { border: 1px solid #e7e6ef; border-radius: 15px; padding: 0; box-shadow: 0 12px 40px #25214020; width: min(860px,94vw); max-height: 90dvh; color: var(--ink); transform-origin: center center; }
dialog::backdrop { background: #2527394d; }
.dialog-top { padding: 18px 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 13px; }
.dialog-bottom { padding: 18px 26px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; border-bottom: 0; border-top: 1px solid var(--line); gap: 10px; }
.dialog-bottom>span { font-size: 11px; color: #9a9fb0; }
.dialog-bottom>div { display: flex; gap: 10px; }
.icon-button { font-size: 18px; color: #969bad; padding: 3px 7px; display: inline-flex; align-items: center; justify-content: center; }
.editor-body { padding: 25px 28px; }
#title { width: 100%; font-size: 25px; font-weight: 600; border: 0; padding: 10px 0; color: var(--ink); }
#title::placeholder { color: #bbbcc8; }
.editor-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 15px 0 20px; font-size: 11px; color: #a1a7b5; }
.editor-meta input { width: 120px; padding: 7px 9px; border: 1px solid #e9e5f6; border-radius: 6px; background: #f8f6fe; color: #8c7aaf; font-size: 11px; margin-left: 6px; }
#content { width: 100%; height: 40vh; min-height: 180px; resize: vertical; border: 0; font-size: 14px; line-height: 2; color: #646e83; padding: 8px 0; }
#content::placeholder { color: #b5bac6; }
.secondary { border: 1px solid #e3e5ec; border-radius: 8px; padding: 11px 15px; color: #858b9d; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#toast { position: fixed; top: 25px; left: 50%; transform: translateX(-50%); z-index: 100; background: #353247; color: #fff; border-radius: 9px; padding: 13px 23px; box-shadow: 0 8px 20px #0002; display: none; max-width: 90vw; font-size: 13px; }
#toast.show { display: block; }
#historyList { padding: 20px; max-height: 65vh; overflow: auto; }
#historyList details { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
#historyList summary { cursor: pointer; color: #8c7aaf; list-style: none; display: flex; align-items: center; gap: 8px; }
#historyList pre { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; color: #778094; line-height: 1.9; }
#historyList h3 { overflow-wrap: anywhere; }
.header-right #logout { margin: 0; display: flex; align-items: center; gap: 6px; border-radius: 10px; background: #f4f1fa; padding: 10px 12px; font-size: 11px; color: #a08cb7; }
.icon { display: inline-block; width: 18px; height: 18px; vertical-align: middle; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-icon .icon { width: 25px; height: 25px; }
.avatar .icon { width: 16px; height: 16px; }
.nav-item>span { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-start; }
#logout { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pin .icon { width: 15px; height: 15px; }
.card-actions .icon { width: 16px; height: 16px; }
.search>span { display: flex; align-items: center; }
.search .icon { width: 17px; height: 17px; }
.empty>div .icon { width: 38px; height: 38px; }
.category-dot .icon { width: 12px; height: 12px; vertical-align: top; }
.breadcrumb>span { padding: 0 9px; }
.breadcrumb .icon { width: 12px; height: 12px; }
#historyList summary::-webkit-details-marker { display: none; }
#historyList summary .icon { width: 14px; height: 14px; }
#historyList details[open] summary .icon { transform: rotate(90deg); }
.note-summary { min-width: 0; }
.card-bottom>div:first-child { white-space: nowrap; }
.card-actions .copy-button { gap: 6px; padding: 6px 10px; color: var(--purple); background: #f3effc; font-size: 12px; }
.secondary .icon { width: 15px; height: 15px; }
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: var(--bg); color: #949bad; font-size: 13px; }
.boot p { max-width: 460px; line-height: 1.8; margin: 0; }
.boot-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #9e90cf; background: #efebfa; border-radius: 12px; }
.boot-mark .icon { width: 23px; height: 23px; }
.boot .secondary { margin-top: 8px; }
.sidebar-top { flex-shrink: 0; }
.sidebar-actions { width: 100%; }
.sidebar-actions .new-button { width: 100%; }
.menu-toggle { display: none; }
.sidebar-menu { min-height: 0; overflow: auto; }
.menu-inner { min-height: 0; }
.sidebar-stats { padding: 16px; background: linear-gradient(140deg,#f5f2fc,#f8f9fc); border: 1px solid #eeeaf7; border-radius: 12px; }
.stats-heading { font-size: 10px; letter-spacing: 1.5px; color: #a29ab5; margin-bottom: 14px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.stat-row>span { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #8b859b; }
.stat-row .icon { width: 14px; height: 14px; color: #b0a2d3; }
.stat-row strong { font-size: 14px; font-weight: 600; color: #706187; font-variant-numeric: tabular-nums; }
.date-chip { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #9b9fad; }
.date-chip .icon { width: 15px; height: 15px; color: #aca5bc; }
.account-card { display: flex; align-items: center; gap: 10px; padding: 7px 15px 7px 8px; background: #fff; border: 1px solid #ece8f6; border-radius: 40px; box-shadow: 0 3px 12px #74618d05; }
.account-card .avatar { width: 34px; height: 34px; border: 0; background: linear-gradient(135deg,#e8defb,#f2eefb); color: #927bbf; }
.account-card .avatar .icon { width: 18px; height: 18px; }
.account-copy strong { display: block; font-size: 11px; font-weight: 600; color: #6f6386; }
.account-copy small { display: block; font-size: 9px; color: #b0a9bd; margin-top: 4px; }
.logout-button .icon { width: 15px; height: 15px; }
.header-right #logout:hover { background: #ece6f7; color: #806398; }

@media(max-width:1200px) {
  .sidebar { width: 210px; padding: 30px 18px; }
  main { margin-left: 210px; width: calc(100% - 210px); }
  header { padding: 0 28px; }
  .workspace { padding: 28px; }
  .note-grid { grid-template-columns: minmax(0,1fr); }
  .list-toolbar { align-items: flex-start; }
}

@media(max-width:800px) {
  .sidebar { width: 175px; padding: 25px 12px; }
  main { margin-left: 175px; width: calc(100% - 175px); }
  .workspace { padding: 22px; }
  .list-toolbar { flex-direction: column; align-items: stretch; }
  .filters { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .note-card { gap: 18px; padding: 19px; }
  .card-bottom { padding-left: 17px; font-size: 10px; }
}

@media(max-width:560px) {
  .shell { display: block; }
  .sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr auto; gap: 18px; display: block; padding: 16px 18px; position: relative; }
  .brand { gap: 8px; font-size: 21px; }
  .brand-icon { font-size: 21px; width: 35px; height: 35px; }
  .brand small { font-size: 7px; letter-spacing: 1.5px; }
  .new-button { margin: 0; padding: 11px 15px; align-self: center; gap: 6px; }
  .sidebar .nav-label { display: none; }
  .sidebar-footer { display: none; }
  .category-heading { display: none; }
  #categories { display: none; }
  nav { display: flex; grid-column: 1/-1; gap: 8px; }
  .nav-item { margin: 0; justify-content: center; gap: 8px; padding: 10px 6px; font-size: 12px; }
  .nav-item b { font-size: 10px; }
  main { width: 100%; margin: 0; }
  header { height: 67px; padding: 0 18px; }
  .header-right { gap: 8px; }
  .avatar { width: 28px; height: 28px; }
  .workspace { padding: 20px 17px; padding-top: 25px; }
  .note-grid { grid-template-columns: 1fr; }
  .note-card { grid-template-columns: minmax(0,1fr); gap: 14px; padding: 19px; min-height: 0; }
  .list-toolbar { gap: 16px; }
  .list-toolbar h2 { font-size: 17px; }
  .search input { font-size: 11px; }
  .filters { gap: 8px; }
  select { font-size: 11px; padding: 11px 7px; padding-right: 27px; }
  footer { font-size: 9px; }
  footer span { display: none; }
  .auth-card { padding: 30px 25px; }
  .auth h1 { font-size: 22px; }
  .editor-body { padding: 16px 20px; }
  #title { font-size: 21px; }
  .editor-meta { flex-wrap: wrap; line-height: 1.6; }
  .dialog-top { padding: 14px 18px; }
  .dialog-bottom { padding: 14px 18px; flex-wrap: wrap; }
  .dialog-bottom .primary { font-size: 12px; padding: 10px 9px; }
  .dialog-bottom .secondary { font-size: 12px; padding: 10px 9px; }
  .dialog-bottom>span { max-width: 100px; font-size: 10px; }
  dialog { max-height: 95dvh; }
  #content { height: 40dvh; }
  .nav-item>span { gap: 5px; }
  .nav-item .icon { width: 15px; height: 15px; }
  .note-card h3 { -webkit-line-clamp: 2; font-size: 16px; }
  .card-bottom { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; flex-direction: row; align-items: center; gap: 8px; }
  .card-actions { gap: 5px; }
  .dialog-bottom>div { margin-left: auto; gap: 6px; }
  .sidebar-top { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; }
  .sidebar-actions { width: auto; display: flex; align-items: center; gap: 9px; }
  .sidebar-actions .new-button { width: auto; margin: 0; padding: 10px 12px; font-size: 12px; border-radius: 10px; box-shadow: none; }
  .new-button .icon { width: 16px; height: 16px; }
  .menu-toggle { display: grid; place-items: center; width: 37px; height: 37px; border: 1px solid #ebe7f4; border-radius: 10px; background: #f6f3fc; color: #8b78b3; }
  .menu-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .menu-line { transform-origin: 12px 12px; transition: transform 180ms ease,opacity 120ms ease; }
  .menu-open .line-top { transform: translateY(6px) rotate(45deg); transform-origin: 12px 6px; }
  .menu-open .line-middle { opacity: 0; transform: scaleX(.3); }
  .menu-open .line-bottom { transform: translateY(-6px) rotate(-45deg); transform-origin: 12px 18px; }
  .sidebar-menu { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; overflow: hidden; transition: grid-template-rows 200ms ease,opacity 160ms ease,visibility 200ms; }
  .menu-open .sidebar-menu { grid-template-rows: 1fr; opacity: 1; visibility: visible; }
  .menu-inner { min-height: 0; overflow: hidden; }
  .sidebar .menu-inner .nav-label { display: block; margin: 19px 10px 10px; font-size: 10px; }
  .sidebar .menu-inner .category-heading { display: block; margin-top: 17px; }
  .sidebar .menu-inner nav { display: flex; flex-direction: column; gap: 4px; }
  .sidebar .menu-inner .nav-item { justify-content: space-between; padding: 11px 12px; font-size: 12px; }
  .sidebar .menu-inner #categories { display: block; max-height: 30vh; overflow: auto; padding-bottom: 5px; }
  .category-item { padding: 10px 13px; font-size: 12px; }
  .sidebar .sidebar-footer { display: none; }
  .breadcrumb { font-size: 11px; }
  .breadcrumb>span { padding: 0 4px; }
  .account-card { padding: 5px; box-shadow: none; background: none; border: 0; }
  .account-copy { display: none; }
  .account-card .avatar { width: 30px; height: 30px; }
  .header-right #logout { padding: 8px; border-radius: 9px; }
  .header-right #logout>span { display: none; }
}

@media(prefers-reduced-motion:reduce) {
  * { transition: none!important; }
}

@media(max-width:1100px) {
  .date-chip { display: none; }
}
