/* ============================================================
   视觉风格：macOS 原生观感（毛玻璃侧栏 / 系统色 / 细线 / 柔和阴影）
   交互逻辑：Windows 资源管理器（面包屑、双击、多选、右键、拖拽）
   这一层放在样式表末尾，覆盖前面的基础皮肤，不动布局和功能。
   ============================================================ */

:root {
  --bg: #eceef1;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --soft: #8e8e93;
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .13);
  --accent: #007aff;
  --accent-2: #5ac8fa;
  --accent-soft: rgba(0, 122, 255, .12);
  --danger: #ff3b30;
  --radius: 10px;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .04);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .13), 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-lg: 0 30px 64px rgba(0, 0, 0, .28);
}

body {
  background: var(--bg);
  letter-spacing: -0.006em;
}

/* ---------- 侧栏：macOS 毛玻璃 ---------- */
.sidebar {
  background: rgba(246, 246, 248, .78);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-right: 1px solid var(--line);
}

.nav-item {
  border-radius: 7px;
  height: 34px;
  font-size: 13.5px;
  color: #3a3a3c;
}
.nav-item:hover { background: rgba(0, 0, 0, .045); }
.nav-item.active {
  background: rgba(0, 122, 255, .13);
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 顶部栏：更薄、更淡 ---------- */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.topbar h1 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- 按钮：macOS 圆角与描边 ---------- */
.btn {
  border-radius: 7px;
  border-color: var(--line-2);
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
  transition: background .16s ease, border-color .16s ease, transform .1s ease;
}
.btn:hover { background: #f7f7f9; }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(0, 122, 255, .35);
}
.btn.primary:hover { background: #0a6fe6; }
.btn.ghost { background: rgba(255, 255, 255, .9); }
.btn.danger { background: rgba(255, 59, 48, .08); color: var(--danger); border-color: rgba(255, 59, 48, .25); }
.btn.sm { border-radius: 6px; }
.btn:focus-visible { outline: 3px solid rgba(0, 122, 255, .35); outline-offset: 1px; }

/* ---------- 列表：行高更紧凑，选中是系统蓝 ---------- */
.list-card {
  border-radius: 10px;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.row {
  height: 34px;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 0, 0, .045);
}
.row .name .txt { font-weight: 400; font-size: 13px; }
.row:hover { background: rgba(0, 0, 0, .028); }
.row.selected {
  background: rgba(0, 122, 255, .12);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, .22);
}
.row.selected .name .txt { color: var(--accent); font-weight: 600; }
.row.dir .name .txt { color: var(--text); }

/* 列表表头 */
.list-head { font-size: 11.5px; letter-spacing: .02em; text-transform: none; color: var(--soft); }

/* ---------- 卡片视图 ---------- */
.card {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: var(--shadow-xs);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card.selected {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
}
.card .meta { background: var(--surface); position: relative; z-index: 1; }
.card .thumb img { object-fit: contain; background: #fff; }

/* ---------- 面包屑：像 Finder 的路径栏 ---------- */
.crumb {
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.crumb:hover { background: rgba(0, 0, 0, .05); }
.crumb.active { color: var(--text); font-weight: 600; }

/* ---------- 分段控件（列表/网格切换）---------- */
.seg {
  background: rgba(0, 0, 0, .05);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button { border-radius: 6px; }
.seg button.active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
  color: var(--text);
}

/* ---------- 下拉/输入 ---------- */
.input, .select, select.input {
  border-radius: 7px;
  border-color: var(--line-2);
  background: #fff;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .03);
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .22);
}

/* ---------- 弹窗：毛玻璃遮罩 + 大圆角 ---------- */
.modal-mask {
  background: rgba(0, 0, 0, .28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .6);
}
.modal h3, .modal-title { letter-spacing: -0.01em; }

/* ---------- 右键菜单：macOS 菜单质感 ---------- */
.ctx {
  border-radius: 9px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2), 0 2px 8px rgba(0, 0, 0, .08);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(252, 252, 253, .92);
}
.ctx button:hover { background: var(--accent); color: #fff; border-radius: 5px; }

/* ---------- 提示条 ---------- */
.toast {
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, .12);
}

/* ---------- 滚动条：细、半透明、悬停变深 ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .18);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .32); background-clip: padding-box; }

/* ---------- 状态栏（Windows 逻辑：显示项目数与选中数）---------- */
.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--soft);
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.status-bar #status-path { margin-left: auto; opacity: .8; }
.status-bar #status-sel:not(:empty) { color: var(--accent); font-weight: 600; }

/* ---------- 拖拽高亮 ---------- */
.row.drop-hover, .card.drop-hover {
  background: rgba(0, 122, 255, .10);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 8px;
}
.crumb.drop-hover { background: var(--accent); color: #fff; }

/* ---------- 手机：保持易点按 ---------- */
@media (max-width: 720px) {
  .row { height: 46px; }
  .topbar { height: 48px; }
}

/* ---------- 批量操作条：改成悬浮，避免选中时把列表顶下去（“跳一下”）---------- */
.batch-bar {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 8px 10px 8px 14px;
  margin: 0;
  max-width: calc(100vw - 32px);
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 8px rgba(0, 0, 0, .06);
  animation: batchIn .16s ease-out;
}
.batch-bar.hidden { display: none; }
.batch-count { font-size: 12.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.batch-bar .btn { padding: 6px 10px; font-size: 12.5px; white-space: nowrap; flex: 0 0 auto; }
@keyframes batchIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 720px) {
  .batch-bar {
    left: 12px; right: 12px; bottom: calc(72px + var(--safe-b));
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }
  @keyframes batchIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
/* 同步状态 */
.sync-line { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--soft); margin-bottom: 8px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #34c759; flex: 0 0 7px; }
.sync-line.busy .sync-dot { background: var(--accent); animation: syncPulse 1s ease-in-out infinite; }
.sync-line.stale .sync-dot { background: #ff9f0a; }
.sync-line.stale { color: #b26a00; }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }