/* ==========================================================================
   NAS 企业共享盘规划收集系统 — 仿群晖 DSM 企业级风格
   蓝色主调 · 清爽专业 · 本地实现不依赖任何 CDN
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  --primary: #0078d4;
  --primary-bright: #0086fc;
  --primary-dark: #005a9e;
  --primary-soft: #e8f3fd;
  --bg: #f5f6f7;
  --bg-panel: #ffffff;
  --bg-hover: #edf1f5;
  --border: #e3e7ec;
  --border-strong: #cfd6dd;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #8a9199;
  --text-invert: #ffffff;
  --color-read: #3b82f6;
  --color-edit: #22c55e;
  --color-deny: #ef4444;
  --color-warn: #f59e0b;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-card: 0 2px 8px rgba(16, 34, 51, 0.06), 0 8px 28px rgba(16, 34, 51, 0.08);
  --shadow-pop: 0 6px 18px rgba(16, 34, 51, 0.1), 0 18px 48px rgba(16, 34, 51, 0.16);
  --topbar-h: 54px;
  --sidebar-w: 264px;
  --font: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8d0d8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aab4bf; }
::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   登录视图
   ========================================================================== */
.view-login {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef4fa 0%, #e6eef7 45%, #f5f6f7 100%);
  overflow: hidden;
}

.login-bg-decor { position: absolute; inset: 0; pointer-events: none; }

.decor {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.55;
}
.decor-1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(0,134,252,0.18), transparent 70%); top: -140px; left: -120px; }
.decor-2 { width: 380px; height: 380px; background: radial-gradient(circle, rgba(0,120,212,0.16), transparent 70%); bottom: -120px; right: -80px; }
.decor-3 { width: 220px; height: 220px; background: radial-gradient(circle, rgba(34,197,94,0.10), transparent 70%); top: 42%; right: 12%; }

.login-card {
  position: relative;
  z-index: 1;
  width: 400px;
  max-width: calc(100vw - 40px);
  background: var(--bg-panel);
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  padding: 40px 38px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: card-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.login-logo { margin-bottom: 10px; filter: drop-shadow(0 4px 10px rgba(0,120,212,0.28)); }

.login-title { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: 0.5px; }
.login-subtitle { margin: 6px 0 26px; font-size: 12.5px; color: var(--text-muted); letter-spacing: 1.5px; }

.login-form { width: 100%; display: flex; flex-direction: column; gap: 16px; }

.login-field label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: #9aa4ae; pointer-events: none; transition: color 0.2s; }
.input-wrap:focus-within .input-icon { color: var(--primary); }

.input-wrap input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 38px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: #fafbfc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.14);
}
.input-wrap input::placeholder { color: #b3bcc5; }

.login-error {
  background: #fdf0f0;
  border: 1px solid #f5c6c6;
  color: #c0392b;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  animation: shake 0.3s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.btn-login {
  margin-top: 4px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-bright), var(--primary-dark));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
}
.btn-login:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(0, 120, 212, 0.42); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0) scale(0.99); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-login .btn-arrow { transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(3px); }

.login-tip { margin-top: 22px; font-size: 11.5px; color: var(--text-muted); }
.login-footer {
  position: absolute;
  bottom: 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  z-index: 1;
}

/* ==========================================================================
   主界面骨架
   ========================================================================== */
.view-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(16, 34, 51, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.topbar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.brand { display: flex; align-items: center; gap: 8px; user-select: none; }
.brand svg { filter: drop-shadow(0 2px 4px rgba(0,120,212,0.3)); }
.brand-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; }

.breadcrumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 0 6px;
  white-space: nowrap;
  scrollbar-width: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.crumb:hover { background: var(--bg-hover); color: var(--primary); }
.crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.crumb.current:hover { background: transparent; color: var(--text); }
.crumb-sep { color: #b6bec7; font-size: 11px; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.topbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; }
.topbar-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-bright), var(--primary-dark));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-user .user-name { font-size: 12.5px; color: var(--text); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border: 1px solid #cfe5fa;
  white-space: nowrap;
}

