/* ============ 基础 ============ */
:root {
  --bg: #0b0f14;
  --bg2: #10161f;
  --card: #151c26;
  --card-hi: #1d2632;
  --line: #222c3a;
  --text: #e6edf3;
  --muted: #8794a5;
  --accent: #19c8a7;
  --accent-dim: #0f8f77;
  --blue: #3da9fc;
  --danger: #f2555a;
  --warn: #f0b429;
  --r: 12px;
  --sidebar-w: 224px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 700px at 10% -10%, #12212b 0%, #0b0f14 55%) fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3644; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录 ============ */
.login-wrap {
  height: 100dvh; display: grid; place-items: center; padding: 24px;
}
.login-box {
  width: 100%; max-width: 360px; padding: 34px 28px 26px;
  background: linear-gradient(160deg, #161e2a, #10161f);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  text-align: center;
}
.logo-mark {
  width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: 16px; font-size: 28px; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, #1b3a3a, #121a22);
  border: 1px solid #22463f;
}
.login-box h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: .5px; font-weight: 600; }
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }
#login-pwd {
  width: 100%; padding: 13px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: #0c1219; color: var(--text); font-size: 15px; outline: none; margin-bottom: 12px;
}
#login-pwd:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(25,200,167,.12); }
.login-msg { color: var(--danger); font-size: 12.5px; min-height: 18px; margin: 10px 0 0; }
.login-hint { color: #5f6b7a; font-size: 11.5px; margin-top: 14px; }

.btn {
  border: 1px solid transparent; border-radius: 9px; padding: 9px 16px;
  font-size: 13.5px; background: var(--card-hi); color: var(--text);
  transition: .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #1ad2ae, #12a58c); color: #062b25; font-weight: 600; }
.btn.danger { background: rgba(242,85,90,.14); color: #ff8b8f; border-color: rgba(242,85,90,.4); }
.btn.ghost { background: rgba(255,255,255,.05); border-color: var(--line); color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 13px; font-size: 15px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; background: transparent; color: var(--muted);
  border: none; font-size: 17px; display: grid; place-items: center; line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--text); }

/* ============ 布局 ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100dvh; }
.sidebar {
  grid-column: 1; grid-row: 1;
  background: linear-gradient(180deg, #0e141c, #0b1016);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; z-index: 40;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.brand-dot { color: var(--accent); font-size: 17px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 9px; background: none; border: none;
  color: var(--muted); font-size: 13.5px; margin-bottom: 2px; transition: .15s;
}
.nav-item .ni { width: 16px; text-align: center; font-size: 14px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-item.active { background: rgba(25,200,167,.1); color: #58e5c8; box-shadow: inset 2px 0 0 var(--accent); }
.nav-sep { padding: 14px 12px 6px; font-size: 11px; color: #4d5a6a; letter-spacing: 1px; }
.side-foot { padding: 12px 16px 18px; border-top: 1px solid var(--line); }
.quota-bar { height: 5px; border-radius: 3px; background: #1c2532; overflow: hidden; }
.quota-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--blue)); transition: width .4s; }
.quota-text { font-size: 11px; color: var(--muted); margin-top: 7px; }

.backdrop { display: none; }

.main { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-x: hidden; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: rgba(11,15,20,.7);
}
.path-bar { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.path-bar .pb-root { color: var(--muted); font-weight: 400; font-size: 12px; margin-right: 8px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.search-bar { display: flex; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search-bar input {
  flex: 1; min-width: 160px; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #0c1219; color: var(--text); outline: none; font-size: 14px;
}
.sel-sm {
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: #0c1219; color: var(--text); font-size: 12.5px; outline: none;
}
/* 搜索历史浮层 */
.search-hist {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 18px;
  border-bottom: 1px solid var(--line); background: #0a1017;
}
.search-hist .hchip {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #121b25; color: #9fb0c2; font-size: 12px; cursor: pointer;
}
.search-hist .hchip:hover { color: var(--text); border-color: #2c3d4f; }
.search-hist .hclear { color: #6f7c8a; font-size: 11.5px; cursor: pointer; align-self: center; }
/* 结果页脚 */
.search-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 4px 4px; color: var(--muted); font-size: 12.5px;
}
mark { background: rgba(61, 220, 151, .28); color: inherit; border-radius: 3px; padding: 0 2px; }
.crumbs {
  display: flex; align-items: center; gap: 2px; padding: 9px 18px 0;
  overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumb { background: none; border: none; color: var(--muted); font-size: 12.5px; padding: 4px 6px; border-radius: 6px; }
.crumb:hover { background: rgba(255,255,255,.06); color: var(--text); }
.crumb.cur { color: var(--accent); }
.crumb-sep { color: #39434f; font-size: 11px; }
.content { flex: 1; overflow-y: auto; padding: 14px 18px 90px; min-height: 0; }

/* ============ 通用卡片 ============ */
.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty .big { font-size: 34px; opacity: .3; display: block; margin-bottom: 12px; }
.section-title { font-size: 12px; color: #5f6b7a; letter-spacing: 1.2px; margin: 22px 2px 10px; }

/* 4.11.3 最近访问：无痕开关条 */
.recent-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin: 0 0 14px;
  border: 1px solid #1d2733; border-radius: 12px;
  background: rgba(20, 28, 38, .6);
}
.recent-bar.on {
  border-color: rgba(120, 200, 160, .45);
  background: rgba(30, 64, 52, .45);
}
.recent-bar .rb-text { flex: 1; min-width: 0; }
.recent-bar .rb-text b { display: block; font-size: 13px; font-weight: 600; }
.recent-bar .rb-text span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.recent-bar.on .rb-text b { color: #7fd3a8; }
.recent-bar .rb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.incog-tag {
  margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10px; color: #7fd3a8;
  background: rgba(40, 90, 70, .55); border: 1px solid rgba(120, 200, 160, .35);
}
.nav-item.incog { color: #7fd3a8; }
@media (max-width: 640px) {
  .recent-bar { flex-direction: column; align-items: stretch; }
  .recent-bar .rb-actions { justify-content: flex-end; }
}

/* ============ 文件网格 ============ */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card {
  position: relative; border-radius: var(--r); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: .16s; cursor: default;
}
.card:hover { border-color: #33455c; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(25,200,167,.28); }
.card .thumb {
  position: relative; aspect-ratio: 4/3; background: #0e141c; display: grid; place-items: center; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; }
.card .ext-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #cfe4ff;
  padding: 6px 10px; border-radius: 8px; background: rgba(61,169,252,.13); border: 1px solid rgba(61,169,252,.25);
}
.card.is-folder .thumb { background: linear-gradient(150deg, #1a2b3d, #131c26); }
.card .folder-glyph { font-size: 34px; color: #58a6e8; opacity: .85; }
.card .play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.card .play span {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 15px;
  backdrop-filter: blur(4px);
}
.card .meta { padding: 9px 11px 11px; }
.card .nm { font-size: 12.8px; line-height: 1.35; margin: 0 0 4px; word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 11px; color: var(--muted); }
.card .chk {
  position: absolute; top: 7px; left: 7px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.45); background: rgba(0,0,0,.42); display: grid; place-items: center;
  font-size: 12px; color: #fff; opacity: .42; transition: .15s; z-index: 2;
}
.card:hover .chk, .select-mode .card .chk { opacity: 1; }
.card.selected .chk { background: var(--accent); border-color: var(--accent); color: #04231d; font-weight: 700; opacity: 1; }
.card .more {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 7px;
  border: none; background: rgba(0,0,0,.42); color: #dbe6f2; font-size: 15px; line-height: 1;
  display: none; place-items: center; backdrop-filter: blur(3px);
}
.card:hover .more { display: grid; }

/* ============ 列表视图 ============ */
.list { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 24px 26px 1fr 92px 118px 112px; align-items: center;
  gap: 10px; padding: 10px 14px; border-bottom: 1px solid #1a222d; background: var(--card);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--card-hi); }
.row.selected { background: rgba(25,200,167,.09); }
.row .chk {
  width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.3); display: grid; place-items: center; font-size: 12px; color: #fff;
  cursor: pointer; opacity: .42; transition: .15s;
}
.row:hover .chk, .select-mode .row .chk { opacity: 1; }
.row.selected .chk { background: var(--accent); border-color: var(--accent); color: #04231d; font-weight: 700; opacity: 1; }
.row .r-ico { font-size: 15px; text-align: center; color: var(--muted); }
.row .r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.2px; }
.row .r-size, .row .r-time, .row .r-kind { font-size: 11.5px; color: var(--muted); }
.row .chk2 { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid #3c4a5c; display: grid; place-items: center; font-size: 11px; }

/* ============ 概览 ============ */
.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { width: 96px; height: 96px; border-radius: 50%; position: relative; flex: none;
  background: conic-gradient(var(--accent) 0deg, var(--blue) var(--deg, 0deg), #1b2431 var(--deg, 0deg)); }
.ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.ring-txt { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; font-size: 15px; font-weight: 600; }
.dash-nums .v { font-size: 21px; font-weight: 600; }
.dash-nums .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.dash-nums > div + div { margin-top: 10px; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.cat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  text-align: left; color: var(--text); transition: .16s;
}
.cat-tile:hover { border-color: #33455c; background: var(--card-hi); }
.cat-tile .ct-n { font-size: 17px; font-weight: 600; }
.cat-tile .ct-l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.quick { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
.quick .btn { padding: 9px 14px; font-size: 13px; }

/* ============ 顶栏/面包屑杂项 ============ */
.bulkbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 18px;
  background: #18212c; border: 1px solid #2b3948; border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55); z-index: 60; max-width: calc(100vw - 24px);
}
.bulk-count { font-size: 12.5px; color: var(--accent); white-space: nowrap; }
.bulk-actions { display: flex; gap: 6px; overflow-x: auto; }

/* ============ 上传面板 ============ */
.upload-panel {
  position: fixed; right: 18px; bottom: 18px; width: 320px; max-width: calc(100vw - 36px);
  background: #131a24; border: 1px solid #2b3948; border-radius: 13px; z-index: 70;
  box-shadow: 0 16px 44px rgba(0,0,0,.55); overflow: hidden;
}
.up-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.up-head b { font-size: 13px; font-weight: 600; }
.up-list { max-height: 220px; overflow-y: auto; }
.up-item { padding: 9px 14px; border-bottom: 1px solid #1a222d; }
.up-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.up-bar { height: 3px; background: #1c2532; border-radius: 2px; overflow: hidden; }
.up-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up-item.done .up-bar > div { background: var(--blue); }
.up-item.fail .up-bar > div { background: var(--danger); width: 100% !important; }

/* ============ 拖放 ============ */
.dropzone {
  position: fixed; inset: 0; z-index: 80; background: rgba(8,14,18,.82);
  display: grid; place-items: center; backdrop-filter: blur(4px);
}
.dz-inner {
  padding: 40px 60px; border: 2px dashed var(--accent-dim); border-radius: 18px; text-align: center;
}
.dz-inner b { display: block; font-size: 17px; margin-bottom: 6px; }
.dz-inner span { color: var(--muted); font-size: 12.5px; }

/* ============ 预览 ============ */
.viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(4,7,10,.94);
  display: flex; flex-direction: column; backdrop-filter: blur(10px);
}
.vw-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.vw-title { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-sub { font-size: 11px; color: var(--muted); }
.vw-body { position: relative; flex: 1; display: grid; place-items: center; overflow: auto; padding: 16px; min-height: 0; }
.vw-body img {
  /* 同视频：绝对定位铺满 + contain，图片永远完整显示（长的、竖的都不会被切掉半截） */
  position: absolute; inset: 0; margin: auto;
  max-width: calc(100% - 32px); max-height: calc(100% - 32px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 8px;
}
.vw-body video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
/* 视频单独占满整块，黑底无留白，看着才像播放器而不是嵌在面板里的小方块 */
.vw-body.media {
  padding: 0; background: #000; overflow: hidden;
  display: block;            /* 不留 grid 的 auto 行轨道，否则缩放算不出来 */
  min-height: 0;
}
/* 用绝对定位铺满，不靠 height:100%（在 auto 行轨道里会退化成视频原始像素高度，
   1080p 视频就比窗口高，被 overflow:hidden 裁掉上下——这就是不全屏时画面不全的原因） */
.vw-body.media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  border-radius: 0; object-fit: contain; object-position: center center;
  display: block; background: #000;
}
.vw-body audio { width: min(520px, 90vw); }
.vw-body iframe { width: 100%; height: 100%; border: none; background: #fff; border-radius: 8px; }
.vw-body pre {
  width: 100%; height: 100%; overflow: auto; margin: 0; padding: 16px;
  background: #0a0f15; border: 1px solid #1d2733; border-radius: 10px;
  font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: #c8d5e3;
}
/* 播放器快捷键提示 */
.vw-hint {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center;
  font-size: 12px; color: rgba(200,213,227,.55); pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  transition: opacity .4s;
}
.vw-body.media:hover .vw-hint { opacity: 0; }

/* 视频准备中（ts/mkv 第一次要先建索引） */
.vw-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; pointer-events: none;
}
.vw-loading p { margin: 0; text-align: center; color: #9fb0c0; font-size: 13.5px; line-height: 1.6; }
.vw-loading p span { color: #5f6b7a; font-size: 12px; }
.vw-loading .ld {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(61,220,151,.22); border-top-color: #3ddc97;
  animation: vwspin .9s linear infinite;
}
@keyframes vwspin { to { transform: rotate(360deg); } }

.vw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.45); color: #fff; font-size: 18px;
  display: grid; place-items: center;
}
.vw-nav.prev { left: 14px; }
.vw-nav.next { right: 14px; }
.vw-unsupported { text-align: center; color: var(--muted); }
.vw-unsupported .big { font-size: 40px; display: block; margin-bottom: 12px; opacity: .5; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 120; background: rgba(3,6,9,.72); display: grid; place-items: center; padding: 22px; }
.modal-box {
  width: min(420px, 100%); background: #131a24; border: 1px solid #2b3948; border-radius: 16px;
  padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.6); max-height: 86vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 600; }
.modal-box p { color: var(--muted); font-size: 12.8px; line-height: 1.6; margin: 0 0 16px; }
.modal-box input[type=text], .modal-box input[type=password] {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line);
  background: #0c1219; color: var(--text); font-size: 14px; outline: none; margin-bottom: 16px;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.modal-list { margin: 0 0 16px; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.modal-list li { padding: 5px 0; border-bottom: 1px solid #1a222d; }

/* ============ 右键菜单 ============ */
.ctx {
  position: fixed; z-index: 130; min-width: 168px; padding: 6px;
  background: #18212c; border: 1px solid #2b3948; border-radius: 11px;
  box-shadow: 0 14px 40px rgba(0,0,0,.6);
}
.ctx button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 7px;
  background: none; border: none; color: var(--text); font-size: 13px;
}
.ctx button:hover { background: rgba(255,255,255,.07); }
.ctx button.danger { color: #ff8b8f; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(14px);
  background: #18212c; border: 1px solid #2b3948; color: var(--text);
  padding: 11px 18px; border-radius: 11px; font-size: 13px; z-index: 200;
  opacity: 0; pointer-events: none; transition: .22s; max-width: 86vw; text-align: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(242,85,90,.5); color: #ff9a9e; }

/* ============ 直连徽标 ============ */
.link-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; flex: none;
  border-radius: 999px; border: 1px solid #22463f; background: rgba(25,200,167,.08);
  font-size: 11.5px; color: var(--accent); white-space: nowrap;
}
.link-badge.wan { border-color: rgba(240,180,41,.45); background: rgba(240,180,41,.09); color: var(--warn); }
.link-badge.hidden { display: none; }

/* ============ 手机备份 ============ */.bk-panel { max-width: 760px; }
.bk-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.bk-orb {
  width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center;
  border-radius: 15px; font-size: 25px; color: var(--accent);
  background: radial-gradient(circle at 30% 25%, #1b3a3a, #121a22);
  border: 1px solid #22463f;
}
.bk-hero-txt h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.bk-hero-txt p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

.bk-status {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: 10px; background: #0c1219;
  border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); margin-bottom: 16px;
}
.bk-status b { color: var(--text); font-weight: 600; }
.bk-status .sep { color: #39434f; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 8px; }
.dot.ok { background: var(--accent); box-shadow: 0 0 8px rgba(25,200,167,.7); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(240,180,41,.7); }

.bk-acts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bk-acts .btn { padding: 12px 20px; font-size: 14px; }

.bk-hint { color: #5f6b7a; font-size: 11.5px; line-height: 1.85; }
.bk-hint code { color: var(--accent); }

.bk-prog { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.bk-prog-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.bk-prog-head b { font-size: 20px; color: var(--accent); }
.bk-prog-head span { font-size: 12px; color: var(--muted); }
.bk-bar { height: 7px; border-radius: 4px; background: #1c2532; overflow: hidden; }
.bk-bar > div { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--blue)); transition: width .18s; }
.bk-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.bk-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 14px; }
.bk-item { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #131a24; border: 1px solid var(--line); }
.bk-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bki-ph { display: grid; place-items: center; width: 100%; height: 100%; color: #4d5a6a; font-size: 20px; }
.bki-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.6); }
.bki-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.bk-item.done { border-color: rgba(25,200,167,.65); }
.bk-item.dup { border-color: rgba(61,169,252,.65); }
.bk-item.dup .bki-bar > div { background: var(--blue); }
.bk-item.fail { border-color: rgba(242,85,90,.7); }
.bk-item.fail .bki-bar > div { background: var(--danger); }

/* ============ 响应式 ============ */
.only-mobile { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 262px; transform: translateX(-104%);
    transition: transform .26s cubic-bezier(.3,.8,.3,1); box-shadow: 12px 0 40px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .main { grid-column: 1; }
  .only-mobile { display: grid; }
  .backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; opacity: 0;
    pointer-events: none; transition: .24s;
  }
  .backdrop.show { opacity: 1; pointer-events: auto; }
  .content { padding: 12px 12px 96px; }
  .topbar { padding: 10px 12px; }
  .crumbs { padding: 8px 12px 0; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; }
  .card .meta { padding: 8px 9px 9px; }
  .card .nm { font-size: 11.6px; -webkit-line-clamp: 2; }
  .card .sub { font-size: 10px; }
  .row { grid-template-columns: 20px 22px 1fr 62px 78px; gap: 7px; padding: 9px 10px; }
  .row .r-kind { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .top-actions .btn.primary.sm { padding: 6px 11px; }
  .bulkbar { left: 12px; right: 12px; transform: none; bottom: 12px; }
  .upload-panel { left: 12px; right: 12px; width: auto; bottom: 12px; }
  .viewer .vw-body { padding: 8px; }
  .vw-nav { width: 38px; height: 38px; font-size: 15px; }
}
@media (max-width: 400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}


/* ============ 拖拽框选 ============ */
.marquee {
  position: fixed; z-index: 75; pointer-events: none;
  border: 1px solid rgba(25,200,167,.9);
  background: rgba(25,200,167,.13);
  border-radius: 3px;
}

/* ============ 安全区（iPhone 刘海 / 底部横条） ============ */
.topbar {
  padding-top: calc(12px + env(safe-area-inset-top));
  padding-left: calc(18px + env(safe-area-inset-left));
  padding-right: calc(18px + env(safe-area-inset-right));
}
.sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.content { padding-bottom: calc(90px + env(safe-area-inset-bottom)); padding-left: calc(18px + env(safe-area-inset-left)); padding-right: calc(18px + env(safe-area-inset-right)); }
.bulkbar { bottom: calc(18px + env(safe-area-inset-bottom)); }
.upload-panel { bottom: calc(18px + env(safe-area-inset-bottom)); }
.login-wrap { padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ============ 自动备份卡片 ============ */
.bk-auto {
  margin-top: 18px; padding: 16px 18px;
  background: rgba(61,169,252,.06); border: 1px solid rgba(61,169,252,.28);
  border-radius: 14px;
}
/* 4.12.0：安卓 App 内的原生一键备份卡片（绿色，跟首页那个按钮同一个色系） */
.bk-native {
  margin-top: 18px; padding: 16px 18px;
  background: rgba(61,220,151,.07); border: 1px solid rgba(61,220,151,.30);
  border-radius: 14px;
}
.bk-native .bk-auto-head b { color: #6ff0b6; }
.bk-native .bk-auto-tag { background: rgba(61,220,151,.16); color: #7ff0bb; }
.bk-native p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 0 0 10px; }
.bk-native .btn.auto { width: 100%; }
.bk-auto-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bk-auto-head b { font-size: 14px; }
.bk-auto-tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: rgba(61,169,252,.18); color: #7cc6ff; white-space: nowrap;
}
.bk-auto p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin: 0 0 12px; }
.bk-auto-url {
  display: flex; align-items: center; gap: 10px;
  background: #0c1117; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 8px 8px 11px; margin-bottom: 14px;
}
.bk-auto-url code {
  flex: 1; min-width: 0; font-size: 11.5px; color: #6fd8c0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bk-auto-steps { font-size: 12.5px; color: var(--muted); }
.bk-auto-steps > b { display: block; color: var(--text); margin-bottom: 6px; font-size: 12.5px; }
.bk-auto-steps li b { color: #cfe0ee; }
.bk-auto-steps ol { margin: 0; padding-left: 18px; line-height: 1.9; }
.bk-auto-steps code { background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; color: #a9c6db; }

@media (max-width: 860px) {
  .topbar {
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
  }
  .content {
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  .bulkbar { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .upload-panel { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .bk-auto { padding: 14px 14px; }
  .bk-auto-url { flex-wrap: wrap; }
  .bk-auto-url code { flex-basis: 100%; white-space: normal; word-break: break-all; }
}
.btn.auto { background: linear-gradient(135deg, #4cb8ff, #2b7fd8); color: #03202f; font-weight: 700; box-shadow: 0 4px 18px rgba(61,169,252,.28); }

.up-meta { font-size: 10.5px; color: #4a5563; margin-top: 3px; min-height: 13px; font-variant-numeric: tabular-nums; }
#bk-speed { margin-left: auto; margin-right: 12px; font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
#bk-count { margin-left: 0; }
/* ===================== 手机正在上传（实时条） ===================== */
.live-strip{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  margin:0 18px 10px;padding:9px 14px;border-radius:10px;
  background:linear-gradient(90deg,rgba(25,200,167,.12),rgba(25,200,167,.03));
  border:1px solid rgba(25,200,167,.35);font-size:12.5px;color:var(--text);
}
.live-strip.hidden{display:none}
.ls-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);
  box-shadow:0 0 0 0 rgba(25,200,167,.55);animation:lsPulse 1.4s infinite}
@keyframes lsPulse{
  0%{box-shadow:0 0 0 0 rgba(25,200,167,.5)}
  70%{box-shadow:0 0 0 9px rgba(25,200,167,0)}
  100%{box-shadow:0 0 0 0 rgba(25,200,167,0)}
}
.ls-t{color:var(--accent);font-weight:600}
.ls-name{max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ls-meta{color:var(--muted);font-variant-numeric:tabular-nums}
.ls-more{color:var(--muted)}
.ls-bar{flex:1;min-width:100px;height:5px;border-radius:3px;background:rgba(255,255,255,.08);overflow:hidden}
.ls-bar>i{display:block;height:100%;background:var(--accent);transition:width .4s}

/* ===================== 重复检测 ===================== */
.dup-warn{color:var(--danger)}
.dup-actions{display:flex;justify-content:flex-end;margin:14px 0 10px}
.dup-group{border:1px solid var(--line);border-radius:var(--r);margin-bottom:10px;
  overflow:hidden;background:var(--card)}
.dg-head{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:9px 12px;background:var(--card-hi);font-size:12.5px}
.dg-size{color:var(--muted)}
.dg-files{padding:6px 12px 10px}
.dg-file{display:flex;align-items:center;gap:9px;padding:5px 0;font-size:12.5px}
.dg-file.keep{color:var(--accent)}
.dg-tag{flex:0 0 auto;font-size:11px;padding:1px 7px;border-radius:5px;
  background:rgba(255,255,255,.07);color:var(--muted)}
.dg-file.keep .dg-tag{background:rgba(25,200,167,.15);color:var(--accent)}
.dg-path{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}
.dg-file.keep .dg-path{color:var(--text)}

@media (max-width:860px){
  .live-strip{margin:0 10px 8px;font-size:12px}
  .ls-name{max-width:52%}
}
/* 同一张照片的不同格式（HEIC / JPEG）标记 */
.dg-kind{
  font-size:11.5px; color:#e0a33e;
  border:1px solid rgba(224,163,62,.42); border-radius:6px;
  padding:1px 7px; margin-left:8px; white-space:nowrap;
}

/* 共享区顶部说明 */
.share-hint{
  display:flex; flex-direction:column; gap:5px;
  margin:0 10px 14px; padding:13px 15px;
  border-radius:12px;
  background:rgba(61,220,151,.07);
  border:1px solid rgba(61,220,151,.24);
}
.share-hint .sh-t{color:var(--text); font-size:14px; font-weight:600; letter-spacing:.2px}
.share-hint .sh-d{color:var(--muted); font-size:12.5px; line-height:1.75}
.share-hint .sh-d b{color:#3ddc97; font-weight:600}
.share-hint .sh-net{
  margin-left:8px; padding:1px 8px; border-radius:6px;
  font-size:11.5px; font-weight:500; letter-spacing:.2px; vertical-align:1px;
}
.share-hint .sh-net.lan{
  color:#3ddc97; background:rgba(61,220,151,.12);
  border:1px solid rgba(61,220,151,.35);
}
.share-hint .sh-net.wan{
  color:#e0a33e; background:rgba(224,163,62,.1);
  border:1px solid rgba(224,163,62,.35);
}
@media (max-width:860px){
  .share-hint{margin:0 10px 10px; padding:11px 12px}
  .share-hint .sh-d{font-size:12px; line-height:1.7}
}

/* 访客只读：藏掉所有写入口 */
body.readonly #upload-btn,
body.readonly #select-btn,
body.readonly .bulkbar { display: none !important; }
body.readonly .dropzone { display: none !important; }

/* 强制改密浮层（不可跳过） */
.force-pwd {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(4,7,10,.86); backdrop-filter: blur(6px); padding: 24px;
}
.fp-box {
  width: min(420px, 100%); padding: 26px 24px 22px; border-radius: 16px;
  background: #131a24; border: 1px solid #2b3948; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  display: grid; gap: 10px;
}
.fp-orb { font-size: 26px; color: var(--accent); text-align: center; }
.fp-box h2 { margin: 0; font-size: 17px; text-align: center; color: var(--text); font-weight: 600; }
.fp-box p { margin: 0 0 4px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.fp-box input {
  padding: 12px 14px; background: #0c1219; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); outline: none; font-size: 13.5px;
}
.fp-box input:focus { border-color: var(--accent-dim); }
.fp-msg { color: #f87171; font-size: 12px; min-height: 16px; margin: 0; }

/* 密码弱时的顶部常驻提醒 */
.weak-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 90; display: flex;
  gap: 12px; align-items: center; justify-content: center; padding: 7px 14px;
  background: #3a1c1c; color: #fca5a5; font-size: 12.5px;
  border-bottom: 1px solid #6b2b2b;
}

/* 阶段 2：批量条在小屏横向滚动，别把按钮挤成两行 */
.bulkbar { flex-wrap: nowrap; }
.bulk-actions { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.bulk-actions .btn { flex: none; white-space: nowrap; }

/* 阶段 2：焦点项、toast 动作按钮、批量重命名、快捷键说明 */
.card.focused, .row.focused {
  outline: 2px solid var(--accent-dim);
  outline-offset: -2px;
}
.toast { display: flex; align-items: center; gap: 12px; }
.toast-act {
  flex: none; padding: 5px 10px; border-radius: 7px; cursor: pointer;
  background: rgba(45, 212, 191, .16); border: 1px solid rgba(45, 212, 191, .5);
  color: var(--accent); font-size: 12px;
}
.ctx-k {
  float: right; margin-left: 18px; font-size: 11px; opacity: .55;
  font-family: ui-monospace, Menlo, monospace;
}
.br-box { width: min(520px, 100%); max-height: 86vh; overflow: auto; }
.br-mode { display: flex; gap: 16px; font-size: 13px; color: var(--text); }
.br-fields { display: grid; gap: 8px; }
.br-row { display: flex; gap: 8px; }
.br-row input { flex: 1; min-width: 0; }
.br-fields input {
  padding: 11px 13px; background: #0c1219; border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); outline: none; font-size: 13px;
}
.br-preview { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.br-cap { font-size: 11.5px; color: var(--muted); padding: 2px 4px 8px; }
.br-item { display: flex; gap: 8px; align-items: baseline; font-size: 12px; padding: 5px 4px; border-top: 1px solid #1b2530; }
.br-old { color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-arrow { color: #4b5b6b; }
.br-new { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-item.bad .br-new { color: #f87171; }
.br-item.bad em { font-style: normal; font-size: 11px; margin-left: 6px; color: #f87171; }
.br-actions { display: flex; gap: 8px; justify-content: flex-end; }
.kh-box { width: min(560px, 100%); }
.kh-list { max-height: 60vh; overflow: auto; }
.kh-row { display: flex; gap: 14px; padding: 7px 4px; border-top: 1px solid #1b2530; font-size: 12.5px; }
.kh-row kbd {
  flex: none; min-width: 128px; color: var(--accent);
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
}
.kh-row span { color: var(--muted); }

/* 挂载进来的目录：只读徽标 */
.mnt-tag{
  display:inline-block; margin-left:6px; padding:0 6px; border-radius:5px;
  font-size:10.5px; font-weight:500; line-height:16px; vertical-align:1px;
  color:#e0a33e; background:rgba(224,163,62,.11); border:1px solid rgba(224,163,62,.32);
  white-space:nowrap;
}
/* ---------- 阶段 3：异步任务条 ---------- */
#taskbar {
  position: fixed; right: 18px; bottom: 18px; z-index: 900;
  width: 288px; padding: 12px 14px;
  background: #0c1219; border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
#taskbar.hidden { display: none; }
#taskbar .tb-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--text); margin-bottom: 8px; gap: 8px;
}
#taskbar .tb-pct { font-size: 11.5px; color: #7d8794; white-space: nowrap; }
#taskbar .tb-bar {
  height: 6px; background: #131b24; border-radius: 4px; overflow: hidden;
}
#taskbar .tb-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #3d7dff, #5fd0a0);
  transition: width .35s ease;
}
#taskbar .tb-acts { margin-top: 9px; display: flex; justify-content: flex-end; }

/* ===== 4.5.0 传输中心 ===== */
.tp-group { margin-bottom: 18px; }
.tp-group-h { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; letter-spacing: .3px; }
.tp-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.tp-row:last-child { border-bottom: none; }
.tp-main { flex: 1; min-width: 0; }
.tp-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dim { color: var(--muted); font-size: 11.5px; }
.tp-bar { height: 5px; border-radius: 3px; background: #0e161f; overflow: hidden; margin: 7px 0 5px; }
.tp-bar > div { height: 100%; background: linear-gradient(90deg,#2f7fbf,#4f9ad6); transition: width .25s; }
.tp-meta { font-size: 11.5px; color: var(--muted); }
.tp-meta.bad { color: #ef7a7a; }
.tp-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tp-empty { color: var(--muted); font-size: 12.5px; padding: 14px 0; }
.up-item.state-fail .up-meta { color: #ef7a7a; }
.up-item.state-paused .up-meta { color: #e0b25a; }

/* 4.7.0 阶段 6：播放续播提示条 */
.vw-resume {
  position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: rgba(12, 18, 25, .92); border: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; z-index: 12;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
}
.vw-resume span { color: var(--muted); }
