/* ============================================================
   pCloud Vault — 界面样式
   ============================================================ */

:root {
  --bg: #07090f;
  --bg-2: #0b0f18;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #101623;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eefc;
  --text-dim: #9aa7bd;
  --text-faint: #667189;
  --accent: #7aa2ff;
  --accent-2: #b07cff;
  --accent-glow: rgba(122, 162, 255, 0.35);
  --danger: #ff6b81;
  --ok: #46d8a4;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont,
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(122, 162, 255, 0.32); }

/* ---------------------------- 背景光晕 ---------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.aurora .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  animation: float 22s ease-in-out infinite;
}
.aurora .b1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #2f5cff 0%, transparent 68%);
  top: -180px; left: -120px;
}
.aurora .b2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #8b3dff 0%, transparent 68%);
  bottom: -200px; right: -80px;
  animation-delay: -7s;
}
.aurora .b3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #106b7a 0%, transparent 70%);
  top: 45%; left: 55%;
  opacity: 0.28;
  animation-delay: -13s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-30px, 25px) scale(0.95); }
}

/* ---------------------------- 顶栏 ---------------------------- */

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  flex: none;
}

.brand { display: flex; align-items: center; gap: 11px; }
.logo { width: 30px; height: 30px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14.5px; letter-spacing: 0.2px; font-weight: 640; }
.brand-text span { font-size: 11px; color: var(--text-faint); letter-spacing: 0.4px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  transition: 0.18s;
}
.chip:hover { border-color: var(--stroke-strong); color: var(--text); }
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.chip.online .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(70, 216, 164, 0.16); }
/* 保险库按钮：库名 + 「切换」尾巴，让人一眼看出可点 */
.chip-vault { color: var(--text); }
.chip-swap {
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--stroke);
  color: var(--text-faint);
  font-size: 11.5px;
}
.chip:hover .chip-swap { color: var(--text-dim); }

/* ---------------------------- 按钮 ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  font-weight: 550;
  font-size: 13.5px;
  letter-spacing: 0.1px;
  transition: transform 0.12s, background 0.18s, border-color 0.18s, box-shadow 0.18s, opacity 0.18s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.994); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn.primary {
  background: linear-gradient(135deg, #6f96ff 0%, #9b6cff 100%);
  color: #080b12;
  font-weight: 640;
  box-shadow: 0 10px 26px -12px rgba(122, 140, 255, 0.85),
              inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn.primary:hover {
  box-shadow: 0 14px 34px -12px rgba(140, 150, 255, 0.95),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn.ghost {
  background: var(--panel);
  border-color: var(--stroke);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--stroke-strong); }

.btn.block { width: 100%; }
.btn.big { padding: 14px 18px; font-size: 14.5px; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; }
.btn.icon-only { padding: 10px; }
.btn-ico { width: 17px; height: 17px; flex: none; }

/* ---------------------------- 舞台 ---------------------------- */

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: auto;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 26px 40px;
  min-height: 0;
}
.view.wide { padding: 18px 22px 0; }

.view[hidden] { display: none; }

/* ---------------------------- 卡片 ---------------------------- */

.card {
  margin: auto;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 34px 34px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  animation: rise 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card.narrow { max-width: 430px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.card-head { margin-bottom: 24px; }
.card-head.center { text-align: center; margin-bottom: 26px; }

.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

h1 {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.muted { margin: 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.65; }

/* ---------------------------- 表单 ---------------------------- */

.form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 550;
  letter-spacing: 0.2px;
}
.field .hint {
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: 0.18s;
}
input::placeholder { color: var(--text-faint); }
input:focus, select:focus {
  border-color: rgba(122, 162, 255, 0.55);
  box-shadow: 0 0 0 3.5px rgba(122, 162, 255, 0.14);
  background: rgba(0, 0, 0, 0.45);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.key-field { position: relative; }

#in-key {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  padding-right: 58px;
}
#in-key::placeholder { font-size: 12.5px; letter-spacing: 0; }

.key-field .reveal {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.15s;
}
.key-field .reveal:hover { background: rgba(255, 255, 255, 0.11); color: var(--text); }

.prep-note {
  margin: 4px 0 16px;
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(122, 162, 255, 0.07);
  border: 1px solid rgba(122, 162, 255, 0.16);
  color: var(--text-dim);
  font-size: 12.3px;
  line-height: 1.6;
}
.prep-note b { color: #a9c0ff; }

.err {
  margin: 0;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 129, 0.1);
  border: 1px solid rgba(255, 107, 129, 0.28);
  color: #ffb3be;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-line;
}

.footnote {
  margin: 18px 0 0;
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.6;
  text-align: center;
}

/* ---------------------------- 特性列表 ---------------------------- */

.facts {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.facts li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 12px;
  transition: background 0.18s;
}
.facts li:hover { background: rgba(255, 255, 255, 0.035); }
.facts .ico {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #9db4ff;
  flex: none;
}
.facts .ico svg { width: 17px; height: 17px; }
.facts b { display: block; font-weight: 600; font-size: 13.2px; margin-bottom: 1px; }
.facts small { color: var(--text-faint); font-size: 11.8px; line-height: 1.5; }

/* ---------------------------- 锁 ---------------------------- */

.lock-badge {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: grid; place-items: center;
  color: #a9bdff;
  background: linear-gradient(160deg, rgba(122, 162, 255, 0.2), rgba(176, 124, 255, 0.12));
  border: 1px solid rgba(122, 162, 255, 0.28);
  box-shadow: 0 12px 30px -14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.lock-badge svg { width: 27px; height: 27px; }

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.6px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.11);
}

/* ---------------------------- 工具栏 ---------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  flex: none;
}
.spacer { flex: 1; }

.searchbox {
  position: relative;
  display: flex;
  align-items: center;
}
.searchbox svg {
  position: absolute;
  left: 12px;
  width: 15px; height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.searchbox input {
  padding-left: 35px;
  width: 220px;
  background: var(--panel);
  border-radius: 999px;
  height: 38px;
  font-size: 13px;
}

/* ---------------------------- 面包屑 ---------------------------- */

.crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 9px 4px;
  margin-bottom: 8px;
  font-size: 13px;
  flex: none;
}
.crumbs button {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--text-dim);
  transition: 0.15s;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumbs button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.crumbs button.current { color: var(--text); font-weight: 600; }
