:root {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1d1732;
  background: #fff;
  --purple: #6845f7;
  --muted: #665f78;
  --subtle: #88829c;
  --line: #ebe7f2;
  --soft: #f0ebff;
  --sidebar: #faf9fc;
  --gutter: clamp(18px, 2.25vw, 36px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
button, input, select { font: inherit; color: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px 12px; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
:focus { outline: none; }
button svg, .search-field svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary { background: var(--purple); border-color: transparent; color: white; font-weight: 650; }
h1, h2, p { margin: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 8px var(--gutter); background: #251a38; color: #f4effd; }
.enterprise, .account-pill { min-width: 0; display: flex; align-items: center; gap: 9px; }
#account, #account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#account { font-size: 15px; }
.topbar .top-icon { padding: 4px 6px; background: transparent; color: #e2d5f3; border: 0; border-radius: 999px; flex: none; line-height: 1; }
.topbar .top-icon:hover { background: #ffffff20; }

.account-pill { padding: 4px 6px 4px 4px; border-radius: 999px; background: #3b2b54; gap: 7px; font-size: 13px; }
#avatar { flex: none; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #7359bd; }
#account-phone { color: #d6c9e8; white-space: nowrap; }
.account-divider { width: 1px; height: 15px; background: #66527d; }
.topbar .logout { display: grid; place-items: center; color: #ffaaa7; }

.login-layout { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-height: 540px; }
.login-art { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: #fff; }
.login-brand { display: flex; align-items: center; }
.login-pane { display: grid; place-items: center; }
#login, #company, dialog form { display: grid; gap: 14px; }
#login { width: min(100%, 380px); }
#login p { color: var(--muted); }
#login label { display: grid; font-weight: 600; }
#login input { width: 100%; min-width: 0; font-weight: 400; }
#login .primary { min-height: 44px; margin-top: 4px; }
#login #login-error { color: #a3263f; }
.password-field button { color: #5934d2; border: none; }
#company { width: min(calc(100% - 28px),380px); margin: 15px auto; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }

#manager { display: grid; grid-template-columns: clamp(168px,21vw,242px) minmax(0,1fr); flex: 1; background: #fff; }
#manager aside { display: flex; flex-direction: column; gap: 18px; padding: 17px 13px; background: #f9f8fc; border-right: 1px solid var(--line); }
nav { display: grid; gap: 4px; }
nav button, .management-nav button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 12px 14px; color: var(--muted); }
nav button[aria-pressed=true] { color: #5934e4; background: var(--soft); font-weight: 650; }
.sync-card { margin-top: auto; padding: 13px; border: 1px solid #e5dcff; border-radius: 14px; background: linear-gradient(140deg,#f4edff,#eef1ff); color: var(--muted); font-size: 12px; }
#manager section { display: flex; flex-direction: column; min-width: 0; }
.breadcrumbs, .toolbar, #selection { display: flex; align-items: center; gap: 8px; padding: 14px var(--gutter); flex-wrap: wrap; }
.breadcrumbs { border-bottom: 1px solid var(--line); min-height: 68px; }
#path { flex: 1; min-width: 100px; display: flex; align-items: center; flex-wrap: wrap; gap: 1px; }
#path button { border: 0; padding: 4px; color: var(--muted); overflow-wrap: anywhere; }
#path button:last-child { color: #211a36; font-weight: 650; }
.search-field { display: flex; align-items: center; gap: 6px; width: clamp(190px,24vw,300px); padding: 1px 13px; border-radius: 12px; background: #f3f0f8; color: var(--subtle); }
.search-field input { width: 100%; min-width: 0; padding: 8px 0; border: 0; background: transparent; color: #211a36; }
.folder-heading { display: flex; gap: 10px; align-items: baseline; margin-right: auto; min-width: 0; }
.folder-heading h1 { font-size: clamp(20px,2vw,28px); overflow-wrap: anywhere; }
#file-summary { color: var(--subtle); white-space: nowrap; }
.switch { display: flex; background: #f3f0f8; padding: 3px; border-radius: 10px; }
.switch button { display: grid; place-items: center; padding: 6px 8px; border: 0; background: transparent; color: var(--subtle); }
.switch button[aria-pressed=true] { background: white; color: var(--purple); box-shadow: 0 1px 4px #2616461a; }
.sort-control { position: relative; display: inline-flex; align-items: center; min-height: 37px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.sort-control select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
#selection { margin: 0 var(--gutter) 10px; padding: 9px 14px; border: 1px solid #ddd0fe; border-radius: 12px; background: var(--soft); color: #5830df; }
#selection button { border: 0; background: transparent; color: var(--muted); }
#clear { margin-left: auto; }
#files { padding: 0 var(--gutter) 18px; }
#files.grid { padding-top: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(108px,1fr)); gap: 9px; align-content: start; }
.file { min-width: 0; position: relative; }
input[type=checkbox] {
  appearance: none;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin: 0;
  padding: 0;
  border: 1.5px solid #cdc6db;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
}
input[type=checkbox]:is(:checked,:indeterminate) { border-color: var(--purple); background: var(--purple); }
input[type=checkbox]:checked::before {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
input[type=checkbox]:indeterminate::before {
  content: '';
  width: 8px;
  height: 2px;
  background: white;
  border: 0;
  border-radius: 1px;
  transform: none;
}
@media (forced-colors: active) {
  input[type=checkbox] { appearance: auto; }
  input[type=checkbox]:is(:checked,:indeterminate)::before { content: none; }
}
.file-title, .file-description { min-width: 0; }
.file-title { width: 100%; border: 0; padding: 0; background: transparent; text-align: inherit; }
.file-description { display: grid; gap: 1px; max-width: 100%; }
.file-name { min-width: 0; padding: 1px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.file-meta { color: var(--subtle); font-size: 12px; }
.grid .file { min-height: 126px; text-align: center; border: 1px solid transparent; border-radius: 13px; padding: 12px 5px 8px; }
.grid .file-title { display: grid; justify-items: center; gap: 10px; }
.grid .file input { position: absolute; left: 6px; top: 6px; }
.grid .file:not(.selected):not(:hover):not(:focus-within) input { opacity: 0; }
.grid .file.selected { border-color: #d7c6ff; box-shadow: inset 0 0 0 1px #d7c6ff; }
.grid :is(.list-type,.list-size,.list-access) { display: none; }
.file.selected { background: var(--soft); }
.file-actions button { border: 0; background: transparent; color: var(--subtle); line-height: 1; padding: 5px 7px; }
.grid .file-actions { position: absolute; top: 1px; right: 1px; opacity: 0; }
.grid .file:is(:hover,:focus-within) .file-actions { opacity: 1; }
.list .file, #list-head { display: grid; grid-template-columns: 24px minmax(120px,2.4fr) minmax(65px,1fr) minmax(64px,1fr) minmax(88px,1.15fr) 32px; gap: 12px; align-items: center; padding: 8px 10px; }
#list-head { margin: 0 var(--gutter); border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.list .file { min-height: 49px; border-bottom: 1px solid var(--line); }
.list .file.selected { border-radius: 10px; }
.list .file-title { display: flex; align-items: center; gap: 10px; }
.list .file-name { text-align: left; }
.list .file-meta { display: none; }
.list :is(.list-type,.list-size) { color: var(--muted); }
.permission { display: inline-block; white-space: nowrap; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #f0eef4; color: #665f78; }
.permission.read { background: #fff1dc; color: #925d11; }
.permission.edit { background: #e3f7ed; color: #087756; }
.icon { display: grid; place-items: center; width: 36px; height: 44px; background: #f5f0ff; color: #5837bf; border: 1px solid #d9cdf7; border-radius: 5px 10px 5px 5px; font-size: 9px; font-weight: 750; flex: none; }
.icon.folder { position: relative; width: 48px; height: 32px; margin-block: 9px 3px; border: 0; color: transparent; font-size: 0; border-radius: 5px; background: linear-gradient(#ffdb73 0 24%,#ffc74a 25% 100%); box-shadow: inset 0 1px 0 #ffe495; }
.icon.folder::before { content: ''; position: absolute; width: 20px; height: 6px; left: 0; top: -5px; border-radius: 4px 5px 0 0; background: #f4a51e; }
.icon.pdf { color: #a32739; background: #fff5f5; border-color: #f5cbd0; }
.icon.xlsx { color: #126c48; background: #eefaf4; border-color: #bee7d4; }
.icon.docx { color: #214ea7; background: #f0f4ff; border-color: #cdd9ff; }
.icon.image { object-fit: cover; width: 60px; height: 43px; border: 0; border-radius: 7px; }
.list .icon { width: 26px; height: 33px; font-size: 7px; }
.list .icon.folder { width: 28px; height: 21px; margin-block: 5px 0; }
.list .icon.folder::before { width: 12px; }
.list .icon.image { width: 34px; height: 25px; }
#file-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 9px var(--gutter); color: var(--subtle); font-size: 12px; }
.status { padding: 0 16px; color: var(--muted); }
.status:empty { display: none; }
dialog { border: 1px solid var(--line); border-radius: 12px; max-width: calc(100% - 20px); }
dialog::backdrop { background: #1d173578; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  #manager { display: block; }
  #manager aside { border: 0; background: #fff; padding: 10px var(--gutter) 3px; }
  nav { grid-template-columns: repeat(3,minmax(0,1fr)); background: #f2eff8; border-radius: 12px; padding: 3px; }
  nav button { justify-content: center; padding: 9px 5px; }
  nav button svg { display: none; }
  nav button[aria-pressed=true] { background: white; box-shadow: 0 1px 4px #2616461a; }
  .login-layout { grid-template-columns: 1fr; min-height: 0; align-content: start; }
  .breadcrumbs { padding-top: 8px; padding-bottom: 8px; border: 0; }
  .search-field { order: -1; width: 100%; }
  .toolbar { padding-top: 2px; }
  .folder-heading { width: 100%; }
  #list-head { display: none; }
  .grid { grid-template-columns: repeat(auto-fill,minmax(94px,1fr)); gap: 5px; }
  .grid .file { min-height: 106px; }
  .grid .file:not(.selected) input { opacity: 1; }
  .grid .file-actions { opacity: 1; }
  .grid .file-meta { display: none; }
  .list .file { grid-template-columns: minmax(0,1fr) 32px 20px; gap: 5px; border: 0; padding-block: 9px; }
  .list .file input { grid-column: 3; grid-row: 1; }
  .list .file-title { grid-column: 1; grid-row: 1; }
  .list .file-actions { grid-column: 2; grid-row: 1; justify-self: center; }
  .list :is(.list-type,.list-size,.list-access) { display: none; }
  .list .file-meta { display: block; }
  #selection { position: fixed; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: max(12px,env(safe-area-inset-bottom)); margin: 0; background: #1e1835; color: #fff; border: 0; box-shadow: 0 5px 18px #251b4b40; }
  #selection button { color: #eee6fb; }
  #manager:has(#selection:not([hidden])) #file-footer { margin-bottom: 70px; }
}
@media (max-width: 410px) {
  #account { font-size: 13px; }
  .topbar { padding-inline: 10px; }
  #account-phone { display: none; }
  .grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .toolbar { gap: 5px; }
  .toolbar button,.toolbar select { font-size: 12px; }
  .toolbar > button { padding-inline: 7px; }
}
.sync-card:not(:has(> :not([hidden]))) { display: none; }
#back-folder { display: inline-grid; place-items: center; padding: 8px; }
@media (max-width: 760px) {
  #back-folder, .sync-card:not(:has(#local-sync:not([hidden]))) { display: none; }
}
.desktop-shell .topbar { position: relative; padding-top: 37px; min-height: 80px; }
.desktop-shell .topbar::before { content: ''; position: absolute; inset: 0 0 auto; height: 30px; -webkit-app-region: drag; }
#avatar { position: relative; overflow: hidden; }
#avatar-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#login .login-options label { display: flex; gap: 7px; align-items: center; margin: 0; font-weight: 400; color: var(--muted); }
#login .login-options input { width: 17px; flex: 0 0 17px; }
.top-version { display: inline-flex; align-items: center; gap: 4px; color: #e2d5f3; flex: none; font-size: 12px; white-space: nowrap; }
#version { display: grid; place-items: center; border: 0; padding: 4px; background: transparent; color: inherit; }
#version:hover { color: #fff; }
#version svg { width: 15px; height: 15px; }
#upgrade { width: min(560px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); padding: clamp(16px,4vw,27px); color: #211a36; background: #fff; border-radius: 16px; box-shadow: 0 18px 40px #0003; }
#upgrade[open] { display: grid; gap: 14px; }
.upgrade-header h2 { font-size: 19px; }
.upgrade-body { display: grid; gap: 14px; font-size: 13px; }
#upgrade-current, .upgrade-help { color: var(--muted); }
#upgrade-status { font-weight: 650; }
#upgrade-notes { max-height: 220px; overflow-y: auto; }
#upgrade-notes ul { margin: 0; padding-left: 20px; overflow-wrap: anywhere; }
#upgrade-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
#upgrade-progress progress { display: block; width: 100%; height: 11px; accent-color: var(--purple); }
#upgrade-close { margin-inline-end: auto; }
.upgrade-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Login artwork and form spacing follow the operations assistant. */
.login-art { position: relative; isolation: isolate; overflow: hidden; padding: 32px 24px 32px 16%; gap: 28px; background: #161022; }
.login-backdrop { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.login-brand { font-size: 20px; gap: 16px; }
.login-brand small { display: block; margin-top: 5px; letter-spacing: 2.2px; font-size: 9px; color: #d7cce9; }
.login-logo-art { position: relative; flex: none; display: block; overflow: hidden; width: clamp(64px,7vw,96px); aspect-ratio: 1; border-radius: 24%; box-shadow: 0 0 18px color(srgb .66 .35 1 / .48); }
.login-logo-art img { display: block; width: 100%; height: 100%; border-radius: 0; }
.login-logo-sweep { position: absolute; pointer-events: none; width: 42%; height: 155%; left: 29%; top: -27.5%; background: linear-gradient(90deg, transparent, #e0c2ff70, #ffffffb8, transparent); transform: translateX(-238%) rotate(25deg); animation: login-icon-sweep 950ms ease-out 250ms forwards; }
@keyframes login-icon-sweep { to { transform: translateX(238%) rotate(25deg); } }
.login-art p { color: #ffffffa6; font-size: 14px; line-height: 1.57; }
.login-art .login-headline { color: white; font-size: 34px; font-weight: 650; line-height: 1.4; margin: 42px 0 0; }
.login-pane { padding: 48px 40px; }
#login { gap: 22px; }
.login-form-heading { padding-bottom: 8px; }
.login-form-heading small { font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.login-form-heading h1 { font-size: 27px; line-height: 1.35; margin: 12px 0; }
.login-form-heading p { font-size: 13px; }
#login label { gap: 9px; }
#login label:first-of-type { margin: 0; }
.login-field { display: flex; align-items: center; gap: 8px; padding: 11px 12px; min-height: 45px; border: 1px solid #e3dbea; border-radius: 8px; background: #fff; }
#login .login-field input { min-height: 0; padding: 0; border: 0; outline: 0; background: transparent; }
.login-field button { position: static; flex: none; display: inline-grid; place-items: center; padding: 4px; }
.login-field button svg { width: 16px; height: 16px; }
.login-field button[aria-pressed=false] .eye-strike { display: none; }
#login .login-options { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 7px; }
.login-submit svg { width: 15px; height: 15px; }
.login-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #ffffff66; border-right-color: #fff; animation: login-spinner 750ms linear infinite; }
@keyframes login-spinner { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .login-art { padding: 24px 22px; gap: 10px; }
  .login-art .login-headline { margin-top: 10px; font-size: 24px; }
  .login-art .login-headline br { display: none; }
  .login-logo-art { width: 54px; }
  .login-pane { padding: 24px 20px; }
  .login-form-heading h1 { font-size: 23px; }
  #login { gap: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-logo-sweep { display: none; }
  .login-spinner { animation: none; }
}
#login .login-options label:has(input:disabled) { color: #a6a0b4; cursor: default; }
#login .login-options input:disabled { opacity: .45; cursor: default; }
.account-pill .top-icon { width: 28px; height: 28px; display: inline-grid; place-items: center; }
.account-pill .top-icon svg { width: 16px; height: 16px; }
.account-pill .logout { color: #ffaaa7; }
#profile {
  width: min(450px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 24px; border: 0; border-radius: 14px; background: #fff;
  color: #251a38; box-shadow: 0 18px 42px #20172f26; overflow: auto;
}
#profile::backdrop { background: #211a3b38; }
.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.profile-header h2 { font-size: 17px; }
#profile button { border: 0; border-radius: 7px; min-height: 24px; padding: 3px 10px; background: #efe8fa; color: #6835b8; }
#profile button.primary { min-width: 86px; background: #7040bf; color: #fff; }
#profile button:disabled { opacity: 1; background: #e8e1f1; color: #756880; }
#profile #profile-close { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; }
#profile-close svg { width: 14px; height: 14px; stroke-width: 1.4; }
.profile-body { display: grid; gap: 18px; }
.profile-body :is(section,form) { display: grid; gap: 13px; padding: 18px; border: 1px solid #e6dcf1; border-radius: 12px; }
.profile-body h3 { font-size: 14px; margin: 0; }
.profile-body p { font-size: 12px; color: #756987; }
.profile-row { display: flex; gap: 8px; align-items: center; }
.profile-row input:not([type=file]) { flex: 1; min-width: 0; }
.profile-body input:not([type=file]) { width: 100%; min-height: 26px; padding: 3px 7px; border-color: #e9e8eb; border-radius: 7px; }
.profile-avatar { position: relative; display: grid; place-items: center; flex: none; border-radius: 50%; width: 48px; height: 48px; overflow: hidden; background: #eee7fb; color: #6547aa; font-size: 19px; }
.profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-left: auto; }
#profile-password-form { grid-template-columns: minmax(0,1fr); gap: 8px; }
#profile-password-form header { margin-bottom: 5px; }
#profile-password-form button { justify-self: end; margin-top: 3px; }
@media (max-width: 410px) {
  #profile { padding: 16px; }
  .profile-body { gap: 12px; }
  .profile-body :is(section,form) { padding: 13px; }
}
#profile-notice:empty { display: none; }

.mobile-workbench, .mobile-file-heading, #up span, #selection svg, .mobile-clear { display: none; }
#up { display: inline-grid; place-items: center; padding: 8px; }
#path button { display: inline-flex; align-items: center; gap: 6px; }
#path button:not(:last-child)::after { content: '›'; color: var(--subtle); }
#path button[aria-current] { color: #211a36; }
#files.grid { grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 10px 8px; }
.grid .file { min-height: 140px; padding-top: 19px; }
.grid .file-title { grid-template-rows: 49px auto; align-items: center; }
.icon:not(.folder,.image) {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  border: 1.5px solid var(--file-border,#dad1f4);
  background: #fff;
}
.icon:not(.folder,.image)::before {
  content: '';
  position: absolute;
  inset: 22% 22% auto;
  height: 2px;
  background: var(--file-border,#dad1f4);
  box-shadow: 0 4px var(--file-border,#dad1f4);
}
.icon:not(.folder,.image) span {
  border-radius: 4px;
  padding: 0 4px;
  background: var(--file-label,#7052c8);
  color: #fff;
  letter-spacing: .04em;
}
.icon.pdf { --file-border: #f7cdd0; --file-label: #d93547; }
.icon.xlsx { --file-border: #bde8d6; --file-label: #07895e; }
.icon.docx { --file-border: #cbd9ff; --file-label: #275de0; }
.list .icon:not(.folder,.image) { padding-bottom: 5px; }

@media (max-width: 760px) {
  #manager aside { padding-top: 13px; gap: 12px; }
  :root:not(.desktop-shell) .mobile-workbench { display: inline-flex; align-self: flex-start; color: var(--muted); text-decoration: none; }
  .mobile-file-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-file-heading h1 { font-size: 28px; line-height: 1.2; }
  #mobile-sync-usage {
    margin-left: auto; min-height: 36px; padding: 0 8px;
    border: 0; background: transparent; color: #5934e4; font-size: 12px; white-space: nowrap;
  }
  #mobile-upload { padding: 8px 13px; box-shadow: 0 6px 14px #6845f733; }
  .toolbar > #upload { display: none; }
  .toolbar .folder-heading { width: auto; flex: 1 1 96px; gap: 5px; }
  #mkdir span { display: none; }
  #mkdir { min-width: 34px; }
  .toolbar { padding-bottom: 8px; }
  .breadcrumbs { min-height: 0; row-gap: 12px; }
  .sort-control { padding-inline: 7px; border: 0; }
  .sort-icon { display: none; }
  #up:disabled { display: none; }
  #up { padding: 4px 8px; border: 0; background: #f3f0f8; color: var(--muted); }
  #up svg { display: none; }
  #up span { display: inline; }
  #path { flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
  #path button { flex: none; white-space: nowrap; }
  #files.grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .grid .file { min-height: 107px; padding-top: 12px; }
  .grid .file-title { gap: 7px; }
  .grid .file:not(.selected):not(:focus-within) input:not(:hover),
  .grid .file:not(.selected):not(:focus-within) .file-actions:not(:hover) { opacity: .55; }
  .list .file { min-height: 61px; padding-inline: 7px; }
  .list .file.selected { border-radius: 13px; }
  .list .file-name { font-weight: 650; }
  .list .icon.folder { width: 33px; height: 25px; }
  .list .icon.image { width: 40px; height: 29px; }
  #selection { flex-wrap: nowrap; min-height: 57px; border-radius: 17px; }
  #selection strong { margin-right: auto; }
  #selection button { display: grid; justify-items: center; gap: 2px; padding: 4px 8px; font-size: 12px; }
  #selection svg, .mobile-clear { display: block; }
  #selection .desktop-clear { display: none; }
  #clear { margin-left: 0; }
}

#refresh-files { display: inline-grid; place-items: center; }
#sync-queue {
  width: min(440px, calc(100vw - 24px)); padding: 20px; border: 0; border-radius: 16px;
  background: #fff; color: #26215C; box-shadow: 0 24px 48px -16px rgba(20,14,60,.35);
  font: 13px -apple-system,"PingFang SC","Microsoft YaHei UI",sans-serif;
}
#sync-queue::backdrop { background: rgba(38,33,92,.38); }
#sync-queue svg { width: 1em; height: 1em; display: block; flex: none; stroke-width: 2; }
.sync-modal-head { display: flex; align-items: flex-start; gap: 10px; }
.sync-modal-title-group { flex: 1; min-width: 0; }
.sync-modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 24px; color: #26215C; }
.sync-modal-sub { font-size: 12px; color: #8A84B5; line-height: 18px; min-height: 18px; }
.sync-modal-close {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #F6F4FC; color: #8A84B5; font-size: 18px; flex: none;
}
.sync-modal-close:hover { background: #ECE7FB; color: #534AB7; }
#sync-usage-overview { margin-top: 16px; }
.sync-usage-total-card {
  border-radius: 14px; padding: 16px;
  background: linear-gradient(135deg,#F4F0FF 0%,#EEF1FF 100%);
  border: 1px solid #E6DFFE;
}
.sync-usage-total-label { font-size: 12px; color: #6B6790; display: flex; align-items: center; gap: 5px; }
.sync-usage-total-label svg { font-size: 14px; color: #6C4BF4; }
.sync-usage-total-value { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.sync-usage-total-value b {
  font-size: 32px; font-weight: 700; letter-spacing: -.5px; line-height: 40px;
  font-variant-numeric: tabular-nums; color: #26215C;
}
.sync-usage-total-value em { font-style: normal; font-size: 15px; font-weight: 600; color: #534AB7; }
.sync-usage-total-value em[hidden] { display: none; }
.sync-usage-total-hint { font-size: 11.5px; color: #8A84B5; margin-top: 2px; line-height: 16px; }
.sync-usage-bar {
  display: flex; height: 8px; border-radius: 4px; overflow: hidden;
  background: #E7E2FB; margin: 14px 0 12px; gap: 2px;
}
.sync-usage-bar i { display: block; height: 100%; min-width: 0; }
.sync-usage-bar i[hidden] { display: none; }
.sync-usage-bar i:first-child { background: #7C6CF0; }
.sync-usage-bar i:last-child { background: #2FA884; }
.sync-usage-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sync-usage-split > div {
  background: #fff; border-radius: 10px; padding: 9px 10px;
  display: flex; align-items: center; gap: 9px; border: 1px solid #EEEAFB; min-width: 0;
}
.sync-usage-k {
  width: 28px; height: 28px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; font-size: 15px; flex: none;
}
.sync-usage-k.is-up { background: #EEEBFF; color: #6C4BF4; }
.sync-usage-k.is-down { background: #E3F5EE; color: #1E8C6B; }
.sync-usage-split small { display: block; font-size: 11px; color: #8A84B5; line-height: 14px; }
.sync-usage-split b {
  display: block; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 19px; color: #26215C; white-space: nowrap;
}
.sync-usage-pct {
  margin-left: auto; font-size: 11px; color: #A39DC6;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
#sync-usage-error { margin: 8px 0 0; font-size: 12px; color: #C2352F; }
.sync-modal-sec {
  font-size: 12px; font-weight: 600; color: #6B6790; margin: 18px 0 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.sync-modal-sec small { font-size: 12px; font-weight: 400; color: #A39DC6; }
.sync-info-list { border: 1px solid #EEEAFB; border-radius: 12px; overflow: hidden; background: #fff; }
.sync-info-row {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  width: 100%; border: 0; border-radius: 0; background: #fff; text-align: left; color: inherit;
  font: inherit;
}
.sync-info-row:not(:first-child) { border-top: 1px solid #F2EFFB; }
.sync-info-row[hidden] { display: none; }
.sync-info-row.is-action { cursor: pointer; }
.sync-info-row.is-action:disabled { cursor: default; opacity: .7; }
.sync-info-row.is-action:not(:disabled):hover { background: #FAF9FF; }
.sync-info-row.is-warn { background: #FFF8EE; }
.sync-info-row.is-error { background: #FFF5F5; }
.sync-info-ic { font-size: 16px; color: #8A84B5; display: flex; flex: none; }
.sync-info-ic.is-folder { color: #E2A93B; }
.sync-info-label { color: #6B6790; width: 64px; flex: none; font-size: 12.5px; }
.sync-info-val {
  flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; color: #26215C;
}
.sync-info-ch { color: #C4BFE0; font-size: 15px; display: flex; flex: none; }
.sync-info-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: #9C96B8;
}
.sync-info-dot[data-state="enabled"] { background: #2FA884; }
.sync-info-dot[data-state="running"] { background: #6C4BF4; }
.sync-info-dot[data-state="attention"] { background: #E08A1E; }
.sync-info-dot[data-state="failed"] { background: #C2352F; }
#sync-queue-progress { display: block; width: 100%; height: 4px; border: 0; accent-color: #6C4BF4; }
#sync-queue-progress[hidden] { display: none; }
#sync-queue-items.sync-modal-errors {
  margin: 0; padding: 0; list-style: none; max-height: min(32dvh, 220px); overflow: auto;
}
#sync-queue-items.sync-modal-errors:empty { display: none; }
#sync-queue-items.sync-modal-errors li {
  padding: 8px 12px; font-size: 12px; background: #FFF8EE; border-top: 1px solid #F2EFFB;
}
#sync-queue-items.sync-modal-errors li.is-error { background: #FFF5F5; }
.sync-err-line { display: flex; align-items: center; gap: 8px; }
.sync-err-line svg { font-size: 15px; color: #C2700C; flex: none; }
.sync-modal-errors li.is-error .sync-err-line svg { color: #C2352F; }
.sync-err-file {
  flex: 1; min-width: 0; overflow-wrap: anywhere; color: #26215C;
}
.sync-err-reason { color: #C2700C; font-size: 11.5px; max-width: 50%; text-align: right; overflow-wrap: anywhere; }
.sync-modal-errors li.is-error .sync-err-reason { color: #C2352F; }
.sync-err-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; padding-left: 23px; }
.sync-err-actions button {
  padding: 3px 8px; font-size: 11.5px; border-radius: 6px;
  border: 1px solid #E2D9C5; background: #fff; color: #4A4570;
}
.sync-err-actions button:hover { border-color: #6C4BF4; color: #534AB7; }
@media (max-width: 420px) {
  #sync-queue { padding: 16px; }
  .sync-usage-split > div { padding: 8px; gap: 6px; }
}
@media (max-width: 350px) {
  .sync-usage-split > div { flex-wrap: wrap; }
  .sync-usage-pct { flex-basis: 100%; text-align: right; }
}
#file-footer { display: flex; align-items: center; gap: 7px; }
#sync-detail { padding: 0; border: 0; background: transparent; }
#sync-detail:disabled { opacity: 1; }
#sync-detail:not(:disabled):hover { text-decoration: underline; }
#sync-detail.sync-failed { color: #ad2743; }
#trash-view { padding: 14px var(--gutter); }
#trash-view p { margin-top: 54px; color: var(--muted); text-align: center; }
#trash-list { list-style: none; margin: 0; padding: 0; }
#trash-list-head, #trash-list .file {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.8fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto;
  align-items: center; gap: 12px; padding-inline: 10px;
}
#trash-list-head { padding-block: 8px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
#trash-list .file-description, #trash-list .trash-column { min-width: 0; }
#trash-list .trash-column { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#trash-list button { justify-self: end; grid-row: auto; grid-column: auto; }
@media (max-width: 760px) {
  #trash-list-head, #trash-list .trash-column { display: none; }
  #trash-list .file { grid-template-columns: minmax(0, 1fr) auto; }
  #trash-list .file-meta { display: block; }
}
.folder-chevron { display: none; }
.grid .file-title > .icon:not(.folder,.image) { height: 48px; width: 37px; }
@media (max-width: 760px) {
  #manager:not(:has(#selection:not([hidden]))) .list .directory-entry .folder-chevron {
    display: block; position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%); color: var(--subtle); font-size: 19px;
  }
  #manager:not(:has(#selection:not([hidden]))) .list .directory-entry .file-title {
    grid-column: 1 / -1; padding-right: 28px;
  }
  #manager:not(:has(#selection:not([hidden]))) .list .directory-entry .file-actions { z-index: 1; margin-right: 15px; }
  #manager:not(:has(#selection:not([hidden]))) .list .directory-entry input:not(:focus-visible) { opacity: 0; }
}
.management-nav { color: var(--subtle); font-size: 12px; }
.management-nav > span { display: block; padding: 0 14px 4px; }
.management-nav button { width: 100%; font-size: 1rem; }
.management-nav button:hover { background: var(--soft); color: #5934e4; }
#upload { display: inline-flex; align-items: center; gap: 6px; }
.desktop-shell #file-footer::before {
  display: inline-block; content: ''; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; background: #c6c0d4;
}
@media (max-width: 760px) {
  .management-nav, .toolbar > #upload { display: none; }
}

/* File manager controls and feedback. */
#manager { --gutter: 28px; font-family: "PingFang SC", "Microsoft YaHei UI", -apple-system, sans-serif; }
#file-area { position: relative; }
#manager :is(#file-summary,#file-count,#selection strong,.list-size,.file-meta,progress) { font-variant-numeric: tabular-nums; }
#manager :is(button,.file,.file input,.file-actions,.image img) {
  transition: background-color 150ms, color 150ms, box-shadow 150ms, opacity 150ms, border-color 150ms;
}
.breadcrumbs :is(#back-folder,#up) {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; background: #f3f1f7; color: var(--muted);
}
.breadcrumbs :is(#back-folder,#up):not(:disabled):hover { background: #e9e4f2; }
.toolbar { gap: 8px; padding-top: 16px; padding-bottom: 20px; }
.toolbar :is(#upload,#mkdir,#refresh-files,.sort-control,.switch) { height: 36px; min-height: 36px; border-radius: 10px; }
.toolbar :is(#upload,#mkdir,#refresh-files) { padding-block: 0; }
.toolbar #refresh-files { width: 36px; padding-inline: 0; }
.view-tools { display: flex; align-items: center; gap: 8px; }
.toolbar .switch button { width: 32px; padding: 0; border-radius: 8px; }
.toolbar button:not(.primary,:disabled):hover { background: #f3effa; }
.toolbar button.primary:not(:disabled):hover, #mobile-upload:not(:disabled):hover { background: #5836e0; }
#files.grid { padding-top: 0; gap: 12px; grid-template-columns: repeat(auto-fill,minmax(112px,1fr)); }
.grid .file { border: 0; }
.grid .file:hover:not(.selected) { background: #f8f5fc; box-shadow: 0 2px 10px #3c27580d; }
.grid .file:is(.selected,:hover,:focus-within) .file-actions,
#manager:has(#selection:not([hidden])) .grid .file input { opacity: 1; }
.grid .file.selected { box-shadow: inset 0 0 0 1.5px #d7c6ff; }
.icon.folder {
  background: linear-gradient(180deg,#ffe08e 0%,#ffd777 22%,#ffcd56 25%,#ffc34a 100%);
  box-shadow: inset 0 1px 0 #ffeaaf, inset 0 -1px 0 #efa72d29;
}
.icon.folder::before { background: linear-gradient(110deg,#f6ae29,#ed9d17); }
.icon.folder.shared-folder { background: linear-gradient(#e1d4ff 0 24%,#cbb7fa 25% 100%); box-shadow: inset 0 1px 0 #eee6ff; }
.icon.folder.shared-folder::before { background: #aa8bec; }
.icon .shared-folder-badge { position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; color: #fff; background: #6842c4; border-radius: 50%; }
.icon.folder.received-folder { background: linear-gradient(#8dc7ff 0 24%,#388eec 25% 100%); box-shadow: inset 0 1px 0 #b2dcff; }
.icon.folder.received-folder::before { background: #1673da; }
.received-folder .shared-folder-badge { background: #146acd; }
.shared-folder-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }

#manager .grid .icon.image {
  width: 56px; height: 56px; border-radius: 8px; border: 1px solid #e8e4ee; background: #f0edf4; overflow: hidden;
}
#manager .list .icon.image { border: 1px solid #e8e4ee; border-radius: 8px; background: #f0edf4; overflow: hidden; }
.icon.image img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.icon.image.loaded img { opacity: 1; }
.grid .file-title { grid-template-rows: 56px auto; }
.list .file { min-height: 48px; padding-block: 6px; }
.list .file:hover:not(.selected) { background: #f8f7fb; }
.sync-card { padding: 12px; }
#sync-detail[data-state="enabled"]::before { background: #28a477; }
#sync-detail[data-state="running"]::before { background: #6C4BF4; }
#sync-detail[data-state="attention"]::before { background: #E08A1E; }
#sync-detail[data-state="failed"]::before { background: #cf3b54; }
#sync-detail[data-state="failed"] { color: #ad2743; }
#sync-detail::before { display:inline-block; content:''; width:7px; height:7px; border-radius:50%; margin-right:7px; background:#c6c0d4; }
.desktop-shell #file-footer::before { content: none; }
@keyframes sync-breathe { 50% { opacity: .4; } }
#file-empty {
  display: grid; place-items: center; align-content: center; min-height: min(46vh,360px);
  gap: 12px; padding: 24px var(--gutter); color: var(--muted); text-align: center;
}
#file-empty svg { width: 88px; height: 72px; }
#file-empty h2 { color: #271e3b; font-size: 19px; }
#file-loading {
  display: grid; grid-template-columns: repeat(auto-fit,minmax(88px,1fr)); gap: 12px; padding: 0 var(--gutter) 20px;
}
#file-loading span { display: block; height: 100px; border-radius: 12px; background: #f1edf6; animation: sync-breathe 1.5s ease-in-out infinite; }
#drop-upload {
  position: absolute; z-index: 5; inset: 8px; pointer-events: none; display: grid; align-content: center;
  justify-content: center; justify-items: center; gap: 6px; border: 2px dashed #9269ee; border-radius: 14px;
  background: #f1e9ffda; color: #493084; font-size: 18px; text-align: center;
}
#status {
  position: fixed; right: 20px; bottom: max(20px,env(safe-area-inset-bottom)); z-index: 7; display: flex; align-items: center;
  gap: 8px; max-width: min(420px,calc(100vw - 40px)); padding: 8px 8px 8px 14px;
  border-radius: 12px; border: 1px solid #e2d9f3; background: #faf7ff; color: #42365a;
  box-shadow: 0 4px 20px #30234b21;
}
#status.failed { border-color: #efd0d8; background: #fff5f7; color: #9b2644; }
#status button { padding: 1px 7px; border: 0; background: transparent; }
#status span { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #manager { --gutter: 16px; }
  .breadcrumbs #back-folder { display: none; }
  .breadcrumbs #up { width: auto; height: 26px; padding: 0 8px; }
  .breadcrumbs #up:disabled { display: none; }
  .toolbar { padding-top: 2px; padding-bottom: 12px; gap: 5px; }
  .view-tools { gap: 4px; }
  #files.grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  #manager:has(#selection:not([hidden])) + #status { bottom: 82px; }
  .list .file { min-height: 58px; }
}
@media (max-width: 360px) {
  .toolbar .folder-heading { flex-basis: 72px; }
  .toolbar #refresh-files { width: 30px; }
  .toolbar .switch button { width: 28px; }
  .toolbar .sort-control { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #manager :is(button,.file,input,.file-actions,.image img), #file-loading span,
  #sync-detail[data-state]::before { animation: none; transition: none; }
}

#list-select-all { justify-self: start; }
#selection #select-all { padding: 5px 7px; color: #5830df; white-space: nowrap; }
#file-action-menu {
  position: fixed; z-index: 6; display: grid; min-width: 126px; padding: 4px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; box-shadow: 0 6px 24px #2d214224;
}
#file-action-menu button { border: 0; text-align: left; border-radius: 6px; padding: 6px 10px; }
#file-action-menu button:hover { background: #f2edfc; }
#archive-dialog { width: min(480px,calc(100vw - 32px)); padding: 24px; color: #281d3b; }
#archive-dialog :is(#archive-summary,#archive-state,#archive-browser-hint) { margin-top: 10px; color: var(--muted); }
#archive-default-location { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
#archive-dialog #archive-browser-hint { color: #855711; }
#archive-dialog progress { margin-top: 12px; width: 100%; accent-color: var(--purple); }
#archive-failures { max-height: 34dvh; overflow: auto; padding-left: 20px; color: #a32944; overflow-wrap: anywhere; }
#archive-dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
@media (max-width: 760px) {
  #selection #select-all { color: #eee6fb; padding: 4px 3px; }
  #selection strong { flex: 1; line-height: 1.35; }
  #selection { gap: 4px; padding-inline: 10px; }
}

#share-dialog {
  width: min(460px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: clamp(16px, 5vw, 26px);
  border: 0;
  border-radius: 20px;
  color: #171322;
  background: #fff;
  box-shadow: 0 16px 48px #20173538;
}
#share-dialog::backdrop { background: #322b565f; }
.share-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.share-heading h2 { margin: 2px 0 0; font-size: clamp(22px, 5vw, 29px); line-height: 1.25; }
.share-heading .share-close { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; color: #6c638d; background: transparent; }
.share-heading .share-close:hover { background: #f0ebfb; }
.share-heading svg, .share-option svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.share-heading svg { width: 20px; height: 20px; }
#share-dialog fieldset { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.share-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  align-items: center;
  gap: clamp(10px, 4vw, 20px);
  padding: 14px clamp(12px, 4vw, 21px);
  min-height: 84px;
  border: 1px solid #dcd7e6;
  border-radius: 14px;
  cursor: pointer;
}
.share-option:hover { border-color: var(--purple); }
.share-option:has(:checked) { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); background: #eee9ff; }
.share-option svg { width: 32px; height: 32px; color: #6c638d; }
.share-option strong, .share-option small { display: block; }
.share-option strong { font-size: 18px; }
.share-option small { margin-top: 4px; font-size: 14px; color: #51495f; }
.share-option input { width: 21px; height: 21px; margin: 0; accent-color: var(--purple); cursor: pointer; }
.share-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.share-footer button { min-width: 82px; min-height: 43px; }

/* Sync card, fourth approved design. */
.sync-card:has(#local-sync:not([hidden])) {
  padding: 12px;
  border: 1px solid #E9E4FB;
  border-radius: 14px;
  background: #fff;
  color: #26215C;
  box-shadow: 0 1px 2px rgba(38,33,92,.04), 0 6px 16px -10px rgba(38,33,92,.12);
  font: 13px -apple-system,"PingFang SC","Microsoft YaHei UI",sans-serif;
}
@media (min-width: 1153px) {
  .sync-card:has(#local-sync:not([hidden])) { margin-inline: -10.5px; }
}
.sync-v3-head { display: flex; gap: 10px; align-items: center; min-height: 36px; }
.sync-v3-icon {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: #F1EFF6; color: #8C88A3;
}
.sync-v3-icon span { display: flex; }
.sync-v3-icon span[hidden] { display: none; }
#local-sync[data-state="running"] .sync-v3-icon { background: #6C4BF4; color: #fff; }
#local-sync[data-state="enabled"] .sync-v3-icon { background: #E1F5EE; color: #0F6E56; }
#local-sync[data-state="attention"] .sync-v3-icon { background: #FEF3E2; color: #C2700C; }
#local-sync[data-state="failed"] .sync-v3-icon { background: #FDECEC; color: #C2352F; }
#local-sync svg { display: block; flex: none; width: 1em; height: 1em; stroke-width: 2; }
.sync-v3-heading { flex: 1; min-width: 0; }
#local-sync #sync-state {
  color: #26215C; font-weight: 600; font-size: 14px; line-height: 19px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#local-sync #sync-last {
  display: block; width: 100%; padding: 0; border: 0; border-radius: 0;
  background: none; text-align: left; color: #8C88A3; font-size: 11.5px; line-height: 16px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; transition: none;
}
#local-sync #sync-last:disabled { opacity: 1; cursor: default; }
#local-sync #sync-last:not(:disabled) { cursor: pointer; }
#local-sync #sync-last:not(:disabled):hover { text-decoration: underline; }
#local-sync[data-state="running"] #sync-last { color: #7F77DD; }
#local-sync[data-state="enabled"] #sync-last { color: #0F6E56; }
#local-sync[data-state="attention"] #sync-last { color: #C2700C; }
#local-sync[data-state="failed"] #sync-last { color: #C2352F; }
#local-sync #open-sync-recovery {
  display: flex; align-items: center; gap: 3px; height: 22px; margin: 0; padding: 0 7px 0 6px;
  border: 0; border-radius: 11px; background: #F3F0FF; color: #534AB7;
  font-size: 11.5px; font-weight: 600; flex: none;
}
#local-sync #open-sync-recovery:hover { background: #E8E1FF; }
#local-sync #open-sync-recovery svg { font-size: 13px; }
#local-sync #open-sync-recovery[hidden] { display: none; }
.sync-v4-track { height: 3px; border-radius: 2px; background: #F1EEFB; margin: 12px 0 10px; overflow: hidden; }
#sync-track-fill {
  display: block; width: 0; height: 100%; background: #6C4BF4;
  border-radius: 2px;
}
.sync-v4-actions { display: flex; gap: 8px; margin-top: 10px; }
#local-sync :is(#start-sync,#stop-sync) {
  flex: 1; min-width: 0; margin: 0; height: 36px; padding: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 600;
}
#local-sync :is(#start-sync,#stop-sync) svg { font-size: 15px; }
#local-sync :is(#start-sync,#stop-sync,#open-sync-directory)[hidden] { display: none; }
#local-sync #start-sync {
  border: 0; background: #6C4BF4; color: #fff;
  box-shadow: 0 4px 10px -4px rgba(108,75,244,.55);
}
#local-sync #start-sync:hover:not(:disabled) { background: #5D3BE8; }
#local-sync #stop-sync { border: 1px solid #F3C4C2; background: #FFF5F5; color: #C2352F; }
#local-sync #stop-sync:hover { background: #FDECEC; border-color: #EA9E9B; }
#local-sync #open-sync-directory {
  width: 36px; height: 36px; flex: none; margin: 0; padding: 0; border-radius: 10px;
  border: 1px solid #F0E3C4; background: #FFF8E8; color: #E2A93B;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
#local-sync #open-sync-directory:hover:not(:disabled) { background: #FFF0CC; border-color: #EBCB86; }

.selection-dock-anchor { display: none; }
@media (min-width: 761px) {
  #selection { display: none; }
  .selection-dock-anchor {
    display: block; position: sticky; bottom: 44px; z-index: 2;
    height: 0; margin-block: -8px 8px; flex: none; pointer-events: none;
  }
  #file-area:has(#selection-dock[data-visible]) #files { padding-bottom: 84px; }
  #selection-dock {
    position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 8px);
    display: flex; align-items: center; gap: 2px; width: max-content;
    background: #221A35; color: #fff; border-radius: 16px; padding: 6px;
    font: 12px -apple-system,"PingFang SC","Microsoft YaHei UI",sans-serif;
    opacity: 0; visibility: hidden;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  }
  #selection-dock[data-visible] {
    opacity: 1; visibility: visible; transform: translate(-50%, 0);
    pointer-events: auto; transition-delay: 0s;
  }
  .dock-count { padding: 0 12px 0 10px; line-height: 1.35; white-space: nowrap; }
  #dock-selection-count { font-weight: 500; }
  #dock-selection-size { font-size: 11px; color: #AFA9EC; }
  .dock-separator { width: 1px; height: 28px; background: #3E3556; }
  #selection-dock button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    box-sizing: content-box; padding: 6px 12px; border: 0; border-radius: 10px;
    min-width: 44px; white-space: nowrap; background: transparent;
  }
  #selection-dock button:hover { background: #352B4E; }
  #selection-dock svg { width: 18px; height: 18px; }
  #selection-dock .dock-danger { color: #F09595; }
  #selection-dock .dock-muted { color: #B4B2A9; }
}
@media (prefers-reduced-motion: reduce) {
  #selection-dock { transition: none; }
}


#file-preview { width: min(980px, calc(100vw - 24px)); padding: 16px; }
#file-preview > header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
#file-preview h2 { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
#file-preview-body { overflow: auto; max-height: 76dvh; text-align: center; }
#file-preview-body img, #file-preview-body video { display: block; max-width: 100%; max-height: 72dvh; margin-inline: auto; }
#file-preview-body.zoomed img { max-width: none; max-height: none; min-width: 150%; }
#file-preview-body audio { width: min(100%,500px); }
#file-preview-body object { display: block; width: 100%; height: 70dvh; }
#file-preview-body pre { margin: 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; background: var(--sidebar); }
#file-preview-status { color: var(--muted); }


:where(html, *) { scrollbar-width: thin; scrollbar-color: #75659038 transparent; }
:where(html:hover, #file-area:hover, aside:hover, dialog:hover, dialog :hover) { scrollbar-color: #75659075 transparent; }
@media (forced-colors: active) {
  :where(html, *, html:hover, *:hover, *:focus-within) { scrollbar-color: auto; }
}
@media (min-width: 761px) {
  body:has(#manager:not([hidden])) { height: 100dvh; }
  body:has(#manager:not([hidden])) > main, #manager { min-height: 0; }
  #manager > aside, #file-area { min-height: 0; overflow-y: auto; }
  #file-area > *, #manager > aside > * { flex-shrink: 0; }
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 5px 3px; }
.sidebar-brand img { width: 44px; height: 44px; border-radius: 12px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 19px; line-height: 1.2; }
.sidebar-brand small { margin-top: 3px; color: var(--muted); }
.trash-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.trash-actions { display: flex; justify-content: end; gap: 6px; }
#trash-list .trash-actions button { padding-inline: 8px; white-space: nowrap; }
.trash-danger { color: #ad262d; border-color: #edb1b4; }
.trash-danger:not(:disabled):hover { background: #fff1f1; }
#trash-confirm { width: min(440px, calc(100vw - 28px)); padding: 22px; }
#trash-confirm p { margin: 12px 0 20px; color: var(--muted); overflow-wrap: anywhere; }
#trash-confirm footer { display: flex; justify-content: end; gap: 8px; }
.trash-confirm-danger { background: #bd3238; border-color: #bd3238; color: #fff; font-weight: 650; }
@media (max-width: 760px) { .sidebar-brand { display: none; } }


#directory-settings { min-width: 0; padding: 32px; }
#directory-settings h1 { margin: 0 0 22px; }
.directory-settings-card { padding: 0 20px; border: 1px solid #e9e4ef; border-radius: 14px; }
.directory-setting { display: grid; grid-template-columns: 1.1fr 1fr auto; gap: 16px; align-items: center; padding: 20px 0; }
.directory-setting + .directory-setting { border-top: 1px solid #e9e4ef; }
.directory-setting h2 { margin: 0 0 5px; font-size: 17px; }
.directory-setting p { margin: 0; color: var(--muted); }
.directory-setting output { padding: 9px 12px; background: #f5f2fa; border-radius: 8px; overflow-wrap: anywhere; }
#directory-settings-link[aria-pressed="true"] { background: #eee7fd; color: var(--purple); }
aside:has(#directory-settings-link[aria-pressed="true"]) nav button[aria-pressed="true"] { background: transparent; color: inherit; }
#archive-dialog.quick-download { position: fixed; inset: auto 18px 18px auto; margin: 0; z-index: 25; box-shadow: 0 10px 36px #251a3830; }
@media (max-width: 760px) {
  #directory-settings { padding: 16px; }
  .directory-setting { grid-template-columns: minmax(0,1fr) auto; }
  .directory-setting div { grid-column: 1 / -1; }
}
