/* ==========================================================================
   公司共享网盘 · 界面样式
   ========================================================================== */

:root {
  --bg: #f3f6fc;
  --bg-glow: rgba(47, 107, 255, .09);
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #eef3fd;
  --text: #162039;
  --text-soft: #33405c;
  --muted: #6d7991;
  --faint: #98a3b8;
  --line: #e5eaf4;
  --line-strong: #d7dfee;
  --primary: #2f6bff;
  --primary-dark: #1f54d8;
  --primary-soft: #ecf2ff;
  --teal: #12b7a6;
  --teal-soft: #e7faf7;
  --danger: #e5484d;
  --danger-soft: #fff0f0;
  --warn: #e9a23b;
  --sidebar: #0b1730;
  --sidebar-2: #132746;
  --sidebar-text: #eaf0ff;
  --sidebar-muted: #8fa1c2;
  --shadow-xs: 0 1px 2px rgba(16, 29, 54, .05);
  --shadow-sm: 0 2px 6px rgba(16, 29, 54, .06);
  --shadow-md: 0 12px 32px rgba(16, 29, 54, .10);
  --shadow-lg: 0 26px 70px rgba(8, 20, 44, .24);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --sidebar-w: 258px;
  --topbar-h: 74px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  --bg: #09101d;
  --bg-glow: rgba(53, 118, 255, .14);
  --surface: #101a2c;
  --surface-2: #142034;
  --surface-3: #1a2942;
  --text: #e9effb;
  --text-soft: #c5d0e4;
  --muted: #93a2bc;
  --faint: #72819b;
  --line: #22314a;
  --line-strong: #2e405d;
  --primary: #5b8cff;
  --primary-dark: #7aa1ff;
  --primary-soft: #17294a;
  --teal: #2bd0bd;
  --teal-soft: #11332f;
  --danger: #ff6b6f;
  --danger-soft: #351b21;
  --warn: #f0b35a;
  --sidebar: #070e1b;
  --sidebar-2: #0d1a2e;
  --sidebar-text: #eef3ff;
  --sidebar-muted: #8294b5;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-md: 0 14px 38px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { height: 100%; }
body.modal-open { overflow: hidden; }
body.is-marquee { user-select: none; cursor: crosshair; }
body.is-marquee .file-card { cursor: crosshair; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 78% -8%, var(--bg-glow), transparent 62%),
    radial-gradient(700px 420px at 18% 8%, rgba(18, 183, 166, .05), transparent 65%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
svg { display: block; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sprite symbol { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: rgba(47, 107, 255, .24); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(123, 140, 166, .35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(123, 140, 166, .28); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(123, 140, 166, .48); background-clip: content-box; border: 3px solid transparent; }

/* ==========================================================================
   Shell & Sidebar
   ========================================================================== */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.mobile-scrim { display: none; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px 16px;
  background:
    radial-gradient(520px 280px at 12% 0%, rgba(73, 132, 255, .30), transparent 65%),
    radial-gradient(420px 320px at 100% 82%, rgba(18, 183, 166, .16), transparent 65%),
    linear-gradient(175deg, var(--sidebar-2) 0%, var(--sidebar) 64%);
  color: var(--sidebar-text);
  z-index: 40;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) .7px, transparent .7px);
  background-size: 16px 16px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 48%);
}
.sidebar > * { position: relative; z-index: 1; }

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 4px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #5b8dff 0%, #2f6bff 48%, #16c7b2 100%);
  box-shadow: 0 9px 24px rgba(47, 107, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.brand-mark .icon, .brand-mark svg { width: 25px; height: 25px; }
.brand-copy { min-width: 0; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.brand-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--sidebar-muted); font-size: 11.5px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #30d5b7; box-shadow: 0 0 0 4px rgba(48, 213, 183, .11); }
.live-dot.offline { background: #f0a14a; box-shadow: 0 0 0 4px rgba(240, 161, 74, .12); }

.nav { display: flex; flex-direction: column; gap: 5px; }
.nav-label { padding: 3px 12px 7px; color: #6f83a7; font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.nav-label-gap { margin-top: 14px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; height: 45px; padding: 0 12px;
  border: 0; border-radius: 12px;
  background: transparent;
  color: #b9c8e2;
  font-size: 13.5px; font-weight: 500; text-align: left; text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.nav-item .icon { width: 19px; height: 19px; opacity: .82; }
.nav-item span:nth-child(2) { flex: 1; }
.nav-item:hover { background: rgba(255, 255, 255, .065); color: #fff; }
.nav-item.is-active {
  background: linear-gradient(100deg, rgba(74, 128, 255, .28), rgba(74, 128, 255, .10));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(123, 163, 255, .22), 0 8px 22px rgba(5, 14, 35, .18);
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -18px; top: 12px; bottom: 12px; width: 3px;
  border-radius: 0 4px 4px 0; background: #5e91ff; box-shadow: 0 0 12px #5e91ff;
}
.nav-item.is-active .icon { opacity: 1; color: #8bafff; }
.nav-count { flex: 0 0 auto !important; font-size: 11px; color: #7f93b6; }
.nav-badge { flex: 0 0 auto !important; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; display: inline-grid; place-items: center; background: rgba(255, 107, 111, .18); color: #ff9699; font-size: 10.5px; font-weight: 700; }

.sidebar-spacer { flex: 1; min-height: 6px; }

.storage-card, .connect-card {
  border: 1px solid rgba(255, 255, 255, .075);
  background: rgba(255, 255, 255, .045);
  border-radius: 15px;
  padding: 13px 14px;
  backdrop-filter: blur(10px);
}
.storage-title { display: flex; align-items: center; gap: 7px; color: #c5d3eb; font-size: 11.5px; font-weight: 600; }
.storage-title .icon { width: 15px; height: 15px; color: #8ba8d6; }
.storage-title em { margin-left: auto; font-style: normal; color: #7f93b6; font-size: 10.5px; }
.storage-bar { height: 6px; margin: 11px 0 8px; border-radius: 20px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.storage-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #4b86ff, #24d2bb); box-shadow: 0 0 10px rgba(36, 210, 187, .4); transition: width .6s var(--ease); }
.storage-meta { display: flex; justify-content: space-between; gap: 8px; color: #7b8eb1; font-size: 10px; }
.storage-meta span:last-child { text-align: right; }

.connect-card { padding: 12px 13px; }
.connect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aebfd9; font-size: 11px; font-weight: 600; }
.connect-head > span { display: flex; align-items: center; gap: 6px; }
.connect-head .icon { width: 14px; height: 14px; color: #4fd8c4; }
.connect-url {
  display: block; width: 100%; margin: 8px 0 5px; padding: 7px 6px;
  border: 0; border-radius: 7px;
  background: rgba(0, 0, 0, .18);
  color: #dce9ff; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; letter-spacing: -.15px;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .18s;
}
.connect-url:hover { background: rgba(0, 0, 0, .3); }
.connect-url.alt { margin-top: 0; margin-bottom: 5px; background: rgba(0, 0, 0, .10); color: #a9bfdf; font-size: 10px; }
.connect-url.alt:hover { background: rgba(0, 0, 0, .24); }
.connect-hint { color: #7185a7; font-size: 9.5px; }

.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 0; }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(140deg, #2c4f8d, #1b345d); color: #a9c3ed; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.user-copy { min-width: 0; }
.user-copy b { display: block; color: #d4e0f5; font-size: 11.5px; font-weight: 600; }
.user-copy span { display: block; margin-top: 2px; color: #7185a7; font-size: 9.5px; white-space: nowrap; }
.sidebar .icon-button { color: #8da2c4; border-color: rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .04); }
.sidebar .icon-button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: block; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 30px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
}
.back-button { display: none; }
.back-button:not([hidden]) { display: inline-grid; }
.breadcrumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; flex: 1; }
.crumb {
  display: inline-flex; align-items: center; gap: 7px;
  min-width: 0; max-width: 190px; height: 32px; padding: 0 9px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .18s, color .18s;
}
.crumb .icon { width: 15px; height: 15px; }
.crumb:hover { background: var(--surface-3); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--faint); flex: 0 0 auto; }
.crumb-sep .icon { width: 13px; height: 13px; }
.crumb.drop-target-crumb { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  width: 248px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s, box-shadow .18s, width .22s var(--ease);
  cursor: text;
}
.search-box:focus-within { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); box-shadow: 0 0 0 3px rgba(47, 107, 255, .11); width: 292px; }
.search-box .icon { width: 17px; height: 17px; color: var(--faint); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 12.5px; }
.search-box input::placeholder { color: var(--faint); }
.search-box kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--faint); font-family: var(--font); font-size: 9px; white-space: nowrap; }
.search-clear { border: 0; background: transparent; padding: 2px; color: var(--faint); border-radius: 5px; }
.search-clear:hover { color: var(--text); background: var(--surface-3); }
.search-clear .icon { width: 14px; height: 14px; }

.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-xs); }
.view-switch button { width: 31px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--faint); transition: .18s; }
.view-switch button:hover { color: var(--text); }
.view-switch button.is-active { background: var(--primary-soft); color: var(--primary); }
.view-switch .icon { width: 16px; height: 16px; }

.icon-button {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow-xs);
  transition: color .18s, background .18s, border-color .18s, transform .18s;
}
.icon-button:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-button:active { transform: scale(.95); }
.icon-button.tiny { width: 27px; height: 27px; border: 0; border-radius: 7px; box-shadow: none; background: transparent; }
.icon-button.tiny .icon { width: 15px; height: 15px; }
.mobile-menu { display: none; }

/* ==========================================================================
   Content / page head
   ========================================================================== */
.content { width: 100%; max-width: 1620px; margin: 0 auto; padding: 26px 30px 18px; display: flex; flex-direction: column; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.eyebrow { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.eyebrow-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px rgba(18, 183, 166, .13); }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.8px; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.head-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 15px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .18s, background .18s, border-color .18s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(135deg, #3d78ff, #2f63ef); color: #fff; box-shadow: 0 8px 18px rgba(47, 107, 255, .24), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover { background: linear-gradient(135deg, #4b83ff, #356bf5); box-shadow: 0 10px 22px rgba(47, 107, 255, .32); }
.btn-soft { border-color: var(--line); background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow-xs); }
.btn-soft:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-white { background: #fff; color: #183768; box-shadow: 0 8px 22px rgba(3, 12, 33, .2); }
.btn-white:hover { background: #f4f8ff; }
.btn-ghost-white { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .09); color: #fff; backdrop-filter: blur(8px); }
.btn-ghost-white:hover { background: rgba(255, 255, 255, .16); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 8px 18px rgba(229, 72, 77, .22); }
.btn-danger:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .55; }

.upload-split { position: relative; display: flex; }
.upload-split .btn-primary:first-child { border-radius: 10px 0 0 10px; padding-right: 13px; }
.upload-split .btn-primary.chevron { width: 34px; padding: 0; border-radius: 0 10px 10px 0; border-left: 1px solid rgba(255, 255, 255, .18); }
.upload-split .chevron .icon { width: 15px; height: 15px; }

.popover {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 230px; padding: 6px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: popIn .16s var(--ease);
}
.upload-popover button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; }
.upload-popover button:hover { background: var(--surface-2); }
.upload-popover .icon { width: 19px; height: 19px; color: var(--primary); }
.upload-popover b { display: block; font-size: 12px; font-weight: 600; }
.upload-popover small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  min-height: 202px;
  margin-bottom: 20px;
  padding: 28px 32px;
  display: flex; align-items: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(620px 300px at 82% 10%, rgba(36, 210, 187, .35), transparent 62%),
    radial-gradient(520px 280px at 12% 100%, rgba(91, 141, 255, .42), transparent 68%),
    linear-gradient(118deg, #152e60 0%, #123f70 52%, #0b5f6a 100%);
  box-shadow: 0 18px 44px rgba(17, 48, 99, .18);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; max-width: 600px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #86e7d8; font-size: 9.5px; font-weight: 800; letter-spacing: 2px; }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #42e1ca; box-shadow: 0 0 0 0 rgba(66, 225, 202, .55); animation: pulse 2.4s infinite; }
.hero h2 { margin: 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 750; letter-spacing: -.8px; }
.hero p { max-width: 500px; margin: 9px 0 18px; color: #b8cdea; font-size: 12.5px; line-height: 1.65; }
.hero-actions { display: flex; gap: 9px; }
.hero-actions .btn { height: 38px; font-size: 12px; }
.hero-art { position: absolute; right: 2%; top: 0; bottom: 0; width: 42%; min-width: 390px; pointer-events: none; }
.hero-folder { position: absolute; right: 22%; top: 50%; width: 130px; height: 130px; margin-top: -65px; display: grid; place-items: center; border-radius: 38px; color: #bfe1ff; background: linear-gradient(145deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .05)); border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 28px 60px rgba(3, 15, 38, .3), inset 0 1px 0 rgba(255, 255, 255, .22); backdrop-filter: blur(4px); transform: rotate(-5deg); }
.hero-folder svg { width: 76px; height: 76px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-a { width: 210px; height: 210px; right: 0; top: -80px; background: radial-gradient(circle at 35% 35%, rgba(68, 255, 223, .5), rgba(20, 138, 153, .05) 65%); }
.orb-b { width: 150px; height: 150px; right: 38%; bottom: -70px; background: radial-gradient(circle at 40% 40%, rgba(100, 151, 255, .4), transparent 68%); }
.float-card { position: absolute; display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 7px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(12, 35, 68, .54); backdrop-filter: blur(10px); box-shadow: 0 12px 28px rgba(4, 16, 38, .24); }
.float-card b { display: block; color: #f2f8ff; font-size: 10.5px; font-weight: 600; }
.float-card small { display: block; margin-top: 1px; color: #8fb1d2; font-size: 8.5px; }
.float-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; }
.float-icon .icon { width: 14px; height: 14px; }
.float-icon.video { background: rgba(91, 141, 255, .22); color: #91b6ff; }
.float-icon.image { background: rgba(36, 210, 187, .18); color: #61e1cf; }
.float-icon.share { background: rgba(255, 178, 76, .16); color: #ffc472; }
.float-video { right: 6%; top: 25%; animation: floatY 5s ease-in-out infinite; }
.float-image { left: 0; top: 15%; animation: floatY 6s ease-in-out infinite .8s; }
.float-share { right: 9%; bottom: 16%; animation: floatY 5.5s ease-in-out infinite .4s; }

/* ==========================================================================
   File panel
   ========================================================================== */
.file-panel {
  position: relative;
  display: flex; flex-direction: column; flex: 1;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.file-toolbar { display: flex; align-items: center; gap: 13px; height: 54px; padding: 0 17px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.select-all { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.select-all input { position: absolute; opacity: 0; pointer-events: none; }
.custom-check { width: 17px; height: 17px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); display: grid; place-items: center; transition: .15s; }
.custom-check .icon { width: 12px; height: 12px; color: #fff; opacity: 0; transform: scale(.6); transition: .15s; }
.select-all input:checked + .custom-check, .file-card.selected .custom-check { background: var(--primary); border-color: var(--primary); }
.select-all input:checked + .custom-check .icon, .file-card.selected .custom-check .icon { opacity: 1; transform: scale(1); }
.select-all input:indeterminate + .custom-check { background: var(--primary); border-color: var(--primary); }
.select-all input:indeterminate + .custom-check::after { content: ""; width: 8px; height: 1.8px; border-radius: 2px; background: #fff; }
.select-label { color: var(--text-soft); font-size: 11.5px; font-weight: 600; }
.toolbar-divider { width: 1px; height: 17px; background: var(--line); }
.file-summary { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-spacer { flex: 1; }
.sort-control { display: inline-flex; align-items: center; gap: 7px; color: var(--faint); font-size: 10.5px; }
.sort-control select { height: 29px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--text-soft); font-size: 10.5px; outline: none; cursor: pointer; }

.list-head { display: none; grid-template-columns: 32px 44px minmax(0, 1fr) 170px 100px 150px 36px; align-items: center; gap: 0; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.list-head:not([hidden]) { display: grid; }
.list-head button { border: 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; text-align: left; padding: 0; display: inline-flex; align-items: center; gap: 3px; }
.list-head button:hover { color: var(--text-soft); }
.list-head .icon { width: 11px; height: 11px; opacity: .6; }
.lh-size, .lh-date { text-align: right; }
.lh-name { padding-left: 12px !important; }
.lh-size { padding-right: 14px; }
.list-head.is-sorted .lh-name .icon, .list-head .lh-name.is-sorted .icon { color: var(--primary); opacity: 1; }

.file-area { position: relative; flex: 1; min-height: 280px; overflow: auto; outline: none; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; padding: 17px; align-content: start; }
.file-grid.is-list { display: block; padding: 0; }

/* Cards — grid mode */
.file-card {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  cursor: default;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
  user-select: none;
  -webkit-user-drag: element;
}
.file-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 20%, var(--line)); box-shadow: var(--shadow-md); }
.file-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .14), var(--shadow-md); }
.file-card.cut { opacity: .48; }
.file-card.drag-source { opacity: .55; }
.file-card.drop-target { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18, 183, 166, .16); background: var(--teal-soft); }
.file-card.drop-target .file-thumb { transform: scale(1.02); }
.file-thumb {
  position: relative; height: 118px; margin: 7px 7px 0; border-radius: 11px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #f0f4fc, #e7eefb);
  transition: transform .2s var(--ease);
}
.file-thumb > .icon { width: 43px; height: 43px; stroke-width: 1.35; }
.file-thumb .thumb-video .icon { width: 43px; height: 43px; stroke-width: 1.35; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-thumb .thumb-video { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.file-thumb .thumb-video::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .18), transparent 60%); }
.file-thumb .play-badge { position: absolute; z-index: 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(13, 27, 55, .46); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(5px); box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.file-thumb .play-badge .icon { width: 15px; height: 15px; margin-left: 2px; }
.file-thumb .ext-badge { position: absolute; right: 7px; bottom: 7px; z-index: 2; max-width: calc(100% - 14px); padding: 2px 5px; border-radius: 4px; background: rgba(16, 29, 54, .56); color: #fff; font-size: 7.5px; font-weight: 700; letter-spacing: .3px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(4px); }
.file-card[data-kind="video"] .file-thumb { background: linear-gradient(145deg, #e9efff, #dbe6ff); }
.file-card[data-kind="video"] .file-thumb > .icon { color: #4f7ef0; }
.file-card[data-kind="image"] .file-thumb { background: linear-gradient(145deg, #e8faf6, #d7f2ec); }
.file-card[data-kind="image"] .file-thumb > .icon { color: #16a693; }
.file-card[data-kind="audio"] .file-thumb { background: linear-gradient(145deg, #f3edff, #e7ddff); }
.file-card[data-kind="audio"] .file-thumb > .icon { color: #8a63df; }
.file-card[data-kind="doc"] .file-thumb { background: linear-gradient(145deg, #fff5e7, #ffead1); }
.file-card[data-kind="doc"] .file-thumb > .icon { color: #dc8a2c; }
.file-card[data-kind="archive"] .file-thumb { background: linear-gradient(145deg, #f2f4f8, #e7ebf2); }
.file-card[data-kind="archive"] .file-thumb > .icon { color: #6f7f98; }
.file-card[data-kind="code"] .file-thumb { background: linear-gradient(145deg, #ebf3ff, #dce9ff); }
.file-card[data-kind="code"] .file-thumb > .icon { color: #3572d6; }
.file-card[data-kind="design"] .file-thumb { background: linear-gradient(145deg, #ffeef5, #ffdcea); }
.file-card[data-kind="design"] .file-thumb > .icon { color: #d64d8d; }
.file-card[data-kind="folder"] .file-thumb { background: linear-gradient(145deg, #edf3ff, #dfe9fc); }
.file-card[data-kind="folder"] .file-thumb > .icon { width: 55px; height: 55px; color: #5d88e8; stroke-width: 1.2; }
html[data-theme="dark"] .file-card[data-kind="video"] .file-thumb { background: linear-gradient(145deg, #172848, #1a3157); }
html[data-theme="dark"] .file-card[data-kind="image"] .file-thumb { background: linear-gradient(145deg, #11302f, #153c39); }
html[data-theme="dark"] .file-card[data-kind="audio"] .file-thumb { background: linear-gradient(145deg, #261b44, #2c214e); }
html[data-theme="dark"] .file-card[data-kind="doc"] .file-thumb { background: linear-gradient(145deg, #362818, #3b2c1c); }
html[data-theme="dark"] .file-card[data-kind="archive"] .file-thumb { background: linear-gradient(145deg, #1b2638, #202c40); }
html[data-theme="dark"] .file-card[data-kind="code"] .file-thumb { background: linear-gradient(145deg, #152640, #182d4d); }
html[data-theme="dark"] .file-card[data-kind="design"] .file-thumb { background: linear-gradient(145deg, #351c2a, #3c2130); }
html[data-theme="dark"] .file-card[data-kind="folder"] .file-thumb { background: linear-gradient(145deg, #182744, #1b3054); }

.file-info { padding: 10px 12px 12px; min-width: 0; }
.file-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.42; word-break: break-all; }
.file-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--faint); font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--faint); }
.file-loc, .file-size, .file-date { display: none; }

.card-check { position: absolute; z-index: 4; left: 9px; top: 9px; width: 20px; height: 20px; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.file-card:hover .card-check, .file-card.selected .card-check { opacity: 1; }
.card-check input { position: absolute; opacity: 0; pointer-events: none; }
.card-check .custom-check { width: 19px; height: 19px; border-radius: 6px; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 8px rgba(16, 29, 54, .17); }
html[data-theme="dark"] .card-check .custom-check { background: rgba(15, 27, 47, .85); }
.card-check input:checked + .custom-check { background: var(--primary); border-color: var(--primary); }

.card-more { position: absolute; z-index: 4; right: 9px; top: 9px; width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 7px; background: rgba(255, 255, 255, .86); color: var(--text-soft); box-shadow: 0 2px 8px rgba(16, 29, 54, .12); opacity: 0; transform: translateY(-2px); transition: .15s; backdrop-filter: blur(6px); }
html[data-theme="dark"] .card-more { background: rgba(15, 27, 47, .9); }
.file-card:hover .card-more, .file-card.selected .card-more { opacity: 1; transform: none; }
.card-more:hover { color: var(--primary); }
.card-more .icon { width: 15px; height: 15px; }

/* Cards — list mode */
.file-grid.is-list .file-card {
  display: grid;
  grid-template-columns: 32px 44px minmax(0, 1fr) 170px 100px 150px 36px;
  align-items: center;
  min-height: 58px; padding: 0 14px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent;
  transform: none !important;
  box-shadow: none !important;
}
.file-grid.is-list .file-card:last-child { border-bottom: 0; }
.file-grid.is-list .file-card:hover { background: var(--surface-2); }
.file-grid.is-list .file-card.selected { background: var(--primary-soft); }
.file-grid.is-list .file-card.drop-target { background: var(--teal-soft); box-shadow: inset 0 0 0 2px var(--teal) !important; }
.file-grid.is-list .file-thumb { width: 36px; height: 36px; margin: 0; border-radius: 9px; }
.file-grid.is-list .file-thumb > .icon { width: 20px; height: 20px; }
.file-grid.is-list .file-thumb .thumb-video .icon { width: 20px; height: 20px; }
.file-grid.is-list .file-card[data-kind="folder"] .file-thumb > .icon { width: 24px; height: 24px; }
.file-grid.is-list .file-thumb .play-badge { width: 20px; height: 20px; }
.file-grid.is-list .file-thumb .play-badge .icon { width: 8px; height: 8px; }
.file-grid.is-list .file-info { padding: 0 12px; min-width: 0; }
.file-grid.is-list .file-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; line-height: 1.3; }
.file-grid.is-list .file-meta { display: none; }
.file-grid.is-list .file-loc, .file-grid.is-list .file-size, .file-grid.is-list .file-date { display: block; color: var(--faint); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-grid.is-list .file-loc { padding-right: 14px; color: var(--muted); }
.file-grid.is-list .file-size, .file-grid.is-list .file-date { text-align: right; padding-right: 14px; }
.file-grid.is-list .file-date { padding-right: 0; }
.file-grid.is-list .card-check { position: static; left: auto; top: auto; opacity: 1; width: 20px; }
.file-grid.is-list .card-more { position: static; right: auto; top: auto; opacity: 0; background: transparent; box-shadow: none; width: 30px; height: 30px; transform: none; }
.file-grid.is-list .file-card:hover .card-more, .file-grid.is-list .file-card.selected .card-more { opacity: 1; }
.file-grid.is-list .file-card:hover .card-more:hover { background: var(--surface-3); }

/* Empty / loading */
.empty-state { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px 20px; text-align: center; }
.empty-art { position: relative; width: 106px; height: 94px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 30px; background: linear-gradient(145deg, var(--primary-soft), var(--surface-3)); }
.empty-art > svg { width: 54px; height: 54px; color: var(--primary); fill: none; stroke: currentColor; stroke-width: 1.1; opacity: .85; }
.empty-spark { position: absolute; border-radius: 50%; background: var(--teal); opacity: .6; }
.empty-spark.s1 { width: 5px; height: 5px; top: 7px; right: 7px; }
.empty-spark.s2 { width: 4px; height: 4px; bottom: 12px; left: 2px; background: var(--primary); }
.empty-spark.s3 { width: 3px; height: 3px; top: 24px; left: -4px; }
.empty-state h3 { margin: 8px 0 5px; font-size: 15px; font-weight: 650; }
.empty-state p { max-width: 340px; margin: 0 0 17px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.empty-state .btn { height: 36px; font-size: 11.5px; }
.loading-layer { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; background: color-mix(in srgb, var(--surface) 76%, transparent); backdrop-filter: blur(3px); }
.loading-layer p { margin: 0; color: var(--muted); font-size: 11.5px; }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.small { width: 15px; height: 15px; border-width: 2px; }
.marquee { position: absolute; z-index: 8; border: 1px solid var(--primary); background: rgba(47, 107, 255, .09); border-radius: 3px; pointer-events: none; }

.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 4px 0; color: var(--faint); font-size: 10px; }
.statusbar > span { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.statusbar.offline .status-dot { background: var(--warn); }

/* ==========================================================================
   Selection bar
   ========================================================================== */
.selection-bar {
  position: fixed; z-index: 80; left: calc(var(--sidebar-w) + 30px); right: 30px; bottom: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 11px 9px 15px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 18px 46px rgba(9, 22, 48, .2);
  backdrop-filter: blur(18px) saturate(1.4);
  animation: slideUp .22s var(--ease);
}
.selection-count { display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sel-badge { min-width: 25px; height: 25px; padding: 0 7px; display: grid; place-items: center; border-radius: 7px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; box-shadow: 0 5px 12px rgba(47, 107, 255, .3); }
.selection-actions { display: flex; align-items: center; gap: 3px; }
.selection-actions button { display: inline-flex; align-items: center; gap: 6px; height: 33px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.selection-actions button:hover { background: var(--surface-3); color: var(--text); }
.selection-actions button.danger { color: var(--danger); }
.selection-actions button.danger:hover { background: var(--danger-soft); }
.selection-actions .icon { width: 15px; height: 15px; }
.selection-divider { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }

/* ==========================================================================
   Upload panel
   ========================================================================== */
.upload-panel {
  position: fixed; z-index: 90; right: 26px; bottom: 24px; width: 378px;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideUp .24s var(--ease);
}
.upload-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 12px 12px 15px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.upload-title { font-size: 12px; font-weight: 700; }
.upload-summary { margin-left: 8px; color: var(--muted); font-size: 10px; }
.upload-head-actions { display: flex; gap: 1px; }
.upload-list { max-height: 310px; overflow: auto; padding: 8px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.upload-item:hover { background: var(--surface-2); }
.upload-file-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.upload-file-icon .icon { width: 17px; height: 17px; }
.upload-file-main { flex: 1; min-width: 0; }
.upload-file-top { display: flex; align-items: center; gap: 8px; }
.upload-file-name { flex: 1; min-width: 0; color: var(--text-soft); font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-file-state { color: var(--muted); font-size: 9px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.upload-file-state.done { color: var(--teal); }
.upload-file-state.error { color: var(--danger); }
.upload-progress { height: 4px; margin-top: 6px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #3d78ff, #14bfae); transition: width .18s linear; }
.upload-item.error .upload-progress span { background: var(--danger); }
.upload-cancel { border: 0; background: transparent; color: var(--faint); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; flex: 0 0 auto; }
.upload-cancel:hover { background: var(--danger-soft); color: var(--danger); }
.upload-cancel .icon { width: 13px; height: 13px; }
.upload-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--faint); font-size: 9px; }
.upload-foot span { display: flex; align-items: center; gap: 4px; }
.upload-foot .icon { width: 12px; height: 12px; }
.upload-foot button { border: 0; background: transparent; color: var(--primary); font-size: 9.5px; font-weight: 600; }
.upload-pill { position: fixed; z-index: 90; right: 26px; bottom: 24px; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow-md); font-size: 10.5px; font-weight: 600; }
.upload-pill b { color: var(--primary); font-size: 11px; }

/* ==========================================================================
   Drop overlay
   ========================================================================== */
.drop-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 26px; background: rgba(7, 16, 34, .62); backdrop-filter: blur(9px); animation: fadeIn .14s; pointer-events: none; }
.drop-inner { width: min(460px, 100%); padding: 42px 32px; border: 2px dashed rgba(125, 167, 255, .55); border-radius: 28px; background: rgba(17, 36, 68, .72); text-align: center; color: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.drop-icon { width: 76px; height: 76px; margin: 0 auto 15px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(91, 141, 255, .3), rgba(36, 210, 187, .2)); border: 1px solid rgba(255, 255, 255, .18); color: #bfe0ff; animation: bob 1.8s ease-in-out infinite; }
.drop-icon .icon { width: 34px; height: 34px; }
.drop-inner h2 { margin: 0 0 6px; font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.drop-inner p { margin: 0; color: #a9bfdc; font-size: 12px; }
.drop-chip { display: inline-block; margin-top: 15px; padding: 5px 11px; border-radius: 20px; background: rgba(255, 255, 255, .09); color: #91e3d7; font-size: 9.5px; letter-spacing: .3px; }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-root { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(7, 16, 34, .48); backdrop-filter: blur(7px); animation: fadeIn .16s; }
.modal { width: min(460px, 100%); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .2s var(--ease); }
.modal.modal-wide { width: min(680px, 100%); }
.modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 13px; background: var(--primary-soft); color: var(--primary); }
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-icon.warn { background: rgba(233, 162, 59, .12); color: var(--warn); }
.modal-icon .icon { width: 21px; height: 21px; }
.modal-body { padding: 22px 22px 8px; }
.modal-body h3 { margin: 0 0 7px; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.modal-body p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.modal-body p strong { color: var(--text); font-weight: 600; }
.field { margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 600; }
.field input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 12.5px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .11); background: var(--surface); }
.field-hint { margin-top: 7px; color: var(--faint); font-size: 9.5px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.modal-foot .btn { height: 37px; font-size: 11.5px; }
.modal-foot .spacer { flex: 1; }
.modal-error { margin-top: 11px; padding: 8px 10px; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 10px; }

/* Preview modal */
.preview-modal { width: min(1080px, 94vw); max-height: 90vh; display: flex; flex-direction: column; border-radius: 18px; background: #0a1220; overflow: hidden; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); animation: modalIn .2s var(--ease); }
.preview-head { display: flex; align-items: center; gap: 12px; padding: 13px 15px 13px 19px; color: #eaf1ff; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
.preview-title { min-width: 0; flex: 1; }
.preview-title b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-title span { display: block; margin-top: 3px; color: #7f92ad; font-size: 9.5px; }
.preview-actions { display: flex; align-items: center; gap: 6px; }
.preview-actions .icon-button { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .1); color: #c3d1e6; box-shadow: none; }
.preview-actions .icon-button:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.preview-actions .icon-button.close:hover { background: rgba(255, 90, 95, .2); color: #ff9b9e; }
.preview-stage { flex: 1; min-height: 260px; max-height: calc(90vh - 65px); display: grid; place-items: center; overflow: auto; background: radial-gradient(900px 500px at 50% 40%, rgba(40, 65, 108, .23), transparent 70%), #070e19; }
.preview-stage img { max-width: 100%; max-height: calc(90vh - 80px); object-fit: contain; }
.preview-stage video { width: 100%; max-height: calc(90vh - 80px); background: #000; outline: none; }
.preview-stage audio { width: min(560px, 90%); }
.preview-stage iframe { width: 100%; height: calc(90vh - 65px); border: 0; background: #fff; }
.preview-stage pre { width: 100%; height: 100%; max-height: calc(90vh - 65px); margin: 0; padding: 24px; overflow: auto; color: #c7d6eb; font-family: "Cascadia Code", Consolas, monospace; font-size: 11.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.preview-unsupported { text-align: center; color: #8ea1bd; padding: 40px 20px; }
.preview-unsupported .icon { width: 58px; height: 58px; margin: 0 auto 14px; color: #536b8f; }
.preview-unsupported h4 { margin: 0 0 6px; color: #d3e0f4; font-size: 14px; }
.preview-unsupported p { margin: 0 0 17px; font-size: 11px; }
.preview-unsupported .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }

/* Context menu */
.context-menu { position: fixed; z-index: 400; min-width: 188px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: popIn .12s var(--ease); }
.context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 11px; text-align: left; }
.context-menu button:hover { background: var(--surface-2); color: var(--text); }
.context-menu button.danger { color: var(--danger); }
.context-menu button.danger:hover { background: var(--danger-soft); }
.context-menu .icon { width: 15px; height: 15px; color: var(--faint); }
.context-menu button.danger .icon { color: var(--danger); }
.context-menu button:hover .icon { color: inherit; }
.context-menu kbd { margin-left: auto; color: var(--faint); font-family: var(--font); font-size: 8.5px; }
.context-sep { height: 1px; margin: 4px 5px; background: var(--line); }
.context-label { padding: 6px 9px 3px; color: var(--faint); font-size: 9px; font-weight: 600; }

/* Toast */
.toast-stack { position: fixed; z-index: 500; top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 40px); }
.toast { display: flex; align-items: center; gap: 9px; max-width: 480px; padding: 10px 14px 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow-md); font-size: 11px; line-height: 1.45; animation: toastIn .22s var(--ease); pointer-events: auto; }
.toast .toast-icon { width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; background: var(--primary-soft); color: var(--primary); }
.toast .toast-icon .icon { width: 13px; height: 13px; }
.toast.success .toast-icon { background: var(--teal-soft); color: var(--teal); }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast.warn .toast-icon { background: rgba(233, 162, 59, .12); color: var(--warn); }
.toast.leaving { animation: toastOut .18s forwards; }

/* Trash specific */
.trash-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 10.5px; grid-column: 1 / -1; }
.trash-banner .icon { width: 17px; height: 17px; color: var(--warn); }
.trash-banner .spacer { flex: 1; }
.trash-actions { display: flex; gap: 4px; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text-soft); font-size: 9.5px; font-weight: 500; white-space: nowrap; }
.mini-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.mini-btn.danger { color: var(--danger); }
.mini-btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.mini-btn .icon { width: 12px; height: 12px; }
.trash-card .file-thumb { background: linear-gradient(145deg, #f2f4f8, #e9edf5); }
html[data-theme="dark"] .trash-card .file-thumb { background: linear-gradient(145deg, #1b2638, #202c40); }
.trash-card .file-thumb > .icon { color: var(--faint); }
.trash-meta-row { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--faint); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trash-meta-row .icon { width: 11px; height: 11px; }
.trash-card .card-actions { display: flex; gap: 5px; margin-top: 9px; }
.file-grid:not(.is-list) .trash-card { min-height: 250px; }
.version-list { display: flex; flex-direction: column; gap: 7px; max-height: 390px; margin-top: 14px; overflow: auto; }
.version-row { display: flex; align-items: center; gap: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.version-main { flex: 1; min-width: 0; }
.version-main b { display: block; color: var(--text); font-size: 11px; font-weight: 600; }
.version-main span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-empty { padding: 26px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 10.5px; text-align: center; }
.version-row .mini-btn { flex: 0 0 auto; }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-5px) scale(.98); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(9px) scale(.985); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(66, 225, 202, .5); } 70% { box-shadow: 0 0 0 8px rgba(66, 225, 202, 0); } 100% { box-shadow: 0 0 0 0 rgba(66, 225, 202, 0); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  :root { --sidebar-w: 236px; }
  .sidebar { padding-left: 15px; padding-right: 15px; }
  .hero-art { width: 40%; min-width: 330px; opacity: .9; }
  .float-image { display: none; }
  .search-box { width: 210px; }
  .search-box:focus-within { width: 250px; }
}

@media (max-width: 980px) {
  :root { --sidebar-w: 258px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-102%); transition: transform .25s var(--ease); box-shadow: 24px 0 60px rgba(0, 0, 0, .25); }
  body.nav-open .sidebar { transform: none; }
  .mobile-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5, 13, 27, .5); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .mobile-scrim { opacity: 1; pointer-events: auto; }
  .mobile-menu { display: inline-grid; }
  .back-button { display: inline-grid; }
  .selection-bar { left: 18px; right: 18px; }
  .topbar { padding: 0 20px; }
  .content { padding: 22px 20px 16px; }
  .hero { padding: 25px 26px; }
  .hero-art { opacity: .72; }
  .float-card { display: none; }
  .hero-folder { right: 12%; }
}

@media (max-width: 760px) {
  .search-box { width: 40px; padding: 0 10px; }
  .search-box input, .search-box kbd { display: none; }
  .search-box:focus-within { position: absolute; right: 12px; left: 12px; top: 17px; z-index: 5; width: auto; padding: 0 10px; background: var(--surface); }
  .search-box:focus-within input { display: block; }
  .search-box:focus-within kbd { display: none; }
  .search-box .search-clear { display: none; }
  .page-head { flex-direction: column; align-items: stretch; gap: 15px; }
  .head-actions { justify-content: flex-end; }
  .hero { min-height: 185px; padding: 23px; }
  .hero-art { display: none; }
  .hero h2 { font-size: 23px; }
  .hero p { font-size: 11.5px; max-width: 92%; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 11px; padding: 13px; }
  .file-thumb { height: 104px; }
  .file-grid.is-list .file-card { grid-template-columns: 30px 40px minmax(0, 1fr) 80px 30px; padding: 0 10px; }
  .list-head { display: none !important; }
  .file-grid.is-list .file-loc, .file-grid.is-list .file-date { display: none; }
  .file-grid.is-list .file-size { padding-right: 10px; }
  .toast-stack { top: 10px; }
  .upload-panel { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .upload-pill { right: 12px; bottom: 12px; }
  .selection-bar { bottom: 12px; padding: 8px; gap: 4px; }
  .selection-count { display: none; }
  .selection-actions { width: 100%; justify-content: space-between; }
  .selection-actions button span { display: none; }
  .selection-actions button { padding: 0 9px; }
  .selection-divider { display: none; }
  .sort-control > span { display: none; }
  .file-summary { font-size: 10.5px; }
  .page-head h1 { font-size: 24px; }
  .btn { padding: 0 12px; }
  .head-actions .btn span { font-size: 11.5px; }
}

@media (max-width: 480px) {
  .topbar { height: 64px; padding: 0 12px; gap: 5px; }
  .content { padding: 17px 12px 12px; }
  .topbar-actions { gap: 5px; }
  .view-switch { display: none; }
  .page-head { margin-bottom: 14px; }
  .page-head p { font-size: 11px; }
  .hero { border-radius: 20px; padding: 20px; min-height: 176px; }
  .hero-actions .btn { flex: 1; padding: 0 9px; }
  .hero-kicker { font-size: 8.5px; }
  .hero h2 { font-size: 20px; }
  .head-actions { width: 100%; }
  .head-actions .btn-soft { flex: 1; }
  .upload-split { flex: 1; }
  .upload-split .btn-primary:first-child { flex: 1; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 10px; }
  .file-thumb { height: 96px; margin: 5px 5px 0; }
  .file-info { padding: 8px 9px 10px; }
  .file-name { font-size: 11px; }
  .file-meta { font-size: 8.5px; }
  .file-toolbar { padding: 0 11px; gap: 8px; }
  .sort-control select { max-width: 100px; }
  .breadcrumb .crumb { max-width: 110px; }
  .page-title-wrap h1 { font-size: 22px; }
  .statusbar { display: none; }
  .modal-root { padding: 12px; }
  .modal-body { padding: 19px 18px 6px; }
  .modal-foot { padding: 14px 18px 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   登录 / 注册
   ========================================================================== */
body.auth-pending { overflow: hidden; }
body.auth-pending .app-shell { display: none; }
.sidebar-bottom-actions { display: flex; align-items: center; gap: 3px; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: auto;
  color: #eaf2ff;
  background:
    radial-gradient(800px 500px at 78% 5%, rgba(47, 107, 255, .38), transparent 65%),
    radial-gradient(650px 500px at 10% 95%, rgba(18, 183, 166, .24), transparent 65%),
    linear-gradient(145deg, #071225, #0b1b35 55%, #071c2b);
}
.auth-screen[hidden] { display: none !important; }
.auth-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 50% 45%, #000, transparent 72%);
}
.auth-orb { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(2px); }
.auth-orb-a { width: 300px; height: 300px; right: 12%; top: 8%; background: radial-gradient(circle at 35% 35%, rgba(73, 132, 255, .35), transparent 68%); }
.auth-orb-b { width: 220px; height: 220px; left: 16%; bottom: 4%; background: radial-gradient(circle at 40% 40%, rgba(36, 210, 187, .22), transparent 68%); }

.auth-card {
  position: relative; z-index: 2;
  width: min(430px, 100%);
  padding: 30px 30px 24px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 24px;
  background: rgba(255, 255, 255, .985);
  color: var(--text);
  box-shadow: 0 35px 90px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .8);
  animation: modalIn .3s var(--ease);
}
html[data-theme="dark"] .auth-card { border-color: rgba(255, 255, 255, .08); background: #101c30; box-shadow: 0 35px 90px rgba(0, 0, 0, .6); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.auth-brand b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.auth-brand span { display: block; margin-top: 2px; color: var(--faint); font-size: 8.5px; font-weight: 700; letter-spacing: 1.6px; }
.auth-heading h1 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -.6px; }
.auth-heading p { margin: 7px 0 19px; color: var(--muted); font-size: 11.5px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-tabs button { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 600; transition: .18s; }
.auth-tabs button:hover { color: var(--text); }
.auth-tabs button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 17px; }
.auth-field { display: block; }
.auth-field > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9.5px; font-weight: 600; }
.auth-field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface-2); color: var(--text); font-size: 12.5px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); background: var(--surface); }
.auth-field input::placeholder { color: var(--faint); }
.auth-submit {
  height: 43px; margin-top: 4px;
  border: 0; border-radius: 9px;
  background: linear-gradient(135deg, #3d78ff, #2f63ef);
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 9px 20px rgba(47, 107, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: .18s;
}
.auth-submit:hover { filter: brightness(1.06); }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { padding: 9px 10px; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 10px; line-height: 1.5; }
.auth-hint { margin: 15px 0 0; color: var(--faint); font-size: 9.5px; line-height: 1.6; text-align: center; }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 8.5px; }
.auth-footer .live-dot { width: 5px; height: 5px; }

@media (max-width: 480px) {
  .auth-screen { padding: 12px; }
  .auth-card { padding: 24px 19px 20px; border-radius: 20px; }
  .auth-heading h1 { font-size: 21px; }
}