.crumbs .sep { color: var(--text-faint); font-size: 11px; padding: 0 1px; }

/* ---------------------------- 文件列表 ---------------------------- */

.list-head, .file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 150px 96px;
  align-items: center;
  gap: 12px;
}

.list-head {
  padding: 0 14px 8px;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--stroke);
  flex: none;
}

.filelist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0 30px;
  outline: none;
}
.filelist:empty {
  flex: 0 0 auto;
  padding: 0;
}
.filelist::-webkit-scrollbar { width: 9px; }
.filelist::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.filelist::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); background-clip: content-box; }

.file-row {
  padding: 9px 14px;
  margin: 0 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: default;
  transition: background 0.13s, border-color 0.13s;
  position: relative;
  overflow: hidden;
}
.file-row:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.07);
}
.file-row.selected {
  background: rgba(122, 162, 255, 0.13);
  border-color: rgba(122, 162, 255, 0.28);
}

.f-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.f-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  flex: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
}
.f-icon svg { width: 18px; height: 18px; }
.f-icon.dir {
  background: linear-gradient(155deg, rgba(122, 162, 255, 0.22), rgba(122, 162, 255, 0.07));
  border-color: rgba(122, 162, 255, 0.2);
  color: #a9c0ff;
}
.f-label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.f-label .t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}
.f-label .p {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-size, .c-time {
  color: var(--text-dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.c-act {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  opacity: 0.32;
  transition: opacity 0.15s;
}
.file-row:hover .c-act, .file-row.selected .c-act { opacity: 1; }

.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  transition: 0.14s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.icon-btn.danger:hover { background: rgba(255, 107, 129, 0.16); color: var(--danger); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------------------------- 空状态 ---------------------------- */

.empty {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 40px 20px 80px;
  color: var(--text-faint);
}
.empty[hidden] { display: none; }
.empty-art { margin-bottom: 10px; color: var(--text-dim); opacity: 0.5; }
.empty-art svg { width: 62px; height: 62px; }
.empty p { margin: 0; font-size: 14px; color: var(--text-dim); }
.empty span { font-size: 12.5px; }

/* ---------------------------- 状态栏 ---------------------------- */

.statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-top: 1px solid var(--stroke);
  font-size: 11.8px;
  color: var(--text-faint);
  flex: none;
}
.statusbar .sep { opacity: 0.4; }
.enc-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(122, 162, 255, 0.75);
  font-size: 11.5px;
}
.enc-note svg { width: 13px; height: 13px; }

/* ---------------------------- 拖放 ---------------------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  background: rgba(7, 9, 15, 0.82);
  backdrop-filter: blur(8px);
  border: 2px dashed rgba(122, 162, 255, 0.5);
  border-radius: 0;
}
.drop-overlay.active { display: grid; animation: fade 0.16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drop-inner { text-align: center; }
.drop-ico {
  margin-bottom: 12px;
  color: var(--accent);
  animation: bob 1.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 18px rgba(122, 162, 255, 0.5));
}
.drop-ico svg { width: 46px; height: 46px; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.drop-inner p { margin: 0; font-size: 16px; color: var(--text); font-weight: 550; }

/* ---------------------------- 提示 ---------------------------- */

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(18, 24, 38, 0.94);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  backdrop-filter: blur(14px);
  animation: toastIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  max-width: 78vw;
  text-align: center;
}
.toast.ok { border-color: rgba(70, 216, 164, 0.4); color: #9df0d2; }
.toast.err { border-color: rgba(255, 107, 129, 0.42); color: #ffb3be; }
.toast.out { animation: toastOut 0.22s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ---------------------------- 模态 ---------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(10px);
}
.modal-root.active { display: grid; animation: fade 0.18s ease; }

.modal {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #141b29, #0e131d);
  border: 1px solid var(--stroke-strong);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95);
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin: 0 0 6px; font-size: 18px; font-weight: 630; }
.modal p.sub { margin: 0 0 18px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }
.modal .actions { display: flex; gap: 9px; margin-top: 20px; }
.modal .actions .btn { flex: 1; }

/* 恢复码 */

.recovery-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(122, 162, 255, 0.24);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 1.1px;
  text-align: center;
  user-select: all;
}
.recovery-box span {
  padding: 6px 2px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: #cfe0ff;
}

/* 创建成功后的密钥图片预览 */
.key-preview {
  display: grid;
  place-items: center;
  margin-top: 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(122, 162, 255, 0.22);
  min-height: 150px;
  overflow: hidden;
}
.key-preview img {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  border-radius: 9px;
}
.key-preview .kp-loading {
  font-size: 12.4px;
  color: var(--text-faint);
}

.warn-strip {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  margin-top: 14px;
  border-radius: 11px;
  background: rgba(255, 180, 84, 0.09);
  border: 1px solid rgba(255, 180, 84, 0.26);
  color: #ffd9a3;
  font-size: 12.2px;
  line-height: 1.6;
}
.warn-strip b { color: #ffc470; }
.warn-ico {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 180, 84, 0.22);
  color: #ffc470;
  font-size: 11px;
  font-weight: 800;
}

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  font-size: 12.6px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  line-height: 1.55;
}

