:root {
  --bg: #f2f4f9;
  --panel: #ffffff;
  --sidebar: #fbfcff;
  --line: #e9edf5;
  --line-strong: #dde3ee;
  --text: #0f172a;
  --text-2: #475467;
  --muted: #8a94a6;
  --primary: #2563eb;
  --primary-2: #4f46e5;
  --primary-soft: #eef3ff;
  --green: #12b76a;
  --red: #ef4444;
  --amber: #f59e0b;
  --purple: #7c5cfc;
  --shadow: 0 1px 2px rgba(16, 24, 40, .03), 0 12px 30px -18px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { -webkit-appearance: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; display: block; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 196px; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  box-shadow: 0 7px 16px rgba(59, 130, 246, .32);
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.logo svg { width: 23px; height: 23px; }
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: .2px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.search { flex: 1; max-width: 430px; position: relative; }
.search > .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 40px;
  border: 1px solid transparent;
  background: #f3f5fa;
  border-radius: 11px;
  padding: 0 38px 0 38px;
  outline: none;
  font-size: 13px;
  color: var(--text);
  transition: .18s;
}
.search input::placeholder { color: #9aa4b5; }
.search input:focus { background: #fff; border-color: #bfd3ff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: #e5eaf3;
  color: #667085;
  cursor: pointer;
  display: none;
  place-items: center;
  padding: 0;
}
.search-clear.show { display: grid; }
.search-clear .ic { width: 13px; height: 13px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.sync-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 0 4px; white-space: nowrap; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(18, 183, 106, .14); }
.sync-state.syncing .sync-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.storage-pill {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f3f6fc;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.storage-pill .ic { width: 14px; height: 14px; color: #7b879b; }

.btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: .18s;
  white-space: nowrap;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: #c9d4e8; background: #f8faff; color: var(--text); }
.btn.primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 8px 20px rgba(37, 99, 235, .32); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn.danger:hover { background: #fee2e2; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: .15s;
  padding: 0;
}
.icon-btn:hover { background: #f2f5fa; color: var(--text); }
.icon-btn.active { background: var(--primary-soft); color: var(--primary); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 68px); }
.sidebar {
  width: 236px;
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
}
.nav-title { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #98a2b3; padding: 0 10px; margin-bottom: 7px; }
.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
  user-select: none;
}
.nav-item .ic { width: 18px; height: 18px; color: #7b879b; }
.nav-item:hover { background: #f1f4fa; color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item.active .ic { color: var(--primary); }
.nav-badge { margin-left: auto; background: #e8edf7; color: #667085; border-radius: 6px; padding: 1px 6px; font-size: 10.5px; }
.storage-card {
  margin-top: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .03);
}
.storage-card .row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-2); }
.storage-card strong { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.storage-card .sub { font-size: 11px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.storage-bar { height: 6px; background: #eef1f7; border-radius: 99px; margin-top: 11px; overflow: hidden; }
.storage-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #6366f1); transition: width .4s; }

.main { flex: 1; min-width: 0; padding: 22px 28px 70px; max-width: 1560px; margin: 0 auto; width: 100%; }
.pathbar { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; min-height: 34px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 13.5px; min-width: 0; }
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--text-2);
  cursor: pointer;
  transition: .15s;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumb:hover { background: #eaf0fb; color: var(--text); }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.crumb.current:hover { background: transparent; }
.crumb .ic { width: 15px; height: 15px; color: #8a94a6; }
.crumb-sep { color: #c3cad9; font-size: 11px; display: flex; align-items: center; padding: 0 1px; }
.crumb-sep .ic { width: 12px; height: 12px; }
.count-tag { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .hint { font-size: 11.5px; color: #9aa4b5; margin-left: 2px; }
.select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 0 9px;
  color: var(--text-2);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: #bfd3ff; }
.view-toggle { display: flex; background: #eef1f7; border-radius: 9px; padding: 3px; gap: 2px; }
.view-toggle button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  color: #8a94a6;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.view-toggle button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
.view-toggle .ic { width: 15px; height: 15px; }

/* ---------- 文件列表 ---------- */
.content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
  min-height: 430px;
}
.file-table .thead, .file-table .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 158px 136px;
  align-items: center;
  padding: 0 18px;
}
.file-table .thead {
  height: 44px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: #98a2b3;
  letter-spacing: .04em;
}
.row {
  height: 58px;
  border-bottom: 1px solid #f1f4f9;
  cursor: pointer;
  transition: background .13s;
  position: relative;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #f8faff; }
.cell-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.visual { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; overflow: hidden; }
.visual .ic { width: 20px; height: 20px; }
.visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visual.has-thumb { position: relative; background: #e9fbf2; color: #0ca678; }
.visual.has-thumb > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.visual.has-thumb > .ic { position: relative; z-index: 0; }
.fileicon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.fileicon .ic { width: 20px; height: 20px; }
.fileicon.folder { background: #eef4ff; color: #3b82f6; }
.fileicon.image { background: #e9fbf2; color: #0ca678; }
.fileicon.video { background: #f2efff; color: #7c5cfc; }
.fileicon.audio { background: #fff4e8; color: #f08c00; }
.fileicon.doc { background: #e9f5ff; color: #1f8fe0; }
.fileicon.pdf { background: #feeeee; color: #e5484d; }
.fileicon.archive { background: #fff8e6; color: #d99400; }
.fileicon.other { background: #f1f3f8; color: #7b879b; }
.name-wrap { min-width: 0; }
.name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 10.5px; color: #98a2b3; margin-top: 2px; }
.cell-size, .cell-time { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1px; opacity: 0; transition: opacity .15s; }
.row:hover .cell-actions { opacity: 1; }
.act-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #7b879b;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.act-btn:hover { background: #eaf0fb; color: var(--primary); }
.act-btn.danger:hover { background: #feecec; color: #dc2626; }
.act-btn .ic { width: 15px; height: 15px; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; padding: 16px; }
.file-card {
  border: 1px solid #edf0f6;
  border-radius: 13px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  transition: .16s;
  position: relative;
  min-width: 0;
}
.file-card:hover { border-color: #d9e5ff; box-shadow: 0 10px 22px -14px rgba(37, 99, 235, .35); transform: translateY(-2px); }
.file-card .visual, .file-card .fileicon { width: 46px; height: 46px; border-radius: 12px; margin-bottom: 11px; }
.file-card .visual .ic, .file-card .fileicon .ic { width: 23px; height: 23px; }
.file-card .name {
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  word-break: break-all;
  height: 36px;
  overflow: hidden;
}
.file-card .meta { font-size: 10.5px; color: #98a2b3; margin-top: 7px; display: flex; justify-content: space-between; gap: 8px; }
.card-actions {
  position: absolute;
  top: 8px;
  right: 6px;
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: .15s;
  background: rgba(255, 255, 255, .94);
  border-radius: 8px;
  padding: 2px;
  backdrop-filter: blur(4px);
}
.file-card:hover .card-actions { opacity: 1; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 20px; text-align: center; min-height: 430px; }
.empty-art { width: 132px; height: 120px; color: #c9d8f5; }
.empty h3 { font-size: 14.5px; margin: 14px 0 6px; font-weight: 650; }
.empty p { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; line-height: 1.65; }
.empty-actions { display: flex; gap: 9px; }

/* ---------- 拖拽遮罩 ---------- */
.drop-overlay {
  position: fixed;
  inset: 82px 14px 14px 14px;
  background: rgba(37, 99, 235, .06);
  backdrop-filter: blur(1.5px);
  border: 2px dashed #4f8cff;
  border-radius: 20px;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}
.drop-overlay.show { display: flex; }
.drop-box {
  background: #fff;
  border-radius: 18px;
  padding: 28px 42px;
  box-shadow: 0 24px 60px rgba(37, 99, 235, .22);
  text-align: center;
  color: var(--primary);
  pointer-events: none;
}
.drop-box .ic { width: 42px; height: 42px; margin-bottom: 10px; }
.drop-box strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.drop-box span { font-size: 12px; color: var(--muted); }

/* ---------- 上传面板 ---------- */
.upload-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 392px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px -20px rgba(16, 24, 40, .35);
  z-index: 300;
  overflow: hidden;
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } }
.upload-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; background: linear-gradient(135deg, #f7faff, #f2f6ff); border-bottom: 1px solid var(--line); }
.upload-head strong { font-size: 12.5px; display: block; }
.upload-head .sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.upload-head .spacer { flex: 1; }
.upload-head .icon-btn { width: 30px; height: 30px; }
.upload-head .icon-btn .ic { width: 15px; height: 15px; }
.upload-body { max-height: 290px; overflow: auto; padding: 6px 15px 12px; }
.upload-panel.collapsed .upload-body { display: none; }
.upload-item { padding: 9px 0; border-bottom: 1px solid #f3f5f9; }
.upload-item:last-child { border-bottom: 0; }
.upload-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.upload-row .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; color: var(--text-2); }
.upload-row .pct { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-row .ok { color: var(--green); display: flex; }
.upload-row .ok .ic { width: 15px; height: 15px; }
.upload-row .err { color: var(--red); font-size: 10.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar { height: 5px; background: #eef1f7; border-radius: 99px; margin-top: 7px; overflow: hidden; }
.upload-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #6366f1); transition: width .18s; }
.upload-item.done .upload-bar i { background: var(--green); }
.upload-item.error .upload-bar i { background: var(--red); }

/* ---------- 弹窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5);
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
.modal.wide { width: min(1000px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 14.5px; margin: 0; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-close { width: 32px; height: 32px; border: 0; background: #f4f6fa; border-radius: 9px; color: #667085; display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.modal-close:hover { background: #eaeef6; color: #101828; }
.modal-close .ic { width: 15px; height: 15px; }
.modal-body { padding: 20px; overflow: auto; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 18px 18px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  background: #fff;
  transition: .15s;
}
.input:focus { border-color: #9dbcff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.file-summary { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8faff; border: 1px solid #eef2fa; border-radius: 12px; margin-bottom: 16px; }
.file-summary .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-summary .sub { margin-top: 2px; }
.share-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: #fff; font-size: 12px; color: var(--text-2); cursor: pointer; transition: .15s; }
.chip.active { background: var(--primary-soft); border-color: #bfd3ff; color: var(--primary); font-weight: 600; }
.share-link { display: flex; gap: 7px; margin-top: 12px; }
.share-link input { flex: 1; height: 40px; border: 1px solid var(--line-strong); background: #f8faff; border-radius: 9px; padding: 0 10px; font-size: 11.5px; color: var(--text-2); outline: none; min-width: 0; }
.share-existing { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.share-existing h4 { font-size: 11px; color: var(--muted); margin: 0 0 7px; font-weight: 600; }
.share-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 6px 0; }
.share-row .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.share-row .when { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.share-row button { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 11.5px; padding: 3px 5px; border-radius: 6px; }
.share-row button:hover { background: var(--primary-soft); }
.share-row button.del { color: #dc2626; }
.share-row button.del:hover { background: #fef2f2; }
.muted-note { font-size: 11px; color: var(--muted); line-height: 1.6; }

/* ---------- 预览 ---------- */
.preview-stage { display: grid; place-items: center; background: #0b1220; min-height: 300px; max-height: calc(100vh - 260px); overflow: auto; }
.preview-stage img { max-width: 100%; max-height: calc(100vh - 260px); display: block; }
.preview-stage video { max-width: 100%; max-height: calc(100vh - 260px); background: #000; display: block; }
.audio-stage { padding: 48px 30px; display: flex; flex-direction: column; align-items: center; gap: 20px; background: linear-gradient(135deg, #f5f8ff, #eef3ff); }
.audio-cover { width: 90px; height: 90px; border-radius: 26px; background: linear-gradient(135deg, #7c5cfc, #4f46e5); color: #fff; display: grid; place-items: center; box-shadow: 0 16px 40px rgba(79, 70, 229, .35); }
.audio-cover .ic { width: 40px; height: 40px; }
.audio-stage audio { width: min(520px, 100%); }
.pdf-stage { width: 100%; height: calc(100vh - 240px); border: 0; background: #fff; display: block; }
.text-preview { margin: 0; padding: 20px 22px; background: #0f172a; color: #e2e8f0; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, "Courier New", monospace; max-height: calc(100vh - 260px); overflow: auto; }
.preview-empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.preview-empty .visual { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; }
.preview-empty p { margin: 0 0 16px; font-size: 12.5px; }

/* ---------- 菜单 / 提示 ---------- */
.popmenu {
  position: fixed;
  z-index: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 18px 44px -12px rgba(16, 24, 40, .28);
  padding: 5px;
  min-width: 132px;
  animation: pop .12s;
}
.popmenu button { width: 100%; display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; text-align: left; }
.popmenu button:hover { background: #f4f7fc; color: var(--text); }
.popmenu button.danger { color: #dc2626; }
.popmenu button.danger:hover { background: #fef2f2; }
.popmenu .ic { width: 15px; height: 15px; }

.toast-root { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 900; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #101828; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 12px; box-shadow: 0 12px 30px rgba(16, 24, 40, .3); animation: toastIn .2s; display: flex; align-items: center; gap: 8px; max-width: 82vw; }
.toast.error { background: #b42318; }
.toast .ic { width: 15px; height: 15px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 登录层 ---------- */
.login-layer { position: fixed; inset: 0; z-index: 950; background: linear-gradient(135deg, #0f172a, #1e3a8a 55%, #312e81); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: min(360px, 100%); background: #fff; border-radius: 18px; padding: 30px; box-shadow: 0 40px 100px rgba(0, 0, 0, .4); }
.login-card .logo { margin-bottom: 16px; }
.login-card h2 { font-size: 18px; margin: 0 0 6px; }
.login-card p { font-size: 12px; color: var(--muted); margin: 0 0 20px; line-height: 1.6; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .storage-pill { display: none; }
  .search { max-width: 320px; }
}
@media (max-width: 900px) {
  .topbar { height: auto; min-height: 62px; padding: 11px 16px; flex-wrap: wrap; gap: 10px; }
  .brand { min-width: auto; }
  .brand-sub { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .sync-state { display: none; }
  .layout { display: block; }
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px 16px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
  }
  .sidebar nav { display: flex; gap: 6px; }
  .nav-title, .storage-card { display: none; }
  .nav-list { flex-direction: row; }
  .nav-item { height: 36px; white-space: nowrap; padding: 0 12px; }
  .main { padding: 16px 16px 60px; }
  .content-card { min-height: 360px; }
  .file-table .thead, .file-table .row { grid-template-columns: minmax(0, 1fr) 100px 124px; }
  .cell-time { display: none; }
  .cell-actions { opacity: 1; }
  .empty { min-height: 360px; }
  .toolbar .hint { display: none; }
}
@media (max-width: 620px) {
  .top-actions .storage-pill { display: none; }
  .brand-title { font-size: 15px; }
  .logo { width: 38px; height: 38px; border-radius: 11px; }
  .top-actions .btn.primary { padding: 0 13px; }
  .file-table .thead, .file-table .row { grid-template-columns: minmax(0, 1fr) 112px; padding: 0 13px; }
  .cell-size { display: none; }
  .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .file-card { padding: 12px; }
  .file-card .visual, .file-card .fileicon { width: 42px; height: 42px; }
  .file-card .name { height: 34px; font-size: 12px; }
  .card-actions { opacity: 1; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .upload-panel { right: 12px; bottom: 12px; }
  .pdf-stage { height: calc(100vh - 220px); }
  .pathbar { gap: 8px; }
  .crumb { max-width: 150px; }
  .count-tag { display: none; }
}