.topbar-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.topbar-btn.primary {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary-dark));
  border-color: transparent;
  color: #fff;
}
.topbar-btn.primary:hover { filter: brightness(1.06); color: #fff; }

/* ---------- 主体 ---------- */
.app-body { flex: 1; display: flex; min-height: 0; }

/* ---------- 侧栏目录树 ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: #fbfcfd;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: margin-left 0.25s ease;
}
.sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; flex-shrink: 0; }
.sidebar-title { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 2px; }
.sidebar-count { font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 2px 8px; border-radius: 10px; }

.tree { flex: 1; overflow-y: auto; padding: 2px 8px 16px; }

.tree-node { margin: 1px 0; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 8px 0 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.12s;
}
.tree-row:hover { background: var(--bg-hover); }
.tree-row.active { background: var(--primary-soft); }
.tree-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.tree-toggle {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9aa4ae;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
  transition: transform 0.18s;
}
.tree-toggle:hover { background: #e6ebf0; color: var(--text); }
.tree-toggle.open { transform: rotate(90deg); }

.tree-folder-icon { color: #e8a33d; flex-shrink: 0; display: flex; }
.tree-folder-icon.root { color: var(--primary); }

.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text); }
.tree-row.active .tree-label { color: var(--primary-dark); font-weight: 600; }

.tree-children { padding-left: 16px; }

.tree-empty { padding: 22px 12px; text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 1.8; }

.preview-banner {
  margin: 0 10px 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: #fef6e7;
  border: 1px solid #f5dcae;
  color: #9a6b00;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-banner span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-exit { border: none; background: transparent; color: #9a6b00; cursor: pointer; font-size: 13px; padding: 0 3px; border-radius: 4px; }
.preview-exit:hover { background: rgba(154,107,0,0.12); }

/* ---------- 主文件区 ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.main-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; flex-wrap: wrap; }
.toolbar-title { font-size: 16px; font-weight: 600; color: var(--text); margin-right: 6px; }

.tool-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.tool-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.tool-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.tool-btn.danger:hover:not(:disabled) { border-color: var(--color-deny); color: var(--color-deny); background: #fdf0f0; }
.tool-spacer { flex: 1; }

.file-list { flex: 1; overflow-y: auto; padding: 4px 20px 24px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 46px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.file-item:hover { border-color: #bcd6ee; box-shadow: 0 2px 8px rgba(0,120,212,0.08); transform: translateY(-1px); }
.file-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,120,212,0.14); }

.file-item .folder-icon { color: #e8a33d; display: flex; flex-shrink: 0; }
.file-item .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; color: var(--text); }
.file-item .file-path { font-size: 11.5px; color: var(--text-muted); }

/* 权限标签 */
.perm-badge {
  font-size: 11px;
  padding: 2.5px 9px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.perm-badge.read { background: #eaf2fe; color: #1d5bb8; border: 1px solid #c8ddf8; }
.perm-badge.edit { background: #e9f9ee; color: #15803d; border: 1px solid #bde8cb; }
.perm-badge.deny { background: #fdeaec; color: #c0392b; border: 1px solid #f5c6cb; }
.perm-badge.special { background: linear-gradient(135deg, #eef5ff, #e8f3fd); color: var(--primary-dark); border: 1px solid #cfe5fa; }

.list-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); gap: 8px; padding-bottom: 60px; }
.list-empty .empty-icon { opacity: 0.5; }
.list-empty p { font-size: 13px; }

/* ==========================================================================
   弹窗体系
   ========================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 41, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: mask-in 0.2s ease;
}
@keyframes mask-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 520px;
  max-width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.lg { width: 680px; }
.modal.sm { width: 380px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-title .title-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-item > label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-item .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; line-height: 1.6; }

textarea.input { resize: vertical; min-height: 120px; font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 12.5px; line-height: 1.7; white-space: pre; }

/* 批量导入结果 */
.import-summary { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; font-size: 11.5px; padding: 4px 12px; border-radius: 999px; background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-ok { background: #e9f9ee; color: #15803d; border-color: #bde8cb; }
.import-fail-list { margin-top: 8px; max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.import-fail-title { font-size: 12px; color: var(--text-secondary); padding: 8px 12px; background: #fafafa; border-bottom: 1px solid var(--border); font-weight: 600; }
.import-fail { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.import-fail:last-child { border-bottom: none; }
.import-line { color: var(--text); font-family: Consolas, Monaco, 'Courier New', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-reason { color: #c0392b; flex-shrink: 0; }

.input, .select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,120,212,0.12); }
.input:disabled, .select:disabled { background: var(--bg-hover); color: var(--text-muted); cursor: not-allowed; }

.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: #b8c2cc; color: var(--text); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary-dark));
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.danger { border-color: #f5c6cb; color: var(--color-deny); }
.btn.danger:hover { background: #fdf0f0; }

/* 权限配置弹窗 */
.perm-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin: 18px 0 8px;
}
.perm-section-title:first-child { margin-top: 0; }

.perm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.perm-row:hover { background: var(--bg-hover); }
.perm-row .perm-obj { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.perm-row .perm-name { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-row .perm-sub { font-size: 11px; color: var(--text-muted); }
.perm-row .perm-note { font-size: 11px; color: var(--color-warn); flex-shrink: 0; }

.perm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.perm-avatar.avatar-user { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.perm-avatar.avatar-group { background: linear-gradient(135deg, #fbbf24, #d97706); border-radius: 7px; }

.perm-select {
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  min-width: 92px;
}
.perm-select:focus { border-color: var(--primary); }

/* 用户/组/部门管理 */
.list-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.mgmt-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.mgmt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background 0.12s;
}
.mgmt-row:last-child { border-bottom: none; }
.mgmt-row:hover { background: var(--bg-hover); }
.mgmt-row .mgmt-main { flex: 1; min-width: 0; }
.mgmt-row .mgmt-name { font-size: 13px; font-weight: 500; color: var(--text); }
.mgmt-row .mgmt-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgmt-row .mgmt-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mgmt-row .row-role { font-size: 10.5px; padding: 2px 7px; border-radius: 10px; flex-shrink: 0; }
.row-role.admin { background: #fdf0e8; color: #c05621; border: 1px solid #f5d2b8; }
.row-role.dept_admin { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #cfe5fa; }
.row-role.employee { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border-strong); }

.row-btn {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.row-btn:hover { border-color: var(--primary); color: var(--primary); }
.row-btn.danger:hover { border-color: var(--color-deny); color: var(--color-deny); background: #fdf0f0; }

/* 预览弹窗 */
.preview-list { display: flex; flex-direction: column; gap: 6px; }
.preview-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.preview-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.preview-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,120,212,0.14); }

/* 开关 */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd3db;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 分组勾选 chips */
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.check-chip:hover { border-color: var(--primary); color: var(--primary); }
.check-chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 500; }
.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }

/* 确认删除弹窗 */
.confirm-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fdeaec;
  color: var(--color-deny);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.confirm-text { text-align: center; font-size: 13px; color: var(--text-secondary); line-height: 1.8; word-break: break-all; }
.confirm-text strong { color: var(--text); }

/* 树预览面板（权限明细） */
.path-line {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  word-break: break-all;
}

/* ==========================================================================
   Toast 提示
   ========================================================================== */
#toast-root {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(20, 32, 45, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 22px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { background: rgba(21, 128, 61, 0.94); }
.toast.error { background: rgba(192, 57, 43, 0.94); }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: all 0.25s; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 820px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: var(--topbar-h);
    bottom: 0;
    z-index: 30;
    box-shadow: 6px 0 20px rgba(16, 34, 51, 0.12);
  }
  .sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-w)); }
  .brand-name { display: none; }
  .topbar-right .topbar-btn span.btn-label { display: none; }
  .topbar-btn { padding: 0 9px; }
  .topbar-user .user-name { max-width: 70px; }
  .file-item .file-path { display: none; }
  .modal { width: calc(100vw - 24px); }
  .main-toolbar { padding: 10px 14px; }
  .file-list { padding: 4px 14px 20px; }
}