/* 锁屏页的「手动输入」折叠区（新版已移除入口，样式保留向后兼容） */
.manual-key {
  margin-top: 14px;
}

/* 解锁两步提示 */
.unlock-steps {
  display: grid;
  gap: 9px;
  margin: 18px 0 16px;
}
.ustep {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.ustep .n {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #8fb6ff;
  background: rgba(96, 148, 255, 0.14);
  border: 1px solid rgba(96, 148, 255, 0.3);
}
.ustep b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ustep small {
  display: block;
  margin-top: 2px;
  font-size: 11.8px;
  color: var(--text-faint);
}
.manual-key summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  font-size: 12.4px;
  color: var(--text-faint);
  padding: 8px 0 4px;
}
.manual-key summary::-webkit-details-marker { display: none; }
.manual-key summary::before { content: '▾  '; }
.manual-key[open] summary::before { content: '▴  '; }
.manual-key .form { margin-top: 8px; }
.checkline input {
  margin-top: 2px;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  flex: none;
}

/* ---------------------------- 进度层 ---------------------------- */

.progress-layer {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(9px);
}
.progress-layer[hidden] { display: none; }

.progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 30px 40px;
  border-radius: 22px;
  background: rgba(16, 22, 35, 0.92);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
  min-width: 280px;
  max-width: min(420px, 92vw);
}
.ring-wrap { position: relative; width: 80px; height: 80px; margin-bottom: 8px; }
.ring { width: 80px; height: 80px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-bg { stroke: rgba(255, 255, 255, 0.08); }
.ring-fg {
  stroke: url(#none);
  stroke: var(--accent);
  stroke-dasharray: 207.3;
  stroke-dashoffset: 207.3;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 6px rgba(122, 162, 255, 0.6));
}
.ring-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.p-title { margin: 0; font-size: 14px; font-weight: 550; }
.p-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
  min-height: 18px;
  text-align: center;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;   /* 速度数字跳动时不抖 */
}

/* 进度层上的「暂停 / 取消」 */
.p-acts {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.p-acts .btn { min-width: 92px; justify-content: center; }
.p-acts #p-cancel {
  color: #ff8b9b;
  border-color: rgba(255, 107, 129, 0.32);
}
.p-acts #p-cancel:hover:not(:disabled) {
  background: rgba(255, 107, 129, 0.14);
  border-color: rgba(255, 107, 129, 0.55);
}
.p-acts .btn:disabled { opacity: 0.55; cursor: default; }
.progress-layer[data-pause="1"] .ring-fg {
  stroke: #d0b070;
  filter: drop-shadow(0 0 6px rgba(208, 176, 112, 0.55));
}

/* ---------------------------- 响应式 ---------------------------- */

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .brand-text span { display: none; }
  .view { padding: 20px 14px 30px; }
  .view.wide { padding: 12px 12px 0; }
  .card { padding: 26px 20px 22px; }
  .list-head, .file-row { grid-template-columns: minmax(0, 1fr) 78px 62px; }
  .c-time { display: none; }
  .searchbox input { width: 140px; }
  .toolbar .btn span { display: none; }
  .recovery-box { grid-template-columns: repeat(2, 1fr); font-size: 12.5px; }
  .c-act { opacity: 1; }
}

/* ============================================================
   多选 / 标签页 / 菜单 / 预览器
   ============================================================ */

.list-head, .file-row {
  grid-template-columns: minmax(0, 1fr) 110px 150px 44px;
}

/* 标签页 */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex: none;
}
.tab {
  position: relative;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active {
  color: var(--text);
  background: rgba(122, 162, 255, 0.14);
  border-color: rgba(122, 162, 255, 0.28);
}
.tab-badge {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255, 107, 129, 0.18);
  color: #ffb3be;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.crumb-note {
  margin-left: 10px;
  font-size: 11.8px;
  color: var(--text-faint);
}

