:root{
  --brand:#2563eb;--brand-strong:#1d4ed8;--brand-soft:#e8effc;--brand-line:#c9d9f5;
  --canvas:#f5f7fb;--surface:#fff;--surface-2:#f8faff;
  --ink:#172033;--ink-2:#41506a;--muted:#7c899e;--faint:#98a5b8;
  --line:#e4e9f2;--line-soft:#eef2f8;
  --success:#0f7a5a;--success-soft:#e7f4ee;--warning:#b45309;--danger:#b42318;
  --radius-sm:10px;--radius-md:14px;--radius-lg:18px;
  --shadow-1:0 1px 2px rgba(23,32,51,.04);--shadow-2:0 18px 48px rgba(30,55,100,.10);
  --font:"PingFang SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
body{
  margin:0;min-width:0;min-height:100vh;color:var(--ink);font-family:var(--font);line-height:1.6;
  background:
    radial-gradient(900px 480px at 6% -10%,rgba(37,99,235,.08),transparent 62%),
    radial-gradient(720px 400px at 100% 0,rgba(96,165,250,.07),transparent 60%),
    var(--canvas);
}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
button:disabled{opacity:.45;cursor:not-allowed}
a{color:inherit;text-decoration:none}
::selection{background:rgba(37,99,235,.16);color:var(--ink)}
:focus-visible{outline:2px solid var(--brand);outline-offset:3px}
h1,h2,h3,p{margin-top:0}
.muted{color:var(--muted)}
.eyebrow{display:inline-flex;align-items:center;color:var(--brand-strong);font-size:10px;font-weight:750;letter-spacing:.13em;text-transform:uppercase}
.eyebrow:before{content:"";width:14px;height:1px;margin-right:6px;background:var(--brand)}
.danger-text{color:var(--danger)}
.danger-text:before{background:var(--danger)}

/* 登录与账号权益 */
.session-loading{text-align:center;padding:80px 20px;color:var(--ink-2);font-size:14px}
.login-shell{width:min(980px,calc(100% - 48px));min-height:calc(100dvh - 69px);margin:auto;display:grid;grid-template-columns:minmax(0,1fr) 390px;align-items:center;gap:80px;padding:48px 0 64px}
.login-intro h1{font-size:clamp(30px,3vw,40px);line-height:1.35;letter-spacing:-1.3px;margin:18px 0 20px;max-width:380px;text-wrap:balance}
.login-intro h1>span{display:block}
.login-intro>p{max-width:365px;font-size:15px;line-height:1.9;color:var(--ink-2);margin-bottom:30px}
.login-benefit{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--ink-2);margin:16px 0}
.login-benefit svg{width:22px;height:22px;flex:none;color:var(--brand)}
.login-pricing{display:inline-block;margin-top:28px;color:var(--brand-strong);font-size:13px;text-underline-offset:4px}
.login-pricing:hover,.login-help:hover{text-decoration:underline}
.login-card{padding:30px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow-2)}
.login-mark{display:inline-flex;padding:8px;border:1px solid var(--line-soft);border-radius:16px;background:var(--surface-2);margin-bottom:16px}
.login-mark img{border-radius:11px;display:block}
.login-card h2{font-size:22px;letter-spacing:-.5px;margin:0 0 6px}
.login-subtitle{font-size:12px;color:var(--ink-2);margin-bottom:26px;line-height:1.6}
.login-card label{display:block;font-size:12px;font-weight:650;color:var(--ink-2);margin:16px 0 7px}
.login-card input{display:block;width:100%;height:46px;padding:0 12px;border:1px solid #d8e1ed;border-radius:10px;background:var(--surface-2);outline:none;font-size:14px}
.login-card input:focus{background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.login-card #loginBtn{width:100%;min-height:46px;margin-top:8px;font-size:14px}
.login-card .notice{min-height:20px}
.password-hint,.code-hint{font-size:12px;color:var(--ink-2);line-height:1.6;margin:7px 0 0}
.code-hint.sent{color:var(--success)}
.register-code-row{display:flex;align-items:stretch;gap:8px}
.register-code-row input{flex:1;min-width:0}
.register-code-row button{flex:none;min-height:46px;min-width:104px;font-size:12px;padding:8px 12px}
.register-note{border-top:1px solid var(--line-soft);padding-top:20px;margin:23px 0 9px;font-size:12px;line-height:1.8;color:var(--ink-2)}
.register-note a{display:inline-flex;align-items:center;min-height:32px;margin-left:6px;color:var(--brand-strong);font-weight:650;text-underline-offset:4px}
.register-note a:hover{text-decoration:underline}
.login-help{display:inline-block;color:var(--brand-strong);font-size:12px;padding:6px 0}
.profile-card{display:grid;grid-template-columns:minmax(210px,.95fr) minmax(360px,1.55fr) auto;align-items:center;gap:22px;margin-top:12px;padding:16px 20px;border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface);box-shadow:var(--shadow-1)}
.profile-identity{min-width:0}
.profile-identity .eyebrow{font-size:11px}
.account-email{display:block;overflow-wrap:anywhere;font-size:17px;color:var(--ink)}
.profile-plan{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:8px}
.plan-badge{padding:4px 9px;border:1px solid var(--brand-line);border-radius:6px;background:var(--brand-soft);color:var(--brand-strong);font-size:12px;font-weight:650}
.account-expiry{margin:0;color:var(--ink-2);font-size:12px}
.profile-quotas{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;padding:0}
.profile-quotas>div{min-width:0;padding:2px 15px;border-left:1px solid var(--line-soft)}
.profile-quotas dt{color:var(--muted);font-size:12px;line-height:1.45}
.profile-quotas dd{margin:6px 0 0;color:var(--ink);font-size:15px;font-weight:700;overflow-wrap:anywhere}
.profile-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;min-width:144px}
.profile-action{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink-2);font-size:12px;font-weight:600;white-space:nowrap}
a.profile-action{color:var(--brand-strong);border-color:var(--brand-line);background:#f8faff}
.profile-action:hover:not(:disabled){background:var(--surface-2);border-color:var(--brand-line)}
.profile-action.quiet{border-color:transparent;background:transparent;color:var(--muted)}
.profile-action.quiet:hover:not(:disabled){color:var(--danger);background:#fff2f0}
.profile-action:disabled{opacity:.5;cursor:wait}
.account-status{flex-basis:100%;min-height:0;color:var(--danger);font-size:10.5px;line-height:1.5;text-align:right;overflow-wrap:anywhere}
.account-status:not(:empty){min-height:16px}

/* 页面骨架 */
.app-main{width:min(1380px,calc(100% - 40px));margin:0 auto;padding:20px 0 36px}
.cloud-note{display:flex;align-items:center;gap:12px;padding:13px 16px;border:1px solid var(--brand-line);border-radius:14px;background:linear-gradient(120deg,#f6f9ff,#eef4ff);box-shadow:var(--shadow-1)}
.cloud-icon{width:38px;height:38px;flex:none;border-radius:11px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand-strong)}
.cloud-icon svg{width:20px;height:20px}
.cloud-copy{min-width:0;flex:1}
.cloud-copy strong{display:block;font-size:12.8px;color:var(--ink)}
.cloud-copy small{display:block;margin-top:2px;color:var(--ink-2);font-size:11.8px;line-height:1.55}
.sync-state{flex:none;padding:4px 9px;border:1px solid var(--brand-line);border-radius:999px;background:#fff;color:var(--brand-strong);font-size:10.5px;font-weight:700;white-space:nowrap}
.workspace{display:grid;grid-template-columns:266px minmax(0,1fr);gap:16px;margin-top:16px;align-items:start}
.sidebar,.content{border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:var(--shadow-1)}
.sidebar{position:sticky;top:88px;max-height:calc(100vh - 108px);padding:18px 12px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:#dbe3f0 transparent}
.side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 6px 14px}
.side-head h2{margin:4px 0 0;font-size:17px;letter-spacing:-.3px;color:var(--ink)}
.icon-btn{width:32px;height:32px;flex:none;display:grid;place-items:center;border-radius:9px;color:var(--muted);transition:background .16s,color .16s}
.icon-btn:hover{background:var(--brand-soft);color:var(--brand-strong)}
.icon-btn svg{width:16px;height:16px}
.folder-row{display:flex;align-items:center;gap:9px;width:100%;min-height:36px;padding:8px 10px;border-radius:9px;color:var(--ink-2);font-size:12.5px;font-weight:550;text-align:left;transition:background .14s,color .14s}
.folder-row:hover{background:var(--surface-2);color:var(--brand-strong)}
.folder-row.active{background:var(--brand-soft);color:var(--brand-strong);font-weight:700;box-shadow:inset 0 0 0 1px rgba(37,99,235,.08)}
.all-icon,.folder-icon{width:17px;height:17px;flex:none;color:var(--faint)}
.folder-row.active .all-icon,.folder-row.active .folder-icon{color:var(--brand)}
.all-icon svg,.folder-icon svg{width:17px;height:17px}
.folder-row>span:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.folder-row .count{margin-left:auto;color:var(--faint);font-size:10.5px;font-weight:650}
.folder-entry{display:flex;align-items:center;min-width:0;gap:1px}
.folder-entry>.folder-row{flex:1;min-width:0}
.folder-sort{display:flex;flex:none;gap:0}
.folder-entry .folder-sort button{width:24px;height:30px;padding:3px;border-radius:7px}
.tree-label{margin:17px 9px 6px;color:var(--faint);font-size:9.5px;font-weight:750;letter-spacing:.12em;text-transform:uppercase}
.add-folder{display:flex;align-items:center;gap:6px;margin:10px 0 0 7px;padding:6px;color:var(--brand-strong);font-size:11.5px;font-weight:650}
.add-folder:hover{text-decoration:underline}
.side-note{display:flex;align-items:center;gap:6px;margin:15px 7px 0;padding-top:11px;border-top:1px solid var(--line-soft);color:var(--faint);font-size:10.5px;line-height:1.5}
.note-dot{width:5px;height:5px;border-radius:50%;background:var(--success);box-shadow:0 0 0 3px var(--success-soft);flex:none}

/* 主内容 */
.content{min-width:0;padding:24px 26px 20px}
.content-head{display:flex;justify-content:space-between;align-items:center;gap:18px}
.heading-copy{min-width:0}
.breadcrumbs{color:var(--faint);font-size:11px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.content-head h1{font-size:25px;margin:6px 0 4px;letter-spacing:-.55px;color:var(--ink);overflow-wrap:anywhere}
.compact{margin:0;font-size:12px}
.actions{display:flex;align-items:center;gap:8px;flex:none}
.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:8px 14px;border-radius:9px;font-size:12.5px;font-weight:650;white-space:nowrap;transition:background .16s,border-color .16s,box-shadow .16s,transform .16s}
.primary{color:#fff;background:linear-gradient(180deg,#2f6ff0,#2563eb);border:1px solid #2563eb;box-shadow:0 6px 14px rgba(37,99,235,.20)}
.primary:hover:not(:disabled){background:linear-gradient(180deg,#2563eb,#1d4ed8);transform:translateY(-1px)}
.secondary{color:var(--ink-2);background:#fff;border:1px solid var(--line)}
.secondary:hover:not(:disabled){border-color:var(--brand-line);background:var(--brand-soft);color:var(--brand-strong)}
.danger{color:#fff;background:var(--danger);border:1px solid var(--danger)}
.danger:hover:not(:disabled){background:#981b13}
.toolbar{display:flex;align-items:center;gap:9px;margin:22px 0 8px}
.search{height:40px;flex:1;min-width:0;display:flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--faint);transition:border-color .16s,box-shadow .16s,background .16s}
.search:focus-within{border-color:var(--brand);background:#fff;box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.search svg{width:16px;height:16px;flex:none}
.search input{width:100%;border:0;outline:0;background:transparent;color:var(--ink);font-size:12.5px}
.search input::placeholder{color:#9aa7ba}
.toolbar select{height:40px;max-width:180px;padding:0 34px 0 11px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink-2);font-size:12px;outline:0}
.toolbar select:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.sort-hint{font-size:11px;color:var(--faint);line-height:1.6;margin:0 0 8px}
.bookmark-list{display:flex;flex-direction:column;margin-top:5px}
.item{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 6px;border-bottom:1px solid var(--line-soft);min-width:0}
.item:last-child{border-bottom:0}
.item:hover{background:#fbfcff;border-radius:10px}
.favicon,.folder-tile{width:36px;height:36px;border-radius:9px;background:var(--brand-soft);display:grid;place-items:center;color:var(--brand-strong);font-weight:700;flex:none;overflow:hidden;position:relative}
.folder-tile svg{width:19px;height:19px}
.favicon img{position:absolute;width:22px;height:22px;inset:0;margin:auto;object-fit:contain}
.favicon.has-icon .favicon-fallback{visibility:hidden}
.item-main{min-width:0}
.item-title{font-size:12.8px;font-weight:650;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.title-button,.title-link{display:block;padding:0;text-align:left;background:none;color:inherit;text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.title-button:hover,.title-link:hover{color:var(--brand-strong);text-decoration:underline}
.item-url{display:block;font-size:10.8px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;text-decoration:none}
.item-url:hover{color:var(--brand-strong)}
.item-actions{display:flex;align-items:center;gap:3px;flex:none}
.item-actions button{width:31px;height:31px;display:inline-flex;align-items:center;justify-content:center;padding:5px;border-radius:8px;color:var(--muted);background:transparent;transition:background .14s,color .14s}
.item-actions button:hover{background:var(--brand-soft);color:var(--brand-strong)}
.item-actions [data-delete]:hover{background:#fdeeee;color:var(--danger)}
.item-actions button:disabled{opacity:.3;background:transparent}
.item-actions svg{width:16px;height:16px}
.empty{text-align:center;padding:72px 20px;color:var(--muted)}
.empty-icon{width:52px;height:52px;margin:0 auto;display:grid;place-items:center;border-radius:14px;background:var(--brand-soft);color:var(--brand-strong)}
.empty-icon svg{width:25px;height:25px}
.empty h3{color:var(--ink-2);font-size:15px;margin:13px 0 5px}
.empty p{font-size:12px;margin:0}
.pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:20px;color:var(--muted);font-size:12px}
.pagination .secondary{min-height:34px;padding:6px 12px;font-size:12px}

/* 弹窗 */
dialog{position:fixed;inset:0;margin:auto;width:min(470px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid var(--line);border-radius:16px;padding:24px;background:var(--surface);color:var(--ink);box-shadow:0 24px 90px rgba(18,32,64,.25)}
dialog::backdrop{background:rgba(23,32,51,.42);backdrop-filter:blur(3px)}
.dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.dialog-head h2{font-size:19px;margin:5px 0 14px;color:var(--ink)}
.dialog-head .icon-btn{font-size:20px;line-height:1;width:30px;height:30px}
dialog label{display:block;font-size:12px;font-weight:650;color:var(--ink-2);margin:14px 0}
dialog label input,dialog label select{display:block;width:100%;height:42px;margin-top:7px;padding:0 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);color:var(--ink);outline:0}
dialog label input:focus,dialog label select:focus{background:#fff;border-color:var(--brand);box-shadow:0 0 0 3px rgba(37,99,235,.10)}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:21px}
.dialog-actions .primary,.dialog-actions .secondary,.dialog-actions .danger{min-height:38px}
.notice{min-height:18px;color:var(--danger);font-size:12px;line-height:1.65;margin:10px 0 0}
.delete-message{line-height:1.7;overflow-wrap:anywhere;color:var(--ink-2);font-size:13px}
dialog .muted{font-size:12px;line-height:1.7}

/* 提示 */
.toast{position:fixed;bottom:26px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;transition:.2s;background:#1e3358;color:#fff;padding:10px 16px;border-radius:9px;font-size:12px;box-shadow:0 8px 24px rgba(15,32,64,.25);z-index:100;max-width:calc(100vw - 30px)}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-width:980px){
  .app-main{width:calc(100% - 28px)}
  .login-shell{gap:40px;grid-template-columns:minmax(0,1fr) 360px}
  .workspace{grid-template-columns:230px minmax(0,1fr)}
  .content{padding:21px 18px 18px}
  .profile-card{grid-template-columns:minmax(0,1fr) auto;gap:13px 18px;padding:14px 16px}
  .profile-identity{grid-column:1/-1}
  .profile-quotas{grid-column:1;grid-row:2}
  .profile-quotas>div:first-child{padding-left:0;border-left:0}
  .profile-actions{grid-column:2;grid-row:2}
}
@media(max-width:800px){
  .login-shell{display:block;width:min(440px,calc(100% - 32px));min-height:0;padding:32px 0}
  .login-intro{margin:0 4px 24px}
  .login-intro h1{font-size:27px;margin:12px 0}
  .login-intro>p{font-size:13px;margin:0;max-width:none}
  .login-benefit{display:none}
  .login-pricing{margin-top:12px}
  .login-card{padding:24px}
  .cloud-note{align-items:flex-start;padding:12px}
  .cloud-copy small{font-size:11px}
  .profile-card{grid-template-columns:minmax(0,1fr);gap:13px;padding:14px}
  .profile-identity,.profile-quotas,.profile-actions{grid-column:1;grid-row:auto}
  .profile-quotas>div{padding:2px 9px}
  .profile-actions{justify-content:flex-start}
  .account-status{text-align:left}
  .workspace{display:block}
  .sidebar{position:static;max-height:none;padding:14px 12px 12px;margin-bottom:12px}
  .side-head{padding-bottom:9px}
  .sidebar nav{display:flex;overflow-x:auto;gap:4px;padding-bottom:2px}
  .folder-entry{flex:none}
  .folder-entry>.folder-row{min-width:max-content}
  .folder-row{padding:7px 10px!important}
  .folder-row .count{display:none}
  .tree-label{display:none}
  .folder-sort{display:none}
  .add-folder{margin-top:8px;padding:6px 8px}
  .side-note{display:none}
  .content{padding:19px 14px 16px}
  .content-head{align-items:flex-start;flex-direction:column;gap:13px}
  .content-head h1{font-size:22px}
  .actions{width:100%}
  .actions .primary,.actions .secondary{flex:1}
  .toolbar{margin-top:17px}
  .toolbar select{max-width:145px}
  .item{grid-template-columns:36px minmax(0,1fr);gap:9px;padding:11px 2px}
  .item-actions{grid-column:2;justify-self:end;margin-top:2px}
  .notice{font-size:11.5px}
  .sync-state{white-space:nowrap}
}
@media(max-width:480px){
  .profile-card{grid-template-columns:minmax(0,1fr);gap:13px;padding:14px}
  .profile-identity,.profile-quotas,.profile-actions{grid-column:1;grid-row:auto}
  .profile-quotas>div{padding:2px 9px}
  .profile-actions{justify-content:flex-start}
  .account-status{text-align:left}
  .login-shell{padding:24px 0}
  .login-intro h1{font-size:25px}
  .toolbar{flex-wrap:wrap}
  .toolbar .search{flex-basis:100%}
  .toolbar select{width:100%;max-width:none}
  .cloud-copy strong{font-size:12px}
  .sync-state{display:none}
  .item-actions button{width:29px;height:31px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
