/* ============================================================
   简易个人网盘 - 样式（浅色 / 深色主题，自适应手机与电脑）
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg: #eef1f7;
  --bg-soft: #e6eaf3;
  --card: #ffffff;
  --text: #1e2433;
  --muted: #7a8499;
  --border: #e3e8f0;
  --hover: #f4f6fb;
  --selected: #edf0ff;
  --primary: #4f6ef7;
  --primary-2: #7b5cff;
  --primary-soft: rgba(79, 110, 247, .12);
  --danger: #ef4444;
  --ok: #10b981;
  --info: #3b82f6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .07), 0 10px 30px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 40px rgba(16, 24, 40, .16);
  --topbar-bg: rgba(255, 255, 255, .82);
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  --bg: #0e1220;
  --bg-soft: #131829;
  --card: #171d2e;
  --text: #e7ebf4;
  --muted: #8d97ad;
  --border: #232b41;
  --hover: #1d2438;
  --selected: #223056;
  --primary: #5d7bff;
  --primary-2: #8a6dff;
  --primary-soft: rgba(93, 123, 255, .16);
  --topbar-bg: rgba(14, 18, 32, .82);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
::selection { background: var(--primary-soft); }

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(128, 138, 160, .35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 138, 160, .55); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 8px 14px; font-weight: 600; font-size: 13.5px;
  transition: transform .06s, box-shadow .15s, background .15s, border-color .15s, opacity .15s;
  white-space: nowrap; user-select: none; cursor: pointer; background: none;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 4px 14px rgba(88, 105, 245, .35);
}
.btn.primary:hover { box-shadow: 0 6px 20px rgba(88, 105, 245, .45); filter: brightness(1.05); }
.btn.ghost { border-color: var(--border); background: var(--card); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 4px 14px rgba(239, 68, 68, .3); }
.btn.danger:hover { filter: brightness(1.06); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; border: none; background: none;
  color: var(--muted); font-size: 18px; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.icon-btn.light { color: rgba(255, 255, 255, .85); }
.icon-btn.light:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.select {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: 13px; cursor: pointer;
}
.select:focus { outline: 2px solid var(--primary-soft); }

input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex: none;
}

/* ---------- 登录页 ---------- */
.login-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(135deg, #3b3f9e 0%, #5a3fd1 45%, #8b5cf6 100%);
}
.login-bg .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: float 12s ease-in-out infinite;
}
.login-bg .b1 { width: 420px; height: 420px; background: #7c8bff; top: -120px; left: -80px; }
.login-bg .b2 { width: 380px; height: 380px; background: #ff7ac6; bottom: -140px; right: -60px; animation-delay: -4s; }
.login-bg .b3 { width: 300px; height: 300px; background: #55d6ff; top: 40%; left: 60%; animation-delay: -8s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.08); }
  66% { transform: translate(-25px, 25px) scale(.95); }
}

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: min(92vw, 380px); background: rgba(255, 255, 255, .96);
  border-radius: 20px; padding: 38px 32px 30px; text-align: center;
  box-shadow: 0 24px 70px rgba(20, 20, 60, .45);
  backdrop-filter: blur(8px);
}
.login-card.shake { animation: shake .4s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}
.login-logo {
  width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(88, 105, 245, .45);
}
.login-title { margin: 0 0 4px; font-size: 22px; letter-spacing: .5px; color: #1e2433; }
.login-sub { margin: 0 0 22px; color: #8a92a6; font-size: 13px; }
.login-field {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #dfe3ee; border-radius: 12px; padding: 11px 14px; margin-bottom: 14px;
  background: #f8f9fd; color: #7a8499; transition: border-color .15s, box-shadow .15s;
}
.login-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: #fff; }
.login-field .ic { font-size: 17px; }
.login-field input {
  flex: 1; border: none; outline: none; background: none; font-size: 15px; color: #1e2433;
}
.login-err { color: var(--danger); font-size: 13px; margin: 0 0 12px; min-height: 0; }
.login-hint { margin: 14px 0 0; font-size: 12px; color: #a0a7bb; line-height: 1.6; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--card); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(88, 105, 245, .35);
}
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: .5px; }

.snav { display: flex; flex-direction: column; gap: 4px; }
.snav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: none; background: none; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; transition: background .15s, color .15s;
}
.snav-item:hover { background: var(--hover); color: var(--text); }
.snav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.snav-item .ic { font-size: 18px; }

.scard { background: var(--bg-soft); border-radius: var(--radius); padding: 13px 14px; }
.scard-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.scard-text { font-size: 12.5px; color: var(--text); word-break: break-all; }
.scard-text.sm { margin-top: 8px; color: var(--muted); }
.scard-text.xs { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.tips ul { margin: 2px 0 8px; padding: 0 0 0 2px; list-style: none; color: var(--muted); font-size: 12px; line-height: 1.9; }

.bar {
  height: 8px; border-radius: 99px; background: var(--border); overflow: hidden;
}
.bar i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width .5s ease;
}

.sfoot { margin-top: auto; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; flex: none;
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.searchbox {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1.5px solid transparent; border-radius: 99px; padding: 8px 14px;
  color: var(--muted); transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.searchbox .ic { font-size: 16px; }
.searchbox input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 13.5px; color: var(--text); }
.searchbox input::placeholder { color: var(--muted); }
.sb-clear { border: none; background: none; color: var(--muted); font-size: 14px; padding: 2px; display: flex; }
.sb-clear:hover { color: var(--text); }

.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* 主题按钮图标切换 */
[data-theme="light"] .only-dark-el { display: none; }
[data-theme="dark"] .only-light-el { display: none; }

/* ---------- 工具栏 ---------- */
.content { flex: 1; padding: 18px 20px 90px; max-width: 1440px; width: 100%; margin: 0 auto; }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; font-size: 14.5px; }
.crumb {
  border: none; background: none; padding: 5px 8px; border-radius: 8px;
  color: var(--muted); font-weight: 500; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.crumb:hover { background: var(--hover); color: var(--text); }
.crumb.home { font-weight: 700; }
.crumb.cur { color: var(--text); font-weight: 700; }
.crumb-sep { color: var(--muted); opacity: .6; margin: 0 -2px; }

.toolbar-sub { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
#btnSortDir.asc .ic { transform: scaleY(1); }
#btnSortDir.desc .ic { transform: scaleY(-1); }

/* ---------- 文件卡片 ---------- */
.filecard {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; min-height: 220px; position: relative;
}
.loading-box {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--muted); font-size: 13.5px;
}
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 列表视图 */
.fhead, .frow {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 30px 38px minmax(0, 1fr) 96px 150px 42px;
  padding: 9px 16px;
}
.fhead {
  border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; user-select: none;
  background: var(--bg-soft);
}
.fhead .hcol { display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 3px 0; }
.fhead .hcol:hover { color: var(--text); }
.fhead .hcol.active { color: var(--primary); font-weight: 700; }
.fhead .hcol .arr { font-size: 10px; }

.frow { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; touch-action: manipulation; }
.frow:last-child { border-bottom: none; }
.frow:hover { background: var(--hover); }
.frow.sel { background: var(--selected); }
.frow .chk { display: flex; align-items: center; justify-content: center; }

.fchip {
  width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex: none;
}
.fname { min-width: 0; display: flex; flex-direction: column; }
.fname b {
  font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.frow.sel .fname b { color: var(--primary); font-weight: 700; }
.fpath { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize, .fmtime { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmore {
  border: none; background: none; color: var(--muted); font-size: 18px;
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, background .15s;
}
.frow:hover .fmore, .fcard:hover .fmore { opacity: 1; }
.fmore:hover { background: var(--border); color: var(--text); }
@media (hover: none) {
  .fmore { opacity: 1; }
}

/* 图标颜色 */
.chip-folder { background: rgba(255, 178, 46, .16); color: #f5a623; }
.chip-image  { background: rgba(139, 92, 246, .16); color: #8b5cf6; }
.chip-video  { background: rgba(236, 72, 153, .15); color: #ec4899; }
.chip-audio  { background: rgba(6, 182, 212, .16); color: #06b6d4; }
.chip-zip    { background: rgba(249, 115, 22, .16); color: #f97316; }
.chip-code   { background: rgba(16, 185, 129, .16); color: #10b981; }
.chip-doc    { background: rgba(59, 130, 246, .15); color: #3b82f6; }
.chip-sheet  { background: rgba(5, 150, 105, .15); color: #059669; }
.chip-pdf    { background: rgba(239, 68, 68, .14); color: #ef4444; }
.chip-text   { background: rgba(100, 116, 139, .16); color: #64748b; }
.chip-file   { background: rgba(100, 116, 139, .14); color: #94a3b8; }

/* 网格视图 */
.fgrid {
  display: grid; gap: 12px; padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
}
.fcard {
  position: relative; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 8px; touch-action: manipulation;
}
.fcard:hover { border-color: var(--primary); background: var(--hover); box-shadow: var(--shadow); }
.fcard.sel { border-color: var(--primary); background: var(--selected); }
.fcard .chk { position: absolute; top: 8px; left: 8px; z-index: 2; }
.fcard .thumb {
  aspect-ratio: 4 / 3; border-radius: 8px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fcard .thumb .fchip { width: 52px; height: 52px; font-size: 28px; border-radius: 14px; }
.fcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard .cname {
  font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 2px;
}
.fcard.sel .cname { color: var(--primary); font-weight: 700; }
.fcard .cmeta { font-size: 11px; color: var(--muted); padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .fmore { position: absolute; top: 4px; right: 4px; opacity: 0; background: var(--card); }
.fcard .fmore:hover { opacity: 1; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 20px; }
.empty-icon {
  width: 110px; height: 110px; margin: 0 auto 18px; border-radius: 50%;
  border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 52px; color: var(--muted); opacity: .8;
}
.empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }

/* ---------- 多选操作条 ---------- */
.selbar {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 10px 14px; max-width: calc(100vw - 24px);
  animation: pop-up .18s ease;
}
@keyframes pop-up { from { opacity: 0; transform: translate(-50%, 12px); } }
.selbar-count { font-size: 13.5px; font-weight: 700; color: var(--primary); }
.selbar-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 右键菜单 ---------- */
.ctxmenu {
  position: fixed; z-index: 90; min-width: 176px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; animation: pop-in .12s ease;
}
@keyframes pop-in { from { opacity: 0; transform: scale(.95); } }
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: none; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--text); text-align: left;
}
.ctx-item .ic { font-size: 16px; color: var(--muted); }
.ctx-item:hover { background: var(--hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger .ic { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--border); margin: 5px 8px; }

/* ---------- 弹窗 ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  padding: 20px; animation: fade-in .15s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: min(92vw, 400px); background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 22px; animation: pop-in .15s ease;
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.modal-text { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; line-height: 1.7; word-break: break-all; }
.modal-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; background: var(--bg-soft);
  padding: 10px 13px; font-size: 14px; outline: none; margin-bottom: 18px; transition: border-color .15s, box-shadow .15s;
}
.modal-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 预览 ---------- */
.pv { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 22, .94); display: flex; flex-direction: column; animation: fade-in .15s; }
.pv-top {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(255, 255, 255, .06); backdrop-filter: blur(8px);
}
.pv-name {
  flex: 1; min-width: 0; color: #fff; font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-actions { display: flex; gap: 4px; }
.pv-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; }
.pv-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.pv-body video, .pv-body audio { max-width: 100%; max-height: 100%; width: auto; }
.pv-body audio { width: min(90vw, 560px); }
.pv-body iframe { width: 100%; height: 100%; border: none; background: #fff; border-radius: 8px; }
.pv-pre-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 8px; }
.pv-note { color: #c9d1e4; font-size: 12px; padding: 8px 14px; background: rgba(255, 255, 255, .06); }
.pv-pre {
  flex: 1; margin: 0; overflow: auto; padding: 16px 18px; color: #dbe4f5;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.pv-loading { color: #aab4cc; font-size: 14px; }
.pv-unsupported { text-align: center; color: #aab4cc; }
.pv-foot { flex: none; text-align: center; color: #9aa5bd; font-size: 12px; padding: 8px; }

/* ---------- 上传面板 ---------- */
.upanel {
  position: fixed; right: 16px; bottom: 16px; z-index: 80; width: 330px; max-width: calc(100vw - 24px);
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop-in .15s ease;
}
.upanel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-weight: 700; font-size: 13.5px; border-bottom: 1px solid var(--border);
}
.upanel-list { max-height: 40vh; overflow-y: auto; padding: 6px 14px 12px; }
.uitem { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.uitem:last-child { border-bottom: none; }
.uitem-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.uitem-name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uitem-state { font-size: 11px; color: var(--muted); flex: none; }
.uitem.done .uitem-state { color: var(--ok); }
.uitem.err .uitem-state { color: var(--danger); }
.ubar { height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; }
.ubar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .2s; border-radius: 99px; }
.uitem.err .ubar i { background: var(--danger); }
.uitem.done .ubar i { background: var(--ok); }

/* ---------- 拖拽遮罩 ---------- */
.dropzone {
  position: fixed; inset: 0; z-index: 95; padding: 18px; pointer-events: none;
  background: color-mix(in srgb, var(--primary) 12%, rgba(20, 24, 40, .55));
}
.dz-inner {
  height: 100%; border: 2.5px dashed rgba(255, 255, 255, .75); border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; font-size: 46px;
}
.dz-inner p { margin: 0; font-size: 16px; font-weight: 600; }

/* ---------- 提示条 ---------- */
.toasts {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 30px);
}
.toast {
  display: flex; align-items: center; gap: 8px; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 99px; box-shadow: var(--shadow-lg);
  padding: 9px 18px; font-size: 13px; font-weight: 500; max-width: 100%;
  animation: toast-in .2s ease;
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
.toast .ic { font-size: 15px; }
.toast.ok .ic { color: var(--ok); }
.toast.err .ic { color: var(--danger); }
.toast.info .ic { color: var(--info); }

/* ---------- 侧栏遮罩（手机） ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .5); animation: fade-in .15s; }

/* ---------- 显隐工具类 ---------- */
.only-mobile { display: none !important; }
[hidden] { display: none !important; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 960px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 75; width: 274px;
    transform: translateX(-102%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg); height: 100dvh;
  }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }

  .content { padding: 14px 12px 110px; }
  .topbar { padding: 0 12px; height: 56px; }
  .tools { gap: 6px; }
  .hide-sm { display: none; }
  .btn { padding: 8px 12px; }

  .fhead, .frow { grid-template-columns: 28px 36px minmax(0, 1fr) 40px; padding: 10px 12px; gap: 9px; }
  .fsize, .fmtime { display: none; }

  .fgrid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 9px; padding: 10px; }
  .fcard .thumb .fchip { width: 42px; height: 42px; font-size: 23px; border-radius: 12px; }

  .selbar { bottom: calc(14px + env(safe-area-inset-bottom)); padding: 8px 12px; gap: 8px; }
  .selbar-count { font-size: 12.5px; }
  .upanel { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .crumb { max-width: 130px; }
  .toolbar-sub { order: -1; flex-basis: 100%; }
  .pv-name { font-size: 13px; }
  .searchbox { padding: 7px 12px; }
}

@media (max-width: 480px) {
  .login-card { padding: 30px 22px 24px; }
  .toolbar { gap: 8px 10px; }
  .tools { margin-left: 0; }
  .select { padding: 6px 8px; }
  .btn.primary { padding: 8px 12px; }
}