.btn.danger {
  background: linear-gradient(135deg, #ff6b81, #ff9a6b);
  color: #1a070b;
  border-color: transparent;
}
.btn.danger:hover { filter: brightness(1.06); }

/* 右键菜单 */
.ctxmenu {
  position: fixed;
  z-index: 140;
  min-width: 172px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(21, 25, 36, 0.97);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
}
.ctxmenu[hidden] { display: none; }
.cm-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.cm-item:hover { background: rgba(255, 255, 255, 0.08); }
.cm-item.danger { color: #ff9aa8; }
.cm-item.danger:hover { background: rgba(255, 107, 129, 0.14); }
.cm-sep { height: 1px; margin: 5px 8px; background: var(--stroke); }

/* 移动目标选择 */
.mv-list {
  max-height: 46vh;
  overflow: auto;
  margin: 14px 0 4px;
  padding: 6px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}
.mv-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.mv-item:hover { background: rgba(255, 255, 255, 0.05); }
.mv-item.active {
  background: rgba(122, 162, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(122, 162, 255, 0.35);
}
.mv-ico { display: grid; place-items: center; }
.mv-ico svg { width: 17px; height: 17px; color: #7aa2ff; }
.mv-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-path {
  font-size: 11px;
  color: var(--text-faint);
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 预览器 */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 16, 0.965);
  backdrop-filter: blur(22px);
}
.viewer[hidden] { display: none; }
.v-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  flex: none;
}
.v-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v-actions { display: flex; gap: 8px; flex: none; }
.v-body { position: relative; flex: 1; min-height: 0; display: flex; }
.v-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
}
.v-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.v-stage video { max-width: 100%; max-height: 100%; border-radius: 10px; background: #000; }
.v-stage iframe { width: 100%; height: 100%; border: none; border-radius: 10px; background: #fff; }
.v-text {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 18px 20px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.6px;
  line-height: 1.75;
  color: #d6e2f5;
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}
.v-note {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 99px;
  background: rgba(20, 24, 34, 0.92);
  border: 1px solid var(--stroke);
  font-size: 11.5px;
  color: var(--text-faint);
}
.v-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.v-cover {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  font-size: 46px;
  background: linear-gradient(140deg, rgba(122, 162, 255, 0.22), rgba(176, 124, 255, 0.16));
  border: 1px solid var(--stroke);
}
.v-a-name { font-size: 13px; color: var(--text-dim); max-width: 70vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(10, 13, 20, 0.72);
}
.v-loading[hidden] { display: none; }
.v-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(122, 162, 255, 0.2);
  border-top-color: #7aa2ff;
  animation: vspin 0.85s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }
.v-l-sub { margin: 0; font-size: 12.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.v-track {
  width: 230px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.v-fill {
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7aa2ff, #b07cff);
  transition: width 0.2s linear;
}
.v-fail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}
.v-fail-ico {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 107, 129, 0.16);
  color: #ff9aa8;
  font-weight: 700;
}

@media (max-width: 720px) {
  .list-head, .file-row { grid-template-columns: minmax(0, 1fr) 74px 38px; }
  .c-time { display: none; }
  .tabs { margin-bottom: 8px; }
  .v-stage { padding: 10px; }
}

/* ============ 缩略图 ============ */
.f-icon { position: relative; overflow: hidden; }
.f-icon.thumbable { width: 34px; height: 34px; }
.f-icon.thumbable img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.ver-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  border-radius: 8px;
  background: rgba(122, 162, 255, 0.15);
  color: #a9c0ff;
  vertical-align: middle;
}

/* ============ 版本历史 ============ */
.ver-list { max-height: 46vh; overflow: auto; margin: 12px 0; }
.ver-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  margin-bottom: 8px;
}
.ver-info { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.ver-info .dim { color: var(--text-dim); }
.ver-acts { display: flex; gap: 6px; }

/* ============ zip / Office 预览 ============ */
.v-zip { width: 100%; max-width: 760px; height: 100%; display: flex; flex-direction: column; gap: 8px; }
.v-zip-head { font-size: 13px; color: var(--text-dim); padding: 4px 2px; }
.v-zip-list {
  flex: 1; overflow: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}
.v-zip-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.v-zip-row:hover { background: rgba(255, 255, 255, 0.05); }
.v-zip-row.is-dir { cursor: default; opacity: 0.75; }
.v-zip-row.busy { opacity: 0.5; pointer-events: none; }
.v-zip-row .z-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-zip-row .z-s { color: var(--text-dim); flex: none; font-size: 12px; }
.v-back { align-self: flex-start; }

.v-office { width: 100%; max-width: 860px; height: 100%; overflow: auto; background: #fff; color: #222; border-radius: 12px; padding: 18px; }
.v-printbar { margin-bottom: 10px; display: flex; justify-content: flex-end; }
.v-printbar .btn { color: #456; border-color: #cdd5e0; }
.v-docx-doc .docx-wrapper { background: none; padding: 0; }
.v-docx-doc .docx-wrapper > section.docx {
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  margin: 0 auto 18px;
}
.x-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.x-tab {
  padding: 5px 12px; font-size: 12px;
  border: 1px solid #d5dbe4; border-radius: 999px;
  background: #f6f8fb; color: #345;
  cursor: pointer;
}
.x-tab.on { background: #2c5cff; border-color: #2c5cff; color: #fff; }
.x-body table { border-collapse: collapse; width: 100%; font-size: 12px; }
.x-body td, .x-body th {
  border: 1px solid #e2e6ee;
  padding: 4px 8px;
  white-space: nowrap;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis;
}
.x-body td:first-child, .x-body th:first-child { color: #99a3b2; background: #f6f8fb; }
.v-pptx { background: none; color: inherit; }
.ppt-slide {
  background: #fff; color: #222;
  border-radius: 12px; padding: 14px 18px;
  margin-bottom: 12px;
}
.ppt-num { font-size: 11px; color: #8b96ab; margin-bottom: 6px; }
.ppt-text { white-space: pre-wrap; font-size: 13px; line-height: 1.55; font-family: inherit; }

/* ============ 打印（导出 PDF） ============ */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block !important; }
  #print-area { color: #000; }
  #print-area .v-printbar { display: none !important; }
}

/* ============================================================
   Win11 / Android 操作习惯适配
   ============================================================ */

/* ---------------- Win11：右键菜单带图标 ---------------- */
.ctxmenu { min-width: 208px; padding: 5px; }
.cm-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
}
.cm-ico {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1;
}
.cm-item:hover .cm-ico { color: var(--text); }
.cm-item.danger .cm-ico { color: #ff9aa8; }

/* ---------------- FAB（Android 悬浮上传按钮） ---------------- */
.fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 95;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #6f96ff, #9b6cff);
  color: #0a0d15;
  box-shadow: 0 14px 30px -8px rgba(122, 140, 255, 0.65);
  place-items: center;
  overflow: hidden;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.94); }

/* ---------------- 底部导航栏（Android） ---------------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 95;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(13, 17, 26, 0.92);
  border-top: 1px solid var(--stroke);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.bottom-nav button {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-faint);
  font-size: 10.5px;
  overflow: hidden;
}
.bottom-nav button svg { width: 22px; height: 22px; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button.active span { font-weight: 600; }
.bottom-nav button.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 26px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}
.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 26px);
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 8px;
  background: rgba(255, 107, 129, 0.9);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ---------------- 涟漪动效（Android） ---------------- */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 62%);
  transform: scale(0);
  animation: rip 0.55s ease-out forwards;
  pointer-events: none;
}
@keyframes rip { to { transform: scale(1); opacity: 0; } }

