/* ============================================================
   文件库 · 界面样式
   ============================================================ */

:root {
  --font: "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --bg: #07080c;
  --bg-soft: #0b0d14;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.17);
  --text: #e9edf6;
  --muted: #8f97ab;
  --faint: #6b7386;
  --accent: #7c8cff;
  --accent-2: #3ee0c4;
  --accent-3: #b388ff;

  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  --hero-title: linear-gradient(180deg, #ffffff 30%, #aeb8d0);
  --shadow-card: 0 24px 48px -30px rgba(70, 95, 255, 0.85), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --shadow-modal: 0 50px 100px -40px #000000;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: rgba(17, 24, 39, 0.035);
  --panel-strong: rgba(17, 24, 39, 0.06);
  --border: rgba(17, 24, 39, 0.09);
  --border-strong: rgba(17, 24, 39, 0.18);
  --text: #121826;
  --muted: #5b6478;
  --faint: #7b8498;
  --accent: #5b6cff;
  --accent-2: #0fa78d;
  --accent-3: #8b5cf6;

  --card-bg: linear-gradient(180deg, #ffffff, #fbfcff);
  --hero-title: linear-gradient(180deg, #10162a 20%, #4a5578);
  --shadow-card: 0 22px 44px -30px rgba(60, 80, 180, 0.55), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-modal: 0 40px 90px -40px rgba(20, 30, 60, 0.5);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

body.no-copy {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body.no-copy input,
body.no-copy textarea,
body.no-copy select,
body.no-copy [contenteditable="true"] {
  user-select: text;
  -webkit-user-select: text;
}

body.no-copy img,
body.no-copy svg {
  -webkit-user-drag: none;
}

a { color: inherit; }

button, input, select { font-family: inherit; }

::selection { background: rgba(124, 140, 255, 0.35); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.aurora {
  position: fixed;
  inset: -25% -15%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 34% at 12% 6%, rgba(108, 124, 255, 0.22), transparent 62%),
    radial-gradient(38% 30% at 88% 12%, rgba(62, 224, 196, 0.14), transparent 64%),
    radial-gradient(52% 44% at 50% 108%, rgba(179, 136, 255, 0.14), transparent 70%);
  filter: blur(24px);
}

[data-theme="light"] .aurora {
  background:
    radial-gradient(42% 34% at 12% 6%, rgba(108, 124, 255, 0.16), transparent 62%),
    radial-gradient(38% 30% at 88% 12%, rgba(62, 224, 196, 0.12), transparent 64%),
    radial-gradient(52% 44% at 50% 108%, rgba(179, 136, 255, 0.12), transparent 70%);
}

body.has-site-bg {
  background-image:
    linear-gradient(180deg, rgba(7, 8, 12, 0.78), rgba(7, 8, 12, 0.9)),
    var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

[data-theme="light"] body.has-site-bg {
  background-image:
    linear-gradient(180deg, rgba(245, 247, 255, 0.84), rgba(245, 247, 255, 0.92)),
    var(--site-bg-image);
}

body.has-site-bg .aurora { opacity: 0.4; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6d7cff 0%, #a06bff 55%, #3ee0c4 130%);
  box-shadow: 0 12px 26px -14px rgba(109, 124, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-mark svg { width: 21px; height: 21px; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s, background 0.18s, border-color 0.18s, transform 0.18s;
  text-decoration: none;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--panel-strong);
  border-color: var(--border-strong);
}

.icon-btn:active { transform: scale(0.96); }

.icon-btn svg { width: 17px; height: 17px; }

.icon-btn.spin svg { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 主区域 ---------- */

.wrap {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.hero { padding: 46px 0 26px; }

.hero-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.18;
  background: var(--hero-title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-title {
    color: var(--text);
    background: none;
  }
}

.hero-sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* 搜索框 */

.search {
  margin-top: 26px;
  max-width: 760px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(124, 140, 255, 0.12), 0 18px 40px -30px var(--accent);
}

.search-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--faint);
}

.search:focus-within .search-icon { color: var(--accent); }

.search.busy .search-icon { animation: spin 0.9s linear infinite; color: var(--accent); }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search input::placeholder { color: var(--faint); }

.search input::-webkit-search-cancel-button { display: none; }

.search kbd {
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 11px;
  color: var(--faint);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.search-clear {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.search-clear:hover { color: var(--text); }

/* 统计 */

.stats {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12.5px;
  color: var(--faint);
}

.stat strong {
  color: var(--text);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

/* 面包屑 */

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 4px 0 18px;
  font-size: 13px;
  color: var(--faint);
}

.crumb {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

.crumb:hover { color: var(--text); }

.crumb[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  cursor: default;
}

.crumb-sep { color: var(--faint); opacity: 0.6; user-select: none; }

/* 工具栏 */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}

.chip:hover { color: var(--text); background: var(--panel); }

.chip .count {
  font-size: 11.5px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.chip.active {
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 10px 22px -12px rgba(109, 124, 255, 0.95);
}

.chip.active .count { opacity: 0.9; }

/* 结果提示 */

.result-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.result-info strong { color: var(--text); font-weight: 600; }

/* ---------- 文件网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 15px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  min-width: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.2s,
    background 0.2s;
  animation: card-in 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: var(--shadow-card);
}

.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-tile {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #a1a1aa, #52525b);
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.icon-tile svg { width: 23px; height: 23px; }

.icon-tile.sm { width: 40px; height: 40px; border-radius: 11px; }
.icon-tile.sm svg { width: 20px; height: 20px; }

.icon-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.k-folder { background: linear-gradient(135deg, #8b9dff, #4f5fd6); }
.k-image { background: linear-gradient(135deg, #ff9ab5, #f0507d); }
.k-video { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.k-audio { background: linear-gradient(135deg, #34d399, #0ea5e9); }
.k-pdf { background: linear-gradient(135deg, #fb7185, #be123c); }
.k-doc { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.k-sheet { background: linear-gradient(135deg, #4ade80, #15803d); }
.k-slide { background: linear-gradient(135deg, #fb923c, #c2410c); }
.k-archive { background: linear-gradient(135deg, #fbbf24, #d97706); }
.k-app { background: linear-gradient(135deg, #94a3b8, #475569); }
.k-code { background: linear-gradient(135deg, #22d3ee, #0e7490); }
.k-font { background: linear-gradient(135deg, #f472b6, #be185d); }
.k-other { background: linear-gradient(135deg, #a1a1aa, #52525b); }

.badge {
  margin-left: auto;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-variant-numeric: tabular-nums;
}

.card-name {
  margin: 0;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.45;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  min-height: 40px;
}

.card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.pin-chip {
  flex: 0 0 auto;
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: #1b1406;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 10px -6px rgba(245, 158, 11, 0.9);
}

.lock-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(124, 140, 255, 0.32);
  color: #b9c2ff;
  background: rgba(124, 140, 255, 0.1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.lock-chip svg { width: 11px; height: 11px; }

.card.is-locked .icon-tile { filter: saturate(0.65); }
.card.is-locked .card-name { color: var(--text); }

.card-meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.card-meta .dot { opacity: 0.5; }

.card-meta .dir {
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

.btn-mini {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.16s, background 0.16s, border-color 0.16s, transform 0.16s;
  white-space: nowrap;
}

.btn-mini svg { width: 14px; height: 14px; }

.btn-mini:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--panel-strong);
}

.btn-mini.primary {
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #8b5cf6);
  border-color: transparent;
  box-shadow: 0 10px 22px -14px rgba(109, 124, 255, 1);
  margin-left: auto;
}

.btn-mini.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* 文件夹卡片 */

.card.is-dir .card-name { min-height: 0; }

.card.is-dir .folder-hint {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  transition: color 0.16s, transform 0.16s;
}

.card.is-dir:hover .folder-hint { color: var(--text); transform: translateX(2px); }

.card.is-dir .folder-hint svg { width: 13px; height: 13px; }

/* 列表视图 */

.view-list .grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.view-list .card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-areas:
    "top name foot"
    "top desc foot"
    "top meta foot";
  align-items: center;
  column-gap: 14px;
  row-gap: 3px;
  padding: 10px 14px;
  border-radius: 13px;
  animation: none;
}

.view-list .card:hover { transform: none; }

.view-list .card-top { grid-area: top; }
.view-list .folder-hint { display: none; }
.view-list .card-name { grid-area: name; min-height: 0; -webkit-line-clamp: 1; font-size: 13.5px; }
.view-list .card-desc { grid-area: desc; -webkit-line-clamp: 1; font-size: 11.5px; }
.view-list .card-meta { grid-area: meta; }
.view-list .card-foot { grid-area: foot; margin: 0; padding: 0; }
.view-list .badge { display: none; }
.view-list .pin-chip { margin-left: 0; }
.view-list .lock-chip { margin-left: 0; padding: 3px 4px; }
.view-list .lock-chip span { display: none; }
.view-list .icon-tile { width: 40px; height: 40px; border-radius: 11px; }
.view-list .icon-tile svg { width: 20px; height: 20px; }
.view-list .btn-mini { height: 30px; padding: 0 11px; }
.view-list .btn-mini span { display: none; }
.view-list .btn-mini svg { width: 15px; height: 15px; }

@media (min-width: 900px) {
  .view-list .btn-mini span { display: inline; }
}

/* ---------- 空状态 / 骨架屏 ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 72px 20px 60px;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  background: var(--panel);
}

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel-strong);
  margin-bottom: 18px;
}

.empty-icon svg { width: 30px; height: 30px; }

.empty h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 620;
}

.empty p {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--muted);
  max-width: 460px;
  line-height: 1.7;
}

.empty code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.btn {
  height: 38px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s, filter 0.16s, background 0.16s;
}

.btn:hover { background: var(--panel); transform: translateY(-1px); }

.btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #6d7cff, #8b5cf6);
  box-shadow: 0 14px 30px -18px rgba(109, 124, 255, 1);
}

.btn.primary:hover { filter: brightness(1.07); }

.btn.ghost { background: transparent; }

.skeleton .sk-card {
  height: 154px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton .sk-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

.skeleton .sk-tile,
.skeleton .sk-lines i {
  display: block;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03));
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton .sk-tile { width: 40px; height: 40px; border-radius: 11px; }
.skeleton .sk-lines { display: flex; flex-direction: column; gap: 7px; }
.skeleton .sk-lines i { width: min(280px, 60%); height: 11px; }
.skeleton .sk-lines i:last-child { width: min(180px, 38%); height: 8px; }

[data-theme="light"] .skeleton .sk-card,
[data-theme="light"] .skeleton .sk-tile,
[data-theme="light"] .skeleton .sk-lines i {
  background: linear-gradient(90deg, #eef1f7, #f9fafd, #eef1f7);
  background-size: 220% 100%;
}

@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -20% 0; }
}

.hidden { display: none !important; }

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding: 26px 24px 34px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.9;
}

.footer p { margin: 0; }

/* ---------- 预览弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex: 0 0 auto;
}

.modal-head-text { min-width: 0; flex: 1; }

.modal-head-text h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 620;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-head-text p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.modal-actions .icon-btn { width: 34px; height: 34px; }

.preview-desc {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
  width: 100%;
  align-self: start;
}

.modal-body {
  flex: 1 1 auto;
  min-height: 220px;
  display: grid;
  place-items: center;
  background: #05060a;
  overflow: auto;
}

[data-theme="light"] .modal-body { background: #eef1f7; }

.modal-body img {
  display: block;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
}

.modal-body video {
  display: block;
  width: 100%;
  max-height: 74vh;
  background: #000;
}

.modal-body audio {
  width: min(560px, 86%);
  margin: 48px auto;
  display: block;
}

.modal-body iframe {
  display: block;
  width: 100%;
  height: 76vh;
  border: 0;
  background: #fff;
}

.modal-body .text-preview {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 20px 22px 28px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-soft);
}

.modal-body .no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.modal-body .no-preview .icon-tile { width: 56px; height: 56px; border-radius: 16px; }
.modal-body .no-preview .icon-tile svg { width: 28px; height: 28px; }

/* ---------- 多线程下载 ---------- */

.dl-panel { width: min(560px, 100%); }

.dl-body {
  padding: 18px 18px 16px;
  overflow-y: auto;
}

.dl-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.dl-option-row strong { display: block; font-size: 13px; font-weight: 620; }
.dl-option-sub { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; }

.dl-thread-pills {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  flex: 0 0 auto;
}

.dl-thread-pills button {
  min-width: 30px;
  height: 27px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 620;
  cursor: pointer;
}

.dl-thread-pills button:hover { color: var(--text); background: var(--panel); }
.dl-thread-pills button.is-active { color: #fff; background: var(--accent); }
.dl-thread-pills button:disabled { opacity: 0.45; cursor: default; }

.dl-progress { margin-top: 16px; }

.dl-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--panel-strong);
  overflow: hidden;
}

.dl-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.18s ease;
}

.dl-stats {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--faint);
  font-size: 11.5px;
}

.dl-stats strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.dl-stats span { font-variant-numeric: tabular-nums; }

.dl-segments {
  display: flex;
  gap: 3px;
  margin-top: 10px;
}

.dl-segments span {
  flex: 1 1 0;
  height: 4px;
  min-width: 2px;
  border-radius: 999px;
  background: var(--panel-strong);
}

.dl-segments span.active { background: var(--accent-3); }
.dl-segments span.done { background: var(--accent-2); }

.dl-note {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.dl-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dl-actions .btn { height: 34px; padding: 0 13px; font-size: 12.5px; }
.dl-actions .btn[hidden] { display: none !important; }

@media (max-width: 560px) {
  .dl-panel { width: 100%; }
  .dl-body { padding: 14px; }
  .dl-option-row { align-items: flex-start; flex-direction: column; }
  .dl-thread-pills { align-self: stretch; }
  .dl-thread-pills button { flex: 1; }
  .dl-actions .btn { flex: 1 1 auto; }
}

/* ---------- Toast ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.toast {
  pointer-events: auto;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.75);
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast.error { border-color: rgba(248, 113, 113, 0.5); color: #ffb4b4; }
.toast.success { border-color: rgba(62, 224, 196, 0.45); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 滚动条 ---------- */

* { scrollbar-width: thin; scrollbar-color: rgba(145, 155, 180, 0.35) transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }

::-webkit-scrollbar-thumb {
  background: rgba(145, 155, 180, 0.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover { background: rgba(145, 155, 180, 0.45); background-clip: padding-box; }

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

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 720px) {
  .topbar-inner { height: 58px; padding: 0 16px; }
  .brand-text small { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }

  .wrap { padding: 0 16px 56px; }
  .hero { padding: 30px 0 20px; }
  .hero-sub { font-size: 13px; }
  .search { height: 48px; margin-top: 20px; border-radius: 13px; }
  .search kbd { display: none; }

  .toolbar { gap: 10px; }
  .toolbar-right { width: 100%; justify-content: space-between; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 10px; }
  .card { padding: 12px; gap: 8px; border-radius: 13px; }
  .icon-tile { width: 40px; height: 40px; border-radius: 11px; }
  .icon-tile svg { width: 20px; height: 20px; }
  .card-name { font-size: 13px; min-height: 36px; }
  .badge { display: none; }
  .card-foot { gap: 6px; }
  .btn-mini { height: 30px; padding: 0 10px; font-size: 12px; }

  .view-list .card { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 8px 12px; }
  .view-list .btn-mini.primary span { display: none; }

  .modal { padding: 0; }
  .modal-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .modal-actions .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .modal-actions .btn.ghost { display: none; }
  .modal-body img,
  .modal-body video { max-height: 70dvh; }
  .modal-body iframe { height: 70dvh; }

  .footer { padding: 22px 16px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   本机管理页
   ============================================================ */

.admin-wrap {
  max-width: 1000px;
  padding: 34px 24px 80px;
}

.admin-head { margin-bottom: 22px; }

.admin-head h1 {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.admin-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head .crumbs { margin: 0; }

.panel-actions { display: flex; align-items: center; gap: 8px; }

.muted { color: var(--faint); font-size: 12.5px; }

.panel-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 620;
}

.current-path { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* 上传区 */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 20px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.dropzone:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

.dropzone.drag {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.08);
  transform: scale(1.005);
}

.dropzone > svg { width: 34px; height: 34px; color: var(--muted); margin-bottom: 2px; }
.dropzone strong { font-size: 14px; font-weight: 600; }
.dropzone > span { font-size: 12.5px; color: var(--faint); }

.dropzone-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.upload-list:empty { display: none; }

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  font-size: 12.5px;
  color: var(--muted);
}

.upload-name {
  flex: 0 1 auto;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.upload-item .bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--panel-strong);
  overflow: hidden;
}

.upload-item .bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6d7cff, #8b5cf6);
  transition: width 0.18s ease;
}

.upload-status { flex: 0 0 auto; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.upload-stop-item {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}

.upload-stop-item:hover { color: #ffb4b4; border-color: rgba(248, 113, 113, 0.5); }
.upload-stop-item:disabled { opacity: 0.5; cursor: default; }

.upload-stop {
  color: #ffb4b4;
  border-color: rgba(248, 113, 113, 0.35);
}

.upload-stop:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.55);
}

.upload-item.is-done .upload-status { color: #34d399; }
.upload-item.is-fail { border-color: rgba(248, 113, 113, 0.5); }
.upload-item.is-fail .upload-status { color: #ff9c9c; }

/* 文件表 */

.admin-files { display: flex; flex-direction: column; gap: 4px; }

.arow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 11px;
  transition: background 0.15s;
}

.arow:hover { background: var(--panel); }

.arow.is-pinned { background: color-mix(in srgb, #f59e0b 7%, transparent); }
.arow.is-pinned:hover { background: color-mix(in srgb, #f59e0b 11%, transparent); }

.arow-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.arow-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
}

.arow-open { cursor: pointer; }

.arow-open:hover { color: var(--accent); }

.arow-sub { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.arow-desc {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
}

.arow-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }

/* 资源站沿用后台的行式列表，只保留公开操作 */

#grid .arow { cursor: pointer; }
#grid .arow:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#grid .arow-name { cursor: pointer; }
#grid .arow-actions { flex: 0 0 auto; }

.arow-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--faint);
  transition: color 0.15s, transform 0.15s;
}

.arow-go svg { width: 16px; height: 16px; }
#grid .arow:hover .arow-go { color: var(--text); transform: translateX(2px); }

.btn-mini.is-active {
  color: #f7c66b;
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.1);
}

.btn-mini.is-active:hover {
  color: #ffd98a;
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.16);
}

.btn-mini.danger { color: var(--faint); }

.btn-mini.danger:hover {
  color: #ff9c9c;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
}

.admin-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* 登录 */

.login-box {
  max-width: 400px;
  margin: 9vh auto 0;
  padding: 32px 28px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
}

.login-box .icon-tile { width: 50px; height: 50px; border-radius: 15px; }
.login-box .icon-tile svg { width: 24px; height: 24px; }

.login-box h1 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.login-box p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
}

.login-box code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.login-form input {
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.16);
}

.login-form .btn { height: 44px; }

.login-form .btn[disabled] { opacity: 0.6; cursor: default; transform: none; }

.login-error {
  color: #ff9c9c;
  font-size: 12.5px;
  margin: 0;
}

.login-back {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--faint);
  text-decoration: none;
}

.login-back:hover { color: var(--text); }

.login-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* 前台登录页 */

.login-screen {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 0 40px;
}

.login-screen.hidden { display: none; }

.login-screen .login-box { margin: 0; }

.login-screen .login-box h1 {
  font-size: 21px;
  letter-spacing: -0.02em;
}

.login-screen .login-box p { max-width: 300px; }

/* 顶部账号胶囊 */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}

.user-avatar {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #a06bff);
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
}

.user-logout {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.user-logout svg { width: 15px; height: 15px; }

/* 管理后台 · 账号管理 */

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-me {
  font-size: 12px;
  color: var(--faint);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  white-space: nowrap;
}

.account-icon { background: linear-gradient(135deg, #22c1a4, #0d9488); }

.account-create {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-strong);
  margin-bottom: 14px;
}

.account-create .field { margin-bottom: 0; }

.account-create input,
.account-create select {
  height: 38px;
  width: 100%;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.account-create input:focus,
.account-create select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.account-create .btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
  white-space: nowrap;
}

.account-list { display: flex; flex-direction: column; gap: 8px; }

.appearance-icon { background: linear-gradient(135deg, #3ec6a8, #5b8cff); }

.bg-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.bg-preview {
  position: relative;
  min-height: 190px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background-color: var(--panel-strong);
  background-position: center;
  background-size: cover;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.bg-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.08), rgba(7, 8, 12, 0.5));
  pointer-events: none;
}

.bg-preview span {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(7, 8, 12, 0.45);
}

.bg-editor-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}

.bg-help {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.bg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.bg-status {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--faint);
}

.bg-status.is-error { color: #fca5a5; }

@media (max-width: 720px) {
  .bg-editor { grid-template-columns: 1fr; }
  .bg-preview { min-height: 160px; }
}

.account-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  transition: border-color 0.16s, background 0.16s;
}

.account-row:hover { border-color: var(--border-strong); }

.account-row.is-banned { opacity: 0.72; }

.account-row.is-self { border-color: rgba(124, 140, 255, 0.4); background: rgba(124, 140, 255, 0.06); }

.account-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #a06bff);
}

.account-main { min-width: 0; }

.account-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}

.account-sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.account-badges { display: flex; align-items: center; gap: 6px; }

.account-badges .badge { margin-left: 0; }

.badge.role-super {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(245, 158, 11, 0.12);
}

.badge.role-admin {
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(139, 92, 246, 0.12);
}

.badge.role-user {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.badge.ok {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(34, 197, 94, 0.08);
}

.badge.danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(248, 113, 113, 0.1);
}

.badge.neutral { margin-left: 0; }

.account-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.account-self { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

.account-empty {
  padding: 26px 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

@media (max-width: 640px) {
  .admin-wrap { padding: 24px 16px 60px; }
  .arow { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 8px 4px; }
  .arow .btn-mini span { display: none; }
  .arow .btn-mini { padding: 0 8px; }
  .panel { padding: 14px; }
  .account-create { grid-template-columns: 1fr 1fr; }
  .account-create .btn { grid-column: 1 / -1; }
  .account-row { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
  .account-avatar { width: 32px; height: 32px; border-radius: 10px; }
  .account-badges { grid-column: 2; justify-content: flex-start; }
  .account-actions { grid-column: 1 / -1; justify-content: flex-start; padding-top: 2px; }
  .user-name { display: none; }
}

/* ============================================================
   回到顶部 / 细节优化
   ============================================================ */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  color: var(--muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition: transform 0.18s, color 0.18s, border-color 0.18s, opacity 0.2s;
}

.to-top:hover { color: var(--text); transform: translateY(-2px); border-color: var(--accent); }
.to-top svg { width: 18px; height: 18px; }

/* 卡片顶部高光 */

.card::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.card:hover::after { opacity: 0.7; }

[data-theme="light"] .card::after {
  background: linear-gradient(90deg, transparent, rgba(120, 140, 255, 0.55), transparent);
}

/* 面板标题（直链上传） */

.panel-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.panel-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #a06bff);
  box-shadow: 0 12px 24px -16px rgba(109, 124, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.panel-icon svg { width: 20px; height: 20px; }

.panel-title-text { min-width: 0; }

.panel-title-text h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-title-text .muted {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

/* 表单（直链上传） */

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

.notice-form input,
.notice-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.notice-form input:focus,
.notice-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.notice-form textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.65;
}

.notice-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notice-actions .btn {
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
}

.notice-actions .btn svg { width: 15px; height: 15px; }

.notice-actions .btn[disabled] { opacity: 0.65; cursor: default; transform: none; }

/* 对话框 */

.dialog {
  position: relative;
  width: min(420px, 92vw);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  box-shadow: var(--shadow-modal);
  animation: modal-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dialog h3 { margin: 0 0 6px; font-size: 16px; font-weight: 650; }

.dialog p {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.dialog input {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.lock-dialog {
  width: min(380px, 92vw);
}

.lock-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  border-radius: 12px;
  color: #c7d0ff;
  border: 1px solid rgba(124, 140, 255, 0.32);
  background: rgba(124, 140, 255, 0.12);
}

.lock-icon svg { width: 22px; height: 22px; }

.lock-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.lock-error {
  margin: 9px 0 0;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  font-size: 12px;
}

.lock-error[hidden] { display: none; }

.lock-dialog .dialog-actions { margin-top: 16px; }

.dialog .meta-sub {
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.meta-label span { font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }

#metaPasswordLabel { margin-top: 12px; }

.meta-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
}

.meta-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.meta-input {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.meta-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.meta-input:disabled { opacity: 0.45; }

.meta-clear-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: #f0a5a5;
  cursor: pointer;
  user-select: none;
}

.meta-clear-row input { accent-color: #ef4444; width: 14px; height: 14px; }
.meta-clear-row[hidden], .bg-actions .btn[hidden], .bg-preview span[hidden] { display: none !important; }

.transfer-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
}

.mode-btn {
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}

.mode-btn:hover { color: var(--text); }

.mode-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, #6d7cff, #8b5cf6);
  box-shadow: 0 8px 18px -12px rgba(109, 124, 255, 1);
}

.meta-select {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.meta-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15);
}

.meta-select:disabled { opacity: 0.55; }

.transfer-tip {
  margin: 9px 0 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--faint);
}

.meta-pin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.meta-pin-row input { accent-color: var(--accent); width: 15px; height: 15px; }

.folder-done-actions { flex-wrap: wrap; }

.folder-done-actions .btn {
  flex: 1 1 auto;
  min-width: 108px;
}

/* 直链上传 */

.fetch-icon {
  background: linear-gradient(135deg, #22d3ee, #0e7490);
  box-shadow: 0 12px 24px -16px rgba(34, 211, 238, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.fetch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.fetch-list:empty { display: none; }

.fetch-item .upload-name { max-width: 46%; }

/* 新建文件夹后的目标提示 */

.target-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border));
  background: rgba(124, 140, 255, 0.08);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.target-bar strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.target-clear {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.target-clear:hover { color: var(--text); }

@media (max-width: 720px) {
  .to-top { right: 14px; bottom: 18px; width: 40px; height: 40px; }
}
