/* ========================================================
   对外材料库 · Design System
   ======================================================== */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --ink: #0b1526;
  --ink-2: #33415c;
  --muted: #5a6b85;
  --muted-2: #8c9ab3;
  --line: #e9eff7;
  --line-strong: #d9e3f2;
  --brand: #3370ff;
  --brand-deep: #1f54e8;
  --brand-soft: #eef3ff;
  --brand-tint: #f5f8ff;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --danger-soft: #fef3f2;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-xs: 0 1px 2px rgba(11, 21, 38, .04);
  --shadow-sm: 0 2px 8px -2px rgba(11, 21, 38, .06), 0 1px 2px rgba(11, 21, 38, .03);
  --shadow-md: 0 12px 28px -14px rgba(11, 21, 38, .2), 0 2px 6px rgba(11, 21, 38, .04);
  --shadow-lg: 0 32px 80px -32px rgba(6, 14, 30, .5);
  --topbar-h: 64px;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: #d8e4ff; }

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

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 60;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 18px;
}
.brand-logo {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #3370ff 0%, #7c5cff 100%);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px -8px rgba(51, 112, 255, .75);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-name strong { font-size: 15px; font-weight: 650; letter-spacing: .2px; white-space: nowrap; }
.brand-name span { font-size: 10px; color: var(--muted-2); letter-spacing: 1.1px; white-space: nowrap; margin-top: 1px; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section {
  margin: 18px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--muted-2);
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-item .icon { width: 17px; height: 17px; color: var(--muted-2); transition: color .15s; }
.nav-item:hover { background: #f3f6fb; color: var(--ink); }
.nav-item:hover .icon { color: var(--ink-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-item.active .icon { color: var(--brand); }
.nav-item.active .nav-count { background: #dfe9ff; color: var(--brand-deep); }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  min-width: 20px;
  padding: 0 6px;
  height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #f1f4f9;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; margin-left: 5px; margin-right: 1px; }

.storage-card {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.storage-head { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.storage-total { font-size: 13px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.storage-bar { display: flex; gap: 2px; height: 6px; border-radius: 999px; overflow: hidden; background: #eef2f8; margin: 9px 0 8px; }
.storage-bar span { height: 100%; border-radius: 2px; }
.storage-sub { font-size: 11px; color: var(--muted-2); }

.sidebar-foot {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 8px 0;
  font-size: 11px; color: var(--muted-2);
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); animation: pulse 2.4s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, .5); }
  70% { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

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

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.crumbs .root { color: var(--muted-2); white-space: nowrap; }
.crumbs .sep { color: #cdd8e8; }
.crumbs strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .badge-local {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 320px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f4f7fc;
  border: 1px solid transparent;
  color: var(--muted-2);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search:hover { background: #f0f4fa; }
.search:focus-within { background: #fff; border-color: #b9ceff; box-shadow: 0 0 0 3px rgba(51, 112, 255, .12); color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--ink); }
.search input::placeholder { color: var(--muted-2); }
.search-clear { border: 0; background: transparent; color: var(--muted-2); padding: 2px; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.search-clear[hidden] { display: none; }
.search-clear:hover { color: var(--ink); background: #e9eff8; }
.search kbd {
  font-family: inherit;
  font-size: 10px;
  color: var(--muted-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 4px;
  background: #fff;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #52607a, #2c3a52);
  flex: none;
}

.avatar.guest {
  background: #e8eefb;
  color: #3370ff;
  border: 1px solid #d5e2fb;
}

[hidden] { display: none !important; }

.login-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted, #8c9ab3);
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(51, 112, 255, .8); }
.btn.primary:hover { background: var(--brand-deep); }
.btn.ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { border-color: #c3d2ea; background: var(--surface-2); }
.btn.soft { background: var(--brand-soft); color: var(--brand-deep); }
.btn.soft:hover { background: #e2ecff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #d92d20; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: #c3d2ea; }
.menu-btn { display: none; }

/* ---------------- 内容 ---------------- */
.view { padding: 26px 28px 90px; width: 100%; max-width: 1480px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 2px 0 22px;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 1.4px;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-head h1 { margin: 0; font-size: 25px; font-weight: 680; letter-spacing: -.3px; line-height: 1.2; }
.page-head p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 9px; flex: none; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  color: var(--c, var(--brand));
  background: color-mix(in srgb, var(--c, #3370ff) 10%, #fff);
}
.stat-icon .icon { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 680; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value span { font-size: 12px; font-weight: 500; color: var(--muted-2); margin-left: 4px; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted-2); }
.delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 5px;
  background: #eefaf3; color: #0e9f5f;
}
.stat-spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: auto; padding-top: 8px; }
.stat-spark i { display: block; width: 6px; border-radius: 2px 2px 1px 1px; background: color-mix(in srgb, #12b76a 24%, #fff); }
.stat-spark i.on { background: #12b76a; }

/* 分类卡片 */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.cat-tile {
  position: relative;
  text-align: left;
  padding: 15px 16px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
  overflow: hidden;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.cat-tile-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cat-tile-icon {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 9%, #fff);
}
.cat-tile-icon .icon { width: 18px; height: 18px; }
.cat-tile-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tile-count {
  margin-left: auto;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -.4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cat-tile-count span { font-size: 10.5px; font-weight: 500; color: var(--muted-2); margin-left: 2px; letter-spacing: 0; }
.cat-tile-desc { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tile-bar { height: 3px; border-radius: 999px; background: #f0f4fa; margin-top: 11px; overflow: hidden; }
.cat-tile-bar span { display: block; height: 100%; border-radius: 999px; background: var(--c); opacity: .85; }

/* 面板 */
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-bottom: 18px; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 18px;
  min-width: 0;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title { font-size: 13.5px; font-weight: 620; }
.panel-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.panel-link {
  border: 0; background: transparent; padding: 2px 0;
  font-size: 11.5px; color: var(--brand);
  display: inline-flex; align-items: center; gap: 2px;
  cursor: pointer; border-radius: 4px;
}
.panel-link .icon { width: 13px; height: 13px; }
.panel-link:hover { color: var(--brand-deep); text-decoration: underline; }

/* 图表 */
.chart-wrap { width: 100%; }
.trend-svg { width: 100%; height: auto; display: block; }
.trend-svg text { font-size: 10px; fill: #9aa8bd; font-family: inherit; }
.trend-svg .grid-line { stroke: #eef2f8; stroke-width: 1; stroke-dasharray: 2 4; }
.trend-svg .line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.trend-svg .dot { fill: #fff; stroke: var(--brand); stroke-width: 2; }
.trend-svg .bar { fill: #e8effd; }
.trend-svg .bar.on { fill: #c9dcff; }

.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-svg { width: 170px; height: 170px; flex: none; }
.donut-center-num { font-size: 28px; font-weight: 680; fill: var(--ink); font-family: inherit; letter-spacing: -.5px; }
.donut-center-label { font-size: 10.5px; fill: #9aa8bd; font-family: inherit; }
.legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; flex: none; background: var(--c); }
.legend-name { flex: 1; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-val { color: var(--muted-2); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.legend-val b { color: var(--ink); font-weight: 600; }

.type-list { display: flex; flex-direction: column; gap: 14px; }
.type-row { display: flex; align-items: center; gap: 9px; }
.type-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); flex: none; }
.type-ico .icon { width: 14px; height: 14px; }
.type-label { width: 42px; font-size: 12px; color: var(--ink-2); flex: none; }
.type-bar { flex: 1; height: 6px; border-radius: 999px; background: #f1f5fb; overflow: hidden; }
.type-bar span { display: block; height: 100%; border-radius: 999px; background: var(--c); }
.type-count { width: 30px; text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

.rank-list { display: flex; flex-direction: column; }
.rank-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f4f7fb; cursor: pointer; }
.rank-row:last-child { border-bottom: 0; }
.rank-row:hover .rank-name { color: var(--brand); }
.rank-no {
  width: 18px; height: 18px; border-radius: 5px;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; color: var(--muted-2);
  background: #f2f5fa; flex: none;
  font-variant-numeric: tabular-nums;
}
.rank-row:nth-child(1) .rank-no { background: linear-gradient(135deg, #ffd66b, #f9a825); color: #7a4b00; }
.rank-row:nth-child(2) .rank-no { background: linear-gradient(135deg, #e4eaf3, #c5cfdd); color: #4a5a70; }
.rank-row:nth-child(3) .rank-no { background: linear-gradient(135deg, #f8d3b8, #e5a273); color: #74380d; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.rank-sub { font-size: 10.5px; color: var(--muted-2); }
.rank-val { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 11px; padding: 8px; margin: 0 -8px; border-radius: 9px; cursor: pointer; transition: background .14s; }
.recent-row:hover { background: #f7faff; }
.file-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); }
.file-ico .icon { width: 17px; height: 17px; }
.recent-main { flex: 1; min-width: 0; }
.recent-name { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-sub { font-size: 11px; color: var(--muted-2); }
.recent-dl { width: 28px; height: 28px; border-radius: 7px; border: 0; background: transparent; color: var(--muted-2); display: grid; place-items: center; cursor: pointer; flex: none; opacity: 0; transition: opacity .14s; }
.recent-row:hover .recent-dl { opacity: 1; }
.recent-dl:hover { background: var(--brand-soft); color: var(--brand); }

/* ---------------- 分类页 ---------------- */
.cat-head {
  position: relative;
  padding: 22px 24px;
  margin-bottom: 16px;
  background:
    radial-gradient(140% 200% at 100% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.cat-title-row { display: flex; align-items: center; gap: 16px; }
.cat-badge {
  width: 54px; height: 54px; flex: none;
  border-radius: 15px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--c) 75%, transparent);
}
.cat-badge .icon { width: 26px; height: 26px; }
.cat-title-main { flex: 1; min-width: 0; }
.cat-title-main h1 { margin: 0; font-size: 22px; font-weight: 680; letter-spacing: -.3px; }
.cat-title-main p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.cat-head-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.cat-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.metric-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.metric-chip b { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }
.metric-chip .icon { width: 13px; height: 13px; color: var(--muted-2); }

.toolbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 12px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, var(--bg) 72%, rgba(246, 248, 251, 0));
  flex-wrap: wrap;
}
.result-count { font-size: 12.5px; color: var(--muted); }
.result-count b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.toolbar .spacer { flex: 1; }

.select {
  height: 34px;
  padding: 0 28px 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c9ab3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  font-size: 12.5px;
  color: var(--ink-2);
  appearance: none;
  cursor: pointer;
  outline: 0;
}
.select:hover { border-color: #c3d2ea; }
.select:focus { border-color: #b9ceff; box-shadow: 0 0 0 3px rgba(51, 112, 255, .1); }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: #eef2f9; }
.seg-btn { width: 30px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-xs); }
.seg-btn .icon { width: 15px; height: 15px; }

.check {
  width: 18px; height: 18px;
  border-radius: 6px;
  border: 1.5px solid #c9d5e6;
  background: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  flex: none;
  transition: background .12s, border-color .12s;
  padding: 0;
}
.check .icon { width: 12px; height: 12px; color: #fff; opacity: 0; stroke-width: 2.6; }
.check:hover { border-color: var(--brand); }
.check.on { background: var(--brand); border-color: var(--brand); }
.check.on .icon { opacity: 1; }
.check.indet { background: var(--brand); border-color: var(--brand); }
.check.indet::after { content: ""; width: 8px; height: 2px; border-radius: 1px; background: #fff; }
.check.indet .icon { display: none; }
.select-all { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; border: 0; background: transparent; padding: 4px; border-radius: 6px; }
.select-all:hover { color: var(--ink); background: #f1f5fb; }

/* 文件网格 */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: 14px; }
.file-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform .16s, box-shadow .16s, border-color .16s;
  display: flex;
  flex-direction: column;
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.file-card.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-sm); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c, #8c9ab3) 7%, #fbfcff), #f3f7fd);
  cursor: pointer;
  overflow: hidden;
  border-bottom: 1px solid #f1f5fb;
}
.thumb.is-image { background-color: #fff; background-image:
  linear-gradient(45deg, #f4f7fc 25%, transparent 25%),
  linear-gradient(-45deg, #f4f7fc 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f4f7fc 75%),
  linear-gradient(-45deg, transparent 75%, #f4f7fc 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 8px; }
.thumb-icon { color: var(--c, #8c9ab3); opacity: .9; }
.thumb-icon .icon { width: 38px; height: 38px; stroke-width: 1.4; }
.type-badge {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 9px; font-weight: 700; letter-spacing: .6px;
  padding: 2px 6px; border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  color: var(--c, #64748b);
  box-shadow: 0 1px 4px rgba(11, 21, 38, .08);
  text-transform: uppercase;
}
.card-check { position: absolute; top: 9px; left: 9px; opacity: 0; transition: opacity .15s; z-index: 3; }
.file-card:hover .card-check, .file-card.selected .card-check { opacity: 1; }

.file-actions {
  position: absolute;
  top: 8px; right: 8px;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(233, 239, 247, .9);
  box-shadow: 0 4px 12px -4px rgba(11, 21, 38, .18);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .15s, transform .15s;
  z-index: 3;
}
.file-card:hover .file-actions { opacity: 1; transform: none; }
.icon-btn-sm {
  width: 27px; height: 27px;
  border: 0; border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn-sm .icon { width: 15px; height: 15px; }
.icon-btn-sm:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn-sm.danger:hover { background: var(--danger-soft); color: var(--danger); }

.file-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.file-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all; line-height: 1.45; min-height: 38px;
  cursor: pointer;
}
.file-name:hover { color: var(--brand); }
.file-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted-2); }
.file-meta i { width: 2px; height: 2px; border-radius: 50%; background: #cbd5e1; }
.file-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: #f3f6fb; color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.file-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.cat-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--c); }
.cat-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.dl-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.dl-pill .icon { width: 11px; height: 11px; }

mark.hl { background: #fff1bf; color: inherit; border-radius: 3px; padding: 0 1px; }

/* 列表视图 */
.file-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs); }
.list-head, .list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 2.3fr) 118px 84px 108px 56px 118px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.list-head { height: 38px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11px; color: var(--muted-2); font-weight: 500; letter-spacing: .2px; }
.list-row { height: 60px; border-bottom: 1px solid #f4f7fb; font-size: 12.5px; transition: background .13s; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f9fbff; }
.list-row.selected { background: #f5f8ff; }
.list-name { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.list-name .file-ico { width: 30px; height: 30px; border-radius: 8px; }
.list-name .file-ico .icon { width: 15px; height: 15px; }
.list-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 500; }
.list-muted { color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.list-ops { display: flex; justify-content: flex-end; gap: 1px; }
.list-ops .icon-btn-sm { background: transparent; }
.list-ops .icon-btn-sm:hover { background: var(--brand-soft); }

/* 批量操作栏 */
.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translate(-50%, 12px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  border-radius: 14px;
  background: rgba(13, 25, 46, .96);
  color: #eaf1ff;
  box-shadow: 0 20px 50px -18px rgba(6, 14, 30, .7);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.batch-bar.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.batch-count { font-size: 12.5px; white-space: nowrap; }
.batch-count b { color: #fff; font-size: 14px; font-weight: 650; margin-right: 2px; }
.batch-actions { display: flex; align-items: center; gap: 6px; }
.batch-btn {
  height: 32px; padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: #eaf1ff;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
}
.batch-btn .icon { width: 14px; height: 14px; }
.batch-btn:hover { background: rgba(255, 255, 255, .16); }
.batch-btn.primary { background: #fff; color: #0d192e; border-color: #fff; font-weight: 600; }
.batch-btn.primary:hover { background: #eef4ff; }
.batch-btn.danger { color: #ffb4ae; border-color: rgba(240, 68, 56, .35); }
.batch-btn.danger:hover { background: rgba(240, 68, 56, .18); }
.batch-close { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: #8fa4c6; display: grid; place-items: center; cursor: pointer; }
.batch-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* 空状态 / 骨架 */
.empty {
  padding: 70px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-xl);
}
.empty-art {
  width: 92px; height: 76px;
  margin: 0 auto 18px;
  position: relative;
}
.empty-art .sheet {
  position: absolute;
  border-radius: 10px;
  border: 1px solid #dbe6f7;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.empty-art .s1 { width: 44px; height: 56px; left: 10px; top: 8px; transform: rotate(-8deg); background: #f7faff; }
.empty-art .s2 { width: 46px; height: 58px; left: 26px; top: 4px; transform: rotate(5deg); }
.empty-art .s3 { width: 40px; height: 50px; left: 42px; top: 14px; transform: rotate(13deg); background: #f3f7ff; }
.empty-art .plus {
  position: absolute; right: 2px; bottom: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -6px rgba(51, 112, 255, .8);
}
.empty-art .plus .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.empty h3 { margin: 0 0 6px; font-size: 15px; font-weight: 620; }
.empty p { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }

.sk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.sk-thumb { height: 120px; background: #f3f6fb; }
.sk-body { padding: 13px; }
.sk {
  background: linear-gradient(90deg, #f1f4fa 25%, #f8fafd 37%, #f1f4fa 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 5px;
}
.sk-line { height: 10px; margin-bottom: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------------- 弹窗 ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 16, 32, .5);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn .16s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.02);
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 920px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head-main { flex: 1; min-width: 0; }
.modal-title { margin: 0; font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.modal-sub { margin: 3px 0 0; font-size: 12px; color: var(--muted-2); }
.modal-close { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--muted-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.modal-close:hover { background: #f2f5fa; color: var(--ink); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-foot .left { margin-right: auto; font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 5px; }

.dropzone {
  border: 1.5px dashed #c6d6ef;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: #86aaf8; background: #f1f7ff; }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 9px; border-radius: 12px; display: grid; place-items: center; background: #e9f0ff; color: var(--brand); }
.dropzone .dz-icon .icon { width: 21px; height: 21px; }
.dropzone strong { display: block; font-size: 13.5px; font-weight: 600; }
.dropzone span { font-size: 11.5px; color: var(--muted-2); }

.pending-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 150px; overflow-y: auto; }
.pending-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.pending-row .file-ico { width: 30px; height: 30px; border-radius: 8px; }
.pending-row .file-ico .icon { width: 15px; height: 15px; }
.pending-main { flex: 1; min-width: 0; }
.pending-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-size { font-size: 11px; color: var(--muted-2); }
.pending-remove { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted-2); border-radius: 7px; display: grid; place-items: center; cursor: pointer; }
.pending-remove:hover { background: #f1f5f9; color: var(--danger); }

.form-row { margin-top: 16px; }
.form-label { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 7px; }
.form-label .tip { font-weight: 400; font-size: 11px; color: var(--muted-2); }
.input, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  outline: 0;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #a9b5c7; }
.input:focus, .textarea:focus { border-color: #9dbcf8; box-shadow: 0 0 0 3px rgba(51, 112, 255, .1); }
.textarea { resize: vertical; min-height: 66px; line-height: 1.6; }

.seg-cat { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg-cat-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 3px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
  transition: all .14s;
}
.seg-cat-btn .icon { width: 16px; height: 16px; }
.seg-cat-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.seg-cat-btn.active { border-color: color-mix(in srgb, var(--c) 60%, #fff); background: color-mix(in srgb, var(--c) 7%, #fff); color: var(--c); font-weight: 600; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 40%, #fff) inset; }

.progress { margin-top: 16px; display: none; }
.progress.show { display: block; }
.progress-bar { height: 6px; border-radius: 999px; background: #eef2f9; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6a9bff, var(--brand)); transition: width .2s ease; }
.progress-text { margin-top: 6px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }

/* 预览 */
.preview-body { position: relative; padding: 0; background: #f4f7fc; display: flex; align-items: center; justify-content: center; min-height: 260px; max-height: 68vh; overflow: auto; }
.preview-img { max-width: 100%; max-height: 68vh; object-fit: contain; display: block; background-color: #fff; background-image:
  linear-gradient(45deg, #f4f7fc 25%, transparent 25%),
  linear-gradient(-45deg, #f4f7fc 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #f4f7fc 75%),
  linear-gradient(-45deg, transparent 75%, #f4f7fc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.preview-frame { width: 100%; height: 68vh; border: 0; background: #fff; }
.preview-none { padding: 56px 24px; text-align: center; }
.preview-none .file-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 14px; }
.preview-none .file-ico .icon { width: 26px; height: 26px; }
.preview-none h3 { margin: 0 0 6px; font-size: 14px; }
.preview-none p { margin: 0 0 16px; font-size: 12px; color: var(--muted-2); }
.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.preview-nav:hover { background: #fff; color: var(--brand); }
.preview-nav.prev { left: 12px; }
.preview-nav.next { right: 12px; }
.preview-nav[disabled] { opacity: .35; pointer-events: none; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 11px 22px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted-2); background: #fff; }
.preview-meta b { color: var(--ink-2); font-weight: 550; }

/* toast */
.toast-root { position: fixed; top: 76px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  min-width: 200px; max-width: 380px;
  padding: 11px 14px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow-md);
  animation: toastIn .22s ease;
}
.toast .icon { width: 15px; height: 15px; flex: none; }
.toast.success .icon { color: var(--ok); }
.toast.error .icon { color: var(--danger); }
.toast.out { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

/* 拖拽覆盖层 */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(7, 16, 32, .55);
  backdrop-filter: blur(4px);
}
.drop-overlay.show { display: flex; }
.drop-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 46px 70px;
  border: 2px dashed rgba(140, 176, 255, .85);
  border-radius: 20px;
  background: rgba(15, 32, 62, .6);
  color: #eaf1ff;
  text-align: center;
}
.drop-overlay-inner .icon { width: 34px; height: 34px; color: #9dbcff; }
.drop-overlay-inner strong { font-size: 17px; }
.drop-overlay-inner span { font-size: 12px; color: #a9c2e8; }

@media (hover: none) {
  .file-actions { opacity: 1; transform: none; }
  .card-check { opacity: 1; }
  .recent-dl { opacity: 1; }
}

.sidebar-backdrop { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1320px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .span-3, .span-4, .span-5, .span-7 { grid-column: span 6; }
  .span-8 { grid-column: span 12; }
}

@media (max-width: 1080px) {
  .sidebar { width: 76px; padding: 20px 10px 16px; }
  .brand { justify-content: center; padding: 2px 0 18px; }
  .brand-name, .nav-label, .nav-count, .nav-section, .storage-card, .sidebar-foot span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-dot { position: absolute; right: 12px; top: 11px; margin: 0; }
  .view { padding: 22px 22px 80px; }
  .topbar { padding: 0 22px; }
  .search { width: 230px; }
  .search kbd { display: none; }
}

@media (max-width: 860px) {
  .hide-sm { display: none; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .24s ease;
    padding: 20px 14px 16px;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(7, 16, 32, .25); }
  .sidebar.open .brand { justify-content: flex-start; padding: 2px 8px 18px; }
  .sidebar.open .brand-name, .sidebar.open .nav-label, .sidebar.open .nav-count,
  .sidebar.open .storage-card, .sidebar.open .sidebar-foot span { display: flex; }
  .sidebar.open .nav-section { display: block; }
  .sidebar.open .nav-item { justify-content: flex-start; padding: 0 10px; }
  .sidebar.open .nav-dot { position: static; margin-left: 5px; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(7, 16, 32, .4); backdrop-filter: blur(2px); }
  .sidebar-backdrop.show { display: block; }
  .menu-btn { display: grid; }
  .crumbs .root, .crumbs .sep, .badge-local { display: none; }
  .topbar { gap: 8px; }
  .search { width: 180px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 12; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .cat-head-actions { width: 100%; }
  .list-head, .list-row { grid-template-columns: 28px minmax(0, 1fr) 80px 76px; }
  .list-head > :nth-child(3), .list-row > :nth-child(3),
  .list-head > :nth-child(5), .list-row > :nth-child(5),
  .list-head > :nth-child(6), .list-row > :nth-child(6) { display: none; }
  .modal-overlay { padding: 12px; }
}

@media (max-width: 600px) {
  .view { padding: 16px 14px 80px; }
  .topbar { padding: 0 14px; flex-wrap: wrap; height: auto; min-height: 58px; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .topbar-actions { flex: 1 1 100%; width: auto; margin-left: 0; gap: 8px; }
  .topbar-actions .btn { flex: none; }
  .search { flex: 1 1 0; width: auto; min-width: 0; }
  .avatar { display: none; }
  .toolbar { row-gap: 8px; }
  .toolbar .spacer { display: none; }
  .toolbar .select { flex: 1 1 0; min-width: 0; }
  .toolbar .seg { display: none; }
  .page-head h1 { font-size: 21px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-value { font-size: 22px; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-tile { padding: 12px; }
  .cat-tile-count { font-size: 17px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .file-name { min-height: 34px; font-size: 12.5px; }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .seg-cat { grid-template-columns: repeat(3, 1fr); }
  .cat-title-row { flex-wrap: wrap; }
  .cat-head-actions { margin-top: 2px; }
  .batch-bar { left: 12px; right: 12px; transform: translateY(12px); justify-content: space-between; padding: 9px 10px 9px 14px; }
  .batch-bar.show { transform: none; }
  .batch-btn { padding: 0 9px; }
  .btn { padding: 0 12px; }
  .toast-root { left: 14px; right: 14px; top: 70px; }
}

/* ---------------- 访问口令门 ---------------- */
.gate-open .app { filter: blur(3px); pointer-events: none; user-select: none; }

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(51, 112, 255, .12), transparent 60%), #f6f8fb;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid #e9eff7;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(23, 43, 77, .12);
  padding: 30px 28px 26px;
  text-align: center;
}

.gate-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: #1f2b45;
}
.gate-brand .brand-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #4b86ff, #3370ff);
}
.gate-brand .brand-logo svg { width: 22px; height: 22px; }
.gate-brand-name { font-size: 14px; font-weight: 700; letter-spacing: .2px; }

.gate-title { font-size: 19px; font-weight: 700; color: #17233a; margin: 0 0 8px; }
.gate-desc { font-size: 12.5px; line-height: 1.65; color: #7b8aa3; margin: 0 0 18px; }
.gate-input { width: 100%; height: 42px; text-align: center; letter-spacing: 1px; }
.gate-btn { width: 100%; height: 42px; margin-top: 12px; }
.gate-tip { margin-top: 14px; font-size: 12px; color: #8c9ab3; min-height: 18px; }