/* ---------------- 触屏 / 窄屏（手机 = Android 习惯） ---------------- */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  /* 底部导航显示，顶部 zones/tabs 隐藏 */
  .bottom-nav { display: flex; }
  .fab { display: grid; }
  #zones, #tabs { display: none; }

  /* 工具栏按钮交给 FAB / 底部导航（保留刷新和搜索） */
  #btn-upload, #btn-newdir { display: none; }
  #btn-empty-trash { display: inline-flex; }

  /* 触控目标加大：Android 标准 48dp */
  .file-row { min-height: 52px; padding: 10px 12px; }
  .filelist { padding-bottom: 96px; }
  .btn { min-height: 42px; }

  /* 状态栏让位给底部导航 */
  .statusbar { padding-bottom: 68px; }

  /* 弹窗 = 底部弹窗（bottom sheet） */
  .modal-root.active { align-items: end; }
  .modal {
    width: 100%;
    max-width: none;
    max-height: 88vh;
    overflow: auto;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    animation: sheetUp 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .modal .actions { margin-bottom: 4px; }
  .modal .actions .btn { min-height: 46px; }

  /* 右键菜单贴边宽度 */
  .ctxmenu { min-width: 200px; }
  .cm-item { padding: 11px 12px; }

  /* 预览器适配 */
  .v-bar { padding: 10px 12px; }
  .v-stage { padding: 6px; }
  .v-stage video { width: 100%; max-height: 100%; }
  .fab[hidden] { display: none; }

  /* toast 移到底部导航上方 */
  .toasts { bottom: 76px; }
}
@keyframes sheetUp {
  from { transform: translateY(40%); opacity: 0.4; }
  to   { transform: none; opacity: 1; }
}

/* 移动端进度卡片位置 */
@media (max-width: 720px) {
  .progress-card { width: min(84vw, 320px); }
}

/* ---------------- 本地磁盘入口（连接页） ---------------- */
.local-disc { margin-top: 18px; }
.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--text-faint);
  font-size: 12px;
}
.or-line::before, .or-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke);
}
.local-disc .btn + .btn { margin-top: 8px; }
.local-disc .hint { display: block; margin-top: 10px; line-height: 1.6; }
.local-disc .err { margin-top: 10px; }

/* ============================================================
   换钥匙 / 本地文件夹备份
   ============================================================ */

/* 通用文本输入字段 */
.field { display: block; margin: 14px 0 4px; }
.field > span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }

/* 备份任务列表 */
.bk-list { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 4px; }
.bk-empty { padding: 18px 4px; line-height: 1.7; }
.bk-job {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}
.bk-job-main { flex: 1; min-width: 0; }
.bk-job-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.bk-job-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk-job-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bk-auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.bk-auto input { width: 15px; height: 15px; accent-color: var(--accent); }
.danger-text { color: #ff9aa8 !important; }

@media (max-width: 720px) {
  .bk-job { flex-direction: column; align-items: stretch; }
  .bk-job-actions { justify-content: space-between; }
}

/* ------------------------------ 多保险库切换 ------------------------------ */

.vault-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}
.vault-banner .vb-label {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}
.vault-banner b { font-size: 14px; font-weight: 620; }

.vault-list { display: flex; flex-direction: column; gap: 9px; margin: 16px 0 4px; }
.vault-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}
.vault-row.current { border-color: rgba(185, 166, 255, 0.45); background: rgba(185, 166, 255, 0.08); }
.vault-row-main { flex: 1; min-width: 0; }
.vault-row-main b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.vault-row-main small { font-size: 11.5px; color: var(--text-faint); word-break: break-all; }
.vault-row-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

@media (max-width: 720px) {
  .vault-row { flex-direction: column; align-items: stretch; }
  .vault-row-acts { justify-content: flex-end; }
}

/* --------------------------- 已保存的连接（连接页） --------------------------- */

.saved-conns { margin-bottom: 20px; }
.saved-title {
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.saved-hint {
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-faint);
  opacity: 0.75;
  margin-bottom: 9px;
}

/* 已保存连接：一个下拉，只占一行；库再多也不会把页面撑长 */
.conn-picker { display: flex; align-items: stretch; gap: 8px; }
.cp-wrap { position: relative; flex: 1; min-width: 0; }

.conn-picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 13px;
  text-align: left;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.conn-picker-btn:hover { border-color: rgba(185, 166, 255, 0.45); background: rgba(185, 166, 255, 0.08); }
.conn-picker-btn[aria-expanded="true"] { border-color: rgba(185, 166, 255, 0.55); background: rgba(185, 166, 255, 0.1); }

.cp-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-main b {
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-main small {
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-caret { font-size: 10px; color: var(--text-faint); flex-shrink: 0; transition: transform .15s; }
.conn-picker-btn[aria-expanded="true"] .cp-caret { transform: rotate(180deg); }

.conn-menu {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;      /* 滚到头也别把整个页面带着滚 */
  touch-action: pan-y;               /* 触屏上下滑动交给菜单自己 */
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  border: 1px solid var(--stroke-strong);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.6);
  animation: vmIn 0.13s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.conn-menu.up { top: auto; bottom: calc(100% + 6px); }
.conn-menu::-webkit-scrollbar { width: 10px; }
.conn-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.conn-menu:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); background-clip: content-box; }
.conn-menu::-webkit-scrollbar-track { background: transparent; }

.conn-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
}
.conn-item:hover { background: rgba(185, 166, 255, 0.1); }
.conn-item.on { background: rgba(185, 166, 255, 0.14); }
.ci-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ci-main b {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-main small {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-on {
  flex-shrink: 0;
  font-size: 10.5px;
  color: #b9a6ff;
  border: 1px solid rgba(185, 166, 255, 0.3);
  background: rgba(185, 166, 255, 0.08);
  border-radius: 999px;
  padding: 2px 7px;
}
.ci-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.45;
  transition: .15s;
}
.conn-item:hover .ci-del { opacity: 1; }
.ci-del:hover { background: rgba(255, 107, 107, 0.16); color: #ff8b8b; }

/* 当前库标签（替代禁用的"使用中"按钮） */
.vault-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 11.5px;
  color: #b9a6ff;
  border: 1px solid rgba(185, 166, 255, 0.35);
  border-radius: 999px;
  background: rgba(185, 166, 255, 0.08);
  white-space: nowrap;
}

/* --------------------------- 切换保险库下拉 --------------------------- */

.vault-menu {
  position: fixed;
  z-index: 70;
  width: 348px;
  max-width: calc(100vw - 16px);
  padding: 8px;
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
  animation: vmIn 0.14s ease-out;
}
@keyframes vmIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}
.vm-head {
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.4px;
  padding: 6px 10px 8px;
}
.vault-menu .vm-list {
  margin: 0;
  gap: 2px;
  max-height: min(56vh, 440px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.vault-menu .vm-list::-webkit-scrollbar { width: 10px; }
.vault-menu .vm-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.vault-menu .vm-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); background-clip: content-box; }
.vault-menu .vault-row {
  flex-direction: row;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  gap: 8px;
}
.vault-menu .vault-row:hover { background: rgba(255, 255, 255, 0.055); }
.vault-menu .vault-row.current { background: rgba(185, 166, 255, 0.1); }
.vault-menu .vault-row-main b { font-size: 13px; margin-bottom: 1px; }
.vault-menu .vault-row-main small { font-size: 11px; }
.vault-menu .vault-row-acts { gap: 4px; }
.vault-menu .vault-row-acts .btn { padding: 4px 9px; font-size: 11.5px; }
.vm-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 550;
  color: var(--text-dim);
  letter-spacing: 0.2px;
  margin: 6px 4px 0;
  padding: 10px 6px 5px;
  border-top: 1px solid var(--stroke);
}
.vm-sec-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 一台服务器 = 一个框：地址在框头，库在框里，归属关系一眼可见 */
.vm-group {
  margin-top: 8px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  overflow: hidden;
}
.vm-group .vm-sec {
  margin: 0;
  /* 和 .vault-menu .vault-row 的左右内边距保持一致，按钮右边缘才能对齐 */
  padding: 5px 10px;
  font-size: 11.5px;
  border-top: 0;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}
.vm-group .vault-row {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.vm-group .vault-row + .vault-row { border-top: 1px solid var(--stroke); }
.vm-group .vault-row:hover { background: rgba(255, 255, 255, 0.05); }
/* 分组框头里的「移除」就是普通的 btn ghost sm，和本地磁盘那行完全一致 */
.vm-x { flex: none; }
.vm-empty {
  font-size: 11.5px;
  color: var(--text-faint);
  line-height: 1.65;
  padding: 8px 10px 4px;
}
.vm-foot {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 2px 2px;
  border-top: 1px solid var(--stroke);
}
.vm-act {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  transition: 0.16s;
}
.vm-act:hover { color: var(--text); border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.07); }

@media (max-width: 560px) {
  /* 顶栏放不下时折成两行：品牌一行，操作一行可横向滑动 */
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: 12px 14px; gap: 10px; }
  .topbar-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  /* 窄屏不写字，留一个小箭头，仍然一眼看出可点 */
  .chip-swap { font-size: 0; border-left: 0; padding-left: 2px; }
  .chip-swap::after { content: '▾'; font-size: 11px; }
}

@media (max-width: 520px) {
  .vault-menu { left: 8px !important; right: 8px; width: auto; }
  .vault-menu .vm-list { max-height: 54vh; }
}

/* ------------------------------ 内置视频播放器 ------------------------------ */

.zvp {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  outline: none;
  user-select: none;
}
.zvp:fullscreen { border-radius: 0; }
.zvp-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

/* 顶部：文件名 + 渐变，只在全屏时出现（普通视图上面已经有标题栏） */
.zvp-top {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 34px;
  background: linear-gradient(rgba(0, 0, 0, 0.6), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.zvp:fullscreen .zvp-top { opacity: 1; }
.zvp-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 底部控制条 */
.zvp-ctl {
  position: absolute;
  inset: auto 0 0 0;
  padding: 34px 14px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  transition: opacity 0.2s, transform 0.2s;
}
.zvp.is-idle { cursor: none; }
.zvp.is-idle .zvp-ctl {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.zvp.is-dead .zvp-ctl { display: none; }

/* 进度条：细，悬停变粗，拖动时加粗并显示圆点 */
.zvp-seek {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.zvp-seek::before {
  content: '';
  position: absolute;
  inset: 6px 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: inset 0.14s, background 0.14s;
}
.zvp-seek:hover::before,
.zvp-seek.is-drag::before { inset: 5px 0; background: rgba(255, 255, 255, 0.3); }
.zvp-buf,
.zvp-played {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 99px;
  transition: height 0.14s;
  pointer-events: none;
}
.zvp-buf { background: rgba(255, 255, 255, 0.34); }
.zvp-played {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 7px rgba(122, 162, 255, 0.45);
}
.zvp-seek:hover .zvp-buf,
.zvp-seek:hover .zvp-played,
.zvp-seek.is-drag .zvp-buf,
.zvp-seek.is-drag .zvp-played { height: 7px; }
.zvp-played i {
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: scale(0.6);
  transition: 0.14s;
}
.zvp-seek:hover .zvp-played i,
.zvp-seek.is-drag .zvp-played i { opacity: 1; transform: scale(1); }
.zvp-tip {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(12, 15, 22, 0.95);
  border: 1px solid var(--stroke-strong);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  pointer-events: none;
  white-space: nowrap;
}

/* 按钮行 */
.zvp-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.9);
}
.zvp-gap { flex: 1; }
.zvp-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.zvp-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.zvp-btn svg { width: 19px; height: 19px; display: block; }
.zvp-play svg { width: 21px; height: 21px; }
.zvp-btn.is-off { color: rgba(255, 255, 255, 0.55); }
.zvp-rate { width: auto; min-width: 44px; padding: 0 7px; letter-spacing: 0.2px; }
.zvp-rate.is-on { color: var(--accent); background: rgba(122, 162, 255, 0.14); }
.zvp-time {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
}
.zvp-time b { font-weight: 500; color: #fff; }
.zvp-time i { font-style: normal; opacity: 0.45; }

/* 音量：默认只露图标，悬停展开滑块 */
.zvp-vol-wrap { display: flex; align-items: center; }
.zvp-vol-range {
  width: 0;
  opacity: 0;
  margin: 0;
  height: 3px;
  border-radius: 99px;
  appearance: none;
  background: linear-gradient(90deg, #fff calc(var(--v, 1) * 100%), rgba(255, 255, 255, 0.28) 0);
  cursor: pointer;
  transition: width 0.18s, opacity 0.18s, margin 0.18s;
}
.zvp-vol-wrap:hover .zvp-vol-range,
.zvp-vol-range:focus-visible { width: 66px; opacity: 1; margin: 0 8px 0 2px; }
.zvp-vol-range::-webkit-slider-thumb {
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  border: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.zvp-vol-range::-moz-range-thumb {
  width: 11px; height: 11px; border: 0; border-radius: 50%; background: #fff;
}

/* 倍速菜单 */
.zvp-rate-menu {
  position: absolute;
  right: 46px;
  bottom: 62px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 84px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(16, 20, 29, 0.97);
  border: 1px solid var(--stroke-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.zvp-rate-menu button {
  padding: 7px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.zvp-rate-menu button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.zvp-rate-menu button.is-cur { color: var(--accent); background: rgba(122, 162, 255, 0.12); }

/* 中央：加载 / 快进提示 */
.zvp-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
}
.zvp-spin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  animation: zvp-spin 0.8s linear infinite;
}
@keyframes zvp-spin { to { transform: rotate(360deg); } }
.zvp-badge {
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(10, 13, 20, 0.72);
  border: 1px solid var(--stroke);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.zvp-shot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 99px;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid var(--stroke-strong);
  color: #fff;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px);
  pointer-events: none;
  animation: zvp-pop 0.16s ease-out;
}
.zvp-shot svg { width: 16px; height: 16px; }
@keyframes zvp-pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
}

/* 打不开时的兜底面板 */
.zvp-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(60% 60% at 50% 45%, rgba(30, 36, 52, 0.9), rgba(6, 8, 13, 0.97));
}
.zvp-cover-inner { max-width: 400px; text-align: center; }
.zvp-cover-t { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.zvp-cover-d { font-size: 12.5px; line-height: 1.75; color: var(--text-dim); margin-bottom: 16px; }
.zvp-cover-acts { display: flex; justify-content: center; gap: 8px; }

@media (max-width: 640px) {
  .zvp-ctl { padding: 26px 8px 6px; }
  .zvp-time { margin-left: 2px; font-size: 11.5px; }
  .zvp-pip, .zvp-rate { display: none; }
  .zvp-vol-range { display: none; }
  .zvp-btn { width: 32px; height: 32px; }
}

/* 暂停时中央大播放键：小三角藏在角落不容易看见 */
.zvp-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(14, 18, 27, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.18s, transform 0.18s, background 0.18s;
}
.zvp-bigplay svg { width: 30px; height: 30px; margin-left: 3px; }
.zvp:not(.is-playing):not(.is-dead) .zvp-bigplay {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.zvp-bigplay:hover { background: rgba(255, 255, 255, 0.2); transform: translate(-50%, -50%) scale(1.06); }

/* ---------------- 触屏多选（参考夸克网盘） ---------------- */

/* 桌面永远不出现这两条 */
body:not(.touch) .selbar,
body:not(.touch) .batch-bar { display: none !important; }

/* 顶部信息条：✕ 已选 N 项 …… 全选 */
.selbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 6px 10px;
  border-radius: 11px;
  background: rgba(122, 162, 255, 0.1);
  border: 1px solid rgba(122, 162, 255, 0.32);
  animation: sheetUp 0.18s ease-out;
}
.selbar b { font-size: 13.5px; color: var(--text); }
.selbar .spacer { flex: 1; }
.sel-x,
.sel-all {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.sel-x { color: var(--text-dim); font-size: 14px; }
.sel-x:hover, .sel-all:hover { background: rgba(255, 255, 255, 0.08); }

/* 底部批量操作条：盖在底部导航的位置 */
.batch-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 122;
  display: none;
  gap: 4px;
  padding: 5px 8px calc(7px + env(safe-area-inset-bottom));
  background: rgba(11, 15, 24, 0.97);
  border-top: 1px solid var(--stroke-strong);
  backdrop-filter: blur(16px);
}
body.touch .batch-bar:not([hidden]) { display: flex; }
.batch-bar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
}
.batch-bar button i { font-style: normal; font-size: 17px; line-height: 1; }
.batch-bar button:active { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.batch-bar button.danger { color: #ff7a7a; }

/* 多选模式：底部导航和 FAB 让位，行尾「更多」隐藏 */
body.touch.selecting .bottom-nav { display: none; }
body.touch.selecting .fab { display: none; }
body.touch.selecting .c-act { visibility: hidden; }
/* 与选择无关的行全部收起，文件列表最大化 */
body.touch.selecting .toolbar,
body.touch.selecting .crumbs,
body.touch.selecting .statusbar { display: none; }
body.touch.selecting .filelist { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* FAB 的底部菜单 */
.fab-sheet {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-end;
}
.fab-sheet[hidden] { display: none; }
.fs-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  animation: fabFade 0.2s ease-out;
}
@keyframes fabFade { from { opacity: 0; } }
.fs-panel {
  position: relative;
  width: 100%;
  padding: 10px 12px calc(16px + env(safe-area-inset-bottom));
  background: #10141e;
  border-top: 1px solid var(--stroke-strong);
  border-radius: 22px 22px 0 0;
  animation: sheetUp 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fs-panel button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}
.fs-panel button i { font-style: normal; font-size: 17px; width: 22px; text-align: center; }
.fs-panel button:active { background: rgba(255, 255, 255, 0.08); }

/* 手机：搜索框和刷新挤同一行，省一行高度 */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .toolbar { flex-wrap: nowrap; margin-bottom: 8px; }
  .toolbar .spacer { display: none; }
  .searchbox { flex: 1; order: 1; min-width: 0; }
  .searchbox input { width: 100%; }
  #btn-refresh { order: 2; flex: none; }
  /* 列头在手机上没意义（每行已显示大小），去掉 */
  .list-head { display: none; }
  .filelist { padding-top: 2px; }
  /* 顶栏收紧一点 */
  .topbar { padding: 9px 12px; row-gap: 7px; }
  .topbar .btn { min-height: 36px; padding: 6px 13px; }
  /* 面包屑贴紧 */
  .crumbs { padding: 4px 2px 2px; margin-bottom: 4px; }
  .selbar { margin-bottom: 6px; }
}

/* ---------------- 扫描文档编辑器 ---------------- */

.scan-modal { max-width: 560px; }
.scan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.scan-top b { font-size: 17px; font-weight: 630; }
.scan-x {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}
.scan-x:hover { background: rgba(255, 255, 255, 0.12); color: var(--text); }

.scan-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  touch-action: none;
}
.scan-img {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  user-select: none;
  -webkit-user-drag: none;
}
.scan-img:not([src]) { display: none; }

.scan-crop {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  border: 1.5px solid var(--accent);
  cursor: move;
}
.scan-crop .h {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.scan-crop .h.nw { left: -11px; top: -11px; cursor: nwse-resize; }
.scan-crop .h.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.scan-crop .h.sw { left: -11px; bottom: -11px; cursor: nesw-resize; }
.scan-crop .h.se { right: -11px; bottom: -11px; cursor: nwse-resize; }
.scan-empty {
  padding: 40px 16px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

.scan-filters {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.scan-filters button {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.scan-filters button.on {
  background: rgba(122, 162, 255, 0.14);
  border-color: rgba(122, 162, 255, 0.5);
  color: var(--accent);
}

.scan-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.scan-pages:empty { display: none; }
.scan-page {
  position: relative;
  width: 56px;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: #000;
}
.scan-page img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-page i {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  cursor: pointer;
}
.scan-page i:hover { background: #d64545; }

.scan-acts { display: flex; gap: 8px; margin-top: 16px; }
.scan-acts .btn { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }
.scan-acts [data-act="add"] { flex: 1.4; }
